当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Controller_Request_Abstract::getModuleName方法代码示例

本文整理汇总了PHP中Zend_Controller_Request_Abstract::getModuleName方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Request_Abstract::getModuleName方法的具体用法?PHP Zend_Controller_Request_Abstract::getModuleName怎么用?PHP Zend_Controller_Request_Abstract::getModuleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Controller_Request_Abstract的用法示例。


在下文中一共展示了Zend_Controller_Request_Abstract::getModuleName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: routeShutdown

 public function routeShutdown(Zend_Controller_Request_Abstract $request)
 {
     $useModule = array('default', 'mice');
     if (in_array($request->getModuleName(), $useModule) and $this->getRequest()->getParam('language') != 'scripts') {
         Zend_Db_Table_Abstract::setDefaultAdapter(Zend_Registry::get('read'));
     } else {
         Zend_Db_Table_Abstract::setDefaultAdapter(Zend_Registry::get('write'));
     }
     if (in_array($request->getModuleName(), $useModule) and $this->getRequest()->getParam('language') != 'scripts') {
         $language = $this->getRequest()->getParam('language');
         if (empty($language)) {
             $language = 'id';
         }
         // Model
         $dictionaryDb = new Model_DbTable_Dictionary();
         $languageDb = new Model_DbTable_Language();
         // Data
         $dictionary = $dictionaryDb->getDictionaryArray($language);
         $languageId = $languageDb->getIdByName($language);
         try {
             // Translator Zend
             $translate = new Zend_Translate('array', $dictionary, $language);
             // Set registry
             Zend_Registry::set('Zend_Translate', $translate);
             Zend_Registry::set('language', $language);
             Zend_Registry::set('languageId', $languageId['language_id']);
             Zend_Registry::set('languageText', $languageId['language_text']);
         } catch (Zend_Translate_Exception $zte) {
         } catch (Zend_Exception $ze) {
         }
     }
 }
开发者ID:abdulhadikaryana,项目名称:kebudayaan,代码行数:32,代码来源:Language.php

示例2: preDispatch

 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     if (!in_array($request->getModuleName(), array('qg', 'painel'))) {
         return;
     }
     $controller = "";
     $action = "";
     $module = "";
     if (!$this->_auth->hasIdentity()) {
         $controller = $this->_notLoggedRoute['controller'];
         $action = $this->_notLoggedRoute['action'];
         $module = $request->getModuleName();
     } else {
         if (!$this->_isAuthorized($request->getModuleName(), $request->getControllerName(), $request->getActionName())) {
             $controller = $this->_forbiddenRoute['controller'];
             $action = $this->_forbiddenRoute['action'];
             $module = $request->getModuleName();
         } else {
             $controller = $request->getControllerName();
             $action = $request->getActionName();
             $module = $request->getModuleName();
         }
     }
     $request->setControllerName($controller);
     $request->setActionName($action);
     $request->setModuleName($module);
 }
开发者ID:mayconheerdt,项目名称:zfSkeleton,代码行数:27,代码来源:Auth.php

示例3: routeShutdown

 public function routeShutdown(Zend_Controller_Request_Abstract $request)
 {
     Zend_Layout::getMvcInstance()->setLayout($request->getModuleName());
     Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/modules/" . $request->getModuleName() . "/layouts/scripts");
     $eh = Zend_Controller_Front::getInstance()->getPlugin("Zend_Controller_Plugin_ErrorHandler");
     $eh->setErrorHandlerModule($request->getModuleName());
 }
开发者ID:nnevala,项目名称:zf-boilerplate,代码行数:7,代码来源:ModuleLayout.php

示例4: preDispatch

 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $this->_initAcl();
     if ($this->_auth->hasIdentity()) {
         $ident = $this->_auth->getIdentity();
         $date = new Zend_Date();
         $ident->last_login = $date->get(DATABASE_DATE_FORMAT);
         $ident->save();
     }
     if ($request->getControllerName() != 'admin' && $request->getModuleName() != 'admin') {
         return;
     }
     // if this is not admin skip the rest
     if (!$this->_auth->hasIdentity() && !($request->getControllerName() == 'auth' && $request->getActionName() == 'login' && $request->getModuleName() == 'admin')) {
         $redirect = new Zend_Controller_Action_Helper_Redirector();
         $redirect->gotoSimple('login', 'auth', 'admin');
     }
     if ($request->getModuleName() == 'user' && $request->getControllerName() == 'admin' && $request->getActionName() == 'profile') {
         return;
     }
     // the profile is a free resource
     $resource = $request->getModuleName() . '_' . $request->getControllerName();
     $hasResource = $this->_acl->has($resource);
     if ($hasResource && !$this->_acl->isAllowed('fansubcms_user_custom_role_logged_in_user', $resource, $request->getActionName())) {
         throw new FansubCMS_Exception_Denied('The user is not allowd to do this');
     }
 }
