diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-17 19:09:09 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-17 19:09:09 +0000 |
commit | ff6f2152bb6f0a759bffbcc213a82aecc0237ae6 (patch) | |
tree | a0ed026661677ab315069274ca05f7395e6248c5 /actions | |
parent | 99d5f4b0d22e99109da860dd9118265c883a668e (diff) | |
download | elgg-ff6f2152bb6f0a759bffbcc213a82aecc0237ae6.tar.gz elgg-ff6f2152bb6f0a759bffbcc213a82aecc0237ae6.tar.bz2 |
Added config options for tabs and menu items.
git-svn-id: http://code.elgg.org/elgg/trunk@5431 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'actions')
-rw-r--r-- | actions/admin/menu_items.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/actions/admin/menu_items.php b/actions/admin/menu_items.php new file mode 100644 index 000000000..b271e1c2b --- /dev/null +++ b/actions/admin/menu_items.php @@ -0,0 +1,36 @@ +<?php +/** + * Save menu items. + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ + +$featured_urls = get_input('featured_urls', array()); +$hide_toolbar_entries = get_input('menu_items_hide_toolbar_entries', 'yes'); +$featured_url_info = array(); + +// save the full information from the menu item into the config table +// this will be checked upon display that it is still valid (based upon url) +$menu_items = get_register('menu'); +$menu_urls = array(); + +foreach ($menu_items as $name => $info) { + $menu_urls[$info->value->url] = $info; +} + +foreach ($featured_urls as $url) { + if (array_key_exists($url, $menu_urls)) { + $featured_url_info[] = $menu_urls[$url]; + } +} + +// set_config() always returns 0 so can't check for failures +set_config('menu_items_featured_urls', $featured_url_info); +set_config('menu_items_hide_toolbar_entries', $hide_toolbar_entries); + +system_message(elgg_echo('admin:menu_items:saved')); + +forward($_SERVER['HTTP_REFERER']);
\ No newline at end of file |