Пример #1
0
 /**
  * prepare
  *
  * @param	void
  *
  * @return	bool
  **/
 public function prepare()
 {
     parent::prepare();
     $topic_id = (int) $this->mRoot->mContext->mRequest->getRequest('topic_id');
     $handler =& $this->mAsset->getObject('handler', 'Posts', false);
     //$handler = Legacy_Utils::getModuleHandler('posts', $this->mAsset->mDirname);
     $criteria = new criteriacompo();
     $criteria->add(new criteria('topic_id', $topic_id));
     $criteria->addSort('post_time', 'ASC');
     // TODO: other sorts
     $this->mPostsObj = $handler->getObjects($criteria);
     if (is_object($this->mObject)) {
         $this->forum_id = (int) $this->mObject->get('forum_id');
         $handler = Legacy_Utils::getModuleHandler('forums', $this->mAsset->mDirname);
         $this->mForumObj = $handler->get($this->forum_id);
         //adump($this->mForumObj);
         $this->ext_link_id = $this->mObject->get('topic_external_link_id');
         //adump($external_link_id);
         if ($this->ext_link_id > 0) {
             $mExtHandler =& $this->mAsset->getObject('handler', 'Topics', false);
             $criteria = new criteriacompo();
             $criteria->add(new criteria('topic_external_link_id', $this->ext_link_id));
             $this->mTopics_ExtObj = $mExtHandler->getObjects($criteria);
         }
         //adump($this->mTopics_ExtObj);
         return true;
     }
     return false;
 }
Пример #2
0
 /**
  * prepare
  *
  * @param	void
  *
  * @return	bool
  **/
 public function prepare()
 {
     $this->mfAccHandler =& $this->mAsset->getObject('handler', 'Forumaccess', false);
     $this->mForumAcc = $this->mfAccHandler->get_forum_permissions('can_read');
     $mCriteria = $this->mFilter->getCriteria();
     $mCriteria->add(new criteria('forum_id', $this->mForumAcc['can_read'], 'IN'));
     parent::prepare();
     $this->_setupAccessController('forums');
     $this->forum_id = (int) $this->mRoot->mContext->mRequest->getRequest('forum_id');
     return true;
 }
 /**
  * prepare
  * 
  * @param	void
  * 
  * @return	bool
  **/
 public function prepare()
 {
     parent::prepare();
     return true;
 }