当前位置: 首页>>代码示例>>PHP>>正文


PHP rex_article::getCurrentId方法代码示例

本文整理汇总了PHP中rex_article::getCurrentId方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_article::getCurrentId方法的具体用法?PHP rex_article::getCurrentId怎么用?PHP rex_article::getCurrentId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rex_article的用法示例。


在下文中一共展示了rex_article::getCurrentId方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: replaceVars

 static function replaceVars($template, $er = array())
 {
     $r = rex_extension::registerPoint(new rex_extension_point('YFORM_EMAIL_BEFORE_REPLACEVARS', ['template' => $template, 'search_replace' => $er, 'status' => false]));
     $template = $r['template'];
     $er = $r['search_replace'];
     $status = $r['status'];
     if ($status) {
         return true;
     }
     $er['REX_SERVER'] = rex::getServer();
     $er['REX_ERROR_EMAIL'] = rex::getErrorEmail();
     $er['REX_SERVERNAME'] = rex::getServerName();
     $er['REX_NOTFOUND_ARTICLE_ID'] = rex_article::getNotfoundArticleId();
     $er['REX_ARTICLE_ID'] = rex_article::getCurrentId();
     $template['body'] = rex_var::parse($template['body'], '', 'yform_email_template', $er);
     $template['body_html'] = rex_var::parse($template['body_html'], '', 'yform_email_template', $er);
     // rex_vars bug: sonst wird der Zeilenumbruch entfernt - wenn DATA_VAR am Ende einer Zeile
     if (rex_string::versionCompare(rex::getVersion(), '5.0.1', '<')) {
         $template['body'] = str_replace("?>\r", "?>\r\n\r", $template['body']);
         $template['body'] = str_replace("?>\n", "?>\n\r\n", $template['body']);
         $template['body_html'] = str_replace("?>\r", "?>\r\n\r", $template['body_html']);
         $template['body_html'] = str_replace("?>\n", "?>\n\r\n", $template['body_html']);
     }
     $template['body'] = rex_file::getOutput(rex_stream::factory('yform/email/template/' . $template['name'] . '/body', $template['body']));
     $template['body_html'] = rex_file::getOutput(rex_stream::factory('yform/email/template/' . $template['name'] . '/body_html', $template['body_html']));
     return $template;
 }
开发者ID:VIEWSION,项目名称:redaxo_yform,代码行数:27,代码来源:yform_email_template.php

示例2: rex_getUrl

/**
 * Gibt eine Url zu einem Artikel zurück.
 *
 * @param int|null $id
 * @param int|null $clang     SprachId des Artikels
 * @param array    $params    Array von Parametern
 * @param string   $separator
 *
 * @return string
 *
 * @package redaxo\structure
 */
function rex_getUrl($id = null, $clang = null, array $params = [], $separator = '&amp;')
{
    $id = (int) $id;
    $clang = (int) $clang;
    // ----- get id
    if ($id == 0) {
        $id = rex_article::getCurrentId();
    }
    // ----- get clang
    // Wenn eine rexExtension vorhanden ist, immer die clang mitgeben!
    // Die rexExtension muss selbst entscheiden was sie damit macht
    if (!rex_clang::exists($clang) && (rex_clang::count() > 1 || rex_extension::isRegistered('URL_REWRITE'))) {
        $clang = rex_clang::getCurrentId();
    }
    // ----- EXTENSION POINT
    $url = rex_extension::registerPoint(new rex_extension_point('URL_REWRITE', '', ['id' => $id, 'clang' => $clang, 'params' => $params, 'separator' => $separator]));
    if ($url == '') {
        if (rex_clang::count() > 1) {
            $clang = $separator . 'clang=' . $clang;
        } else {
            $clang = '';
        }
        $params = rex_string::buildQuery($params, $separator);
        $params = $params ? $separator . $params : '';
        $url = rex_url::frontendController() . '?article_id=' . $id . $clang . $params;
    }
    return $url;
}
开发者ID:staabm,项目名称:redaxo,代码行数:40,代码来源:function_rex_url.php

示例3: __construct

 public function __construct($article_id = 0, $clang = null)
 {
     if ($article_id == 0) {
         $article_id = rex_article::getCurrentId();
     }
     if (is_null($clang)) {
         $clang = rex_clang::getCurrentId();
     }
     if ($article = rex_article::get($article_id, $clang)) {
         $this->article = $article;
         $this->domain = rex_yrewrite::getDomainByArticleId($article_id, $clang);
     }
 }
开发者ID:tzfrs,项目名称:redaxo_yrewrite,代码行数:13,代码来源:seo.php

示例4: function

<?php

