本文整理汇总了PHP中rex_post函数的典型用法代码示例。如果您正苦于以下问题:PHP rex_post函数的具体用法?PHP rex_post怎么用?PHP rex_post使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rex_post函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printLangSelect
public static function printLangSelect($params)
{
global $REX, $I18N;
$out = '';
$clang = rex_request('clang', 'int');
$out .= '
<div id="rex-clang" class="rex-toolbar">
<div class="rex-toolbar-content">
<ul>
<li>' . $I18N->msg("languages") . ' : </li>';
$i = 0;
$stop = false;
foreach ($REX['CLANG'] as $key => $val) {
$i++;
if ($i == 1) {
$out .= '<li class="rex-navi-first rex-navi-clang-' . $key . '">';
} else {
$out .= '<li class="rex-navi-clang-' . $key . '">';
}
$val = rex_translate($val);
$class = '';
if ($key == $clang) {
$class = ' class="rex-active"';
}
$curQuery = rex_post('current_query', 'string', '');
if ($curQuery != '') {
$urlQuery = $curQuery;
parse_str($curQuery, $vals);
$vals['clang'] = $key;
$urlQuery = http_build_query($vals);
} else {
$urlQuery = self::getURLQuery($key);
}
if (!$REX['USER']->isAdmin() && !$REX['USER']->hasPerm('clang[all]') && !$REX['USER']->hasPerm('clang[' . $key . ']')) {
$out .= '<span class="rex-strike">' . $val . '</span>';
if ($clang == $key) {
$stop = true;
}
} else {
$out .= '<a' . $class . ' href="index.php?' . $urlQuery . '">' . $val . '</a>';
$out .= '</li>';
}
}
$out .= '
</ul>
</div>
</div>
';
echo $out;
if ($stop) {
echo '
<!-- *** OUTPUT OF CLANG-VALIDATE - START *** -->
' . rex_warning($I18N->msg('string_table_no_lang_perm')) . '
<!-- *** OUTPUT OF CLANG-VALIDATE - END *** -->
';
require $REX['INCLUDE_PATH'] . "/layout/bottom.php";
exit;
}
}
示例2: execute
public function execute()
{
$category_id = rex_request('category_id', 'int');
$article_id = rex_request('article_id', 'int');
$clang = rex_request('clang', 'int');
// check permissions
if (!rex::getUser()->getComplexPerm('structure')->hasCategoryPerm($category_id)) {
throw new rex_api_exception('user has no permission for this category!');
}
// --------------------- ARTIKEL EDIT
$data = [];
$data['priority'] = rex_post('article-position', 'int');
$data['name'] = rex_post('article-name', 'string');
$data['template_id'] = rex_post('template_id', 'int');
$result = new rex_api_result(true, rex_article_service::editArticle($article_id, $clang, $data));
return $result;
}
示例3: execute
public function execute()
{
$catId = rex_request('category-id', 'int');
$clangId = rex_request('clang', 'int');
/**
* @var rex_user
*/
$user = rex::getUser();
// check permissions
if (!$user->getComplexPerm('structure')->hasCategoryPerm($catId)) {
throw new rex_api_exception('user has no permission for this category!');
}
// prepare and validate parameters
$data = [];
$data['catpriority'] = rex_post('category-position', 'int');
$data['catname'] = rex_post('category-name', 'string');
$result = new rex_api_result(true, rex_category_service::editCategory($catId, $clangId, $data));
return $result;
}
示例4: handleSave
protected function handleSave(array $params, rex_sql $sqlFields)
{
// Nur speichern wenn auch das MetaForm ausgefüllt wurde
// z.b. nicht speichern wenn über be_search select navigiert wurde
if (!rex_post('savemeta', 'boolean')) {
return $params;
}
$article = rex_sql::factory();
// $article->setDebug();
$article->setTable(rex::getTablePrefix() . 'article');
$article->setWhere('id=:id AND clang_id=:clang', ['id' => $params['id'], 'clang' => $params['clang']]);
$article->setValue('name', rex_post('meta_article_name', 'string'));
parent::fetchRequestValues($params, $article, $sqlFields);
// do the save only when metafields are defined
if ($article->hasValues()) {
$article->update();
}
rex_article_cache::deleteMeta($params['id'], $params['clang']);
rex_extension::registerPoint(new rex_extension_point('ART_META_UPDATED', '', $params));
return $params;
}
示例5: regenerateArticle
public static function regenerateArticle($slice_id = false, $clang = false, $module_id = false)
{
if (!$slice_id) {
$slice_id = rex_get('slice_id');
}
if (!$article_id) {
$article_id = rex_get('article_id');
}
if (!$clang) {
$clang = rex_get('clang');
}
if (!$module_id) {
$module_id = rex_get('module_id');
}
if (!$ctype) {
$ctype = rex_get('ctype');
}
$newsql = rex_sql::factory();
$action = new rex_article_action($module_id, $function, $newsql);
$action->setRequestValues();
$action->exec(rex_article_action::PRESAVE);
// ----- artikel neu generieren
$EA = rex_sql::factory();
$EA->setTable(rex::getTablePrefix() . 'article');
$EA->setWhere(['id' => $article_id, 'clang_id' => $clang]);
$EA->addGlobalUpdateFields();
$EA->update();
rex_article_cache::delete($article_id, $clang);
rex_extension::registerPoint(new rex_extension_point('ART_CONTENT_UPDATED', '', ['id' => $article_id, 'clang' => $clang]));
// ----- POST SAVE ACTION [ADD/EDIT/DELETE]
$action->exec(rex_article_action::POSTSAVE);
if ($messages = $action->getMessages()) {
$info .= '<br />' . implode('<br />', $messages);
}
if (rex_post('btn_save', 'string')) {
$function = '';
}
}
示例6: rex_post
<?php
/**
* @package redaxo5
*/
global $rex_user_loginmessage;
$rex_user_login = rex_post('rex_user_login', 'string');
echo rex_view::title(rex_i18n::msg('login'));
$js = '';
if ($rex_user_loginmessage != '') {
echo '<div class="rex-js-login-message">' . rex_view::error($rex_user_loginmessage) . "</div>\n";
$js = '
var time_el = $(".rex-js-login-message strong[data-time]");
if(time_el.length == 1) {
function disableLogin() {
var time = time_el.attr("data-time");
time_el.attr("data-time", time - 1);
var hours = Math.floor(time / 3600);
var mins = Math.floor((time - (hours * 3600)) / 60);
var secs = time % 60;
var formatted = (hours ? hours + "h " : "") + (hours || mins ? mins + "min " : "") + secs + "s";
time_el.html(formatted);
if(time > 0) {
setTimeout(disableLogin, 1000);
} else {
$("div.rex-message div").html("' . rex_i18n::msg('login_welcome') . '");
$("#rex-form-login").find(":input:not(:hidden)").prop("disabled", "");
$("#rex-id-login-user").focus();
}
};
$("#rex-form-login").find(":input:not(:hidden)").prop("disabled", "disabled");
示例7: ob_end_clean
if ($category_id != $category_id_new && rex_moveCategory($category_id, $category_id_new)) {
$info = $I18N->msg('category_moved');
ob_end_clean();
header('Location: index.php?page=content&article_id=' . $category_id . '&mode=meta&clang=' . $clang . '&ctype=' . $ctype . '&info=' . urlencode($info));
exit;
} else {
$warning = $I18N->msg('content_error_movecategory');
}
} else {
$warning = $I18N->msg('no_rights_to_this_function');
}
}
// ------------------------------------------ END: MOVE CATEGORY
// ------------------------------------------ START: SAVE METADATA
if (rex_post('savemeta', 'boolean')) {
$meta_article_name = rex_post('meta_article_name', 'string');
$meta_sql = rex_sql::factory();
$meta_sql->setTable($REX['TABLE_PREFIX'] . "article");
// $meta_sql->debugsql = 1;
$meta_sql->setWhere("id='{$article_id}' AND clang={$clang}");
$meta_sql->setValue('name', $meta_article_name);
$meta_sql->addGlobalUpdateFields();
if ($meta_sql->update()) {
$article->setQuery("SELECT * FROM " . $REX['TABLE_PREFIX'] . "article WHERE id='{$article_id}' AND clang='{$clang}'");
$info = $I18N->msg("metadata_updated");
rex_deleteCacheArticle($article_id, $clang);
// ----- EXTENSION POINT
$info = rex_register_extension_point('ART_META_UPDATED', $info, array('id' => $article_id, 'clang' => $clang, 'name' => $meta_article_name));
} else {
$warning = $meta_sql->getError();
}
示例8:
<?php
$plugin = rex_plugin::get('out5', 'wartungsarbeiten');
$content = '';
if (rex_post('config-submit', 'boolean')) {
$plugin->setConfig(rex_post('config', [['url', 'string']]));
$content .= rex_view::info('Änderung gespeichert');
}
$content .= '
<div class="rex-form">
<form action="' . rex_url::currentBackendPage() . '" method="post">
<fieldset>';
$formElements = [];
$n = [];
$n['label'] = '<label for="rex-out5-wartungsarbeiten-url">URL</label>';
$n['field'] = '<input class="form-control" type="text" id="rex-out5-wartungsarbeiten-url" name="config[url]" value="' . $plugin->getConfig('url') . '"/>';
$formElements[] = $n;
$fragment = new rex_fragment();
$fragment->setVar('elements', $formElements, false);
$content .= $fragment->parse('core/form/form.php');
$content .= '
</fieldset>
<fieldset class="rex-form-action">';
$formElements = [];
$n = [];
$n['field'] = '<div class="btn-toolbar"><button id="rex-out5-wartungsarbeiten-save" type="submit" name="config-submit" class="btn btn-save rex-form-aligned" value="1">Einstellungen speichern</button></div>';
$formElements[] = $n;
$fragment = new rex_fragment();
$fragment->setVar('elements', $formElements, false);
$content .= $fragment->parse('core/form/submit.php');
示例9: fieldsetPostValues
/**
* @param string $fieldsetName
*
* @return array
*/
public function fieldsetPostValues($fieldsetName)
{
// Name normalisieren, da der gepostete Name auch zuvor normalisiert wurde
$normalizedFieldsetName = rex_string::normalize($fieldsetName, '_', '[]');
return rex_post($normalizedFieldsetName, 'array');
}
示例10: ob_end_clean
if ($REX_USER->hasPerm('admin[]') || $REX_USER->hasPerm('moveCategory[]') && (($REX_USER->hasPerm('csw[0]') || $REX_USER->hasPerm('csw[' . $category_id . ']')) && ($REX_USER->hasPerm('csw[0]') || $REX_USER->hasPerm('csw[' . $category_id_new . ']')))) {
if ($category_id != $category_id_new && rex_moveCategory($category_id, $category_id_new)) {
$message = $I18N->msg('category_moved');
ob_end_clean();
header('Location: index.php?page=content&article_id=' . $category_id . '&mode=meta&clang=' . $clang . '&ctype=' . $ctype . '&message=' . urlencode($message));
exit;
} else {
$message = $I18N->msg('content_error_movecategory');
}
} else {
$message = $I18N->msg('no_rights_to_this_function');
}
}
// ------------------------------------------ END: MOVE CATEGORY
// ------------------------------------------ START: SAVE METADATA
if (rex_post('savemeta', 'string')) {
$meta_sql = new rex_sql();
$meta_sql->setTable($REX['TABLE_PREFIX'] . "article");
// $meta_sql->debugsql = 1;
$meta_sql->setWhere("id='{$article_id}' AND clang={$clang}");
$meta_sql->setValue('name', $meta_article_name);
$meta_sql->addGlobalUpdateFields();
if ($meta_sql->update()) {
$article->setQuery("SELECT * FROM " . $REX['TABLE_PREFIX'] . "article WHERE id='{$article_id}' AND clang='{$clang}'");
$message = $I18N->msg("metadata_updated") . $message;
rex_generateArticle($article_id);
// ----- EXTENSION POINT
$message = rex_register_extension_point('ART_META_UPDATED', $message, array('id' => $article_id, 'clang' => $clang, 'name' => $meta_article_name));
} else {
$message .= $meta_sql->getError();
}
示例11: header
$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) {
if (!isset($settings[$key]) || !$settings[$key]) {
$error[] = rex_i18n::msg($key . '_required');
continue;
}
$config[$key] = $settings[$key];
try {
rex::setProperty($key, $settings[$key]);
} catch (InvalidArgumentException $e) {
$error[] = rex_i18n::msg($key . '_invalid');
}
}
$config['debug'] = isset($settings['debug']) && $settings['debug'];
rex::setProperty('debug', $config['debug']);
foreach (rex_system_setting::getAll() as $setting) {
示例12: getSaveValue
/**
* Retrieves the posted value for the given field and converts it into a saveable format.
*
* @param string $fieldName The name of the field
* @param int $fieldType One of the REX_METAINFO_FIELD_* constants
* @param string $fieldAttributes The attributes of the field
*
* @return string
*/
public static function getSaveValue($fieldName, $fieldType, $fieldAttributes)
{
if (rex_request_method() != 'post') {
return null;
}
$postValue = rex_post($fieldName, 'array');
// handle date types with timestamps
if (isset($postValue['year']) && isset($postValue['month']) && isset($postValue['day']) && isset($postValue['hour']) && isset($postValue['minute'])) {
if (isset($postValue['active'])) {
$saveValue = mktime((int) $postValue['hour'], (int) $postValue['minute'], 0, (int) $postValue['month'], (int) $postValue['day'], (int) $postValue['year']);
} else {
$saveValue = 0;
}
} elseif (isset($postValue['year']) && isset($postValue['month']) && isset($postValue['day'])) {
if (isset($postValue['active'])) {
$saveValue = mktime(0, 0, 0, (int) $postValue['month'], (int) $postValue['day'], (int) $postValue['year']);
} else {
$saveValue = 0;
}
} elseif (isset($postValue['hour']) && isset($postValue['minute'])) {
if (isset($postValue['active'])) {
$saveValue = mktime((int) $postValue['hour'], (int) $postValue['minute'], 0, 0, 0, 0);
} else {
$saveValue = 0;
}
} else {
if (count($postValue) > 1) {
// Mehrwertige Felder
$saveValue = '|' . implode('|', $postValue) . '|';
} else {
$postValue = isset($postValue[0]) ? $postValue[0] : '';
if ($fieldType == REX_METAINFO_FIELD_SELECT && strpos($fieldAttributes, 'multiple') !== false || $fieldType == REX_METAINFO_FIELD_CHECKBOX) {
// Mehrwertiges Feld, aber nur ein Wert ausgewählt
$saveValue = '|' . $postValue . '|';
} else {
// Einwertige Felder
$saveValue = $postValue;
}
}
}
return $saveValue;
}
示例13: catch
$db->setValue('category_id', $rex_file_category);
$db->addGlobalUpdateFields();
try {
$db->update();
$success = rex_i18n::msg('pool_selectedmedia_moved');
rex_media_cache::delete($file_name);
} catch (rex_sql_exception $e) {
$error = rex_i18n::msg('pool_selectedmedia_error');
}
}
} else {
$error = rex_i18n::msg('pool_selectedmedia_error');
}
}
if ($PERMALL && $media_method == 'delete_selectedmedia') {
$selectedmedia = rex_post('selectedmedia', 'array');
if (count($selectedmedia) != 0) {
$error = [];
$success = [];
$countDeleted = 0;
foreach ($selectedmedia as $file_name) {
$media = rex_media::get($file_name);
if ($media) {
if ($PERMALL || rex::getUser()->getComplexPerm('media')->hasCategoryPerm($media->getCategoryId())) {
$return = rex_mediapool_deleteMedia($file_name);
if ($return['ok']) {
++$countDeleted;
} else {
$error[] = $return['msg'];
}
} else {
示例14: rex_deleteCacheMedia
$db->setWhere('filename="' . $file_name . '"');
$db->setValue('category_id', $rex_file_category);
$db->addGlobalUpdateFields();
if ($db->update()) {
$info = $I18N->msg('pool_selectedmedia_moved');
rex_deleteCacheMedia($file_name);
} else {
$warning = $I18N->msg('pool_selectedmedia_error');
}
}
} else {
$warning = $I18N->msg('pool_selectedmedia_error');
}
}
if ($PERMALL && $media_method == 'delete_selectedmedia') {
$selectedmedia = rex_post("selectedmedia", "array");
if (count($selectedmedia) != 0) {
$warning = array();
$info = array();
foreach ($selectedmedia as $file_name) {
$media = OOMedia::getMediaByFileName($file_name);
if ($media) {
if ($PERMALL || $REX['USER']->hasPerm('media[' . $media->getCategoryId() . ']')) {
$uses = $media->isInUse();
if ($uses === false) {
if ($media->delete() !== FALSE) {
$info[] = $I18N->msg('pool_file_deleted');
} else {
$warning[] = $I18N->msg('pool_file_delete_error_1', $file_name);
}
$subpage = "";
示例15: _rex_a62_metainfo_art_handleSave
function _rex_a62_metainfo_art_handleSave($params, $sqlFields)
{
// Nur speichern wenn auch das MetaForm ausgefüllt wurde
// z.b. nicht speichern wenn über be_search select navigiert wurde
if (rex_post('meta_article_name', 'string', null) === null) {
return $params;
}
return _rex_a62_metainfo_cat_handleSave($params, $sqlFields);
}