]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3206 using space so that echo('none') is not passed as value
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 25 Mar 2011 01:48:03 +0000 (01:48 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 25 Mar 2011 01:48:03 +0000 (01:48 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8833 36083f99-b078-4883-b0ff-0f9b5a30f544

actions/admin/menu/save.php
views/default/forms/admin/menu/save.php

index 3fdce8c45abb2c3a4d9850be127b96804ff86cd4..66ce71082efcd9acf5a253d34f1acaf7111ce963 100644 (file)
@@ -9,12 +9,11 @@
 // featured menu items
 $featured_names = get_input('featured_menu_names', array());
 $featured_names = array_unique($featured_names);
-if (in_array('', $featured_names)) {
-       unset($featured_names[array_search('', $featured_names)]);
+if (in_array(' ', $featured_names)) {
+       unset($featured_names[array_search(' ', $featured_names)]);
 }
 elgg_save_config('site_featured_menu_names', $featured_names);
 
-
 // custom menu items
 $custom_menu_titles = get_input('custom_menu_titles', array());
 $custom_menu_urls = get_input('custom_menu_urls', array());
index 7b8a9a6cb13367fd26313d008847c1f0e81ec381..91129c8810112e4f9e9bf0a0ab10ca945f95e3fb 100644 (file)
@@ -3,6 +3,9 @@
  * Form body for setting up site menu
  */
 
+// @todo Could probably make this number configurable
+$num_featured_items = 6;
+
 // get site menu items
 $menu = elgg_get_config('menus');
 $menu = $menu['site'];
@@ -16,7 +19,7 @@ $dropdown_values = array();
 foreach ($menu_items as $item) {
        $dropdown_values[$item->getName()] = $item->getText();
 }
-$dropdown_values[''] = elgg_echo('none');
+$dropdown_values[' '] = elgg_echo('none');
 
 ?>
 <div class="elgg-module elgg-module-inline">
@@ -29,12 +32,11 @@ echo elgg_view('output/longtext', array(
        'value' => elgg_echo("admin:menu_items:description")
 ));
 
-// @todo Could probably make this number configurable
-for ($i=0; $i<6; $i++) {
+for ($i=0; $i<$num_featured_items; $i++) {
        if (array_key_exists($i, $featured_menu_names)) {
                $current_value = $featured_menu_names[$i];
        } else {
-               $current_value = '';
+               $current_value = ' ';
        }
 
        echo elgg_view('input/dropdown', array(