本文整理汇总了PHP中rex_url::backendController方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_url::backendController方法的具体用法?PHP rex_url::backendController怎么用?PHP rex_url::backendController使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rex_url
的用法示例。
在下文中一共展示了rex_url::backendController方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showForm
public static function showForm()
{
$article_id = rex_request('article_id', 'int');
$clang = rex_get('clang');
$ctype = rex_get('ctype');
$_SESSION[__CLASS__]['active'] = 1;
// 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;
}
示例2: header
/**
* @package redaxo5
*/
$info = '';
$error = [];
$success = '';
if ($func == 'setup') {
// REACTIVATE SETUP
$configFile = rex_path::data('config.yml');
$config = rex_file::getConfig($configFile);
$config['setup'] = true;
// echo nl2br(htmlspecialchars($cont));
if (rex_file::putConfig($configFile, $config) !== false) {
$info = rex_i18n::msg('setup_error1', '<a href="' . rex_url::backendController() . '">', '</a>');
header('Location:' . rex_url::backendController());
exit;
} else {
$error[] = rex_i18n::msg('setup_error2');
}
} elseif ($func == 'generate') {
// generate all articles,cats,templates,caches
$success = rex_delete_cache();
} elseif ($func == 'updateassets') {
rex_dir::copy(rex_path::core('assets'), rex_path::assets());
$success = 'Updated assets';
} elseif ($func == 'updateinfos') {
$configFile = rex_path::data('config.yml');
$config = array_merge(rex_file::getConfig(rex_path::core('default.config.yml')), rex_file::getConfig($configFile));
$settings = rex_post('settings', 'array', []);
foreach (['server', 'servername', 'error_email', 'lang'] as $key) {
示例3: substr
}
}
// wenn datei fehlt
if (!file_exists(rex_path::media($file_name))) {
$thumbnail = '<i class="rex-mime rex-mime-error" title="' . rex_i18n::msg('pool_file_does_not_exist') . '"></i><span class="sr-only">' . $file_name . '</span>';
} else {
$file_ext = substr(strrchr($file_name, '.'), 1);
$icon_class = ' rex-mime-default';
if (rex_media::isDocType($file_ext)) {
$icon_class = ' rex-mime-' . $file_ext;
}
$thumbnail = '<i class="rex-mime' . $icon_class . '" title="' . $alt . '" data-extension="' . $file_ext . '"></i><span class="sr-only">' . $file_name . '</span>';
if (rex_media::isImageType(rex_file::extension($file_name)) && $thumbs) {
$thumbnail = '<img class="thumbnail" src="' . rex_url::media($file_name) . '" alt="' . $alt . '" title="' . $alt . '" />';
if ($media_manager) {
$thumbnail = '<img class="thumbnail" src="' . rex_url::backendController(['rex_media_type' => 'rex_mediapool_preview', 'rex_media_file' => $encoded_file_name]) . '" alt="' . $alt . '" title="' . $alt . '" />';
}
}
}
// ----- get file size
$size = $file_size;
$file_size = rex_formatter::bytes($size);
if ($file_title == '') {
$file_title = '[' . rex_i18n::msg('pool_file_notitle') . ']';
}
$file_title .= ' [' . $file_id . ']';
// ----- opener
$opener_link = '';
if ($opener_input_field == 'TINYIMG') {
if (rex_media::isImageType(rex_file::extension($file_name))) {
$opener_link .= '<a class="btn btn-select" href="javascript:insertImage(\'$file_name\',\'' . $files->getValue('title') . '\')">' . rex_i18n::msg('pool_image_get') . '</a>';
示例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: 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;
}
}
示例6: rex_fragment
echo $headline;
$fragment = new rex_fragment();
$fragment->setVar('title', rex_i18n::msg('setup_606'), false);
$fragment->setVar('body', $content, false);
$fragment->setVar('buttons', $buttons, false);
$content = $fragment->parse('core/page/section.php');
echo '<form class="rex-js-createadminform" action="' . rex_url::backendController() . '" method="post" autocomplete="off">' . $content . '</form>';
}
// ---------------------------------- step 7 . thank you . setup false
if ($step == 7) {
$configFile = rex_path::data('config.yml');
$config = array_merge(rex_file::getConfig(rex_path::core('default.config.yml')), rex_file::getConfig($configFile));
$config['setup'] = false;
if (rex_file::putConfig($configFile, $config)) {
$errmsg = '';
rex_file::delete(rex_path::cache('config.yml.cache'));
} else {
$errmsg = rex_i18n::msg('setup_701');
}
$headline = rex_view::title(rex_i18n::msg('setup_700'));
$content = '<h3>' . rex_i18n::msg('setup_703') . '</h3>';
$content .= rex_i18n::rawMsg('setup_704', '<a href="' . rex_url::backendController() . '">', '</a>');
$content .= '<p>' . rex_i18n::msg('setup_705') . '</p>';
$buttons = '<a class="btn btn-setup" href="' . rex_url::backendController() . '">' . rex_i18n::msg('setup_706') . '</a>';
echo $headline;
$fragment = new rex_fragment();
$fragment->setVar('heading', rex_i18n::msg('setup_702'), false);
$fragment->setVar('body', $content, false);
$fragment->setVar('buttons', $buttons, false);
echo $fragment->parse('core/page/section.php');
}
示例7: setHref
/**
* Sets the page href.
*
* @param string|array $href Href string or array of params
*
* @return $this
*/
public function setHref($href)
{
if (is_array($href)) {
$href = rex_url::backendController($href, false);
}
$this->href = $href;
return $this;
}
示例8: getUrl
/**
* {@inheritdoc}
*/
public function getUrl(array $params = [], $escape = true)
{
// combine global params with local
$_params = array_merge($this->globalParams, $params);
return rex::isBackend() ? rex_url::backendController($_params, $escape) : rex_url::frontendController($_params, $escape);
}
示例9: getParsedUrl
/**
* Gibt eine Url zurück, die die Parameter $params enthält
* Dieser Url werden die Standard rexList Variablen zugefügt.
*
* Innerhalb dieser Url werden variablen ersetzt
*
* @see #replaceVariable, #replaceVariables
*
* @param array $params
* @param bool $escape Flag whether the argument separator "&" should be escaped (&)
*
* @return string
*/
public function getParsedUrl($params = [], $escape = true)
{
$params = array_merge($this->getParams(), $params);
$params['list'] = $this->getName();
if (!isset($params['sort'])) {
$sortColumn = $this->getSortColumn();
if ($sortColumn != null) {
$params['sort'] = $sortColumn;
$params['sorttype'] = $this->getSortType();
}
}
$_params = [];
foreach ($params as $name => $value) {
if (is_array($value)) {
foreach ($value as $v) {
$_params[$name] = $this->replaceVariables($v);
}
} else {
$_params[$name] = $this->replaceVariables($value);
}
}
return rex::isBackend() ? rex_url::backendController($_params, $escape) : rex_url::frontendController($_params, $escape);
}
示例10: unset
if (rex::getUser() && $hasNavigation) {
if (rex::isSafeMode()) {
$item = [];
$item['title'] = rex_i18n::msg('safemode_deactivate');
$item['href'] = rex_url::backendController(['safemode' => 0]);
$meta_items[] = $item;
unset($item);
}
$user_name = rex::getUser()->getValue('name') != '' ? rex::getUser()->getValue('name') : rex::getUser()->getValue('login');
$item = [];
$item['title'] = '<span class="text-muted">' . rex_i18n::msg('logged_in_as') . '</span> <a class="rex-username" href="' . rex_url::backendPage('profile') . '" title="' . rex_i18n::msg('profile_title') . '"><i class="rex-icon rex-icon-user"></i> ' . htmlspecialchars($user_name) . '</a>';
$meta_items[] = $item;
unset($item);
$item = [];
$item['title'] = '<i class="rex-icon rex-icon-sign-out"></i> ' . rex_i18n::msg('logout');
$item['href'] = rex_url::backendController(['rex_logout' => 1]);
$item['attributes'] = 'class="rex-logout"' . rex::getAccesskey(rex_i18n::msg('logout'), 'logout');
$meta_items[] = $item;
unset($item);
} elseif ($hasNavigation) {
$item = [];
$item['title'] = rex_i18n::msg('logged_out');
$meta_items[] = $item;
unset($item);
}
// wird in bottom.php an Fragment uebergeben
$navigation = '';
if (rex::getUser() && $hasNavigation) {
$n = rex_be_navigation::factory();
foreach (rex_be_controller::getPages() as $p => $pageObj) {
$p = strtolower($p);
示例11: getMissingWildcards
public static function getMissingWildcards()
{
$wildcards = [];
if (\rex_addon::get('structure')->isAvailable() && \rex_plugin::get('structure', 'content')->isAvailable()) {
$sql = \rex_sql::factory();
// Slices der Artikel durchsuchen
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$fields = ['s.value' => range('1', '20')];
$searchFields = [];
$selectFields = [];
foreach ($fields as $field => $numbers) {
$concatFields = [];
foreach ($numbers as $number) {
$concatFields[] = $field . $number;
$searchFields[] = $field . $number . ' RLIKE ' . $sql->escape(preg_quote(trim(self::getOpenTag())) . '.*' . preg_quote(trim(self::getCloseTag())));
}
$selectFields[] = 'CONCAT_WS("|", ' . implode(',', $concatFields) . ') AS subject';
}
$fields = $searchFields;
$sql_query = ' SELECT s.article_id AS id,
s.clang_id,
s.ctype_id,
' . implode(', ', $selectFields) . '
FROM ' . \rex::getTable('article_slice') . ' AS s
LEFT JOIN
' . \rex::getTable('article') . ' AS a
ON (s.article_id = a.id AND s.clang_id = a.clang_id)
WHERE ' . implode(' OR ', $fields) . '
';
$sql->setDebug(false);
$sql->setQuery($sql_query);
if ($sql->getRows() >= 1) {
$items = $sql->getArray();
foreach ($items as $item) {
preg_match_all(self::getRegexp(), $item['subject'], $matchesSubject, PREG_SET_ORDER);
foreach ($matchesSubject as $match) {
$wildcards[$match[0]]['wildcard'] = str_replace([self::getOpenTag(), self::getCloseTag()], '', $match[0]);
$wildcards[$match[0]]['url'] = \rex_url::backendController(['page' => 'content/edit', 'article_id' => $item['id'], 'mode' => 'edit', 'clang' => $item['clang_id'], 'ctype' => $item['ctype_id']]);
}
}
}
// Alle bereits angelegten Platzhalter entfernen
if (count($wildcards)) {
$sql = \rex_sql::factory();
$sql_query = '
SELECT CONCAT("' . self::getOpenTag() . '", wildcard, "' . self::getCloseTag() . '") AS wildcard
FROM ' . \rex::getTable('sprog_wildcard') . '
WHERE clang_id = "' . \rex_clang::getStartId() . '"';
$sql->setDebug(false);
$sql->setQuery($sql_query);
if ($sql->getRows() >= 1) {
$items = $sql->getArray();
foreach ($items as $item) {
if (isset($wildcards[$item['wildcard']])) {
unset($wildcards[$item['wildcard']]);
}
}
}
}
return $wildcards;
}
return false;
}
示例12:
<?php
/**
* @package redaxo5
*/
if (rex::isSetup()) {
rex_response::sendRedirect(rex_url::backendController());
}
// ----- INCLUDE ADDONS
include_once rex_path::core('packages.php');
// ----- caching end für output filter
$CONTENT = ob_get_contents();
ob_end_clean();
// trigger api functions
rex_api_function::handleCall();
if (rex_extension::isRegistered('FE_OUTPUT')) {
// ----- EXTENSION POINT
rex_extension::registerPoint(new rex_extension_point('FE_OUTPUT', $CONTENT));
} else {
// ----- inhalt ausgeben
rex_response::sendPage($CONTENT);
}
示例13: 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'));
});
}
示例14: get
/**
* @return string
*/
public function get()
{
$this->init();
$this->setApplyUrl($this->getUrl(['func' => ''], false));
if (($controlElement = $this->getControlElement()) !== null) {
if ($controlElement->saved()) {
$this->processPostValues();
// speichern und umleiten
// Nachricht in der Liste anzeigen
if (($result = $this->validate()) === true && ($result = $this->save()) === true) {
$this->redirect(rex_i18n::msg('form_saved'));
} elseif (is_int($result) && isset($this->errorMessages[$result])) {
$this->setWarning($this->errorMessages[$result]);
} elseif (is_string($result) && $result != '') {
$this->setWarning($result);
} else {
$this->setWarning(rex_i18n::msg('form_save_error'));
}
} elseif ($controlElement->applied()) {
$this->processPostValues();
// speichern und wiederanzeigen
// Nachricht im Formular anzeigen
if (($result = $this->validate()) === true && ($result = $this->save()) === true) {
$this->setMessage(rex_i18n::msg('form_applied'));
} elseif (is_int($result) && isset($this->errorMessages[$result])) {
$this->setWarning($this->errorMessages[$result]);
} elseif (is_string($result) && $result != '') {
$this->setWarning($result);
} else {
$this->setWarning(rex_i18n::msg('form_save_error'));
}
} elseif ($controlElement->deleted()) {
// speichern und wiederanzeigen
// Nachricht in der Liste anzeigen
if (($result = $this->delete()) === true) {
$this->redirect(rex_i18n::msg('form_deleted'));
} elseif (is_string($result) && $result != '') {
$this->setWarning($result);
} else {
$this->setWarning(rex_i18n::msg('form_delete_error'));
}
} elseif ($controlElement->resetted()) {
// verwerfen und wiederanzeigen
// Nachricht im Formular anzeigen
$this->setMessage(rex_i18n::msg('form_resetted'));
} elseif ($controlElement->aborted()) {
// verwerfen und umleiten
// Nachricht in der Liste anzeigen
$this->redirect(rex_i18n::msg('form_resetted'));
}
}
$actionParams = [];
if ('get' == strtolower($this->method)) {
// Parameter dem Formular hinzufügen
foreach ($this->getParams() as $name => $value) {
$this->addHiddenField($name, $value, ['internal::useArraySyntax' => 'none']);
}
} else {
$actionParams = $this->getParams();
}
$s = "\n";
$warning = $this->getWarning();
$message = $this->getMessage();
if ($warning != '') {
$s .= ' ' . rex_view::warning($warning) . "\n";
} elseif ($message != '') {
$s .= ' ' . rex_view::info($message) . "\n";
}
$i = 0;
$addHeaders = true;
$fieldsets = $this->getFieldsetElements();
$last = count($fieldsets);
$s .= '<form id="' . $this->divId . '" action="' . rex_url::backendController($actionParams) . '" method="' . $this->method . '">' . "\n";
foreach ($fieldsets as $fieldsetName => $fieldsetElements) {
$s .= '<fieldset>' . "\n";
if ($fieldsetName != '') {
$s .= '<legend>' . htmlspecialchars($fieldsetName) . '</legend>' . "\n";
}
// Die HeaderElemente nur im 1. Fieldset ganz am Anfang einfügen
if ($i == 0 && $addHeaders) {
foreach ($this->getHeaderElements() as $element) {
// Callback
$element->setValue($this->preView($fieldsetName, $element->getFieldName(), $element->getValue()));
// HeaderElemente immer ohne <p>
$s .= $element->formatElement();
}
$addHeaders = false;
}
foreach ($fieldsetElements as $element) {
// Callback
$element->setValue($this->preView($fieldsetName, $element->getFieldName(), $element->getValue()));
$s .= $element->get();
}
// Die FooterElemente nur innerhalb des letzten Fieldsets
if ($i + 1 == $last) {
foreach ($this->getFooterElements() as $element) {
// Callback
//.........这里部分代码省略.........
示例15: foreach
$ctype = $params['ctype'];
$select_priority = [];
$select_priority[] = rex_i18n::msg('yrewrite_priority_auto') . '=';
foreach (rex_yrewrite_seo::$priority as $priority) {
$select_priority[] = rex_i18n::msg('yrewrite_priority_' . str_replace('.', '_', $priority)) . '=' . $priority;
}
$select_changefreq = [];
foreach (rex_yrewrite_seo::$changefreq as $changefreq) {
$select_changefreq[] = rex_i18n::msg('yrewrite_changefreq_' . $changefreq) . '=' . $changefreq;
}
$index_setting = [];
$index_setting[] = rex_i18n::msg('yrewrite_index_status') . '=0';
$index_setting[] = rex_i18n::msg('yrewrite_index_index') . '=1';
$index_setting[] = rex_i18n::msg('yrewrite_index_noindex') . '=-1';
$yform = new rex_yform();
$yform->setObjectparams('form_action', rex_url::backendController(['page' => 'content/edit', 'article_id' => $article_id, 'clang' => $clang, 'ctype' => $ctype], false));
$yform->setObjectparams('form_id', 'yrewrite-seo');
$yform->setObjectparams('form_name', 'yrewrite-seo');
$yform->setHiddenField('yrewrite_func', 'seo');
$yform->setObjectparams('form_showformafterupdate', 1);
$yform->setObjectparams('main_table', rex::getTable('article'));
$yform->setObjectparams('main_id', $article_id);
$yform->setObjectparams('main_where', 'id=' . $article_id . ' and clang_id=' . $clang);
$yform->setObjectparams('getdata', true);
$yform->setValueField('text', ['yrewrite_title', rex_i18n::msg('yrewrite_seotitle')]);
$yform->setValueField('textarea', ['yrewrite_description', rex_i18n::msg('yrewrite_seodescription'), '', '', 'short']);
$yform->setValueField('select', ['yrewrite_changefreq', rex_i18n::msg('yrewrite_changefreq'), implode(',', $select_changefreq), '', rex_yrewrite_seo::$changefreq_default]);
$yform->setValueField('select', ['yrewrite_priority', rex_i18n::msg('yrewrite_priority'), implode(',', $select_priority), '', rex_yrewrite_seo::$priority_default]);
$yform->setValueField('select', ['yrewrite_index', rex_i18n::msg('yrewrite_index'), implode(',', $index_setting), '', rex_yrewrite_seo::$index_setting_default]);
$yform->setActionField('db', [rex::getTable('article'), 'id=' . $article_id . ' and clang_id=' . $clang]);
$yform->setObjectparams('submit_btn_label', $addon->i18n('update_seo'));