Elgg  Version master
content.php
Go to the documentation of this file.
1 <?php
6 // section => string replacements.
8  'intro' => [],
9  'registration' => [
10  elgg_view('output/url', [
11  'text' => elgg_echo('admin:site_settings'),
12  'href' => elgg_generate_url('admin', [
13  'segments' => 'site_settings',
14  ]),
15  'is_trusted' => true,
16  ]),
17  ],
18  'admin_overview' => [],
19  'outro' => [],
20 ];
21 
22 $results = '';
23 foreach ($sections as $section => $strings) {
24  if ($section === 'registration') {
25  if (!elgg_get_config('allow_registration')) {
26  // registration is disabled, tell the admin
27  echo elgg_view_message('warning', elgg_echo("admin:widget:admin_welcome:{$section}", $strings));
28  }
29 
30  continue;
31  }
32 
33  $results .= elgg_format_element('p', [], elgg_echo("admin:widget:admin_welcome:{$section}", $strings));
34 }
35 
36 echo elgg_view('output/longtext', ['value' => $results, 'sanitize' => false]);
$sections
Welcome widget for admins.
Definition: content.php:7
elgg_get_config(string $name, $default=null)
Get an Elgg configuration value.
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
$results
Definition: content.php:22
elgg_view_message(string $type, string $body, array $vars=[])
Wrapper function for the message display pattern.
Definition: views.php:940
elgg_generate_url(string $name, array $parameters=[])
Generate a URL for named route.
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145