示例#1
0
 public static function getArticle($id, $ctype = -1, $clang = null)
 {
     if ($clang === null) {
         $clang = rex_clang::getCurrentId();
     }
     $article = new rex_article_content($id, $clang);
     return $article->getArticle($ctype);
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 protected function preArticle($articleContent, $module_id)
 {
     // ---------- moduleselect: nur module nehmen auf die der user rechte hat
     if ($this->mode == 'edit') {
         $MODULE = rex_sql::factory();
         $modules = $MODULE->getArray('select * from ' . rex::getTablePrefix() . 'module order by name');
         $template_ctypes = isset($this->template_attributes['ctype']) ? $this->template_attributes['ctype'] : [];
         // wenn keine ctyes definiert sind, gibt es immer den CTYPE=1
         if (count($template_ctypes) == 0) {
             $template_ctypes = [1 => 'default'];
         }
         $this->MODULESELECT = [];
         foreach ($template_ctypes as $ct_id => $ct_name) {
             foreach ($modules as $m) {
                 if (rex::getUser()->getComplexPerm('modules')->hasPerm($m['id'])) {
                     if (rex_template::hasModule($this->template_attributes, $ct_id, $m['id'])) {
                         $this->MODULESELECT[$ct_id][] = ['name' => rex_i18n::translate($m['name'], false), 'id' => $m['id']];
                     }
                 }
             }
         }
     }
     return parent::preArticle($articleContent, $module_id);
 }
示例#3
0
文件: boot.php 项目: staabm/redaxo
    rex_extension::register('PAGE_CHECKED', function () {
        if (rex_be_controller::getCurrentPagePart(1) == 'content') {
            rex_be_controller::getPageObject('structure')->setIsActive(true);
        }
    });
    if (rex_be_controller::getCurrentPagePart(1) == 'system') {
        rex_system_setting::register(new rex_system_setting_default_template_id());
    }
    rex_extension::register('CLANG_DELETED', function (rex_extension_point $ep) {
        $del = rex_sql::factory();
        $del->setQuery('delete from ' . rex::getTablePrefix() . "article_slice where clang_id='" . $ep->getParam('clang')->getId() . "'");
    });
} else {
    rex_extension::register('FE_OUTPUT', function (rex_extension_point $ep) {
        $content = $ep->getSubject();
        $article = new rex_article_content();
        $article->setCLang(rex_clang::getCurrentId());
        if ($article->setArticleId(rex_article::getCurrentId())) {
            $content .= $article->getArticleTemplate();
        } else {
            $content .= 'Kein Startartikel selektiert / No starting Article selected. Please click here to enter <a href="' . rex_url::backendController() . '">redaxo</a>';
            rex_response::sendPage($content);
            exit;
        }
        $art_id = $article->getArticleId();
        if ($art_id == rex_article::getNotfoundArticleId() && $art_id != rex_article::getSiteStartArticleId()) {
            rex_response::setStatus(rex_response::HTTP_NOT_FOUND);
        }
        // ----- inhalt ausgeben
        rex_response::sendPage($content, $article->getValue('updatedate'));
    });
示例#4
0
 /**
  * Gibt den Slice formatiert zurück.
  *
  * @since 4.1 - 29.05.2008
  * @see rex_article_content::getSlice()
  *
  * @return string
  */
 public function getSlice()
 {
     $art = new rex_article_content();
     $art->setArticleId($this->getArticleId());
     $art->setClang($this->getClang());
     $art->setSliceRevision($this->getRevision());
     return $art->getSlice($this->getId());
 }