Elgg  Version 3.0
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 elgg_save_config('site_featured_menu_names', $featured_names);
13 
14 // custom menu items
15 $custom_menu_titles = get_input('custom_menu_titles', []);
16 $custom_menu_urls = get_input('custom_menu_urls', []);
19 for ($i = 0; $i < $num_menu_items; $i++) {
20  if (trim($custom_menu_urls[$i]) && trim($custom_menu_titles[$i])) {
21  $url = $custom_menu_urls[$i];
24  }
25 }
26 elgg_save_config('site_custom_menu_items', $custom_menu_items);
27 
28 return elgg_ok_response('', elgg_echo('admin:menu_items:saved'));
$custom_menu_items
Definition: save.php:18
$featured_names
Save menu items.
Definition: save.php:7
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_save_config($name, $value)
Save a configuration setting.
$title
Definition: user.php:20
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
$num_menu_items
Definition: save.php:17
$url
Definition: default.php:33
elgg_ok_response($content= '', $message= '', $forward_url=null, $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
$custom_menu_urls
Definition: save.php:16
$custom_menu_titles
Definition: save.php:15