aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-25 01:48:03 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-25 01:48:03 +0000
commit37ef28ed24c665c39315f119677958e81cc8e387 (patch)
treef13e4bf3d69653776c0c9ed962b93d75c9147b40
parent2f87171fb8ccdd244b496fc31ff882757bbc6902 (diff)
downloadelgg-37ef28ed24c665c39315f119677958e81cc8e387.tar.gz
elgg-37ef28ed24c665c39315f119677958e81cc8e387.tar.bz2
Fixes #3206 using space so that echo('none') is not passed as value
git-svn-id: http://code.elgg.org/elgg/trunk@8833 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--actions/admin/menu/save.php5
-rw-r--r--views/default/forms/admin/menu/save.php10
2 files changed, 8 insertions, 7 deletions
diff --git a/actions/admin/menu/save.php b/actions/admin/menu/save.php
index 3fdce8c45..66ce71082 100644
--- a/actions/admin/menu/save.php
+++ b/actions/admin/menu/save.php
@@ -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());
diff --git a/views/default/forms/admin/menu/save.php b/views/default/forms/admin/menu/save.php
index 7b8a9a6cb..91129c881 100644
--- a/views/default/forms/admin/menu/save.php
+++ b/views/default/forms/admin/menu/save.php
@@ -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(