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


PHP rex_fragment::parse方法代码示例

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


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

示例1: getWidget

 public static function getWidget($id, $name, $value, array $args = [])
 {
     $art_name = '';
     $art = rex_article::get($value);
     $category = 0;
     // Falls ein Artikel vorausgewählt ist, dessen Namen anzeigen und beim öffnen der Linkmap dessen Kategorie anzeigen
     if ($art instanceof rex_article) {
         $art_name = $art->getName();
         $category = $art->getCategoryId();
     }
     $open_params = '&clang=' . rex_clang::getCurrentId();
     if ($category || isset($args['category']) && ($category = (int) $args['category'])) {
         $open_params .= '&category_id=' . $category;
     }
     $class = ' rex-disabled';
     $open_func = '';
     $delete_func = '';
     if (rex::getUser()->getComplexPerm('structure')->hasStructurePerm()) {
         $class = '';
         $open_func = 'openLinkMap(\'REX_LINK_' . $id . '\', \'' . $open_params . '\');';
         $delete_func = 'deleteREXLink(' . $id . ');';
     }
     $e = [];
     $e['field'] = '<input class="form-control" type="text" name="REX_LINK_NAME[' . $id . ']" value="' . htmlspecialchars($art_name) . '" id="REX_LINK_' . $id . '_NAME" readonly="readonly" /><input type="hidden" name="' . $name . '" id="REX_LINK_' . $id . '" value="' . $value . '" />';
     $e['functionButtons'] = '
                     <a href="#" class="btn btn-popup' . $class . '" onclick="' . $open_func . 'return false;" title="' . rex_i18n::msg('var_link_open') . '"><i class="rex-icon rex-icon-open-linkmap"></i></a>
                     <a href="#" class="btn btn-popup' . $class . '" onclick="' . $delete_func . 'return false;" title="' . rex_i18n::msg('var_link_delete') . '"><i class="rex-icon rex-icon-delete-link"></i></a>';
     $fragment = new rex_fragment();
     $fragment->setVar('elements', [$e], false);
     $media = $fragment->parse('core/form/widget.php');
     return $media;
 }
开发者ID:DECAF,项目名称:redaxo,代码行数:32,代码来源:var_link.php

示例2: parse

 /**
  * Parses the variables of the fragment into the file $filename.
  *
  * @param string $filename           the filename of the fragment to parse
  * @param bool   $delete_whitespaces
  *
  * @throws InvalidArgumentException
  * @throws rex_exception
  *
  * @return string
  */
 public function parse($filename, $delete_whitespaces = true)
 {
     if (!is_string($filename)) {
         throw new InvalidArgumentException(sprintf('Expecting $filename to be a string, %s given!', gettype($filename)));
     }
     $this->filename = $filename;
     foreach (self::$fragmentDirs as $fragDir) {
         $fragment = $fragDir . $filename;
         if (is_readable($fragment)) {
             ob_start();
             if ($delete_whitespaces) {
                 preg_replace('/(?:(?<=\\>)|(?<=\\/\\>))(\\s+)(?=\\<\\/?)/', '', require $fragment);
             } else {
                 require $fragment;
             }
             $content = ob_get_clean();
             if ($this->decorator) {
                 $this->decorator->setVar('rexDecoratedContent', $content, false);
                 $content = $this->decorator->parse($this->decorator->filename);
             }
             return $content;
         }
     }
     throw new rex_exception(sprintf('Fragmentfile "%s" not found!', $filename));
 }
开发者ID:DECAF,项目名称:redaxo,代码行数:36,代码来源:fragment.php

