Example #1
0
 public function _preAction()
 {
     if (!$this->request->isXHR() && !in_array($this->route->getName(), array('init', 'index', 'login', 'logout', 'tmpFile'))) {
         //            $this->redirectToUri('/');
     }
     $moduleName = Inflector::underscore(substr($this->route->getControllerName(), 0, -10));
     if (AdminService::getStructure()->has($moduleName)) {
         $moduleConfig = AdminService::getStructure($moduleName);
         $this->route->setControllerName($moduleConfig['type'] . 'Controller');
         $this->request->setVar('moduleName', $moduleName);
     }
 }
Example #2
0
 public function _preAction()
 {
     $this->_moduleName = $this->request->getVar('moduleName');
     $this->_moduleConfig = AdminService::getStructure($this->_moduleName);
     FilesAbility::setBaseStoreLocation(DC::getEnvironment()->getWebRoot() . 'upload/');
 }