Elgg
Version master
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
classes
Elgg
Search
UserSearchFieldsHandler.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Elgg\Search
;
4
9
class
UserSearchFieldsHandler
{
10
18
public
function
__invoke
(\
Elgg
\
Event
$event) {
19
20
$value
= (array) $event->getValue();
21
22
$defaults
= [
23
'metadata'
=> [],
24
];
25
26
$value
= array_merge(
$defaults
,
$value
);
27
28
$fields
= [
29
'username'
,
30
'name'
,
31
'description'
,
32
];
33
34
if
(
elgg_in_context
(
'admin'
) &&
elgg_is_admin_logged_in
()) {
35
$fields
[] =
'email'
;
36
}
37
38
$value
[
'metadata'
] = array_merge(
$value
[
'metadata'
],
$fields
);
39
40
return
$value
;
41
}
42
}
Elgg\Search
Definition:
GroupSearchFieldsHandler.php:3
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
$defaults
$defaults
Generic entity header upload helper.
Definition:
header.php:6
elgg_in_context
elgg_in_context(string $context)
Check if this context exists anywhere in the stack.
Definition:
context.php:78
$value
$value
Definition:
generic.php:51
Elgg
Definition:
ActionsService.php:3
$fields
$fields
Save the configuration of the security.txt contents.
Definition:
security_txt.php:6
Elgg\Search\UserSearchFieldsHandler
Definition:
UserSearchFieldsHandler.php:9
Elgg\Search\UserSearchFieldsHandler\__invoke
__invoke(\Elgg\Event $event)
Populate default search fields for user entities.
Definition:
UserSearchFieldsHandler.php:18
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