示例3: formatElement

 public function formatElement()
 {
     $s = '';
     $values = explode('|', trim($this->getValue(), '|'));
     $options = $this->getOptions();
     $name = $this->getAttribute('name');
     $id = $this->getAttribute('id');
     $attr = '';
     foreach ($this->getAttributes() as $attributeName => $attributeValue) {
         if ($attributeName == 'name' || $attributeName == 'id') {
             continue;
         }
         $attr .= ' ' . htmlspecialchars($attributeName) . '="' . htmlspecialchars($attributeValue) . '"';
     }
     $formElements = [];
     foreach ($options as $opt_name => $opt_value) {
         $opt_id = $id;
         if ($opt_value != '') {
             $opt_id .= '-' . rex_string::normalize($opt_value, '-');
         }
         $opt_attr = $attr . ' id="' . htmlspecialchars($opt_id) . '"';
         $checked = in_array($opt_value, $values) ? ' checked="checked"' : '';
         $n = [];
         $n['label'] = '<label class="control-label" for="' . htmlspecialchars($opt_id) . '">' . htmlspecialchars($opt_name) . '</label>';
         $n['field'] = '<input type="checkbox" name="' . htmlspecialchars($name) . '[' . htmlspecialchars($opt_value) . ']" value="' . htmlspecialchars($opt_value) . '"' . $opt_attr . $checked . ' />';
         $formElements[] = $n;
     }
     $fragment = new rex_fragment();
     $fragment->setVar('elements', $formElements, false);
     $fragment->setVar('grouped', true);
     $s = $fragment->parse('core/form/checkbox.php');
     return $s;
 }
开发者ID:staabm,项目名称:redaxo,代码行数:33,代码来源:checkbox.php

示例4: formatElement

 public function formatElement()
 {
     $s = '';
     $value = $this->getValue();
     $options = $this->getOptions();
     $id = $this->getAttribute('id');
     $attr = '';
     foreach ($this->getAttributes() as $attributeName => $attributeValue) {
         if ($attributeName == 'id') {
             continue;
         }
         $attr .= ' ' . htmlspecialchars($attributeName) . '="' . htmlspecialchars($attributeValue) . '"';
     }
     $formElements = [];
     foreach ($options as $opt_name => $opt_value) {
         $checked = $opt_value == $value ? ' checked="checked"' : '';
         $opt_id = $id . '-' . rex_string::normalize($opt_value, '-');
         $opt_attr = $attr . ' id="' . $opt_id . '"';
         $n = [];
         $n['label'] = '<label class="control-label" for="' . $opt_id . '">' . htmlspecialchars($opt_name) . '</label>';
         $n['field'] = '<input type="radio" value="' . htmlspecialchars($opt_value) . '"' . $opt_attr . $checked . ' />';
         $formElements[] = $n;
     }
     $fragment = new rex_fragment();
     $fragment->setVar('elements', $formElements, false);
     $s = $fragment->parse('core/form/radio.php');
     return $s;
 }
开发者ID:staabm,项目名称:redaxo,代码行数:28,代码来源:radio.php

示例5: formatElement

    public function formatElement()
    {
        $name = $this->getAttribute('name') . '[]';
        $value = explode('|', htmlspecialchars($this->getValue()));
        if (count($value) != 4) {
            $value = [null, 1, 'd'];
        }
        $options = ['i' => rex_i18n::msg('cronjob_interval_minutes'), 'h' => rex_i18n::msg('cronjob_interval_hour'), 'd' => rex_i18n::msg('cronjob_interval_day'), 'w' => rex_i18n::msg('cronjob_interval_week'), 'm' => rex_i18n::msg('cronjob_interval_month'), 'y' => rex_i18n::msg('cronjob_interval_year')];
        $items = [];
        $buttonLabel = '';
        foreach ($options as $optionValue => $optionTitle) {
            $item = [];
            $item['title'] = $optionTitle;
            $item['href'] = '#';
            $item['attributes'] = 'data-value="' . $optionValue . '"';
            if ($optionValue == $value[2]) {
                $buttonLabel = $optionTitle;
            }
            $items[] = $item;
        }
        $toolbar = '';
        $fragment = new rex_fragment();
        $fragment->setVar('button_label', $buttonLabel);
        $fragment->setVar('items', $items, false);
        $fragment->setVar('group', true);
        $fragment->setVar('right', true);
        $dropdown = $fragment->parse('core/dropdowns/dropdown.php');
        $formElements = [];
        $n = [];
        $n['field'] = '<input class="form-control" type="text" name="' . $name . '" value="' . $value[1] . '" />';
        $n['right'] = $dropdown;
        $formElements[] = $n;
        $fragment = new rex_fragment();
        $fragment->setVar('elements', $formElements, false);
        $field = '<div class="rex-js-cronjob-interval">' . $fragment->parse('core/form/input_group.php') . '<input class="rex-js-cronjob-interval-value" type="hidden" name="' . $name . '" value="' . $value[2] . '" /></div>';
        $javascript = '
        <script type="text/javascript">
        // <![CDATA[
            jQuery(function($){
                $(".rex-js-cronjob-interval .dropdown-menu li a").click(function(event){
                    event.preventDefault();
                    var $title = $(this).text();
                    $(this).closest(".input-group-btn").find(".btn > b").html($title);

                    var $value = $(this).closest("li").attr("data-value");
                    $(".rex-js-cronjob-interval-value").val($value);
                });
            });
        // ]]>
        </script>';
        return $field . $javascript;
    }
