Elgg
Version master
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
classes
Elgg
Menus
River.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Elgg\Menus
;
4
5
use
Elgg\Menu\MenuItems
;
6
13
class
River
{
14
22
public
static
function
registerDelete
(\
Elgg
\
Event
$event) {
23
24
$item
= $event->getParam(
'item'
);
25
if
(!
$item
instanceof \
ElggRiverItem
|| !
$item
->canDelete()) {
26
return
;
27
}
28
29
/* @Var $return MenuItems */
30
$return = $event->getValue();
31
32
$return[] =
\ElggMenuItem::factory
([
33
'name'
=>
'delete'
,
34
'icon'
=>
'delete'
,
35
'text'
=>
elgg_echo
(
'river:delete'
),
36
'href'
=>
elgg_generate_action_url
(
'river/delete'
, [
37
'id'
=>
$item
->id,
38
]),
39
'confirm'
=>
elgg_echo
(
'deleteconfirm'
),
40
'priority'
=> 999,
41
]);
42
43
return
$return;
44
}
45
}
$item
if(!$items) $item
Definition:
delete.php:13
elgg_generate_action_url
elgg_generate_action_url(string $action, array $query=[], bool $add_csrf_tokens=true)
Generate an action URL.
Definition:
pagehandler.php:197
elgg_echo
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition:
languages.php:17
ElggMenuItem\factory
static factory(array $options)
Create an ElggMenuItem from an associative array.
Definition:
ElggMenuItem.php:130
MenuItems
Elgg
Definition:
ActionsService.php:3
Elgg\Menus
Definition:
AdminControlPanel.php:3
Elgg\Menus\River\registerDelete
static registerDelete(\Elgg\Event $event)
Add the delete to river actions menu.
Definition:
River.php:22
Elgg\Menus\River
Register menu items to the river menu.
Definition:
River.php:13
ElggRiverItem
Definition:
ElggRiverItem.php:18
Elgg\Event
Models an event passed to event handlers.
Definition:
Event.php:11
Generated on Sat Dec 21 2024 00:02:51 for Elgg by
1.8.11