Elgg
Version 6.1
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
classes
Elgg
Menus
UserUnvalidated.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Elgg\Menus
;
4
5
use
Elgg\Menu\MenuItems
;
6
13
class
UserUnvalidated
{
14
22
public
static
function
register
(
\Elgg\Event
$event) {
23
if
(!
elgg_is_admin_logged_in
()) {
24
return
;
25
}
26
27
$entity
= $event->getEntityParam();
28
if
(!
$entity
instanceof \
ElggUser
||
$entity
->isValidated()) {
29
return
;
30
}
31
32
/* @var $return MenuItems */
33
$return = $event->getValue();
34
35
$return[] =
\ElggMenuItem::factory
([
36
'name'
=>
'change_email'
,
37
'icon'
=>
'edit'
,
38
'text'
=>
elgg_echo
(
'admin:users:unvalidated:change_email'
),
39
'href'
=>
elgg_http_add_url_query_elements
(
'ajax/form/admin/user/change_email'
, [
40
'user_guid'
=>
$entity
->guid,
41
]),
42
'link_class'
=>
'elgg-lightbox'
,
43
'priority'
=> 100,
44
]);
45
46
$return[] =
\ElggMenuItem::factory
([
47
'name'
=>
'validate'
,
48
'icon'
=>
'check'
,
49
'text'
=>
elgg_echo
(
'validate'
),
50
'href'
=>
elgg_generate_action_url
(
'admin/user/validate'
, [
51
'user_guid'
=>
$entity
->guid,
52
]),
53
'confirm'
=>
true
,
54
'priority'
=> 400,
55
]);
56
57
$return[] =
\ElggMenuItem::factory
([
58
'name'
=>
'delete'
,
59
'icon'
=>
'delete'
,
60
'text'
=>
elgg_echo
(
'delete'
),
61
'title'
=>
elgg_echo
(
'delete'
),
62
'href'
=>
elgg_generate_action_url
(
'admin/user/delete'
, [
63
'guid'
=>
$entity
->guid,
64
]),
65
'confirm'
=>
elgg_echo
(
'deleteconfirm'
),
66
'priority'
=> 500,
67
]);
68
69
return
$return;
70
}
71
}
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
$entity
$entity
Definition:
reset.php:8
Elgg\Menus
Definition:
AdminControlPanel.php:3
elgg_http_add_url_query_elements
elgg_http_add_url_query_elements(string $url, array $elements)
Sets elements in a URL's query string.
Definition:
elgglib.php:183
Elgg\Menus\UserUnvalidated
Register menu items to the user:unvalidated menu.
Definition:
UserUnvalidated.php:13
Elgg\Event
Models an event passed to event handlers.
Definition:
Event.php:11
ElggUser
Definition:
ElggUser.php:28
Generated on Wed Dec 4 2024 00:00:21 for Elgg by
1.8.11