开发者ID:skerbis,项目名称:redaxo,代码行数:52,代码来源:form.php

示例6: showHelpOverview

 public static function showHelpOverview()
 {
     $formats = self::getHelpOverviewFormats();
     $echo = '';
     $echo .= '
         <div class="textile-help-overview">
             <h4>' . rex_i18n::msg('textile_instructions') . '</h4>';
     foreach ($formats as $format) {
         $title = $format[0];
         $content = '';
         $content .= '
             <table class="table">
                 <thead>
                     <tr>
                         <th>' . rex_i18n::msg('textile_input') . '</th>
                         <th>' . rex_i18n::msg('textile_preview') . '</th>
                     </tr>
                 </thead>
                 <tbody>
                      ';
         foreach ($format[1] as $perm => $formats) {
             foreach ($formats as $_format) {
                 $desc = $_format[0];
                 $code = '';
                 if (isset($_format[1])) {
                     $code = $_format[1];
                 }
                 if ($code == '') {
                     $code = $desc;
                 }
                 $code = trim(self::parse($code));
                 $content .= '<tr>
                         <td>' . nl2br(htmlspecialchars($desc)) . '</td>
                         <td>' . $code . '</td>
                     </tr>';
             }
         }
         $content .= '</tbody></table>';
         $fragment = new rex_fragment();
         $fragment->setVar('title', '<i class="rex-icon rex-icon-package-addon"></i> ' . $title, false);
         $fragment->setVar('content', $content, false);
         $fragment->setVar('collapse', true);
         $fragment->setVar('collapsed', true);
         $echo .= $fragment->parse('core/page/section.php');
     }
     $echo .= '</div>';
     echo $echo;
 }
开发者ID:staabm,项目名称:redaxo,代码行数:48,代码来源:textile.php

