Esempio n. 1
0
 public function getMaxId()
 {
     $oModelNavigationMenu = new Admin_Model_NavigationMenu();
     $oModelNavigationSubmenu = new Admin_Model_NavigationSubmenu();
     $oModelNavigationSubsubmenu = new Admin_Model_NavigationSubsubmenu();
     $aAllIds = array($oModelNavigationMenu->getLastRow()->id, $oModelNavigationSubmenu->getLastRow()->id, $oModelNavigationSubsubmenu->getLastRow()->id);
     return max($aAllIds) + 1;
 }
 public function setnavigationorderAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     $this->_helper->getHelper("layout")->disableLayout();
     $sElement = $this->_getParam("element");
     $aOrder = $this->_getParam("order");
     if ($sElement == "menu") {
         $oModelNavigationElement = new Admin_Model_NavigationMenu();
     } else {
         if ($sElement == "submenu") {
             $oModelNavigationElement = new Admin_Model_NavigationSubmenu();
         } else {
             if ($sElement == "subsubmenu") {
                 $oModelNavigationElement = new Admin_Model_NavigationSubsubmenu();
             }
         }
     }
     if (is_array($aOrder)) {
         foreach ($aOrder as $nId => $nOrder) {
             $oModelNavigationElement->setOrder((int) $nId, (int) $nOrder);
         }
     }
     $bJson = true;
     header("Content-type: application/json");
     echo Zend_Json::encode($bJson);
     exit;
 }