开发者ID:KasaiDot,项目名称:FansubCMS,代码行数:27,代码来源:Acl.php

示例5: preDispatch

 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     $role = $data['emprole'];
     if ($role == 1) {
         $role = 'admin';
     }
     $request->getModuleName();
     $request->getControllerName();
     $request->getActionName();
     $module = $request->getModuleName();
     $resource = $request->getControllerName();
     $privilege = $request->getActionName();
     $this->id_param = $request->getParam('id');
     $allowed = false;
     $acl = $this->_getAcl();
     $moduleResource = "{$module}:{$resource}";
     if ($resource == 'profile') {
         $role = 'viewer';
     }
     if ($resource == 'services') {
         $role = 'services';
     }
     if ($role != '') {
         if ($acl->has($moduleResource)) {
             $allowed = $acl->isAllowed($role, $moduleResource, $privilege);
         }
         if (!$allowed) {
             $request->setControllerName('error');
             $request->setActionName('error');
         }
     }
 }
开发者ID:sura2k,项目名称:sentrifugo,代码行数:34,代码来源:AccessControl.php

示例6: postDispatch

 public function postDispatch(Zend_Controller_Request_Abstract $request)
 {
     $auth = Zend_Auth::getInstance();
     $sessionName = $request->getModuleName() == 'site' ? 'siteSession' : 'painelSession';
     $this->_moduleName = $request->getModuleName();
     $auth->setStorage(new Zend_Auth_Storage_Session($sessionName));
 }
开发者ID:agenciaaeh,项目名称:kahina,代码行数:7,代码来源:ControleAcesso.php

示例7: preDispatch

 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $auth = Zend_Auth::getInstance();
     $publicPages = array();
     $publicPages['controllers'] = array('login');
     $publicPages['actions'] = array();
     $controllerName = $request->getControllerName();
     if ($auth->hasIdentity() || in_array($controllerName, $publicPages['controllers'])) {
         return true;
     }
     throw new WebVista_App_AuthException('You must be authenticated to access the system.');
     $roleId = $auth->getIdentity()->roleId;
     $acl = WebVista_Acl::getInstance();
     if (!$acl->hasRole($roleId)) {
         $error = "Sorry, the requested user role '" . $roleId . "' does not exist";
     }
     if (!$acl->has($request->getModuleName() . '_' . $request->getControllerName())) {
         $error = "Sorry, the requested controller '" . $request->getControllerName() . "' does not exist as an ACL resource";
     }
     if (!$acl->isAllowed($roleId, $request->getModuleName() . '_' . $request->getControllerName(), $request->getActionName())) {
         $error = "Sorry, the page you requested does not exist or you do not have access";
     }
     if (isset($error)) {
         throw new WebVista_App_AuthException('You must be authenticated to access the system.');
     }
 }
开发者ID:psoas,项目名称:ch3-dev-preview,代码行数:26,代码来源:CheckAuth.php

示例8: routeShutdown

 /**
  * Route shutdown hook -- Ccheck for router exceptions
  *
  * @param Zend_Controller_Request_Abstract $request
  */
 public function routeShutdown(Zend_Controller_Request_Abstract $request)
 {
     $frontController = Zend_Controller_Front::getInstance();
     if (in_array($request->getModuleName(), array('async', 'external', 'externalr12')) && $frontController->hasPlugin('Zend_Controller_Plugin_ErrorHandler')) {
         $errorHandler = $frontController->getPlugin('Zend_Controller_Plugin_ErrorHandler');
         $errorHandler->setErrorHandlerModule($request->getModuleName());
     }
 }
