本文整理汇总了PHP中rex_be_controller类的典型用法代码示例。如果您正苦于以下问题:PHP rex_be_controller类的具体用法?PHP rex_be_controller怎么用?PHP rex_be_controller使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了rex_be_controller类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: markdown
<?php
/**
* This file is part of the Url package.
*
* @author (c) Thomas Blum <thomas@addoff.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Convert some text to Markdown...
*/
function markdown($text)
{
return (new ParsedownExtra())->text($text);
}
if (rex::isBackend()) {
rex_view::addCssFile($this->getAssetsUrl('dao.css'));
rex_view::addJsFile($this->getAssetsUrl('vendor/redips/redips-table.js'));
if (rex_be_controller::getCurrentPage() == 'dao_var/readme') {
rex_view::addJsFile($this->getAssetsUrl('prism.js'));
}
}
示例2: rex_request
<?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:
<?php
/**
* Cronjob Addon.
*
* @author gharlan[at]web[dot]de Gregor Harlan
*
* @package redaxo5
*
* @var rex_addon $this
*/
echo rex_view::title($this->i18n('title'));
rex_be_controller::includeCurrentPageSubPath();
示例4:
<nav class="rex-nav-top navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<?php
if (rex_be_controller::getCurrentPageObject()->isPopup()) {
?>
<span class="navbar-brand"><img class="rex-js-svg rex-redaxo-logo" src="<?php
echo rex_url::coreAssets('redaxo-logo.svg');
?>
" /></span>
<?php
} else {
?>
<a class="navbar-brand" href="<?php
echo rex_url::backendController();
?>
"><img class="rex-js-svg rex-redaxo-logo" src="<?php
echo rex_url::coreAssets('redaxo-logo.svg');
?>
" /></a>
<?php
}
?>
</div>
<?php
echo $this->meta_navigation;
?>
</div>
</nav>
示例5: currentBackendPage
/**
* Returns the url to the current backend page.
*
* @param array $params Params
* @param bool $escape Flag whether the argument separator "&" should be escaped (&)
*
* @return string
*/
public static function currentBackendPage(array $params = [], $escape = true)
{
return self::backendPage(rex_be_controller::getCurrentPage(), $params, $escape);
}
示例6: 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;
}
示例7:
<?php
/**
* MetaForm Addon.
*
* @author markus[dot]staab[at]redaxo[dot]de Markus Staab
*
* @package redaxo5
*/
// Parameter
$Basedir = __DIR__;
$subpage = rex_be_controller::getCurrentPagePart(2);
$func = rex_request('func', 'string');
echo rex_view::title(rex_i18n::msg('minfo_title'));
// Include Current Page
switch ($subpage) {
case 'media':
$prefix = 'med_';
break;
case 'categories':
$prefix = 'cat_';
break;
default:
$prefix = 'art_';
}
$metaTable = rex_metainfo_meta_table($prefix);
require $Basedir . '/field.php';
示例8: rex_extension_point
// ------------------------------------------ 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');
}
}
示例9: loadBackendConfig
protected function loadBackendConfig()
{
$this->addParam('page', rex_be_controller::getCurrentPage());
}
示例10: 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>';
示例11: 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();
}
});
}
示例12: rex_request
<?php
// ------- Default Values
$HTMLArea = rex_request('HTMLArea', 'string');
$opener_input_field = rex_request('opener_input_field', 'string');
$opener_input_field_name = rex_request('opener_input_field_name', 'string');
$category_id = rex_request('category_id', 'int');
$category_id = rex_category::get($category_id) ? $category_id : 0;
$clang = rex_request('clang', 'int');
$clang = rex_clang::exists($clang) ? $clang : rex_clang::getStartId();
$context = new rex_context(['page' => rex_be_controller::getCurrentPage(), 'HTMLArea' => $HTMLArea, 'opener_input_field' => $opener_input_field, 'opener_input_field_name' => $opener_input_field_name, 'category_id' => $category_id, 'clang' => $clang]);
// ------- Build JS Functions
$func_body = '';
if ($HTMLArea != '') {
if ($HTMLArea == 'TINY') {
$func_body = 'window.opener.tinyMCE.insertLink(link);';
} else {
$func_body = 'window.opener.' . $HTMLArea . '.surroundHTML("<a href="+link+">","</a>");';
}
}
if ($opener_input_field != '' && $opener_input_field_name == '') {
$opener_input_field_name = $opener_input_field . '_NAME';
}
if ($opener_input_field == 'TINY') {
$func_body .= 'window.opener.insertLink(link,name);
self.close();';
} elseif (substr($opener_input_field, 0, 13) == 'REX_LINKLIST_') {
$id = substr($opener_input_field, 13, strlen($opener_input_field));
$func_body .= 'var linklist = "REX_LINKLIST_SELECT_' . $id . '";
var linkid = link.replace("redaxo://","");
var source = opener.document.getElementById(linklist);
示例13: 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;
}
示例14: foreach
foreach (rex_i18n::getLocales() as $locale) {
rex_i18n::setLocale($locale, false);
// Locale nicht neu setzen
$sel_be_sprache->addOption(rex_i18n::msg('lang'), $locale);
}
rex_i18n::setLocale($saveLocale, false);
$userperm_be_sprache = rex_request('userperm_be_sprache', 'string');
// ----- welche startseite
$sel_startpage = new rex_select();
$sel_startpage->setSize(1);
$sel_startpage->setName('userperm_startpage');
$sel_startpage->setId('rex-user-perm-startpage');
$sel_startpage->setAttribute('class', 'form-control');
$sel_startpage->addOption('default', '');
$startpages = [];
foreach (rex_be_controller::getPages() as $page => $pageObj) {
/* @var $pageObj rex_be_page */
if ($pageObj->hasNavigation() && !$pageObj->isHidden()) {
$startpages[$page] = $pageObj->getTitle();
}
}
asort($startpages);
$sel_startpage->addOptions($startpages);
$userperm_startpage = rex_request('userperm_startpage', 'string');
// --------------------------------- Title
// --------------------------------- FUNCTIONS
$FUNC_UPDATE = '';
$FUNC_APPLY = '';
$FUNC_DELETE = '';
if ($user_id != 0 && (rex::getUser()->isAdmin() || !$sql->getValue('admin'))) {
$FUNC_UPDATE = rex_request('FUNC_UPDATE', 'string');
示例15: addSlice
public static function addSlice()
{
$article_id = rex_request('article_id', 'int');
$function = rex_request('page', 'string');
$cut_slice_id = $slice_id = $_SESSION['slice_ui']['slice_id'];
$module_id = $_SESSION['slice_ui']['module_id'];
$clang = rex_get('clang');
$ctype = rex_get('ctype');
if (!self::checkPermissions(array('article_id' => $article_id, 'clang' => $clang, 'ctype' => $ctype, 'module_id' => $module_id))) {
// Alle OBs schließen
while (@ob_end_clean()) {
}
header("Location: " . rex_url::backendController() . '?article_id=' . $article_id . '&clang=' . $clang . '&page=content/edit&ctype=' . $ctype);
exit;
}
$slice_revision = 0;
$template_attributes = [];
$newsql = rex_sql::factory();
// $newsql->setDebug();
$sliceTable = rex::getTablePrefix() . 'article_slice';
$newsql->setTable($sliceTable);
if (strpos($function, 'content/paste') !== false && !empty($_SESSION['slice_ui'])) {
// determine priority value to get the new slice into the right order
$priority = '0';
// $prevSlice->setDebug();
if ($function === 'content/paste') {
$priority = 1;
} else {
$prevSlice = rex_sql::factory();
$prevSlice->setQuery('SELECT * FROM ' . $sliceTable . ' WHERE id=' . rex_get('slice_id'));
$priority = $prevSlice->getValue('priority') + 1;
}
$newsql->setValue('article_id', $article_id);
$newsql->setValue('module_id', $module_id);
$newsql->setValue('clang_id', $clang);
$newsql->setValue('ctype_id', $ctype);
$newsql->setValue('revision', $slice_revision);
$newsql->setValue('priority', $priority);
$newsql->addGlobalUpdateFields();
$newsql->addGlobalCreateFields();
try {
$newsql->insert();
$info = $action_message . rex_i18n::msg('block_added');
$slice_id = $newsql->getLastId();
if ($slice_id !== 0) {
$_SESSION['slice_ui']['slice_id'] = $slice_id;
}
rex_sql_util::organizePriorities(rex::getTable('article_slice'), 'priority', 'article_id=' . $article_id . ' AND clang_id=' . $clang . ' AND ctype_id=' . $ctype . ' AND revision=' . $slice_revision, 'priority, updatedate DESC');
$function = '';
// ----- EXTENSION POINT
rex_extension::registerPoint(new rex_extension_point('SLICE_PASTED', '', ['article_id' => $article_id, 'clang' => $clang, 'function' => $function, 'slice_id' => $slice_id, 'page' => rex_be_controller::getCurrentPage(), 'ctype' => $ctype, 'category_id' => $category_id, 'module_id' => $module_id, 'article_revision' => &$article_revision, 'slice_revision' => &$slice_revision]));
if ($_SESSION['slice_ui']['cut'] == 1) {
$curr = rex_sql::factory();
$curr->setDebug();
$curr->setTable($sliceTable);
$curr->setWhere(array('id' => $cut_slice_id));
$curr->delete();
rex_sql_util::organizePriorities(rex::getTable('article_slice'), 'priority', 'article_id=' . $_SESSION['slice_ui']['article_id'] . ' AND clang_id=' . $clang . ' AND ctype_id=' . $ctype . ' AND revision=' . $slice_revision, 'priority, updatedate DESC');
}
} catch (rex_sql_exception $e) {
// echo rex_view::warning($e->getMessage());
}
// Alle OBs schließen
while (@ob_end_clean()) {
}
header("Location: " . rex_url::backendController() . '?article_id=' . $article_id . '&clang=' . $clang . '&page=content/edit&ctype=' . $ctype);
exit;
}
}