示例7: extendBackendSlices

 public static function extendBackendSlices(rex_extension_point $ep)
 {
     $Config = rex_config::get('slice_ui');
     $article_id = rex_get('article_id');
     $clang = rex_get('clang');
     $ctype = rex_get('ctype');
     $content = '';
     $Subject = $ep->getSubject();
     if (rex::isBackend() && !empty($Config['online_from_to']) && (in_array($ep->getParam('module_id'), $Config['online_from_to']) || in_array('all', $Config['online_from_to']))) {
         $sql = rex_sql::factory();
         $sql->setTable(rex::getTablePrefix() . 'article_slice');
         $sql->setWhere(array('id' => $ep->getParam('slice_id')));
         $sql->select();
         $online_from = $sql->getValue('online_from');
         $online_to = $sql->getValue('online_to');
         $fragment = new rex_fragment();
         $fragment->setVar('online_from', $online_from ? date('d.m.Y', $online_from) : null, false);
         $fragment->setVar('online_to', $online_to ? date('d.m.Y', $online_to) : null, false);
         $content = $fragment->parse('status/status.php');
     }
     $strContent = rex_extension::registerPoint(new rex_extension_point('EXTEND_SLICE_FORMS', '', ['slice_id' => $ep->getParam('slice_id'), 'article_id' => $ep->getParam('article_id'), 'clang' => $ep->getParam('clang'), 'ctype' => $ep->getParam('ctype'), 'content' => $Subject]));
     if ($strContent) {
         $content .= $strContent;
     }
     if ($content) {
         $fragment = new rex_fragment();
         $fragment->setVar('action', 'index.php?page=content/status&article_id=' . $article_id . '&clang=' . $clang . '&ctype=' . $clang, false);
         $fragment->setVar('slice_id', $ep->getParam('slice_id'), false);
         $fragment->setVar('body', $content, false);
         $content = $fragment->parse('status/slice_form.php');
     }
     $strContent = rex_extension::registerPoint(new rex_extension_point('ADD_AFTER_SLICE_FORMS', '', ['slice_id' => $ep->getParam('slice_id'), 'article_id' => $ep->getParam('article_id'), 'clang' => $ep->getParam('clang'), 'ctype' => $ep->getParam('ctype'), 'content' => $Subject]));
     if ($strContent) {
         $content .= $strContent;
     }
     $Subject = str_replace('<div class="panel-body">', $content . '<div class="panel-body">', $Subject);
     $strContent = rex_extension::registerPoint(new rex_extension_point('ADD_AFTER_SLICE', '', ['slice_id' => $ep->getParam('slice_id'), 'article_id' => $ep->getParam('article_id'), 'clang' => $ep->getParam('clang'), 'ctype' => $ep->getParam('ctype'), 'content' => $Subject]));
     if ($strContent) {
         $fragment = new rex_fragment();
         $fragment->setVar('body', $strContent, false);
         $strContent = $fragment->parse('panel/footer.php');
         $Subject = preg_replace('|(<\\/div>)([^<]*<\\/div>[^<]*<\\/section>[^<]*<\\/li>$)|is', '$1' . $strContent . '$2', $Subject);
     }
     return $Subject;
 }
开发者ID:nilsology,项目名称:slice_ui,代码行数:45,代码来源:slice_ui.php

示例8: getForm

 public static function getForm($field, $label, $output)
 {
     $fragment = new rex_fragment();
     $fragment->setVar('label', $label, false);
     $fragment->setVar('field', $field, false);
     $output = explode(':', $output);
     if ($output[0] == 'form') {
         $labelClass = 'col-md-2';
         $fieldClass = $label == '' ? 'col-md-12' : 'col-md-10';
         if (count($output) == 3) {
             $labelClass = is_numeric($output[1]) ? 'col-md-' . $output[1] : $output[1];
             $fieldClass = is_numeric($output[2]) ? 'col-md-' . $output[2] : $output[2];
         }
         $fragment->setVar('labelClass', $labelClass, false);
         $fragment->setVar('fieldClass', $fieldClass, false);
     }
     return $fragment->parse('dao/form.php');
 }
开发者ID:tbaddade,项目名称:redaxo_dao_var,代码行数:18,代码来源:Dao.php

