42 if (empty($action_type)) {
52 if (!(
get_entity($object_guid) instanceof ElggEntity)) {
77 'action_type' => $action_type,
79 'subject_guid' => $subject_guid,
80 'object_guid' => $object_guid,
82 'annotation_id' => $annotation_id,
97 if ($values ==
false) {
102 $qb = \Elgg\Database\Insert::intoTable(
'river');
107 $qb->values($query_params);
185 return \Elgg\Database\River::find(
$options);
230 $options[
'batch_inc_offset'] =
false;
240 foreach ($river as $river_item) {
241 if ($river_item->delete()) {
246 return $success ==
$count;
263 'offset' => (int) max(
get_input(
'offset', 0), 0),
265 'pagination' =>
true,
266 'list_class' =>
'elgg-list-river',
272 if (
$options[
'register_rss_link']) {
286 $count_needed =
true;
288 $count_needed =
false;
290 $count_needed =
false;
292 $count_needed =
false;
296 $options[
'count'] =
true;
365 UPDATE {$dbprefix}river AS rv
366 SET rv.enabled =
'no' 367 WHERE (rv.subject_guid = {$entity->guid} OR rv.object_guid = {$entity->guid} OR rv.target_guid = {$entity->guid});
394 UPDATE {$dbprefix}river AS rv
395 LEFT JOIN {$dbprefix}entities AS se ON se.guid = rv.subject_guid
396 LEFT JOIN {$dbprefix}entities AS oe ON oe.guid = rv.object_guid
397 LEFT JOIN {$dbprefix}entities AS te ON te.guid = rv.target_guid
398 SET rv.enabled =
'yes' 400 (se.enabled =
'yes' OR se.guid IS NULL) AND
401 (oe.enabled =
'yes' OR oe.guid IS NULL) AND
402 (te.enabled =
'yes' OR te.guid IS NULL)
404 AND (se.guid = {$entity->guid} OR oe.guid = {$entity->guid} OR te.guid = {$entity->guid});
425 $item = $hook->getParam(
'item');
430 if (!
$item->canDelete()) {
434 $return = $hook->getValue();
438 'href' =>
"action/river/delete?id={$item->id}",
468 $events->registerHandler(
'init',
'system',
'_elgg_river_init');
469 $events->registerHandler(
'disable:after',
'all',
'_elgg_river_disable', 600);
470 $events->registerHandler(
'enable:after',
'all',
'_elgg_river_enable', 600);
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags...
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
elgg_is_logged_in()
Returns whether or not the user is currently logged in.
if(!$item instanceof ElggRiverItem) $object
if(!$user||!$user->canDelete()) $name
$CONFIG default_limit
The default "limit" used in site queries.
_elgg_is_valid_options_for_batch_operation($options, $type)
Checks if there are some constraints on the options array for potentially dangerous operations...
const ELGG_VALUE_INTEGER
Value types.
elgg_delete_river(array $options=[])
Delete river items based on $options.
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
elgg_create_river_item(array $options=[])
Adds an item to the river.
_elgg_river_init()
Initialize river library.
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
_elgg_river_menu_setup(\Elgg\Hook $hook)
Add the delete to river actions menu.
const ELGG_IGNORE_ACCESS
elgg_call() flags
$id
River item delete action.
if(!$owner||!$owner->canEdit()) if(!$owner->hasIcon('master')) if(!$owner->saveIconFromElggFile($owner->getIcon('master'), 'icon', $coords)) $view
Base class for events and hooks.
elgg_get_annotation_from_id($id)
Elgg annotations Functions to manage object annotations.
_elgg_river_update_object_last_action($event, $type, $item)
Updates the last action of the object of an river item.
elgg_set_ignore_access($ignore=true)
Set if Elgg's access system should be ignored.
_elgg_river_disable($event, $type, $entity)
Disable river entries that reference a disabled entity as subject/object/target.
elgg_get_river(array $options=[])
Get river items.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif(is_callable([$item, 'getType']))
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
_elgg_config()
Get the Elgg config service.
_elgg_river_test($hook, $type, $value)
Register river unit tests.
elgg_get_river_item_from_id($id)
Get river item from its ID.
_elgg_services()
Get the global service provider.
_elgg_river_enable($event, $type, $entity)
Enable river entries that reference a re-enabled entity as subject/object/target. ...
elgg_list_river(array $options=[])
List river items.
elgg_trigger_event($event, $object_type, $object=null)
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.
get_entity($guid)
Loads and returns an entity object from a guid.
elgg_register_rss_link()
Include the RSS icon link and link element in the head.