/** * Before executing controller actions * * @return void * @access public */ public function beforeFilter() { parent::beforeFilter(); // Comment, Category, Tag not needed $this->Attachment->unbindModel(array('hasMany' => array('Comment'), 'hasAndBelongsToMany' => array('Category', 'Tag'))); $this->Attachment->type = $this->type; $this->Attachment->Behaviors->attach('Tree', array('scope' => array($this->Attachment->alias . '.type' => $this->type))); $this->set('type', $this->Attachment->type); if ($this->action == 'admin_add') { $this->Security->csrfCheck = false; } }
/** * beforeFilter * * @return void * @access public */ public function beforeFilter() { parent::beforeFilter(); $this->deletablePaths = array(APP . 'View' . DS . 'Themed' . DS, WWW_ROOT); $this->set('deletablePaths', $this->deletablePaths); }