示例9: getWidget

 public static function getWidget($id, $name, $value, array $args = [])
 {
     $open_params = '&clang=' . rex_clang::getCurrentId();
     if (isset($args['category']) && ($category = (int) $args['category'])) {
         $open_params .= '&amp;category_id=' . $category;
     }
     $options = '';
     $linklistarray = explode(',', $value);
     if (is_array($linklistarray)) {
         foreach ($linklistarray as $link) {
             if ($link != '') {
                 if ($article = rex_article::get($link)) {
                     $options .= '<option value="' . $link . '">' . htmlspecialchars($article->getName()) . '</option>';
                 }
             }
         }
     }
     $disabled = ' disabled';
     $open_func = '';
     $delete_func = '';
     if (rex::getUser()->getComplexPerm('structure')->hasStructurePerm()) {
         $disabled = '';
         $open_func = 'openREXLinklist(' . $id . ', \'' . $open_params . '\');';
         $delete_func = 'deleteREXLinklist(' . $id . ');';
     }
     $e = [];
     $e['field'] = '
             <select class="form-control" name="REX_LINKLIST_SELECT[' . $id . ']" id="REX_LINKLIST_SELECT_' . $id . '" size="10">
                 ' . $options . '
             </select>
             <input type="hidden" name="' . $name . '" id="REX_LINKLIST_' . $id . '" value="' . $value . '" />';
     $e['moveButtons'] = '
                 <a href="#" class="btn btn-popup" onclick="moveREXLinklist(' . $id . ',\'top\');return false;" title="' . rex_i18n::msg('var_linklist_move_top') . '"><i class="rex-icon rex-icon-top"></i></a>
                 <a href="#" class="btn btn-popup" onclick="moveREXLinklist(' . $id . ',\'up\');return false;" title="' . rex_i18n::msg('var_linklist_move_up') . '"><i class="rex-icon rex-icon-up"></i></a>
                 <a href="#" class="btn btn-popup" onclick="moveREXLinklist(' . $id . ',\'down\');return false;" title="' . rex_i18n::msg('var_linklist_move_down') . '"><i class="rex-icon rex-icon-down"></i></a>
                 <a href="#" class="btn btn-popup" onclick="moveREXLinklist(' . $id . ',\'bottom\');return false;" title="' . rex_i18n::msg('var_linklist_move_bottom') . '"><i class="rex-icon rex-icon-bottom"></i></a>';
     $e['functionButtons'] = '
                 <a href="#" class="btn btn-popup" onclick="' . $open_func . 'return false;" title="' . rex_i18n::msg('var_link_open') . '"' . $disabled . '><i class="rex-icon rex-icon-open-linkmap"></i></a>
                 <a href="#" class="btn btn-popup" onclick="' . $delete_func . 'return false;" title="' . rex_i18n::msg('var_link_delete') . '"' . $disabled . '><i class="rex-icon rex-icon-delete-link"></i></a>';
     $fragment = new rex_fragment();
     $fragment->setVar('elements', [$e], false);
     $link = $fragment->parse('core/form/widget_list.php');
     return $link;
 }
开发者ID:staabm,项目名称:redaxo,代码行数:44,代码来源:var_linklist.php

示例10: getWidget

 public static function getWidget($id, $name, $value, array $args = [])
 {
     $open_params = '';
     if (isset($args['category']) && ($category = (int) $args['category'])) {
         $open_params .= '&amp;rex_file_category=' . $category;
     }
     foreach ($args as $aname => $avalue) {
         $open_params .= '&amp;args[' . urlencode($aname) . ']=' . urlencode($avalue);
     }
     $wdgtClass = ' rex-js-widget-media';
     if (isset($args['preview']) && $args['preview']) {
         $wdgtClass .= ' rex-js-widget-preview';
         if (rex_addon::get('media_manager')->isAvailable()) {
             $wdgtClass .= ' rex-js-widget-preview-media-manager';
         }
     }
     $disabled = ' disabled';
     $open_func = '';
     $add_func = '';
     $delete_func = '';
     $view_func = '';
     if (rex::getUser()->getComplexPerm('media')->hasMediaPerm()) {
         $disabled = '';
         $open_func = 'openREXMedia(' . $id . ',\'' . $open_params . '\');';
         $add_func = 'addREXMedia(' . $id . ',\'' . $open_params . '\');';
         $delete_func = 'deleteREXMedia(' . $id . ');';
         $view_func = 'viewREXMedia(' . $id . ',\'' . $open_params . '\');';
     }
     $e = [];
     $e['before'] = '<div class="rex-js-widget' . $wdgtClass . '">';
     $e['field'] = '<input class="form-control" type="text" name="' . $name . '" value="' . $value . '" id="REX_MEDIA_' . $id . '" readonly />';
     $e['functionButtons'] = '
             <a href="#" class="btn btn-popup" onclick="' . $open_func . 'return false;" title="' . rex_i18n::msg('var_media_open') . '"' . $disabled . '><i class="rex-icon rex-icon-open-mediapool"></i></a>
             <a href="#" class="btn btn-popup" onclick="' . $add_func . 'return false;" title="' . rex_i18n::msg('var_media_new') . '"' . $disabled . '><i class="rex-icon rex-icon-add-media"></i></a>
             <a href="#" class="btn btn-popup" onclick="' . $delete_func . 'return false;" title="' . rex_i18n::msg('var_media_remove') . '"' . $disabled . '><i class="rex-icon rex-icon-delete-media"></i></a>
             <a href="#" class="btn btn-popup" onclick="' . $view_func . 'return false;" title="' . rex_i18n::msg('var_media_view') . '"' . $disabled . '><i class="rex-icon rex-icon-view-media"></i></a>';
     $e['after'] = '<div class="rex-js-media-preview"></div></div>';
     $fragment = new rex_fragment();
     $fragment->setVar('elements', [$e], false);
     $media = $fragment->parse('core/form/widget.php');
     return $media;
 }
