Elgg  Version master
icons.php
Go to the documentation of this file.
1 <?php
2 
3 $site_icon = elgg_view('output/longtext', ['value' => elgg_echo('admin:site_icons:info')]);
4 
5 $site_icon .= elgg_view('entity/edit/icon', [
6  'entity' => elgg_get_site_entity(),
7 ]);
8 
9 echo elgg_view_module('info', elgg_echo('admin:site_icons:site_icon'), $site_icon);
10 
11 if (extension_loaded('zip')) {
12  $current_zip = elgg_get_config('font_awesome_zip');
13  $fa = elgg_view_field([
14  '#type' => 'file',
15  '#label' => elgg_echo('admin:site_icons:font_awesome:zip'),
16  '#help' => elgg_echo('admin:site_icons:font_awesome:zip:help'),
17  'name' => 'font_awesome_zip',
18  'value' => $current_zip,
19  'accept' => '.zip',
20  ]);
21 
22  if ($current_zip) {
23  $fa .= elgg_view_field([
24  '#type' => 'switch',
25  '#label' => elgg_echo('admin:site_icons:font_awesome:remove_zip'),
26  'name' => 'remove_font_awesome_zip',
27  ]);
28  }
29 
30  echo elgg_view_module('info', elgg_echo('admin:site_icons:font_awesome'), $fa);
31 }
32 
34  '#type' => 'submit',
35  'text' => elgg_echo('save'),
36 ]);
elgg_view_module(string $type, string $title, string $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:919
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
Definition: views.php:1112
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
elgg_set_form_footer(string $footer= '')
Sets form footer and defers its rendering until the form view and extensions have been rendered...
Definition: views.php:1046
$site_icon
Definition: icons.php:3
if(extension_loaded('zip')) $footer
Definition: icons.php:33
elgg_get_site_entity()
Get the current site entity.
Definition: entities.php:101