本文整理汇总了PHP中rex_be_controller::getCurrentPagePart方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_be_controller::getCurrentPagePart方法的具体用法?PHP rex_be_controller::getCurrentPagePart怎么用?PHP rex_be_controller::getCurrentPagePart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rex_be_controller
的用法示例。
在下文中一共展示了rex_be_controller::getCurrentPagePart方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rex_metainfo_extensions_handler
/**
* Bindet ggf extensions ein.
*
* @param rex_extension_point $ep
*/
function rex_metainfo_extensions_handler(rex_extension_point $ep)
{
$page = $ep->getSubject();
$mainpage = rex_be_controller::getCurrentPagePart(1);
$mypage = 'metainfo';
// additional javascripts
if ($mainpage == 'metainfo' || $page == 'content/metainfo' || $page == 'structure') {
rex_view::addJsFile(rex_url::addonAssets($mypage, 'metainfo.js'));
}
// include extensions
$curDir = __DIR__ . '/..';
if ($page == 'structure') {
require_once $curDir . '/lib/handler/category_handler.php';
} elseif ($mainpage == 'mediapool') {
require_once $curDir . '/lib/handler/media_handler.php';
} elseif ($mainpage == 'content') {
require_once $curDir . '/extensions/extension_content_sidebar.php';
} elseif ($page == 'backup') {
require_once $curDir . '/extensions/extension_cleanup.php';
}
}
示例2:
<?php
/**
* @package redaxo5
*/
// -------------- Defaults
$subpage = rex_be_controller::getCurrentPagePart(2);
$func = rex_request('func', 'string');
echo rex_view::title(rex_i18n::msg('modules'));
include rex_be_controller::getCurrentPageObject()->getSubPath();
示例3: title
/**
* Returns the formatted title.
*
* @param string $head
* @param null|string|array $subtitle
*
* @throws InvalidArgumentException
*
* @return string
*/
public static function title($head, $subtitle = null)
{
if ($subtitle !== null && !is_string($subtitle) && (!is_array($subtitle) || count($subtitle) > 0 && !reset($subtitle) instanceof rex_be_page)) {
throw new InvalidArgumentException('Expecting $subtitle to be a string or an array of rex_be_page!');
}
if ($subtitle === null) {
$subtitle = rex_be_controller::getPageObject(rex_be_controller::getCurrentPagePart(1))->getSubpages();
}
if (is_array($subtitle) && count($subtitle) && reset($subtitle) instanceof rex_be_page) {
$nav = rex_be_navigation::factory();
$nav->setHeadline('default', rex_i18n::msg('subnavigation', $head));
foreach ($subtitle as $pageObj) {
$nav->addPage($pageObj);
}
$blocks = $nav->getNavigation();
$navigation = [];
if (count($blocks) == 1) {
$navigation = current($blocks);
$navigation = $navigation['navigation'];
}
if (!empty($navigation)) {
$fragment = new rex_fragment();
$fragment->setVar('left', $navigation, false);
$subtitle = $fragment->parse('core/navigations/content.php');
} else {
$subtitle = '';
}
} elseif (!is_string($subtitle)) {
$subtitle = '';
}
$title = rex_extension::registerPoint(new rex_extension_point('PAGE_TITLE', $head));
$fragment = new rex_fragment();
$fragment->setVar('heading', $title, false);
$fragment->setVar('subtitle', $subtitle, false);
$return = $fragment->parse('core/page/header.php');
$return .= rex_extension::registerPoint(new rex_extension_point('PAGE_TITLE_SHOWN', ''));
return $return;
}
示例4: define
<?php
/**
* Cronjob Addon.
*
* @author gharlan[at]web[dot]de Gregor Harlan
*
* @package redaxo5
*
* @var rex_addon $this
*/
define('REX_CRONJOB_LOG_FOLDER', $this->getDataPath());
define('REX_CRONJOB_TABLE', rex::getTable('cronjob'));
rex_extension::register('PACKAGES_INCLUDED', function () {
foreach ($this->getAvailablePlugins() as $plugin) {
if (($type = $plugin->getProperty('cronjob_type')) != '') {
rex_cronjob_manager::registerType($type);
}
}
});
$nexttime = $this->getConfig('nexttime', 0);
if ($nexttime != 0 && time() >= $nexttime) {
$EP = rex::isBackend() ? 'PAGE_CHECKED' : 'PACKAGES_INCLUDED';
rex_extension::register($EP, function () {
if (!rex::isBackend() || !in_array(rex_be_controller::getCurrentPagePart(1), ['setup', 'login', 'cronjob'])) {
rex_cronjob_manager_sql::factory()->check();
}
});
}
示例5: rex_accesskey
$item['extra'] = rex_accesskey($pageArr['title'], $accesskey++);
*/
$n->addPage($pageObj);
}
}
$blocks = $n->getNavigation();
$navigation = '';
foreach ($blocks as $block) {
$fragment = new rex_fragment();
$fragment->setVar('headline', $block['headline'], false);
$fragment->setVar('items', $block['navigation'], false);
$navigation .= $fragment->parse('core/navigations/main.php');
}
}
/* Setup Navigation ***********************************************************/
if (rex_be_controller::getCurrentPagePart(1) == 'setup') {
$step = rex_request('step', 'float');
$lang = rex_request('lang', 'string', '');
$navi = [];
$end = $lang ? 7 : 1;
for ($i = 1; $i <= $end; ++$i) {
$n = [];
if ($i == $step) {
$n['active'] = true;
}
$n['href'] = 'javascript:void(0)';
if ($i < $step) {
$n['itemAttr']['class'][] = 'bg-success';
$n['href'] = rex_url::backendPage('setup', ['step' => $i, 'lang' => $lang]);
if ($step == 7) {
$n['href'] = 'javascript:void(0)';
示例6: function
if (!rex::isBackend()) {
\rex_extension::register('OUTPUT_FILTER', '\\Sprog\\Extension::replaceWildcards');
}
if (rex::isBackend() && rex::getUser()) {
\rex_extension::register('CLANG_ADDED', '\\Sprog\\Extension::clangAdded');
\rex_extension::register('CLANG_DELETED', '\\Sprog\\Extension::clangDeleted');
rex_extension::register('PAGES_PREPARED', function () {
if (rex::getUser()->isAdmin()) {
if (\rex_be_controller::getCurrentPage() == 'sprog/settings') {
$func = rex_request('func', 'string');
if ($func == 'update') {
\rex_config::set('sprog', 'wildcard_clang_switch', rex_request('clang_switch', 'bool'));
}
}
}
if (rex::getUser()->isAdmin() || rex::getUser()->hasPerm('sprog[wildcard]')) {
$page = \rex_be_controller::getPageObject('sprog/wildcard');
if (Wildcard::isClangSwitchMode()) {
$clang_id = str_replace('clang', '', rex_be_controller::getCurrentPagePart(3));
$page->setSubPath(rex_path::addon('sprog', 'pages/wildcard.clang_switch.php'));
foreach (\rex_clang::getAll() as $id => $clang) {
if (rex::getUser()->getComplexPerm('clang')->hasPerm($id)) {
$page->addSubpage((new rex_be_page('clang' . $id, $clang->getName()))->setSubPath(rex_path::addon('sprog', 'pages/wildcard.clang_switch.php'))->setIsActive($id == $clang_id));
}
}
} else {
$page->setSubPath(rex_path::addon('sprog', 'pages/wildcard.clang_all.php'));
}
}
});
}
示例7: rex_request
if (!array_key_exists($ctype, $ctypes)) {
$ctype = 1;
}
// default = 1
// ----- Artikel wurde gefunden - Kategorie holen
$OOArt = rex_article::get($article_id, $clang);
$category_id = $OOArt->getCategoryId();
// ----- Request Parameter
$subpage = rex_be_controller::getCurrentPagePart(2);
$function = rex_request('function', 'string');
$warning = htmlspecialchars(rex_request('warning', 'string'));
$info = htmlspecialchars(rex_request('info', 'string'));
$context = new rex_context(['page' => rex_be_controller::getCurrentPage(), 'article_id' => $article_id, 'clang' => $clang, 'ctype' => $ctype]);
// ----- Titel anzeigen
echo rex_view::title(rex_i18n::msg('content'), '');
if (rex_be_controller::getCurrentPagePart(1) == 'content' && $article_id > 0) {
$icon = $article->getValue('startarticle') == 1 ? 'rex-icon-startarticle' : 'rex-icon-article';
$term = $article->getValue('startarticle') == 1 ? rex_i18n::msg('start_article') : rex_i18n::msg('article');
//echo '<h2><i class="rex-icon ' . $icon . '" title="' . $term . '"></i> ' . $article->getValue('name') . ' <small>' . rex_i18n::msg('id') . '=' . $article->getValue('id') . ', ' . $term . '</small></h2>';
}
// ----- Languages
echo rex_view::clangSwitchAsButtons($context);
// ----- category pfad und rechte
require rex_path::addon('structure', 'functions/function_rex_category.php');
// ----- EXTENSION POINT
echo rex_extension::registerPoint(new rex_extension_point('STRUCTURE_CONTENT_HEADER', '', ['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]));
// --------------------- SEARCH BAR
//require_once $this->getAddon()->getPath('functions/function_rex_searchbar.php');
//echo rex_structure_searchbar($context);
// ----------------- HAT USER DIE RECHTE AN DIESEM ARTICLE ODER NICHT
if (!rex::getUser()->getComplexPerm('structure')->hasCategoryPerm($category_id)) {
示例8: define
<?php
/**
* Cronjob Addon.
*
* @author gharlan[at]web[dot]de Gregor Harlan
*
* @package redaxo5
*
* @var rex_addon $this
*/
define('REX_CRONJOB_LOG_FOLDER', $this->getDataPath());
define('REX_CRONJOB_TABLE', rex::getTable('cronjob'));
rex_extension::register('PACKAGES_INCLUDED', function () {
foreach ($this->getAvailablePlugins() as $plugin) {
if (($type = $plugin->getProperty('cronjob_type')) != '') {
rex_cronjob_manager::registerType($type);
}
}
});
$nexttime = $this->getConfig('nexttime', 0);
if ($nexttime != 0 && time() >= $nexttime) {
$env = rex_cronjob_manager::getCurrentEnvironment();
$EP = 'backend' === $env ? 'PAGE_CHECKED' : 'PACKAGES_INCLUDED';
rex_extension::register($EP, function () use($env) {
if ('backend' !== $env || !in_array(rex_be_controller::getCurrentPagePart(1), ['setup', 'login', 'cronjob'])) {
rex_cronjob_manager_sql::factory()->check();
}
});
}
示例9: function
/**
* Page Content Addon.
*
* @author markus[dot]staab[at]redaxo[dot]de Markus Staab
*
* @package redaxo5
*/
rex_perm::register('moveSlice[]', null, rex_perm::OPTIONS);
rex_complex_perm::register('modules', 'rex_module_perm');
if (rex::isBackend()) {
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>';
示例10: 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;
}
示例11:
<?php
/** @var rex_addon $this */
$page = rex_be_controller::getCurrentPagePart(1);
$subpage = rex_be_controller::getCurrentPagePart(2, 'packages');
echo rex_view::title($this->i18n('title'));
if ($subpage == 'packages') {
$subpage = rex_be_controller::getCurrentPagePart(3, 'update');
}
if ('reload' === rex_request('func', 'string')) {
rex_install_webservice::deleteCache();
}
include rex_be_controller::getCurrentPageObject()->getSubPath();