开发者ID:staabm,项目名称:redaxo,代码行数:42,代码来源:var_media.php

示例11: rex_metainfo_content_sidebar

function rex_metainfo_content_sidebar($extionPointParams)
{
    $params = $extionPointParams->getParams();
    $article = rex_article::get($params['article_id'], $params['clang']);
    $articleStatusTypes = rex_article_service::statusTypes();
    $panel = '';
    $panel .= '<dl class="dl-horizontal">';
    $panel .= '<dt>' . rex_i18n::msg('created_by') . '</dt>';
    $panel .= '<dd>' . $article->getValue('createuser') . '</dd>';
    $panel .= '<dt>' . rex_i18n::msg('created_on') . '</dt>';
    $panel .= '<dd>' . rex_formatter::strftime($article->getValue('createdate'), 'date') . '</dd>';
    $panel .= '<dt>' . rex_i18n::msg('updated_by') . '</dt>';
    $panel .= '<dd>' . $article->getValue('updateuser') . '</dd>';
    $panel .= '<dt>' . rex_i18n::msg('updated_on') . '</dt>';
    $panel .= '<dd>' . rex_formatter::strftime($article->getValue('updatedate'), 'date') . '</dd>';
    $panel .= '<dt>' . rex_i18n::msg('status') . '</dt>';
    $panel .= '<dd class="' . $articleStatusTypes[$article->getValue('status')][1] . '">' . $articleStatusTypes[$article->getValue('status')][0] . '</dd>';
    $panel .= '</dl>';
    $fragment = new rex_fragment();
    $fragment->setVar('title', rex_i18n::msg('metadata'), false);
    $fragment->setVar('body', $panel, false);
    $content = $fragment->parse('core/page/section.php');
    return $content;
}
开发者ID:skerbis,项目名称:redaxo,代码行数:24,代码来源:extension_content_sidebar.php

示例12: jQuery

$fragment = new rex_fragment();
$fragment->setVar('elements', $formElements, false);
$content .= $fragment->parse('core/form/checkbox.php');
$content .= '</fieldset>';
$formElements = [];
$n = [];
$n['field'] = '<button class="btn btn-primary" type="submit"><i class="rex-icon rex-icon-sign-in"></i> ' . rex_i18n::msg('login') . ' </button>';
$formElements[] = $n;
$fragment = new rex_fragment();
$fragment->setVar('elements', $formElements, false);
$buttons = $fragment->parse('core/form/submit.php');
$fragment = new rex_fragment();
$fragment->setVar('title', rex_i18n::msg('login_welcome'), false);
$fragment->setVar('body', $content, false);
$fragment->setVar('buttons', $buttons, false);
$content = $fragment->parse('core/page/section.php');
$content = '
<form id="rex-form-login" action="' . rex_url::backendController() . '" method="post">
    ' . $content . '
