/**
  * prepare
  * 
  * @param   void
  * 
  * @return  bool
  **/
 public function prepare()
 {
     parent::prepare();
     $this->_setupCategoryManager('page');
     return true;
 }
示例#2
0
 /**
  * prepare
  * 
  * @param   void
  * 
  * @return  bool
  **/
 public function prepare()
 {
     parent::prepare();
     $this->mObject->set('status', Xcck_Utils::getDefaultStatus($this->mAsset->mDirname));
     //subtable requires category_id(parent id)
     if ($this->_getCatId() == 0 && $this->_isSubtable()) {
         $this->mRoot->mController->executeRedirect($this->_getNextUri('page', 'list'), 1, _MD_XCCK_ERROR_MAINTABLE_REQUIRED);
     }
     $this->mDefinitions = Legacy_Utils::getModuleHandler('definition', $this->mAsset->mDirname)->getFields();
     if ($this->mObject->isNew()) {
         $this->mObject->set('uid', Legacy_Utils::getUid());
         $this->mObject->set('p_id', $this->_getParentId());
         $this->mObject->set('category_id', $this->_getCatId());
         $this->_prepareRequest();
     }
     $this->_setupCategoryManager('page');
     $this->mObject->loadPath();
     //setup tags
     $this->mObject->loadTag();
     XCube_DelegateUtils::call('Module.' . $this->mAsset->mDirname . '.PrepareEditAction', new XCube_Ref($this->mObject), new XCube_Ref($this->mActionForm));
     return true;
 }
 /**
  * prepare
  * 
  * @param   void
  * 
  * @return  bool
  **/
 public function prepare()
 {
     return parent::prepare() && is_object($this->mObject);
 }
示例#4
0
 /**
  * prepare
  * 
  * @param   void
  * 
  * @return  bool
  **/
 public function prepare()
 {
     $result = parent::prepare();
     $this->mDefinitions = Legacy_Utils::getModuleHandler('definition', $this->mAsset->mDirname)->getFields();
     if ($this->mObject->isNew()) {
         $this->mObject->set('uid', Legacy_Utils::getUid());
         $this->mObject->set('p_id', $this->_getParentId());
         $this->mObject->set('status', Lenum_Status::PUBLISHED);
         $this->mObject->set('maintable_id', $this->_getMaintableId());
         $this->mObject->set('category_id', $this->_getCatId());
         foreach ($this->mDefinitions as $field) {
             if (in_array($field->get('field_type'), array('string', 'int'))) {
                 $this->mObject->set($field->get('field_name'), $field->get('options'));
             }
         }
         $this->_prepareRequest();
     }
     $this->mObject->loadMaintable();
     if (count($this->mObject->mMaintable) != 1) {
         $this->mRoot->mController->executeRedirect($this->_getNextUri('page', 'list'), 1, _MD_XCCK_ERROR_INVALID_MAINTABLE);
     }
     $this->_setupCategoryManager('page');
     //setup tags
     $this->mObject->loadTag();
     XCube_DelegateUtils::call('Module.' . $this->mAsset->mDirname . '.PrepareEditAction', new XCube_Ref($this->mObject), new XCube_Ref($this->mActionForm));
     return $result;
 }