コード例 #1
0
ファイル: ActionFilter.class.php プロジェクト: AntiqS/altocms
 /**
  * Выводит список топиков
  *
  */
 protected function EventShowTopics()
 {
     /**
      * Меню
      */
     $this->sMenuSubItemSelect = $this->sCurrentEvent;
     /*
      * Получаем тип контента
      */
     if (!($this->oType = E::ModuleTopic()->GetContentType($this->sCurrentEvent))) {
         return parent::EventNotFound();
     }
     /**
      * Устанавливаем title страницы
      */
     E::ModuleViewer()->AddHtmlTitle($this->oType->getContentTitleDecl());
     /**
      * Передан ли номер страницы
      */
     $iPage = $this->GetParamEventMatch(0, 2) ? $this->GetParamEventMatch(0, 2) : 1;
     /**
      * Получаем список топиков
      */
     $aResult = E::ModuleTopic()->GetTopicsByType($iPage, Config::Get('module.topic.per_page'), $this->oType->getContentUrl());
     $aTopics = $aResult['collection'];
     /**
      * Формируем постраничность
      */
     $aPaging = E::ModuleViewer()->MakePaging($aResult['count'], $iPage, Config::Get('module.topic.per_page'), Config::Get('pagination.pages.count'), R::GetPath('filter') . $this->sCurrentEvent);
     /**
      * Загружаем переменные в шаблон
      */
     E::ModuleViewer()->Assign('aPaging', $aPaging);
     E::ModuleViewer()->Assign('aTopics', $aTopics);
     $this->SetTemplateAction('index');
 }
コード例 #2
0
ファイル: Topic.mapper.class.php プロジェクト: AntiqS/altocms
 /**
  * Обновляет тип контента
  *
  * @param ModuleTopic_EntityContentType $oContentType    Объект типа контента
  *
  * @return bool
  */
 public function UpdateContentType($oContentType)
 {
     $sql = "UPDATE ?_content\n\t\t\tSET\n\t\t\t\tcontent_title=?,\n\t\t\t\tcontent_title_decl=?,\n\t\t\t\tcontent_url=?,\n\t\t\t\tcontent_sort=?d,\n\t\t\t\tcontent_candelete=?d,\n\t\t\t\tcontent_active=?d,\n\t\t\t\tcontent_access=?d,\n\t\t\t\tcontent_config=?\n\t\t\tWHERE\n\t\t\t\tcontent_id = ?d\n\t\t";
     $bResult = $this->oDb->query($sql, $oContentType->getContentTitle(), $oContentType->getContentTitleDecl(), $oContentType->getContentUrl(), $oContentType->getContentSort(), $oContentType->getContentCandelete(), $oContentType->getContentActive(), $oContentType->getContentAccess(), $oContentType->getExtra(), $oContentType->getContentId());
     return $bResult !== false;
 }