aboutsummaryrefslogtreecommitdiff
path: root/actions/admin/menu_items.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-24 22:20:03 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-24 22:20:03 +0000
commitc0bc34a6ce4c08e652ef86712dd6b9c1781eade5 (patch)
treee5057c33f98e0b8f029a131f2172a49ccd88a7de /actions/admin/menu_items.php
parent3b0b462b5790f15fcb612de66544838bdbce658b (diff)
downloadelgg-c0bc34a6ce4c08e652ef86712dd6b9c1781eade5.tar.gz
elgg-c0bc34a6ce4c08e652ef86712dd6b9c1781eade5.tar.bz2
Added ability to make arbitrary links for the menu items.
git-svn-id: http://code.elgg.org/elgg/trunk@5498 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'actions/admin/menu_items.php')
-rw-r--r--actions/admin/menu_items.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/actions/admin/menu_items.php b/actions/admin/menu_items.php
index b271e1c2b..8e502bea2 100644
--- a/actions/admin/menu_items.php
+++ b/actions/admin/menu_items.php
@@ -10,12 +10,14 @@
$featured_urls = get_input('featured_urls', array());
$hide_toolbar_entries = get_input('menu_items_hide_toolbar_entries', 'yes');
-$featured_url_info = array();
+$custom_item_names = get_input('custom_item_names', array());
+$custom_item_urls = get_input('custom_item_urls', 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();
+$featured_url_info = array();
foreach ($menu_items as $name => $info) {
$menu_urls[$info->value->url] = $info;
@@ -27,9 +29,25 @@ foreach ($featured_urls as $url) {
}
}
+// save the custom items
+$custom_count = count($custom_item_names);
+$custom_items = array();
+for ($i=0; $i<$custom_count; $i++) {
+ if (isset($custom_item_names[$i]) && isset($custom_item_names[$i])) {
+ $name = $custom_item_names[$i];
+ $url = $custom_item_urls[$i];
+
+ if ($name && $url) {
+ $custom_items[$url] = $name;
+ }
+ }
+}
+
+
// 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);
+set_config('menu_items_custom_items', $custom_items);
system_message(elgg_echo('admin:menu_items:saved'));