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


PHP rex_view::toolbar方法代码示例

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


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

示例1: rex_structure_searchbar


//.........这里部分代码省略.........
                if (rex::getUser()->getComplexPerm('structure')->hasCategoryPerm($OOArt->getCategoryId())) {
                    $label .= ' [' . $search->getValue('id') . ']';
                    $highlightHit = function ($string, $needle) {
                        return preg_replace('/(.*)(' . preg_quote($needle, '/') . ')(.*)/i', '\\1<mark>\\2</mark>\\3', $string);
                    };
                    foreach ($OOArt->getParentTree() as $treeItem) {
                        $treeLabel = $treeItem->getName();
                        if (rex::getUser()->hasPerm('advancedMode[]')) {
                            $treeLabel .= ' [' . $treeItem->getId() . ']';
                        }
                        $treeLabel = htmlspecialchars($treeLabel);
                        $treeLabel = $highlightHit($treeLabel, $needle);
                        $e = [];
                        $e['title'] = $treeLabel;
                        $e['href'] = $context->getUrl(['page' => 'structure', 'category_id' => $treeItem->getId()]);
                        $breadcrumb[] = $e;
                    }
                    $label = htmlspecialchars($label);
                    $label = $highlightHit($label, $needle);
                    $e = [];
                    $e['title'] = $label;
                    $e['href'] = $context->getUrl(['page' => 'content/edit', 'article_id' => $treeItem->getId()]);
                    $breadcrumb[] = $e;
                    $fragment = new rex_fragment();
                    $fragment->setVar('items', $breadcrumb, false);
                    $search_result .= '<div class="list-group-item">' . $fragment->parse('core/navigations/breadcrumb.php') . '</div>';
                }
                $search->next();
            }
            $search_result .= '</div>';
            $fragment = new rex_fragment();
            $fragment->setVar('title', rex_i18n::msg('be_search_result'), false);
            $fragment->setVar('content', $search_result, false);
            $search_result = $fragment->parse('core/page/section.php');
        } else {
            $message = rex_view::info(rex_i18n::msg('be_search_no_results'));
        }
    }
    $select_name = 'category_id';
    $add_homepage = true;
    if (rex_be_controller::getCurrentPagePart(1) == 'content') {
        $select_name = 'article_id';
        $add_homepage = false;
    }
    $category_select = new rex_category_select(false, false, true, $add_homepage);
    $category_select->setName($select_name);
    $category_select->setSize('1');
    $category_select->setAttribute('onchange', 'this.form.submit();');
    $category_select->setSelected($category_id);
    $select = $category_select->get();
    $doc = new DOMDocument();
    $doc->loadHTML('<?xml encoding="UTF-8">' . $select);
    $options = $doc->getElementsByTagName('option');
    $droplistContext = new rex_context(['page' => 'structure', 'category_id' => 0]);
    $button_label = '';
    $items = [];
    foreach ($options as $option) {
        $value = '';
        $item = [];
        if ($option->hasAttributes()) {
            foreach ($option->attributes as $attribute) {
                if ($attribute->name == 'value') {
                    $value = $attribute->value;
                    $droplistContext->setParam('category_id', $value);
                    if ($attribute->value == $category_id) {
                        $button_label = str_replace(" ", '', $option->nodeValue);
                        $item['active'] = true;
                    }
                }
            }
        }
        $item['title'] = preg_replace('/\\[([0-9]+)\\]$/', '<small class="rex-primary-id">$1</small>', $option->nodeValue);
        $item['href'] = $droplistContext->getUrl();
        $items[] = $item;
    }
    $fragment = new rex_fragment();
    $fragment->setVar('button_prefix', rex_i18n::msg('be_search_quick_navi'));
    $fragment->setVar('button_label', $button_label);
    $fragment->setVar('items', $items, false);
    $droplist = '<div class="navbar-btn navbar-right">' . $fragment->parse('core/dropdowns/dropdown.php');
    $formElements = [];
    $n = [];
    $n['field'] = '<input class="form-control" type="text" name="search_article_name" value="' . htmlspecialchars($search_article_name) . '" placeholder="' . htmlspecialchars(rex_i18n::msg('be_search_article_name') . '/' . rex_i18n::msg('be_search_article_id')) . '" />';
    $n['right'] = '<button class="btn btn-search" type="submit" name="search_start" value="1">' . rex_i18n::msg('be_search_start') . '</button>';
    $formElements[] = $n;
    $fragment = new rex_fragment();
    $fragment->setVar('elements', $formElements, false);
    $toolbar = $fragment->parse('core/form/input_group.php');
    $toolbar = '
    <form action="' . rex_url::currentBackendPage() . '" method="post">
    ' . $context->getHiddenInputFields() . '
    <div class="navbar-form navbar-left">
        <div class="form-group">
            ' . $toolbar . '
        </div>
    </div>
    </form>';
    $toolbar = rex_view::toolbar($toolbar . $droplist, rex_i18n::msg('be_search_search'));
    return $toolbar . $search_result;
}
开发者ID:eaCe,项目名称:redaxo,代码行数:101,代码来源:function_rex_searchbar.php

