Ejemplo n.º 1
0
 /**
  * Append translation file ;)
  * @throws NativeException
  */
 public function before()
 {
     parent::before();
     // check if user have permission to access there
     if (!App::$User->isAuth() || !App::$User->identity()->getRole()->can('global/file')) {
         throw new NativeException('Permission denied');
     }
     App::$Translate->append(__DIR__ . '/Translation/' . App::$Request->getLanguage() . '.php');
 }
Ejemplo n.º 2
0
 /**
  * Prepare configuratins before initialization
  */
 public function before()
 {
     parent::before();
     $configs = AppRecord::getConfigs('app', 'Content');
     // prevent null-type config data
     if ((int) $configs['gallerySize'] > 0) {
         $this->maxSize = (int) $configs['gallerySize'] * 1024;
     }
     if ((int) $configs['galleryResize'] > 0) {
         $this->maxResize = (int) $configs['galleryResize'];
     }
 }