Elgg
Version 6.1
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
classes
Elgg
Menus
AdminControlPanel.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Elgg\Menus
;
4
5
use
Elgg\Menu\MenuItems
;
6
13
class
AdminControlPanel
{
14
22
public
static
function
register
(
\Elgg\Event
$event) {
23
if
(!
elgg_is_admin_logged_in
()) {
24
return
;
25
}
26
27
/* @var $return MenuItems */
28
$return = $event->getValue();
29
30
$return[] =
\ElggMenuItem::factory
([
31
'name'
=>
'invalidate'
,
32
'text'
=>
elgg_echo
(
'admin:cache:invalidate'
),
33
'icon'
=>
'sync-alt'
,
34
'href'
=>
elgg_generate_action_url
(
'admin/site/cache/invalidate'
),
35
'link_class'
=>
'elgg-button elgg-button-action'
,
36
]);
37
38
if
(!
_elgg_services
()->mutex->isLocked(
'upgrade'
)) {
39
$return[] =
\ElggMenuItem::factory
([
40
'name'
=>
'upgrade'
,
41
'text'
=>
elgg_echo
(
'upgrade'
),
42
'icon'
=>
'cogs'
,
43
'href'
=>
'upgrade.php'
,
44
'link_class'
=>
'elgg-button elgg-button-action'
,
45
'confirm'
=>
true
,
46
]);
47
}
else
{
48
$return[] =
\ElggMenuItem::factory
([
49
'name'
=>
'unlock_upgrade'
,
50
'text'
=>
elgg_echo
(
'upgrade:unlock'
),
51
'icon'
=>
'unlock'
,
52
'href'
=>
elgg_generate_action_url
(
'admin/site/unlock_upgrade'
),
53
'link_class'
=>
'elgg-button elgg-button-action'
,
54
'confirm'
=>
elgg_echo
(
'upgrade:unlock:confirm'
),
55
]);
56
}
57
58
return
$return;
59
}
60
}
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_is_admin_logged_in
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
Definition:
sessions.php:52
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\Menus
Definition:
AdminControlPanel.php:3
Elgg\Menus\AdminControlPanel
Register menu items for the admin_control_panel menu.
Definition:
AdminControlPanel.php:13
_elgg_services
_elgg_services()
Get the global service provider.
Definition:
elgglib.php:353
Elgg\Event
Models an event passed to event handlers.
Definition:
Event.php:11
Generated on Wed Dec 4 2024 00:00:21 for Elgg by
1.8.11