public function _replyToRegisterSubMenuItems()
 {
     $_aPages = $this->addAndApplyFilter($this->oFactory, "pages_{$this->oFactory->oProp->sClassName}", $this->oFactory->oProp->aPages);
     $this->oFactory->oProp->sDefaultPageSlug = $this->_getDefaultPageSlug($_aPages);
     $_iParsedIndex = 0;
     $_aFormattedPages = array();
     foreach ($_aPages as $_aSubMenuItem) {
         $_oFormatter = new AdminPageFramework_Format_SubMenuItem($_aSubMenuItem, $this->oFactory, ++$_iParsedIndex);
         $_aSubMenuItem = $_oFormatter->get();
         $_aSubMenuItem['_page_hook'] = $this->_registerSubMenuItem($_aSubMenuItem);
         $_sKey = isset($_aSubMenuItem['href']) ? $_aSubMenuItem['href'] : $_aSubMenuItem['page_slug'];
         $_aFormattedPages[$_sKey] = $_aSubMenuItem;
     }
     $this->oFactory->oProp->aPages = $_aFormattedPages;
 }
 public function _replyToRegisterMenu()
 {
     if ($this->oFactory->oProp->aRootMenu['fCreateRoot']) {
         $this->_registerRootMenuPage();
     }
     $this->oFactory->oProp->aPages = $this->addAndApplyFilter($this->oFactory, "pages_{$this->oFactory->oProp->sClassName}", $this->oFactory->oProp->aPages);
     $this->_setDefaultPage();
     $_iParsedIndex = 1;
     foreach ($this->oFactory->oProp->aPages as &$aSubMenuItem) {
         $_oFormatter = new AdminPageFramework_Format_SubMenuItem($aSubMenuItem, $this->oFactory, $_iParsedIndex);
         $aSubMenuItem = $_oFormatter->get();
         $aSubMenuItem['_page_hook'] = $this->_registerSubMenuItem($aSubMenuItem);
         $_iParsedIndex++;
     }
     if ($this->oFactory->oProp->aRootMenu['fCreateRoot']) {
         remove_submenu_page($this->oFactory->oProp->aRootMenu['sPageSlug'], $this->oFactory->oProp->aRootMenu['sPageSlug']);
     }
 }
コード例 #3
0
 public function _replyToBuildMenu()
 {
     if ($this->oProp->aRootMenu['fCreateRoot']) {
         $this->_registerRootMenuPage();
     }
     $this->oProp->aPages = $this->oUtil->addAndApplyFilter($this, "pages_{$this->oProp->sClassName}", $this->oProp->aPages);
     uasort($this->oProp->aPages, array($this->oUtil, 'sortArrayByKey'));
     $this->_setDefaultPage();
     foreach ($this->oProp->aPages as &$aSubMenuItem) {
         $_oFormatter = new AdminPageFramework_Format_SubMenuItem($aSubMenuItem, $this);
         $aSubMenuItem = $_oFormatter->get();
         $aSubMenuItem['_page_hook'] = $this->_registerSubMenuItem($aSubMenuItem);
     }
     if ($this->oProp->aRootMenu['fCreateRoot']) {
         remove_submenu_page($this->oProp->aRootMenu['sPageSlug'], $this->oProp->aRootMenu['sPageSlug']);
     }
     $this->oProp->_bBuiltMenu = true;
 }