if (!rex::isBackend()) {
    rex_extension::register('OUTPUT_FILTER', function (rex_extension_point $ep) {
        // Bereite Ausnahmen vor: Templates und Artikel
        // Dort werden E-Mailadressen nicht verschlüsselt
        $whitelistTemplates = rex_addon::get('emailobfuscator')->getConfig('templates', []);
        $whitelistArticles = rex_addon::get('emailobfuscator')->getConfig('articles', '');
        if ($whitelistArticles != '') {
            $whitelistArticles = explode(',', $whitelistArticles);
        } else {
            $whitelistArticles = [];
        }
        if (!is_null(rex_article::getCurrent()) && !in_array(rex_article::getCurrent()->getTemplateId(), $whitelistTemplates) && !in_array(rex_article::getCurrentId(), $whitelistArticles)) {
            $subject = $ep->getSubject();
            // Ersetze mailto-Links (zuerst!)
            // Anmerkung: Attributwerte (hier: href) benötigen nicht zwingend Anführungsstriche drumrum,
            // deshalb prüfen wir zusätzlich noch auf '>' am Ende .
            $subject = preg_replace_callback('/mailto:(.*?)(?=[\'|"|\\>])/', 'emailobfuscator::encodeEmailLinks', $subject);
            // Ersetze E-Mailadressen
            $subject = preg_replace_callback('/([\\w\\-\\+\\.]+)@([\\w\\-\\.]+\\.[\\w]{2,})/', 'emailobfuscator::encodeEmail', $subject);
            // Injiziere CSS vors schließende </head> im Seitenkopf
            if ($this->getConfig('autoload_css')) {
                $cssFile = '<link rel="stylesheet" href="' . $this->getAssetsUrl('emailobfuscator.css?v=' . $this->getVersion()) . '">';
                $subject = str_replace('</head>', $cssFile . '</head>', $subject);
            }
            // Injiziere JavaScript vors schließende </body> der Seite
            if ($this->getConfig('autoload_js')) {
                $jsFile = '<script src="' . $this->getAssetsUrl('emailobfuscator.js?v=' . $this->getVersion()) . '"></script>';
                $subject = str_replace('</body>', $jsFile . '</body>', $subject);
            }
开发者ID:FriendsOfREDAXO,项目名称:rex_emailobfuscator,代码行数:31,代码来源:boot.php

示例5: rex_fragment

                $select .= '<option value="' . $version['history_date'] . '">' . $version['history_date'] . '</option>';
            }
            $content1select = '<select id="content-history-select-date-1" class="content-history-select" data-iframe="content-history-iframe-1" style="">' . $select . '</select>';
            $content1iframe = '<iframe id="content-history-iframe-1" class="history-iframe"></iframe>';
            $content2select = '<select id="content-history-select-date-2" class="content-history-select" data-iframe="content-history-iframe-2">' . $select . '</select>';
            $content2iframe = '<iframe id="content-history-iframe-2" class="history-iframe"></iframe>';
            $button_restore = '<a class="btn btn-apply" href="javascript:rex_history_snapVersion(\'content-history-select-date-2\');">' . $this->i18n('snapshot_reactivate') . '</a>';
            // fragment holen und ausgeben
            $fragment = new rex_fragment();
            $fragment->setVar('title', $this->i18n('overview_versions'));
            $fragment->setVar('info', $info, false);
            $fragment->setVar('content1select', $content1select, false);
            $fragment->setVar('content1iframe', $content1iframe, false);
            $fragment->setVar('content2select', $content2select, false);
            $fragment->setVar('content2iframe', $content2iframe, false);
            $fragment->setVar('button_restore', $button_restore, false);
            echo $fragment->parse('history/layer.php');
            exit;
    }
    rex_extension::register('STRUCTURE_CONTENT_HEADER', function (rex_extension_point $ep) {
        if ($ep->getParam('page') == 'content/edit') {
            echo '<script>
                    var history_article_id = ' . rex_article::getCurrentId() . ';
                    var history_clang_id = ' . rex_clang::getCurrentId() . ';
                    var history_ctype_id = ' . rex_request('ctype', 'int', 0) . ';
                    var history_revision = ' . rex_request('rex_set_version', 'int', 0) . ';
                    var history_article_link = "' . rex_getUrl(rex_article::getCurrentId(), rex_clang::getCurrentId(), ['history_revision' => rex_request('rex_set_version', 'int', 0)], '&') . '";
                    </script>';
        }
    });
}
开发者ID:redaxo,项目名称:redaxo,代码行数:31,代码来源:boot.php

示例6: setRedaxoVars

 public function setRedaxoVars($aid = '', $clang = '', $params = [])
 {
     if ($clang == '') {
         $clang = rex_clang::getCurrentId();
     }
     if ($aid == '') {
         $aid = rex_article::getCurrentId();
     }
     $this->setObjectparams('form_action', rex_getUrl($aid, $clang, $params));
 }
开发者ID:VIEWSION,项目名称:redaxo_yform,代码行数:10,代码来源:yform.php

示例7: _setActivePath

 private function _setActivePath()
 {
     $article_id = rex_article::getCurrentId();
     if ($OOArt = rex_article::get($article_id)) {
         $path = trim($OOArt->getPath(), '|');
         $this->path = [];
         if ($path != '') {
             $this->path = explode('|', $path);
         }
         $this->current_article_id = $article_id;
         $this->current_category_id = $OOArt->getCategoryId();
         return true;
     }
     return false;
 }
开发者ID:redaxo,项目名称:redaxo,代码行数:15,代码来源:navigation.php

示例8: rex_system_setting_default_template_id

        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'));
    });
}
开发者ID:staabm,项目名称:redaxo,代码行数:31,代码来源:boot.php


注:本文中的rex_article::getCurrentId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。