Elgg
Version 4.3
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
\
Hook
$hook) {
23
$annotation
= $hook->getParam(
'annotation'
);
24
if
(!
$annotation
instanceof \
ElggAnnotation
|| !
$annotation
->canEdit()) {
25
return
;
26
}
27
28
/* @var $result MenuItems */
29
$return = $hook->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
}
$annotation
if($id< 1) $annotation
Definition:
delete.php:11
elgg_generate_action_url
elgg_generate_action_url($action, array $query=[], $add_csrf_tokens=true)
Generate an action URL.
Definition:
pagehandler.php:197
elgg_echo
elgg_echo($message_key, array $args=[], $language="")
Elgg language module Functions to manage language and translations.
Definition:
languages.php:18
ElggMenuItem\factory
static factory($options)
Create an ElggMenuItem from an associative array.
Definition:
ElggMenuItem.php:134
Elgg\Hook
Models an event passed to hook handlers.
Definition:
Hook.php:11
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\Menus\Annotation\registerDelete
static registerDelete(\Elgg\Hook $hook)
Register the generic delete annotation menu item.
Definition:
Annotation.php:22
ElggAnnotation
Generated on Fri Feb 3 2023 00:00:22 for Elgg by
1.8.11