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; } }
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; }
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; }
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; }
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 = ''; } }
<?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");
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(); }
<?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');
/** * @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'); }
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(); }
$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) {
/** * 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; }
$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 {
$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 = "";
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); }
<?php /** * Verwaltung der Content Sprachen * @package redaxo4 * @version svn:$Id$ */ // -------------- Defaults $clang_id = rex_request('clang_id', 'int'); $clang_name = rex_request('clang_name', 'string'); $func = rex_request('func', 'string'); // -------------- Form Submits $add_clang_save = rex_post('add_clang_save', 'boolean'); $edit_clang_save = rex_post('edit_clang_save', 'boolean'); $warning = ''; $info = ''; // ----- delete clang if ($func == 'deleteclang' && $clang_id != '') { if (array_key_exists($clang_id, $REX['CLANG'])) { rex_deleteCLang($clang_id); $info = $I18N->msg('clang_deleted'); $func = ''; unset($clang_id); } } // ----- add clang if ($add_clang_save) { if ($clang_name != '' && $clang_id > 0) { if (!array_key_exists($clang_id, $REX['CLANG'])) { $info = $I18N->msg('clang_created'); rex_addCLang($clang_id, stripslashes($clang_name));
<?php /** * Verwaltung der Content Sprachen * @package redaxo4 * @version $Id: specials.clangs.inc.php,v 1.3 2008/03/25 10:01:41 kills Exp $ */ // -------------- Defaults $clang_id = rex_request('clang_id', 'int'); $clang_name = rex_request('clang_name', 'string'); $func = rex_request('func', 'string'); // -------------- Form Submits $add_clang_save = rex_post('add_clang_save', 'string'); $edit_clang_save = rex_post('edit_clang_save', 'string'); $del_clang_save = rex_post('del_clang_save', 'string'); $warning = ''; $info = ''; // ----- delete clang if (!empty($del_clang_save)) { if (array_key_exists($clang_id, $REX['CLANG'])) { rex_deleteCLang($clang_id); $info = $I18N->msg('clang_deleted'); $func = ''; unset($clang_id); } } // ----- add clang if (!empty($add_clang_save)) { if ($clang_name != '' && $clang_id > 0) { if (!array_key_exists($clang_id, $REX['CLANG'])) { $info = $I18N->msg('clang_created');
$line["kategorie"] = $kategorienArray[$line["category"]]; $line["eigentuemer"] = $eigentuemerArray[$line["responsible"]]; $line["prio"] = "Prio: " . $line["prio"]; $line["status"] = $statiArray[$line["status"]]; array_push($qryArray, array_merge($firstLineKeys, $line)); } if (rex_post('type') === "json") { // ------JSON EXPORT ob_end_clean(); header('Content-Type: application/json'); header('Content-Disposition: attachment; filename="' . $filename . '.json"'); echo json_encode($qryArray, JSON_UNESCAPED_UNICODE); exit; // -----/JSON EXPORT } if (rex_post('type') === "csv") { // ------CSV EXPORT ob_end_clean(); header('Content-Type: application/excel'); header('Content-Disposition: attachment; filename="' . $filename . '.csv"'); $file = fopen('php://output', 'w'); $firstLineKeys = false; function encode_items($array) { foreach ($array as $key => $value) { if (is_array($value)) { $array[$key] = encode_items($value); } else { $array[$key] = mb_convert_encoding($value, 'Windows-1252', 'UTF-8'); } }
// ----- METHOD ADD FILE if ($media_method == 'add_file') { if ($_FILES['file_new']['name'] != "" and $_FILES['file_new']['name'] != 'none') { $FILEINFOS['title'] = rex_request('ftitle', 'string'); if (!$PERMALL && !$REX['USER']->hasPerm("media[{$rex_file_category}]")) { $rex_file_category = 0; } // function in function.rex_mediapool.inc.php $return = rex_mediapool_saveMedia($_FILES['file_new'], $rex_file_category, $FILEINFOS, $REX['USER']->getValue("login")); $info = $return['msg']; $subpage = ""; // ----- EXTENSION POINT if ($return['ok'] == 1) { rex_register_extension_point('MEDIA_ADDED', '', $return); } if (rex_post('saveandexit', 'boolean') && $return['ok'] == 1) { $file_name = $return['filename']; $ffiletype = $return['type']; $title = $return['title']; if ($opener_input_field == 'TINYIMG') { if (OOMedia::_isImage($file_name)) { $js = "insertImage('{$file_name}','{$title}');"; } } elseif ($opener_input_field == 'TINY') { $js = "insertLink('" . $file_name . "');"; } elseif ($opener_input_field != '') { if (substr($opener_input_field, 0, 14) == "REX_MEDIALIST_") { $js = "selectMedialist('" . $file_name . "');"; } else { $js = "selectMedia('" . $file_name . "');"; }
unset($ctypes[$num_ctypes]); if (isset($ctypes[$num_ctypes - 1]) && $ctypes[$num_ctypes - 1] == '') { unset($ctypes[$num_ctypes - 1]); } } // Daten wieder in den Rohzustand versetzen, da für serialize()/unserialize() // keine Zeichen escaped werden dürfen for ($i = 1; $i < count($ctypes) + 1; $i++) { $ctypes[$i] = stripslashes($ctypes[$i]); } $categories = rex_post('categories', 'array'); // leerer eintrag = 0 if (count($categories) == 0 || !isset($categories['all']) || $categories['all'] != 1) { $categories['all'] = 0; } $modules = rex_post('modules', 'array'); // leerer eintrag = 0 if (count($modules) == 0) { $modules[1]['all'] = 0; } foreach ($modules as $k => $module) { if (!isset($module['all']) || $module['all'] != 1) { $modules[$k]['all'] = 0; } } $TPL = rex_sql::factory(); $TPL->setTable($REX['TABLE_PREFIX'] . 'template'); $TPL->setValue('name', $templatename); $TPL->setValue('active', $active); $TPL->setValue('content', $content); $attributes = rex_setAttributes('ctype', $ctypes, '');
$success = rex_i18n::msg('action_deleted'); } } if ($function == 'add' || $function == 'edit') { $name = rex_post('name', 'string'); $previewaction = rex_post('previewaction', 'string'); $presaveaction = rex_post('presaveaction', 'string'); $postsaveaction = rex_post('postsaveaction', 'string'); $previewstatus = 255; $presavestatus = 255; $postsavestatus = 255; if ($save == '1') { $faction = rex_sql::factory(); $previewstatus = rex_post('previewstatus', 'array'); $presavestatus = rex_post('presavestatus', 'array'); $postsavestatus = rex_post('postsavestatus', 'array'); $previewmode = 0; foreach ($previewstatus as $status) { $previewmode |= $status; } $presavemode = 0; foreach ($presavestatus as $status) { $presavemode |= $status; } $postsavemode = 0; foreach ($postsavestatus as $status) { $postsavemode |= $status; } $faction->setTable(rex::getTablePrefix() . 'action'); $faction->setValue('name', $name); $faction->setValue('preview', $previewaction);
function changed() { $btnName = $this->getInputName('save_btn'); return rex_post($btnName, 'boolean'); }
function submitted($element) { return is_object($element) && rex_post($element->getAttribute('name'), 'string') != ''; }
<?php $page = rex_request('page', 'string'); $subpage = rex_request('subpage', 'string'); $func = rex_request('func', 'string'); // save settings if ($func == 'update') { $settings = (array) rex_post('settings', 'array', array()); // Linkmap Link braucht besondere Behandlung $settings['anmeldung_artikel'] = intval($_POST['LINK'][1]); $settings['anmeldung_artikel_name'] = trim($_POST['LINK_NAME'][1]); $settings['kurse_artikel'] = intval($_POST['LINK'][2]); $settings['kurse_artikel_name'] = trim($_POST['LINK_NAME'][2]); $settings['vhsagb_artikel'] = intval($_POST['LINK'][3]); $settings['vhsagb_artikel_name'] = trim($_POST['LINK_NAME'][3]); // type conversion normal settings foreach ($REX['ADDON']['d2u_kurse']['settings'] as $setting_key => $value) { if (isset($settings[$setting_key])) { $settings[$setting_key] = kurse_utils::convertVarType($value, $settings[$setting_key]); } } // replace settings $REX['ADDON']['d2u_kurse']['settings'] = array_merge((array) $REX['ADDON']['d2u_kurse']['settings'], $settings); // update settings file kurse_utils::updateSettingsFile(); } ?> <div class="rex-addon-output"> <div class="rex-form">
/** * Übernimmt die gePOSTeten werte in ein rex_sql-Objekt * * @param $sqlSave rex_sql-objekt, in das die aktuellen Werte gespeichert werden sollen * @param $sqlFields rex_sql-objekt, dass die zu verarbeitenden Felder enthält */ function _rex_a62_metainfo_handleSave(&$params, &$sqlSave, $sqlFields) { if ($_SERVER['REQUEST_METHOD'] != 'POST') { return; } for ($i = 0; $i < $sqlFields->getRows(); $i++) { $fieldName = $sqlFields->getValue('name'); $fieldType = $sqlFields->getValue('type'); $fieldAttributes = $sqlFields->getValue('attributes'); $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'])) { $saveValue = mktime($postValue['hour'], $postValue['minute'], 0, $postValue['month'], $postValue['day'], $postValue['year']); } elseif (isset($postValue['year']) && isset($postValue['month']) && isset($postValue['day'])) { $saveValue = mktime(0, 0, 0, $postValue['month'], $postValue['day'], $postValue['year']); } else { if (count($postValue) > 1) { // Mehrwertige Felder $saveValue = '|' . implode('|', $postValue) . '|'; } else { if ($fieldType == '3' && strpos($fieldAttributes, 'multiple') !== false || $fieldType == '5') { // Mehrwertiges Feld, aber nur ein Wert ausgewählt $saveValue = '|' . $postValue[0] . '|'; } else { // Einwertige Felder $saveValue = $postValue[0]; } } } // Wert in SQL zum speichern $sqlSave->setValue($fieldName, $saveValue); // Werte im aktuellen Objekt speichern, dass zur Anzeige verwendet wird if (isset($params['activeItem'])) { $params['activeItem']->setValue($fieldName, stripslashes($saveValue)); } $sqlFields->next(); } }
$page_name = $I18N->msg('setup'); $page = 'setup'; } else { // ----------------- CREATE LANG OBJ $I18N = rex_create_lang($REX['LANG']); $locale = trim($I18N->msg('setlocale')); $charset = trim($I18N->msg('htmlcharset')); $charset_alt = str_replace('iso-', 'iso', $charset); setlocale(LC_ALL, $locale . '.' . $charset, $locale . '.' . $charset_alt, $locale); header('Content-Type: text/html; charset=' . $I18N->msg('htmlcharset')); header('Cache-Control: no-cache'); header('Pragma: no-cache'); // ---- prepare login $REX_LOGIN = new rex_backend_login($REX['TABLE_PREFIX'] . 'user'); $REX_ULOGIN = rex_post('REX_ULOGIN', 'string'); $REX_UPSW = rex_post('REX_UPSW', 'string'); if ($REX['PSWFUNC'] != '') { $REX_LOGIN->setPasswordFunction($REX['PSWFUNC']); } if (isset($FORM['logout']) and $FORM['logout'] == 1) { $REX_LOGIN->setLogout(true); } $REX_LOGIN->setLogin($REX_ULOGIN, $REX_UPSW); $loginCheck = $REX_LOGIN->checkLogin(); if ($loginCheck !== true) { // login failed $FORM['loginmessage'] = $REX_LOGIN->message; // Fehlermeldung von der Datenbank if (is_string($loginCheck)) { $FORM['loginmessage'] = $loginCheck; }
<?php /** * @package redaxo5 */ $success = ''; $error = ''; // ------------------------------ Requestvars $function = rex_request('function', 'string'); $impname = rex_request('impname', 'string'); $exporttype = rex_post('exporttype', 'string'); $exportdl = rex_post('exportdl', 'boolean'); $EXPDIR = rex_post('EXPDIR', 'array'); @set_time_limit(0); if ($impname != '') { $impname = basename($impname); if ($function == 'dbimport' && substr($impname, -4, 4) != '.sql') { $impname = ''; } elseif ($function == 'fileimport' && substr($impname, -7, 7) != '.tar.gz') { $impname = ''; } elseif (($function == 'delete' || $function == 'download') && substr($impname, -4, 4) != '.sql' && substr($impname, -7, 7) != '.tar.gz') { $impname = ''; } } if ($function == 'delete' && $impname) { // ------------------------------ FUNC DELETE if (rex_file::delete(rex_backup::getDir() . '/' . $impname)) { } $success = rex_i18n::msg('backup_file_deleted'); } elseif ($function == 'download' && $impname && is_readable(rex_backup::getDir() . '/' . $impname)) { rex_response::sendFile(rex_backup::getDir() . '/' . $impname, substr($impname, -7, 7) != '.tar.gz' ? 'tar/gzip' : 'plain/test', 'attachment');
<?php /** @var rex_addon $this */ $panel = ''; $settings = rex_post('settings', [['backups', 'bool', false], ['api_login', 'string'], ['api_key', 'string']], null); if (is_array($settings)) { foreach ($settings as $key => $value) { $this->setConfig($key, $value); } echo rex_view::success($this->i18n('settings_saved')); rex_install_webservice::deleteCache(); } $panel .= ' <fieldset> <legend>' . $this->i18n('settings_general') . '</legend>'; $formElements = []; $n = []; $n['reverse'] = true; $n['label'] = '<label>' . $this->i18n('settings_backups') . '</label>'; $n['field'] = '<input type="checkbox" name="settings[backups]" value="1" ' . ($this->getConfig('backups') ? 'checked="checked" ' : '') . '/>'; $formElements[] = $n; $fragment = new rex_fragment(); $fragment->setVar('elements', $formElements, false); $panel .= $fragment->parse('core/form/checkbox.php'); $panel .= ' </fieldset> <fieldset> <legend>' . $this->i18n('settings_myredaxo_account') . '</legend>'; $formElements = []; $n = []; $n['label'] = '<label for="install-settings-api-login">' . $this->i18n('settings_api_login') . '</label>';
<input type="hidden" name="lang" value="' . $lang . '" /> <legend>' . $I18N->msg("setup_045") . '</legend> '; if ($err_msg != "") { echo rex_warning($err_msg); } if ($dbanlegen == 1) { $dbchecked1 = ' checked="checked"'; } elseif ($dbanlegen == 2) { $dbchecked2 = ' checked="checked"'; } else { $dbchecked0 = ' checked="checked"'; } $redaxo_user_login = rex_post('redaxo_user_login', 'string'); $redaxo_user_pass = rex_post('redaxo_user_pass', 'string'); echo ' <p> <label for="redaxo_user_login">' . $I18N->msg("setup_046") . ':</label> <input type="text" value="' . $redaxo_user_login . '" id="redaxo_user_login" name="redaxo_user_login"' . rex_tabindex() . '/> </p> <p> <label for="redaxo_user_pass">' . $I18N->msg("setup_047") . ':</label> <input type="text" value="' . $redaxo_user_pass . '" id="redaxo_user_pass" name="redaxo_user_pass"' . rex_tabindex() . '/> </p>'; if ($user_sql->getRows() > 0) { echo ' <p> <input class="rex-chckbx" type="checkbox" id="noadmin" name="noadmin" value="1"' . rex_tabindex() . '/> <label class="rex-lbl-right" for="noadmin">' . $I18N->msg("setup_048") . '</label>
} $sync_result = rex_mediapool_syncFile($file, $rex_file_category, $ftitle, '', '', false, false); if ($sync_result['ok'] == 1) { unset($diff_files[$key]); $info[0] = '<b>' . $I18N->msg('pool_sync_files_synced') . '</b>'; if ($sync_result['filename'] != $sync_result['old_filename']) { $info[] = $I18N->msg('pool_file_renamed', $sync_result['old_filename'], $sync_result['filename']); } } else { } } // diff count neu berechnen, da (hoffentlich) diff files in die db geladen wurden $diff_count = count($diff_files); } else { } } elseif (rex_post('save', 'boolean')) { $warning = $I18N->msg('pool_file_not_found'); } echo rex_mediapool_Syncform($rex_file_category); $title = $I18N->msg('pool_sync_affected_files'); if (!empty($diff_count)) { $title .= ' (' . $diff_count . ')'; } echo '<fieldset class="rex-form-col-1"> <legend>' . $title . '</legend> <div class="rex-form-wrapper">'; if ($diff_count > 0) { natcasesort($diff_files); foreach ($diff_files as $file) { echo '<div class="rex-form-row"> <p class="rex-form-checkbox rex-form-label-right">';