Elgg
Version 6.1
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
classes
Elgg
Widgets
EntityUrlHandler.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Elgg\Widgets
;
4
10
class
EntityUrlHandler
{
11
19
public
function
__invoke
(\
Elgg
\
Event
$event): ?string {
20
$widget
= $event->getEntityParam();
21
if
(!
$widget
instanceof \
ElggWidget
) {
22
return
null;
23
}
24
25
$admin_segments = null;
26
switch
(
$widget
->handler) {
27
case
'content_stats'
:
28
$admin_segments =
'statistics'
;
29
break
;
30
case
'cron_status'
:
31
$admin_segments =
'cron'
;
32
break
;
33
case
'banned_users'
:
34
$admin_segments =
'users/banned'
;
35
break
;
36
case
'new_users'
:
37
$admin_segments =
'users'
;
38
break
;
39
case
'online_users'
:
40
$admin_segments =
'users/online'
;
41
break
;
42
case
'elgg_blog'
:
43
return
'https://elgg.org/blog/all'
;
44
}
45
46
return
$admin_segments ?
elgg_generate_url
(
'admin'
, [
'segments'
=> $admin_segments]) : null;
47
}
48
}
Elgg\Widgets
Definition:
CreateAdminWidgetsHandler.php:3
Elgg\Widgets\EntityUrlHandler
Returns widget urls.
Definition:
EntityUrlHandler.php:10
Elgg
Definition:
ActionsService.php:3
Elgg\Widgets\EntityUrlHandler\__invoke
__invoke(\Elgg\Event $event)
Returns widget URLS used in widget titles.
Definition:
EntityUrlHandler.php:19
$widget
if($guid===false) $widget
Definition:
add.php:31
elgg_generate_url
elgg_generate_url(string $name, array $parameters=[])
Generate a URL for named route.
Definition:
pagehandler.php:133
Elgg\Event
Models an event passed to event handlers.
Definition:
Event.php:11
ElggWidget
Definition:
ElggWidget.php:10
Generated on Thu Dec 12 2024 00:00:22 for Elgg by
1.8.11