Elgg  Version master
admin.php
Go to the documentation of this file.
1 <?php
9 
10 // Make sure the 'site' css isn't loaded
11 elgg_unregister_external_file('css', 'elgg');
12 
13 $segments = explode('/', trim(elgg_extract('segments', $vars, ''), '/'));
14 
15 // default to dashboard
16 if (empty($segments[0])) {
17  $segments = ['dashboard'];
18 }
19 
20 $title = elgg_echo("admin:{$segments[0]}");
21 if (count($segments) > 1) {
22  $title .= ' : ' . elgg_echo('admin:' . implode(':', $segments));
23 }
24 
25 $view = 'admin/' . implode('/', $segments);
27  'page' => $segments,
28 ]);
29 
30 if (empty($content)) {
31  throw new PageNotFoundException(elgg_echo('admin:unknown_section'));
32 }
33 
34 // build page
35 $body = elgg_view_layout('admin', [
36  'title' => $title,
37  'content' => $content,
38  'filter_id' => 'admin',
39 ]);
40 
41 // draw page
42 echo elgg_view_page($title, $body, 'admin');
$body
Definition: admin.php:37
elgg_view_layout(string $layout_name, array $vars=[])
Displays a layout with optional parameters.
Definition: views.php:352
elgg_unregister_external_file(string $type, string $name)
Unregister an external file.
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
if(count($segments) > 1) $view
Definition: admin.php:25
if(empty($segments[0])) $title
Definition: admin.php:20
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
$vars['sidebar']
Definition: admin.php:16
Thrown when page is not accessible.
elgg_view_page(string $title, string|array $body, string $page_shell= 'default', array $vars=[])
Assembles and outputs a full page.
Definition: views.php:235
$content
Definition: admin.php:26
$segments
Definition: admin.php:13