</form>
<script type="text/javascript">
     <!--
    jQuery(function($) {
        $("#rex-form-login")
            .submit(function(){
                var pwInp = $("#rex-id-login-password");
                if(pwInp.val() != "") {
                    $("#rex-form-login").append(\'<input type="hidden" name="\'+pwInp.attr("name")+\'" value="\'+Sha1.hash(pwInp.val())+\'" />\');
                    pwInp.removeAttr("name");
                }
        });
开发者ID:DECAF,项目名称:redaxo,代码行数:31,代码来源:login.php

示例13: function

                $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

示例14: clangSwitchAsDropdown

 /**
  * Returns a clang switch.
  *
  * @param rex_context $context
  *
  * @return string
  */
 public static function clangSwitchAsDropdown(rex_context $context)
 {
     if (rex_clang::count() == 1) {
         return '';
     }
     $button_label = '';
     $items = [];
     foreach (rex_clang::getAll() as $id => $clang) {
         if (rex::getUser()->getComplexPerm('clang')->hasPerm($id)) {
             $item = [];
             $item['title'] = rex_i18n::translate($clang->getName());
             $item['href'] = $context->getUrl(['clang' => $id]);
             if ($id == $context->getParam('clang')) {
                 $item['active'] = true;
                 $button_label = rex_i18n::translate($clang->getName());
             }
             $items[] = $item;
         }
     }
     $fragment = new rex_fragment();
     $fragment->setVar('class', 'rex-language');
     $fragment->setVar('button_prefix', rex_i18n::msg('language'));
     $fragment->setVar('button_label', $button_label);
     $fragment->setVar('header', rex_i18n::msg('clang_select'));
     $fragment->setVar('items', $items, false);
     if (rex::getUser()->isAdmin()) {
         $fragment->setVar('footer', '<a href="' . rex_url::backendPage('system/lang') . '"><i class="fa fa-flag"></i> ' . rex_i18n::msg('languages_edit') . '</a>', false);
     }
     return $fragment->parse('core/dropdowns/dropdown.php');
 }
开发者ID:DECAF,项目名称:redaxo,代码行数:37,代码来源:view.php

示例15:

        // ------------------------------------------ END: CONTENT HEAD MENUE
        // ------------------------------------------ WARNING
        if ($global_warning != '') {
            $contentMain .= rex_view::warning($global_warning);
        }
        if ($global_info != '') {
            $contentMain .= rex_view::success($global_info);
        }
        // --------------------------------------------- API MESSAGES
        $contentMain .= rex_api_function::getMessage();
        if ($warning != '') {
            $contentMain .= rex_view::warning($warning);
        }
        if ($info != '') {
            $contentMain .= rex_view::success($info);
        }
        // ----- EXTENSION POINT
        $contentMain .= rex_extension::registerPoint(new rex_extension_point('STRUCTURE_CONTENT_BEFORE_SLICES', '', ['article_id' => $article_id, 'clang' => $clang, 'function' => $function, 'slice_id' => $slice_id, 'page' => rex_be_controller::getCurrentPage(), 'ctype' => $ctype, 'category_id' => $category_id, 'article_revision' => &$article_revision, 'slice_revision' => &$slice_revision]));
        // ------------------------------------------ START: MODULE EDITIEREN/ADDEN ETC.
        $contentMain .= (include rex_be_controller::getCurrentPageObject()->getSubPath());
        // ------------------------------------------ END: AUSGABE
        // ----- EXTENSION POINT
        $contentMain .= rex_extension::registerPoint(new rex_extension_point('STRUCTURE_CONTENT_AFTER_SLICES', '', ['article_id' => $article_id, 'clang' => $clang, 'function' => $function, 'slice_id' => $slice_id, 'page' => rex_be_controller::getCurrentPage(), 'ctype' => $ctype, 'category_id' => $category_id, 'article_revision' => &$article_revision, 'slice_revision' => &$slice_revision]));
        // ----- EXTENSION POINT
        $contentSidebar = rex_extension::registerPoint(new rex_extension_point('STRUCTURE_CONTENT_SIDEBAR', '', ['article_id' => $article_id, 'clang' => $clang, 'function' => $function, 'slice_id' => $slice_id, 'page' => rex_be_controller::getCurrentPage(), 'ctype' => $ctype, 'category_id' => $category_id, 'article_revision' => &$article_revision, 'slice_revision' => &$slice_revision]));
        $fragment = new rex_fragment();
        $fragment->setVar('content', $contentMain, false);
        $fragment->setVar('sidebar', $contentSidebar, false);
        echo $fragment->parse('core/page/main_content.php');
    }
}
开发者ID:alsahh,项目名称:redaxo,代码行数:31,代码来源:content.php


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