Permalink
Browse files

Added ability to silence menu.

Menu can clutter an interface. disableMenu function lets the developer
hide it for that particular page view.
  • Loading branch information...
Stardog committed Nov 20, 2017
1 parent f990048 commit 109f5ca8bfab551dbcda4dab330167b46c08c733
Showing with 23 additions and 5 deletions.
  1. +16 −0 mod/menu/class/Menu.php
  2. +7 −5 mod/menu/inc/close.php
View
@@ -9,6 +9,8 @@
\phpws\PHPWS_Core::initModClass('menu', 'Menu_Item.php');
class Menu {
static $disableMenu = false;
public static function admin()
{
@@ -400,6 +402,20 @@ public static function getMenuListing($include_pin_all = true)
$menus = $db2->select();
return $menus;
}
/**
* Disables the menu for one page load. Useful to get back some screen
* space.
*/
public static function disableMenu()
{
self::$disableMenu = true;
}
public static function enableMenu()
{
self::$disableMenu = true;
}
public static function categoryView()
{
View
@@ -8,11 +8,13 @@
exit();
}
if (PHPWS_Settings::get('menu', 'display_type')) {
Menu::categoryView();
} else {
Menu::show();
Menu::showPinned();
if (!Menu::$disableMenu) {
if (PHPWS_Settings::get('menu', 'display_type')) {
Menu::categoryView();
} else {
Menu::show();
Menu::showPinned();
}
}
unset($GLOBALS['MENU_LINKS']);
Menu::miniadmin();

0 comments on commit 109f5ca

Please sign in to comment.