本文整理汇总了PHP中Cx\Core\Setting\Controller\Setting::storeFromPost方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::storeFromPost方法的具体用法?PHP Setting::storeFromPost怎么用?PHP Setting::storeFromPost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cx\Core\Setting\Controller\Setting
的用法示例。
在下文中一共展示了Setting::storeFromPost方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parsePage
/**
* Use this to parse your backend page
*
* You will get the template located in /View/Template/{CMD}.html
* You can access Cx class using $this->cx
* To show messages, use \Message class
* @param \Cx\Core\Html\Sigma $template Template for current CMD
* @param array $cmd CMD separated by slashes
* @global array $_ARRAYLANG Language data
*/
public function parsePage(\Cx\Core\Html\Sigma $template, array $cmd)
{
global $_ARRAYLANG;
// Parse entity view generation pages
$entityClassName = $this->getNamespace() . '\\Model\\Entity\\' . current($cmd);
if (in_array($entityClassName, $this->getEntityClasses())) {
$this->parseEntityClassPage($template, $entityClassName, current($cmd));
return;
}
// Not an entity, parse overview or settings
switch (current($cmd)) {
case 'Settings':
\Cx\Core\Setting\Controller\Setting::init('Wysiwyg', 'config', 'Yaml');
if (isset($_POST) && isset($_POST['bsubmit'])) {
\Cx\Core\Setting\Controller\Setting::set('specificStylesheet', isset($_POST['specificStylesheet']) ? 1 : 0);
\Cx\Core\Setting\Controller\Setting::set('replaceActualContents', isset($_POST['replaceActualContents']) ? 1 : 0);
\Cx\Core\Setting\Controller\Setting::storeFromPost();
}
$i = 0;
if (!\Cx\Core\Setting\Controller\Setting::isDefined('specificStylesheet') && !\Cx\Core\Setting\Controller\Setting::add('specificStylesheet', '0', ++$i, \Cx\Core\Setting\Controller\Setting::TYPE_CHECKBOX, '1', 'config')) {
throw new \Exception("Failed to add new configuration option");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('replaceActualContents') && !\Cx\Core\Setting\Controller\Setting::add('replaceActualContents', '0', ++$i, \Cx\Core\Setting\Controller\Setting::TYPE_CHECKBOX, '1', 'config')) {
throw new \Exception("Failed to add new configuration option");
}
$tmpl = new \Cx\Core\Html\Sigma();
\Cx\Core\Setting\Controller\Setting::show($tmpl, 'index.php?cmd=Config&act=Wysiwyg&tpl=Settings', $_ARRAYLANG['TXT_CORE_WYSIWYG'], $_ARRAYLANG['TXT_CORE_WYSIWYG_ACT_SETTINGS'], 'TXT_CORE_WYSIWYG_');
$template->setVariable('WYSIWYG_CONFIG_TEMPLATE', $tmpl->get());
break;
case '':
default:
if ($template->blockExists('overview')) {
$template->touchBlock('overview');
}
break;
}
}
示例2: showSettings
/**
* Set the cms system settings
* @global ADONewConnection
* @global array Core language
* @global \Cx\Core\Html\Sigma
*/
function showSettings()
{
global $objTemplate, $_ARRAYLANG;
$template = new \Cx\Core\Html\Sigma();
$objTemplate->addBlockfile('ADMIN_CONTENT', 'settings_system', 'settings.html');
$templateObj = new \Cx\Core\Html\Sigma(ASCMS_CORE_PATH . '/Config/View/Template/Backend');
$templateObj->loadTemplateFile('development_tools.html');
$templateObj->setVariable(array('TXT_TITLE_SET5' => $_ARRAYLANG['TXT_SETTINGS_TITLE_DEVELOPMENT'], 'TXT_DEBUGGING_STATUS' => $_ARRAYLANG['TXT_DEBUGGING_STATUS'], 'TXT_DEBUGGING_FLAGS' => $_ARRAYLANG['TXT_DEBUGGING_FLAGS'], 'TXT_SETTINGS_DEBUGGING_FLAG_LOG' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_LOG'], 'TXT_SETTINGS_DEBUGGING_FLAG_PHP' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_PHP'], 'TXT_SETTINGS_DEBUGGING_FLAG_DB' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_DB'], 'TXT_SETTINGS_DEBUGGING_FLAG_DB_TRACE' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_DB_TRACE'], 'TXT_SETTINGS_DEBUGGING_FLAG_DB_CHANGE' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_DB_CHANGE'], 'TXT_SETTINGS_DEBUGGING_FLAG_DB_ERROR' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_DB_ERROR'], 'TXT_SETTINGS_DEBUGGING_FLAG_LOG_FILE' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_LOG_FILE'], 'TXT_SETTINGS_DEBUGGING_FLAG_LOG_FIREPHP' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_LOG_FIREPHP'], 'TXT_DEBUGGING_EXPLANATION' => $_ARRAYLANG['TXT_DEBUGGING_EXPLANATION'], 'TXT_SAVE_CHANGES' => $_ARRAYLANG['TXT_SAVE'], 'TXT_RADIO_ON' => $_ARRAYLANG['TXT_ACTIVATED'], 'TXT_RADIO_OFF' => $_ARRAYLANG['TXT_DEACTIVATED']));
if (in_array('SystemInfo', \Env::get('cx')->getLicense()->getLegalComponentsList())) {
if (isset($_POST['debugging'])) {
$this->updateDebugSettings($_POST['debugging']);
}
$this->setDebuggingVariables($templateObj);
}
\Cx\Core\Setting\Controller\Setting::init('Config', null, 'Yaml', null, \Cx\Core\Setting\Controller\Setting::REPOPULATE);
\Cx\Core\Setting\Controller\Setting::storeFromPost();
\Cx\Core\Setting\Controller\Setting::setEngineType('Config', 'Yaml', 'site');
\Cx\Core\Setting\Controller\Setting::show($template, 'index.php?cmd=Config', $_ARRAYLANG['TXT_CORE_CONFIG_SITE'], $_ARRAYLANG['TXT_CORE_CONFIG_SITE'], 'TXT_CORE_CONFIG_', !$this->isWritable());
\Cx\Core\Setting\Controller\Setting::setEngineType('Config', 'Yaml', 'contactInformation');
\Cx\Core\Setting\Controller\Setting::show($template, 'index.php?cmd=Config', $_ARRAYLANG['TXT_CORE_CONFIG_CONTACTINFORMATION'], $_ARRAYLANG['TXT_CORE_CONFIG_CONTACTINFORMATION'], 'TXT_CORE_CONFIG_', !$this->isWritable());
\Cx\Core\Setting\Controller\Setting::setEngineType('Config', 'Yaml', 'administrationArea');
\Cx\Core\Setting\Controller\Setting::show($template, 'index.php?cmd=Config', $_ARRAYLANG['TXT_CORE_CONFIG_ADMINISTRATIONAREA'], $_ARRAYLANG['TXT_CORE_CONFIG_ADMINISTRATIONAREA'], 'TXT_CORE_CONFIG_', !$this->isWritable());
\Cx\Core\Setting\Controller\Setting::setEngineType('Config', 'Yaml', 'security');
\Cx\Core\Setting\Controller\Setting::show($template, 'index.php?cmd=Config', $_ARRAYLANG['TXT_CORE_CONFIG_SECURITY'], $_ARRAYLANG['TXT_CORE_CONFIG_SECURITY'], 'TXT_CORE_CONFIG_', !$this->isWritable());
if (in_array('SystemInfo', \Env::get('cx')->getLicense()->getLegalComponentsList())) {
\Cx\Core\Setting\Controller\Setting::show_external($template, $_ARRAYLANG['TXT_SETTINGS_TITLE_DEVELOPMENT'], $templateObj->get());
}
\Cx\Core\Setting\Controller\Setting::setEngineType('Config', 'Yaml', 'otherConfigurations');
\Cx\Core\Setting\Controller\Setting::show($template, 'index.php?cmd=Config', $_ARRAYLANG['TXT_CORE_CONFIG_OTHERCONFIGURATIONS'], $_ARRAYLANG['TXT_CORE_CONFIG_OTHERCONFIGURATIONS'], 'TXT_CORE_CONFIG_', !$this->isWritable());
// show also hidden settins
if (in_array('SystemInfo', \Env::get('cx')->getLicense()->getLegalComponentsList()) && \Permission::hasAllAccess() && isset($_GET['all'])) {
\Cx\Core\Setting\Controller\Setting::setEngineType('Config', 'Yaml', 'core');
\Cx\Core\Setting\Controller\Setting::show($template, 'index.php?cmd=Config', 'CORE', 'CORE', 'TXT_CORE_CONFIG_', true);
\Cx\Core\Setting\Controller\Setting::setEngineType('Config', 'Yaml', 'release');
\Cx\Core\Setting\Controller\Setting::show($template, 'index.php?cmd=Config', 'RELEASE', 'RELEASE', 'TXT_CORE_CONFIG_', true);
\Cx\Core\Setting\Controller\Setting::setEngineType('Config', 'Yaml', 'component');
\Cx\Core\Setting\Controller\Setting::show($template, 'index.php?cmd=Config', 'COMPONENT', 'COMPONENT', 'TXT_CORE_CONFIG_', !$this->isWritable());
\Cx\Core\Setting\Controller\Setting::setEngineType('Config', 'Yaml', 'license');
\Cx\Core\Setting\Controller\Setting::show($template, 'index.php?cmd=Config', 'LICENSE', 'LICENSE', 'TXT_CORE_CONFIG_', true);
\Cx\Core\Setting\Controller\Setting::setEngineType('Config', 'Yaml', 'cache');
\Cx\Core\Setting\Controller\Setting::show($template, 'index.php?cmd=Config', 'CACHE', 'CACHE', 'TXT_CORE_CONFIG_', true);
}
$this->checkFtpAccess();
$objTemplate->setVariable('SETTINGS_TABLE', $template->get());
$objTemplate->parse('settings_system');
}
示例3: testStoreFromPost
public function testStoreFromPost()
{
\DBG::log('*** testStoreFromPost ***');
global $_POST, $_FILES;
Setting::init('MultiSiteTest', 'posttestgroup', 'FileSystem');
//Setting::add('key10.1', '', false, Setting::TYPE_FILEUPLOAD);
Setting::add('key10.2', '', false, Setting::TYPE_CHECKBOX);
Setting::add('key10.3', '', false, Setting::TYPE_CHECKBOXGROUP);
Setting::add('key10.4', '');
$_POST = array('key10.2' => 'postcheckboxvalue10', 'key10.3' => array_flip(array(1, 2, 3, 4, 5, 6)), 'key10.4' => 'postvalue10');
try {
Setting::storeFromPost();
} catch (Exception $e) {
} finally {
Setting::init('MultiSiteTest', 'posttestgroup', 'FileSystem');
$this->assertEquals('postcheckboxvalue10', Setting::getValue('key10.2'));
$this->assertEquals('1,2,3,4,5,6', Setting::getValue('key10.3'));
$this->assertEquals('postvalue10', Setting::getValue('key10.4'));
Setting::init('MultiSiteTest', null, 'FileSystem');
Setting::deleteModule();
}
}
示例4: storeSettings
static function storeSettings()
{
\Cx\Core\Setting\Controller\Setting::storeFromPost();
}
示例5: saveSettings
/**
* Validate and save the settings from $_POST into the database.
*
* @global ADONewConnection
* @global array
*/
function saveSettings()
{
global $objDatabase, $_ARRAYLANG;
//On-Off-Settings can only be 0 or 1.
$arrOnOffValues = array('frmSettings_CommentsAllow' => 'data_comments_activated', 'frmSettings_CommentsAllowAnonymous' => 'data_comments_anonymous', 'frmSettings_CommentsAutoActivate' => 'data_comments_autoactivate', 'frmSettings_CommentsNotification' => 'data_comments_notification', 'frmSettings_VotingAllow' => 'data_voting_activated', 'frmSettings_BlockActivated' => 'data_block_activated', 'frmSettings_RssActivated' => 'data_rss_activated');
//Integer-Settings [0 .. infinite]
$arrIntegerValues = array('frmSettings_CommentsTimeout' => 'data_comments_timeout', 'frmSettings_GeneralIntroduction' => 'data_general_introduction', 'frmSettings_BlockNumberOfMessages' => 'data_block_messages', 'frmSettings_RssNumberOfMessages' => 'data_rss_messages', 'frmSettings_RssNumberOfComments' => 'data_rss_comments', 'frmSettings_TagHitlist' => 'data_tags_hitlist', 'frmSettings_frontendPage' => 'data_target_cmd', 'frmSettings_shadowbox_width' => 'data_shadowbox_width', 'frmSettings_shadowbox_height' => 'data_shadowbox_height');
// String Settings
$arrTextValues = array('frmSettings_templateCategory' => 'data_template_category', 'frmSettings_templateEntry' => 'data_template_entry', 'frmSettings_templateShadowbox' => 'data_template_shadowbox');
//Enum-Settings, must be a value of a given list
$arrEnumValues = array('frmSettings_CommentsEditor' => 'data_comments_editor', 'frmSettings_action' => 'data_entry_action');
$arrEnumPossibilities = array('frmSettings_CommentsEditor' => 'wysiwyg,textarea', 'frmSettings_action' => 'content,overlaybox');
foreach ($_POST as $strKey => $strValue) {
if (key_exists($strKey, $arrOnOffValues)) {
$objDatabase->Execute(' UPDATE ' . DBPREFIX . 'module_data_settings
SET `value` = "' . intval($strValue) . '"
WHERE `name` = "' . $arrOnOffValues[$strKey] . '"
');
}
if (key_exists($strKey, $arrIntegerValues)) {
$objDatabase->Execute(' UPDATE ' . DBPREFIX . 'module_data_settings
SET `value` = "' . abs(intval($strValue)) . '"
WHERE `name` = "' . $arrIntegerValues[$strKey] . '"
');
}
if (key_exists($strKey, $arrEnumValues)) {
$arrSplit = explode(',', $arrEnumPossibilities[$strKey]);
if (in_array($strValue, $arrSplit)) {
$objDatabase->Execute(' UPDATE ' . DBPREFIX . 'module_data_settings
SET `value` = "' . $strValue . '"
WHERE `name` = "' . $arrEnumValues[$strKey] . '"
');
}
}
if (key_exists($strKey, $arrTextValues)) {
$objDatabase->Execute(" UPDATE " . DBPREFIX . "module_data_settings\n SET `value` = '" . contrexx_addslashes(trim($strValue)) . "'\n WHERE `name`= '" . $arrTextValues[$strKey] . "'\n ");
}
}
\Cx\Core\Setting\Controller\Setting::init('Config', 'component', 'Yaml');
\Cx\Core\Setting\Controller\Setting::set('dataUseModule', isset($_POST['frmSettings_useDatalist']) ? 1 : 0);
\Cx\Core\Setting\Controller\Setting::storeFromPost();
$this->_arrSettings = $this->createSettingsArray();
$this->_strOkMessage = $_ARRAYLANG['TXT_DATA_SETTINGS_SAVE_SUCCESSFULL'];
}
示例6: showOverview
/**
* Display GeoIp settings
*/
public function showOverview()
{
global $_ARRAYLANG;
//save the setting values
if (isset($_POST['bsubmit'])) {
\Cx\Core\Setting\Controller\Setting::storeFromPost();
}
//display the setting options
\Cx\Core\Setting\Controller\Setting::init('GeoIp', null, 'Yaml');
\Cx\Core\Setting\Controller\Setting::setEngineType('GeoIp', 'Yaml', 'config');
\Cx\Core\Setting\Controller\Setting::show($this->template, 'index.php?cmd=GeoIp', $_ARRAYLANG['TXT_CORE_MODULE_GEOIP'], $_ARRAYLANG['TXT_CORE_MODULE_GEOIP_SETTINGS'], 'TXT_CORE_MODULE_GEOIP_');
}
示例7: storeSettings
function storeSettings()
{
global $objDatabase;
$result = true;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['senderName'])) . "'\n WHERE `name`='set_sender_name'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['senderEmail'])) . "'\n WHERE `name`='set_sender_email'\n ") ? true : false;
/*
$result &= ($objDatabase->Execute("
UPDATE ".DBPREFIX."module_egov_configuration
SET `value`='".contrexx_addslashes(strip_tags($_REQUEST['recipientEmail']))."'
WHERE `name`='set_recipient_email'
") ? true : false);
*/
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['stateEmail'])) . "'\n WHERE `name`='set_state_email'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['calenderColor1'])) . "'\n WHERE `name`='set_calendar_color_1'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['calenderColor2'])) . "'\n WHERE `name`='set_calendar_color_2'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['calenderColor3'])) . "'\n WHERE `name`='set_calendar_color_3'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['calenderLegende1'])) . "'\n WHERE `name`='set_calendar_legende_1'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['calenderLegende2'])) . "'\n WHERE `name`='set_calendar_legende_2'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['calenderLegende3'])) . "'\n WHERE `name`='set_calendar_legende_3'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['calenderBackground'])) . "'\n WHERE `name`='set_calendar_background'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['calenderBorder'])) . "'\n WHERE `name`='set_calendar_border'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['calenderDateLabel'])) . "'\n WHERE `name`='set_calendar_date_label'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['calenderDateDesc'])) . "'\n WHERE `name`='set_calendar_date_desc'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['stateSubject'])) . "'\n WHERE `name`='set_state_subject'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['orderentrySubject'])) . "'\n WHERE `name`='set_orderentry_subject'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['orderentryEmail'])) . "'\n WHERE `name`='set_orderentry_email'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['orderentrysenderName'])) . "'\n WHERE `name`='set_orderentry_name'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['orderentrysenderEmail'])) . "'\n WHERE `name`='set_orderentry_sender'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['orderentryrecipientEmail'])) . "'\n WHERE `name`='set_orderentry_recipient'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['PayPal_mail'])) . "'\n WHERE `name`='set_paypal_email'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . contrexx_addslashes(strip_tags($_REQUEST['general_currency'])) . "'\n WHERE `name`='set_paypal_currency'\n ") ? true : false;
$result &= $objDatabase->Execute("\n UPDATE " . DBPREFIX . "module_egov_configuration\n SET `value`='" . (isset($_REQUEST['PayPal_IPN']) ? 1 : 0) . "'\n WHERE `name`='set_paypal_ipn'\n ") ? true : false;
\Cx\Core\Setting\Controller\Setting::init('Egov', 'config');
$result_settingdb = \Cx\Core\Setting\Controller\Setting::storeFromPost(true);
if ($result_settingdb === false) {
self::errorHandler();
$result = false;
}
return $result;
}