开发者ID:SandeepUmredkar,项目名称:PortalSMIP,代码行数:13,代码来源:ModuleErrorHandler.php

示例9: hasAccessUrl

 function hasAccessUrl(Zend_Controller_Request_Abstract $request)
 {
     $acl = $this->getAcl();
     $url1 = $request->getModuleName() . '::*';
     $url2 = $request->getModuleName() . '::' . $request->getControllerName() . '::*';
     $url3 = $request->getModuleName() . '::' . $request->getControllerName() . '::' . $request->getActionName();
     return $acl->has($url1) && $acl->isAllowed($this->getRole(), $url1) || $acl->has($url2) && $acl->isAllowed($this->getRole(), $url2) || $acl->has($url3) && $acl->isAllowed($this->getRole(), $url3);
 }
开发者ID:josmel,项目名称:voy,代码行数:8,代码来源:Acl.php

示例10: getModulesIdsByRequest

 public static function getModulesIdsByRequest(Zend_Controller_Request_Abstract $request)
 {
     $map = self::getMapModules();
     if (isset($map[$request->getModuleName()][$request->getControllerName()][$request->getActionName()])) {
         return $map[$request->getModuleName()][$request->getControllerName()][$request->getActionName()];
     } else {
         return false;
     }
 }
开发者ID:dafik,项目名称:dfi,代码行数:9,代码来源:Acl.php

示例11: preDispatch

 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $frontController = Zend_Controller_Front::getInstance();
     $config = $frontController->getParam('bootstrap')->getApplication()->getOptions();
     if (isset($config[$request->getModuleName()]['resources']['layout']['layout'])) {
         $layout = Zend_Layout::getMvcInstance();
         $layout->setLayout($config[$request->getModuleName()]['resources']['layout']['layout']);
     }
 }
开发者ID:Alpha-Hydro,项目名称:alpha-hydro-antares,代码行数:9,代码来源:Layout.php

示例12: preDispatch

 /**
  * @author Phuc Duong <phuc.duong@kiss-concept.com>
  * @desc set layout
  */
 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $this->getLayout()->setLayoutPath(Zend_Controller_Front::getInstance()->getModuleDirectory($request->getModuleName()) . '/layouts/scripts/');
     $module = $request->getModuleName();
     if (isset($module) && $module == "admin") {
         $this->getLayout()->setLayout($module);
     } else {
         $this->getLayout()->setLayout('layout');
     }
 }
开发者ID:hocondoimeo,项目名称:giasu-tam.com,代码行数:14,代码来源:LayoutLoader.php

示例13: preDispatch

 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $layoutDir = 'default';
     if ($request->getModuleName() == 'admin') {
         $layoutDir = 'admin';
     }
     $layout = Zend_Layout::getMvcInstance();
     $layout->setLayoutPath(APPLICATION_PATH . DS . "layouts" . DS . $layoutDir)->setInflectorTarget(':script.:suffix')->setViewSuffix('inc');
     $this->prepareNavigation($request->getModuleName());
 }
开发者ID:jager,项目名称:cms,代码行数:10,代码来源:LayoutSwitcher.php

示例14: preDispatch

 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $front = Zend_Controller_Front::getInstance();
     if ($front->getDefaultModule() == $request->getModuleName()) {
         return;
     }
     $layout = Zend_Layout::getMvcInstance();
     $layout->setLayoutPath($front->getModuleDirectory($request->getModuleName()) . '/views/layouts');
     $layout->setLayout('default');
 }
开发者ID:padraic,项目名称:ZFPlanet,代码行数:10,代码来源:LayoutSwitcher.php

示例15: _includeCssController

 /**
  *
  * @access protected
  * @return void
  */
 protected function _includeCssController()
 {
     $ds = '/';
     //DIRECTORY_SEPARATOR;
     $file = 'public' . $ds . 'styles' . $ds . $this->_request->getModuleName() . $ds . $this->_request->getControllerName() . '.css';
     if (file_exists(APPLICATION_PATH . $ds . '..' . $ds . $file)) {
         $view = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('view');
         $view->headLink()->appendStylesheet($view->baseUrl($file));
     }
 }
开发者ID:fredcido,项目名称:cenbrap,代码行数:15,代码来源:Layout.php


注:本文中的Zend_Controller_Request_Abstract::getModuleName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。