Esempio n. 1
0
 /**
  * Returns the instance of menu. Subsequent calls return the same object.
  *
  * @return OA_Admin_Menu
  */
 function &singleton()
 {
     $accountType = OA_Permission::getAccountType();
     if (isset($GLOBALS['_MAX']['MENU_OBJECT'][$accountType])) {
         $oMenu =& $GLOBALS['_MAX']['MENU_OBJECT'][$accountType];
     } elseif ($GLOBALS['_MAX']['CONF']['debug']['production'] != 0 && ($oMenu = OA_Admin_Menu::_loadFromCache($accountType))) {
         $GLOBALS['_MAX']['MENU_OBJECT'][$accountType] =& $oMenu;
     } else {
         $oMenu = new OA_Admin_Menu();
         if (empty($oMenu->aAllSections)) {
             include_once MAX_PATH . '/lib/OA/Admin/Menu/config.php';
             $oMenu = _buildNavigation(OA_Permission::getAccountType());
         }
         require_once LIB_PATH . '/Plugin/ComponentGroupManager.php';
         $oPluginManager = new OX_Plugin_ComponentGroupManager();
         $oPluginManager->mergeMenu($oMenu, $accountType);
         $GLOBALS['_MAX']['MENU_OBJECT'][$accountType] =& $oMenu;
         $oMenu->_saveToCache($accountType);
     }
     // Filter against user-account-preferences...
     return $oMenu;
 }
 /**
  * return a menu object for a given account type
  * note: we want a *clean* object, not the global one
  *
  * @return object of type OA_Admin_Menu
  */
 function _getMenuObject($accountType)
 {
     $oMenu = $this->_getOA_Admin_Menu($accountType);
     if (empty($oMenu->aAllSections)) {
         include_once MAX_PATH . '/lib/OA/Admin/Menu/config.php';
         $oMenu = _buildNavigation($accountType);
     }
     return $oMenu;
 }
Esempio n. 3
0
 function &_getMenuObjectForAccount($accountType)
 {
     $oMenu = new OA_Admin_Menu($accountType);
     $oMenu = _buildNavigation($accountType);
     return $oMenu;
 }