diff --git a/administrator/components/com_menus/helpers/html/menus.php b/administrator/components/com_menus/helpers/html/menus.php index e2e3e8e711e24..1bf84d2f328f9 100644 --- a/administrator/components/com_menus/helpers/html/menus.php +++ b/administrator/components/com_menus/helpers/html/menus.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Registry\Registry; + JLoader::register('MenusHelper', JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php'); /** @@ -227,4 +229,31 @@ public static function state($value, $i, $enabled = true, $checkbox = 'cb') return JHtml::_('jgrid.state', $states, $value, $i, 'items.', $enabled, true, $checkbox); } + + /** + * Returns a visibility state on a grid + * + * @param integer $params Params of item. + * + * @return string The Html code + * + * @since __DEPLOY_VERSION__ + */ + public static function visibility($params) + { + $registry = new Registry; + + try + { + $registry->loadString($params); + } + catch (Exception $e) + { + // Invalid JSON + } + + $show_menu = $registry->get('menu_show'); + + return ($show_menu === 0) ? '' . JText::_('COM_MENUS_LABEL_HIDDEN') . '' : ''; + } } diff --git a/administrator/components/com_menus/views/items/tmpl/default.php b/administrator/components/com_menus/views/items/tmpl/default.php index 5c0e1b8da2109..1decd8c1e13a3 100644 --- a/administrator/components/com_menus/views/items/tmpl/default.php +++ b/administrator/components/com_menus/views/items/tmpl/default.php @@ -196,6 +196,7 @@ escape($item->note));?> + params); ?>
diff --git a/administrator/language/en-GB/en-GB.com_menus.ini b/administrator/language/en-GB/en-GB.com_menus.ini index d3aa59bc2980e..c026b9d44718c 100644 --- a/administrator/language/en-GB/en-GB.com_menus.ini +++ b/administrator/language/en-GB/en-GB.com_menus.ini @@ -148,6 +148,7 @@ COM_MENUS_MENU_TYPE_NOT_ALLOWED="This is a reserved menutype." COM_MENUS_MENUS_FILTER_SEARCH_DESC="Search in title and menu type." COM_MENUS_MENUS_FILTER_SEARCH_LABEL="Search Menus" COM_MENUS_PAGE_OPTIONS_LABEL="Page Display" +COM_MENUS_LABEL_HIDDEN="Hidden" ; in the following string ; %1$s is for module title, %2$s is for access-title, %3$s is for position COM_MENUS_MODULE_ACCESS_POSITION="%1$s (%2$s in %3$s)"