public function beforeFilter()
 {
     parent::beforeFilter();
     $this->_dir = $this->request->query('dir');
     $this->_file = $this->request->query('file');
     $this->_config = isset($this->passedArgs['config']) ? $this->passedArgs['config'] : null;
 }
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->layout = "Media.filebrowser";
     if (isset($this->passedArgs['config'])) {
         if ($this->Session->check('Media.FileBrowser.' . $this->passedArgs['config'])) {
             $this->FileBrowser = $this->Session->read('Media.FileBrowser.' . $this->passedArgs['config']);
             //$this->Session->write('Media.FileBrowser.'.$this->passedArgs['config'].'.resumed', true);
             $this->_resumed = true;
             $this->_config = $this->passedArgs['config'];
             $this->Session->setFlash(__('FileBrowser instance with config %s resumed', $this->_config));
         }
     } elseif ($this->action != "admin_index") {
         throw new CakeException(__('No filebrowser config provider'));
     }
     $this->dir = $this->request->params['pass'];
     $this->file = null;
     if (isset($this->passedArgs['file'])) {
         $this->file = $this->passedArgs['file'];
     }
 }
Example #3
0
 /**
  *	Se ejecuta antes de la lógica de cada action.
  *
  *	@return void
  *	@access public
  */
 function beforeFilter()
 {
     parent::beforeFilter();
     #Configure::write('debug',0);
     if (isset($this->params['named']['model'])) {
         $this->Auth->allow('*');
         extract($this->params['named']);
         extract($this->params, EXTR_OVERWRITE);
         App::import('Model', $model);
         $this->{$model} =& new $model();
         $this->Medium->model = $model;
         $this->Medium->alias = $alias;
         if (isset($this->History)) {
             $this->History->enabled = false;
         }
         $this->helpers = array('Html', 'Javascript');
     }
     if ($this->params['action'] == 'admin_add_files') {
         $this->Auth->allow('*');
     }
 }
Example #4
0
 /**
  * Set the fallback image, used for any request for an image that doesn't exist
  * Set the target to the current url
  *
  * @return void
  * @access public
  */
 function beforeFilter()
 {
     parent::beforeFilter();
     $this->_setup();
     if (!$this->settings['enabled']) {
         return $this->cakeError('error404', array(array('className' => 'DisabledMediaController', 'plugin' => $this->plugin, 'webroot' => $this->webroot, 'url' => $url, 'base' => $this->base)));
     }
     $url = str_replace('%2C', ',', $this->params->url);
     $this->__target = WWW_ROOT . ltrim($url, '/');
 }
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->_configureAttachment();
 }