Elgg  Version master
save.php
Go to the documentation of this file.
1 <?php
6 // featured menu items
7 $featured_names = (array) get_input('featured_menu_names', []);
8 $featured_names = array_unique($featured_names);
9 if (in_array(' ', $featured_names)) {
10  unset($featured_names[array_search(' ', $featured_names)]);
11 }
12 
13 elgg_save_config('site_featured_menu_names', $featured_names);
14 
15 // custom menu items
16 $custom_menu_titles = get_input('custom_menu_titles', []);
17 $custom_menu_urls = get_input('custom_menu_urls', []);
20 for ($i = 0; $i < $num_menu_items; $i++) {
22  $url = $custom_menu_urls[$i];
25  }
26 }
27 
28 elgg_save_config('site_custom_menu_items', $custom_menu_items);
29 
30 return elgg_ok_response('', elgg_echo('admin:menu_items:saved'));
$custom_menu_items
Definition: save.php:19
elgg_ok_response($content= '', string|array $message= '', string $forward_url=null, int $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
$title
Definition: generic.php:50
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
$featured_names
Save menu items.
Definition: save.php:7
get_input(string $variable, $default=null, bool $filter_result=true)
Parameter input functions.
Definition: input.php:20
$num_menu_items
Definition: save.php:18
elgg_save_config(string $name, $value)
Save a configuration setting.
$custom_menu_urls
Definition: save.php:17
foreach($plugin_guids as $guid) if(empty($deactivated_plugins)) $url
Definition: deactivate.php:39
$custom_menu_titles
Definition: save.php:16