public function __construct($options = null) { $oModelNavigationModule = new Admin_Model_NavigationModule(); $oModelNavigationController = new Admin_Model_NavigationController(); $oModelNavigationAction = new Admin_Model_NavigationAction(); $oModelNavigationResource = new Admin_Model_NavigationResource(); $oModelNavigationPrivilege = new Admin_Model_NavigationPrivilege(); $oModelUserRole = new Admin_Model_UserRole(); $aAllModule = $oModelNavigationModule->getAll()->toArray(); if (count($aAllModule)) { foreach ($aAllModule as $aValue) { $this->_aAllModule[$aValue["id"]] = $aValue["value"]; } } $aAllController = $oModelNavigationController->getAll()->toArray(); if (count($aAllController)) { foreach ($aAllController as $aValue) { $this->_aAllController[$aValue["id"]] = $aValue["value"]; } } $aAllAction = $oModelNavigationAction->getAll()->toArray(); if (count($aAllAction)) { foreach ($aAllAction as $aValue) { $this->_aAllAction[$aValue["id"]] = $aValue["value"]; } } $aAllRosource = $oModelNavigationResource->getAll()->toArray(); if (count($aAllRosource)) { foreach ($aAllRosource as $aValue) { $this->_aAllResource[$aValue["id"]] = $aValue["value"]; } } $aAllPriviage = $oModelNavigationPrivilege->getAll()->toArray(); if (count($aAllPriviage)) { foreach ($aAllPriviage as $aValue) { $this->_aAllPrivilege[$aValue["id"]] = $aValue["value"]; } } $aAllUserRole = $oModelUserRole->getAll()->toArray(); if (count($aAllUserRole)) { foreach ($aAllUserRole as $aValue) { $this->_aAllUserRole[$aValue["id"]] = $aValue["role_name"]; } } $oModelImage = new Admin_Model_Image(); $aImage = $oModelImage->getAll()->toArray(); $this->_aAllImage[0] = "-"; if (count($aImage)) { foreach ($aImage as $nKey => $aValue) { $this->_aAllImage[$aValue["id"]] = $aValue["user_name"]; } } $this->getSiteLayout(); parent::__construct($options); }
public function __construct($options = null) { $oModelUserRole = new Admin_Model_UserRole(); $oModelUserCategory = new Admin_Model_UserCategory(); $aAllUserRole = $oModelUserRole->getAll()->toArray(); if (count($aAllUserRole)) { foreach ($aAllUserRole as $aValue) { $this->_aAllUserRole[$aValue["id"]] = $aValue["role_name"]; } } $oAllCategory = $oModelUserCategory->getAll(); if (isset($oAllCategory)) { foreach ($oAllCategory as $oRow) { $this->_aCategory[$oRow->id] = trim($oRow->name); } } parent::__construct($options); }
public function __construct($options = null) { $oModelVNavigationSubmenu = new Admin_Model_VNavigationSubmenu(); $oModelNavigationAction = new Admin_Model_NavigationAction(); $oModelNavigationResource = new Admin_Model_NavigationResource(); $oModelNavigationPrivilege = new Admin_Model_NavigationPrivilege(); $oModelUserRole = new Admin_Model_UserRole(); $aAllNavigationSubmenu = $oModelVNavigationSubmenu->getDefaultModule()->toArray(); if (count($aAllNavigationSubmenu)) { foreach ($aAllNavigationSubmenu as $aValue) { $this->_aAllNavigationSubmenu[$aValue["id"]] = $aValue["label"] . " / " . $aValue["navigation_module"]; } } $aAllAction = $oModelNavigationAction->getAll()->toArray(); if (count($aAllAction)) { foreach ($aAllAction as $aValue) { $this->_aAllAction[$aValue["id"]] = $aValue["value"]; } } $aAllRosource = $oModelNavigationResource->getAll()->toArray(); if (count($aAllRosource)) { foreach ($aAllRosource as $aValue) { $this->_aAllResource[$aValue["id"]] = $aValue["value"]; } } $aAllPriviage = $oModelNavigationPrivilege->getAll()->toArray(); if (count($aAllPriviage)) { foreach ($aAllPriviage as $aValue) { $this->_aAllPrivilege[$aValue["id"]] = $aValue["value"]; } } $aAllUserRole = $oModelUserRole->getAll()->toArray(); if (count($aAllUserRole)) { foreach ($aAllUserRole as $aValue) { $this->_aAllUserRole[$aValue["id"]] = $aValue["role_name"]; } } $this->_sClassName = get_class(); $this->getSiteLayout(); parent::__construct($options); }
public function roleAction() { $oModelUserRole = new Admin_Model_UserRole(); $oFormUserRole = new Admin_Form_UserRole(); $aPostData = array(); $sSuccess = ""; if ($this->_request->isPost()) { $aPostData = $this->_request->getPost(); if ($oFormUserRole->isValid($aPostData)) { $nRoleId = $aPostData["role_edit_id"]; $sRoleName = $aPostData["role_name"]; if ($nRoleId != 0) { $bIsEdited = $oModelUserRole->edit($nRoleId, $sRoleName); if (!is_numeric($bIsEdited)) { $sSuccess = "NO OK"; } } else { $nRoleId = $oModelUserRole->newRole($sRoleName); if (!is_numeric($nRoleId)) { $sSuccess = "NO OK"; } } $oFormUserRole->reset(); } } $this->view->oFormUserRole = $oFormUserRole; $this->view->aAllUserRole = $oModelUserRole->getAll()->toArray(); $this->view->sSuccess = $sSuccess; }