public function routeStartup(Zend_Controller_Request_Abstract $request) { $mdlMenuItem = new menu_Model_Item(); $menuItems = $mdlMenuItem->getListForRouting(); $frontController = Zend_Controller_Front::getInstance(); $router = $frontController->getRouter(); $options = array(); $options['module'] = 'acl'; /*($menuItems as $menuItem) { if (strcasecmp($menuItem->controller, "authentication") == 0 && strcasecmp($menuItem->actioncontroller, "login") == 0) { $params = Zend_Json::decode($menuItem->params); $options['controller'] = 'authentication'; $options['action'] = 'login'; $options['mid'] = $menuItem->id; $route = new Zend_Controller_Router_Route( $menuItem->id_alias, $options ); $router->addRoute($menuItem->id_alias, $route); } }*/ $options = array(); $options['module'] = 'acl'; $options['controller'] = 'account'; $options['action'] = 'resetpassword'; $options['change'] = 0; $route = new Zend_Controller_Router_Route('resetpassword', $options); $router->addRoute('resetpassword', $route); $options['action'] = 'resetpassword'; $options['change'] = 1; $route = new Zend_Controller_Router_Route('changepassword', $options); $router->addRoute('changepassword', $route); $options['action'] = 'edit'; $route = new Zend_Controller_Router_Route('edit-account', $options); $router->addRoute('edit-account', $route); $options['action'] = 'update'; $route = new Zend_Controller_Router_Route('update-account', $options); $router->addRoute('update-account', $route); $options['controller'] = 'authentication'; $options['action'] = 'login'; $route = new Zend_Controller_Router_Route('login', $options); $router->addRoute('login', $route); $options['controller'] = 'authentication'; $options['action'] = 'logout'; $route = new Zend_Controller_Router_Route('logout', $options); $router->addRoute('logout', $route); }
public function routeStartup(Zend_Controller_Request_Abstract $request) { try { $mdlMenuItem = new menu_Model_Item(); $menuItems = $mdlMenuItem->getListForRouting(); #Zend_Debug::dump($menuItems->toArray()); #die(); if ($menuItems->count() > 0) { foreach ($menuItems as $menuItem) { $route = new Zend_Controller_Router_Route(strlen($menuItem->id_alias) > 0 ? $menuItem->id_alias : strtolower($menuItem->module . '-' . $menuItem->controller . '-' . $menuItem->actioncontroller), array('module' => $menuItem->module, 'controller' => $menuItem->controller, 'action' => $menuItem->actioncontroller)); Zend_Controller_Front::getInstance()->getRouter()->addRoute(strlen($menuItem->id_alias) > 0 ? $menuItem->id_alias : strtolower($menuItem->module . '-' . $menuItem->controller . '-' . $menuItem->actioncontroller), $route); } } $route = new Zend_Controller_Router_Route(':module/:controller/:action/*', array()); Zend_Controller_Front::getInstance()->getRouter()->addRoute('pagination', $route); } catch (Exception $e) { try { $writer = new Zend_Log_Writer_Stream(APPLICATION_LOG_PATH . 'plugins.log'); $logger = new Zend_Log($writer); $logger->log($e->getMessage(), Zend_Log::ERR); } catch (Exception $e) { } } }
public function routeStartup(Zend_Controller_Request_Abstract $request) { $mdlMenuItem = new menu_Model_Item(); $menuItems = $mdlMenuItem->getListForRouting(); $frontController = Zend_Controller_Front::getInstance(); $router = $frontController->getRouter(); if ($menuItems->count() > 0) { foreach ($menuItems as $menuItem) { if (strcasecmp($menuItem->controller, "article") == 0 && strcasecmp($menuItem->actioncontroller, "view") == 0) { $params = Zend_Json::decode($menuItem->params); $options = array(); $options['module'] = 'content'; $options['controller'] = 'article'; $options['action'] = 'view'; foreach ($params as $param) { $options['aid'] = $param['aid']; } $options['mid'] = $menuItem->id; $route = new Zend_Controller_Router_Route($menuItem->id_alias, $options); $router->addRoute($menuItem->id_alias, $route); } } } }