示例2: rex_fragment

    }
    $toolbar = '';
    $fragment = new rex_fragment();
    $fragment->setVar('button_prefix', rex_i18n::msg('version'));
    $fragment->setVar('items', $items, false);
    $fragment->setVar('toolbar', true);
    if (!rex::getUser()->hasPerm('version[live_version]')) {
        $fragment->setVar('disabled', true);
    }
    $toolbar .= '<li class="dropdown">' . $fragment->parse('core/dropdowns/dropdown.php') . '</li>';
    if (!rex::getUser()->hasPerm('version[live_version]')) {
        if ($rex_version_article[$params['article_id']] > 0) {
            $toolbar .= '<li><a href="' . $context->getUrl(['rex_version_func' => 'copy_live_to_work']) . '">' . rex_i18n::msg('version_copy_from_liveversion') . '</a></li>';
            $toolbar .= '<li><a href="' . rex_getUrl($params['article_id'], $params['clang'], ['rex_version' => 1]) . '" target="_blank">' . rex_i18n::msg('version_preview') . '</a></li>';
        }
    } else {
        if ($rex_version_article[$params['article_id']] > 0) {
            if (!$working_version_empty) {
                $toolbar .= '<li><a href="' . $context->getUrl(['rex_version_func' => 'copy_work_to_live']) . '">' . rex_i18n::msg('version_working_to_live') . '</a></li>';
            }
            $toolbar .= '<li><a href="' . rex_getUrl($params['article_id'], $params['clang'], ['rex_version' => 1]) . '" target="_blank">' . rex_i18n::msg('version_preview') . '</a></li>';
        } else {
            $toolbar .= '<li><a href="' . $context->getUrl(['rex_version_func' => 'copy_live_to_work']) . '" data-confirm="' . rex_i18n::msg('version_confirm_copy_live_to_workingversion') . '">' . rex_i18n::msg('version_copy_live_to_workingversion') . '</a></li>';
        }
    }
    $inverse = $rex_version_article[$params['article_id']] == 1 ? true : false;
    $cssClass = $rex_version_article[$params['article_id']] == 1 ? 'rex-state-inprogress' : 'rex-state-live';
    $return .= rex_view::toolbar('<ul class="nav navbar-nav">' . $toolbar . '</ul>', $brand, $cssClass, $inverse);
    $params['slice_revision'] = $rex_version_article[$params['article_id']];
    return $return;
});
开发者ID:eaCe,项目名称:redaxo,代码行数:31,代码来源:boot.php

示例3: rex_fragment

$n['right'] = '<button class="btn btn-search" type="submit"><i class="rex-icon rex-icon-search"></i></button>';
//$n['right'] = $dropdown;
$formElements[] = $n;
$fragment = new rex_fragment();
$fragment->setVar('elements', $formElements, false);
$toolbar = $fragment->parse('core/form/input_group.php');
$toolbar = '
<form action="' . rex_url::currentBackendPage() . '" method="post">
' . $arg_fields . '
<div class="navbar-form rex-navbar-form-flexible">
    <div class="form-group">
        ' . $toolbar . '
    </div>
</div>
</form>';
$toolbar = rex_view::toolbar($toolbar, rex_i18n::msg('be_search_mpool_search'));
// ----- EXTENSION POINT
$toolbar = rex_extension::registerPoint(new rex_extension_point('MEDIA_LIST_TOOLBAR', $toolbar, ['subpage' => $subpage, 'category_id' => $rex_file_category]));
// *************************************** Subpage: Media
if ($file_id && rex_post('btn_delete', 'string')) {
    $sql = rex_sql::factory()->setQuery('SELECT filename FROM ' . rex::getTable('media') . ' WHERE id = ?', [$file_id]);
    $media = null;
    if ($sql->getRows() == 1) {
        $media = rex_media::get($sql->getValue('filename'));
    }
    if ($media) {
        $filename = $media->getFileName();
        if ($PERMALL || rex::getUser()->getComplexPerm('media')->hasCategoryPerm($media->getCategoryId())) {
            $return = rex_mediapool_deleteMedia($filename);
            if ($return['ok']) {
                $success = $return['msg'];
开发者ID:skerbis,项目名称:redaxo,代码行数:31,代码来源:media.php


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