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