Exemplo 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;
 }
Exemplo n.º 2
0
 public function getnavigationoptionuserroleAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     $this->_helper->getHelper("layout")->disableLayout();
     $aInputFilters = array("*" => array(new Zend_Filter_StringTrim()));
     $aInputValidators = array("id" => array(new Zend_Validate_Digits()), "element" => array(new Zend_Validate_StringLength(4, 45)));
     $oInput = new Zend_Filter_Input($aInputFilters, $aInputValidators, $_POST);
     if ($oInput->getUnescaped("element") == "menu") {
         $nNavigationMenuId = $oInput->getUnescaped("id");
         $oModelNavigationMenu = new Admin_Model_NavigationMenu();
         $nNavigationOptionId = $oModelNavigationMenu->findOptionId($nNavigationMenuId);
     } else {
         if ($oInput->getUnescaped("element") == "submenu") {
             $nNavigationSubmenuId = $oInput->getUnescaped("id");
             $oModelNavigationSubmenu = new Admin_Model_NavigationSubmenu();
             $nNavigationOptionId = $oModelNavigationSubmenu->findOptionId($nNavigationSubmenuId);
         } else {
             if ($oInput->getUnescaped("element") == "subsubmenu") {
                 $nNavigationSubsubmenuId = $oInput->getUnescaped("id");
                 $oModelNavigationSubsubmenu = new Admin_Model_NavigationSubsubmenu();
                 $nNavigationOptionId = $oModelNavigationSubsubmenu->findOptionId($nNavigationSubsubmenuId);
             }
         }
     }
     $oModelNavigationOptionUserRole = new Admin_Model_NavigationOptionUserRole();
     $bJson = $oModelNavigationOptionUserRole->getAll($nNavigationOptionId)->toArray();
     header("Content-type: application/json");
     echo Zend_Json::encode($bJson);
     exit;
 }