diff --git a/administrator/components/com_menus/models/forms/item_alias.xml b/administrator/components/com_menus/models/forms/item_alias.xml index 5f6f040726090..cc5586dbcf540 100644 --- a/administrator/components/com_menus/models/forms/item_alias.xml +++ b/administrator/components/com_menus/models/forms/item_alias.xml @@ -36,7 +36,18 @@ - + + + + diff --git a/administrator/components/com_menus/models/forms/item_component.xml b/administrator/components/com_menus/models/forms/item_component.xml index b7018fd97998f..101b3e87704ba 100644 --- a/administrator/components/com_menus/models/forms/item_component.xml +++ b/administrator/components/com_menus/models/forms/item_component.xml @@ -27,7 +27,18 @@ - + + + +
- + + + + +
diff --git a/administrator/components/com_menus/models/forms/item_separator.xml b/administrator/components/com_menus/models/forms/item_separator.xml index 9f03f77077a29..67bfe0e48ed27 100644 --- a/administrator/components/com_menus/models/forms/item_separator.xml +++ b/administrator/components/com_menus/models/forms/item_separator.xml @@ -22,7 +22,18 @@ - + + + + diff --git a/administrator/components/com_menus/models/forms/item_url.xml b/administrator/components/com_menus/models/forms/item_url.xml index 868e99fa60b5d..3d384cf9716fa 100644 --- a/administrator/components/com_menus/models/forms/item_url.xml +++ b/administrator/components/com_menus/models/forms/item_url.xml @@ -25,7 +25,18 @@ - + + + + diff --git a/administrator/language/en-GB/en-GB.com_menus.ini b/administrator/language/en-GB/en-GB.com_menus.ini index 4db646b0a30ac..7b516da3d59e7 100644 --- a/administrator/language/en-GB/en-GB.com_menus.ini +++ b/administrator/language/en-GB/en-GB.com_menus.ini @@ -81,6 +81,8 @@ COM_MENUS_ITEM_FIELD_LINK_DESC="Link for this menu." COM_MENUS_ITEM_FIELD_LINK_LABEL="Link" COM_MENUS_ITEM_FIELD_MENU_IMAGE_DESC="Select or upload an optional image to be used with the menu hyperlink." COM_MENUS_ITEM_FIELD_MENU_IMAGE_LABEL="Link Image" +COM_MENUS_ITEM_FIELD_MENU_SHOW_DESC="Select 'No' if you want to exclude this menu item from displaying in the menu. Note any submenu items will also be hidden." +COM_MENUS_ITEM_FIELD_MENU_SHOW_LABEL="Display in Menu" COM_MENUS_ITEM_FIELD_MENU_TEXT_DESC="If the optional image is added, adds the menu title next to the image. Default is 'Yes'." COM_MENUS_ITEM_FIELD_MENU_TEXT_LABEL="Add Menu Title" COM_MENUS_ITEM_FIELD_NOTE_DESC="An optional note to display in the Menu Manager." diff --git a/modules/mod_menu/helper.php b/modules/mod_menu/helper.php index 34c8f1ee525fd..cca3bc48eea0a 100644 --- a/modules/mod_menu/helper.php +++ b/modules/mod_menu/helper.php @@ -42,13 +42,13 @@ public static function getList(&$params) if (!($items = $cache->get($key))) { - $path = $base->tree; - $start = (int) $params->get('startLevel'); - $end = (int) $params->get('endLevel'); - $showAll = $params->get('showAllChildren'); - $items = $menu->getItems('menutype', $params->get('menutype')); - - $lastitem = 0; + $path = $base->tree; + $start = (int) $params->get('startLevel'); + $end = (int) $params->get('endLevel'); + $showAll = $params->get('showAllChildren'); + $items = $menu->getItems('menutype', $params->get('menutype')); + $hidden_parents = array(); + $lastitem = 0; if ($items) { @@ -63,6 +63,14 @@ public static function getList(&$params) continue; } + // Exclude item with menu item option set to exclude from menu modules + if (($item->params->get('menu_show', 1) == 0) || in_array($item->parent_id, $hidden_parents)) + { + $hidden_parents[] = $item->id; + unset($items[$i]); + continue; + } + $item->deeper = false; $item->shallower = false; $item->level_diff = 0;