本文整理汇总了PHP中Cx\Core\Setting\Controller\Setting::isDefined方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::isDefined方法的具体用法?PHP Setting::isDefined怎么用?PHP Setting::isDefined使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cx\Core\Setting\Controller\Setting
的用法示例。
在下文中一共展示了Setting::isDefined方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateGlobalSetting
/**
* Update the global setting
*
* @param int $value
* @throws DatabaseError
* @global $objDatabase
*/
protected function updateGlobalSetting($value)
{
\Cx\Core\Setting\Controller\Setting::init('Config', 'component', 'Yaml');
if (isset($value)) {
if (!\Cx\Core\Setting\Controller\Setting::isDefined('useKnowledgePlaceholders')) {
\Cx\Core\Setting\Controller\Setting::add('useKnowledgePlaceholders', $value, 1, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, '1:TXT_ACTIVATED,0:TXT_DEACTIVATED', 'component');
} else {
\Cx\Core\Setting\Controller\Setting::set('useKnowledgePlaceholders', $value);
\Cx\Core\Setting\Controller\Setting::update('useKnowledgePlaceholders');
}
}
}
示例2: 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;
}
}
示例3: errorHandler
/**
* Fixes database errors.
*
* @global array $_CONFIG
*
* @return boolean
* @throws SupportException
*/
static function errorHandler()
{
global $_CONFIG;
try {
\Cx\Core\Setting\Controller\Setting::init('Support', '', 'Yaml');
//setup group
\Cx\Core\Setting\Controller\Setting::init('Support', 'setup', 'Yaml');
if (!\Cx\Core\Setting\Controller\Setting::isDefined('faqUrl') && !\Cx\Core\Setting\Controller\Setting::add('faqUrl', 'https://www.cloudrexx.com/FAQ', 1, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'setup')) {
throw new SupportException("Failed to add Setting entry for faq url");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('recipientMailAddress') && !\Cx\Core\Setting\Controller\Setting::add('recipientMailAddress', $_CONFIG['coreAdminEmail'], 2, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'setup')) {
throw new SupportException("Failed to add Setting entry for recipient mail address");
}
} catch (\Exception $e) {
\DBG::msg($e->getMessage());
}
// Always!
return false;
}
示例4: init
/**
* Fixes database errors.
*
* @return boolean False. Always.
* @throws \Cx\Lib\Update_DatabaseException
*/
static function init($configPath = null)
{
try {
//site group
\Cx\Core\Setting\Controller\Setting::init('Config', 'site', 'Yaml', $configPath);
if (!\Cx\Core\Setting\Controller\Setting::isDefined('systemStatus') && !\Cx\Core\Setting\Controller\Setting::add('systemStatus', 'on', 1, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, 'on:TXT_ACTIVATED,off:TXT_DEACTIVATED', 'site')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for Page Status");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('languageDetection') && !\Cx\Core\Setting\Controller\Setting::add('languageDetection', 'on', 2, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, 'on:TXT_ACTIVATED,off:TXT_DEACTIVATED', 'site')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for Auto Detect Language");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('coreGlobalPageTitle') && !\Cx\Core\Setting\Controller\Setting::add('coreGlobalPageTitle', 'Contrexx Example Website', 3, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'site')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for Global Page Title");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('mainDomainId') && !\Cx\Core\Setting\Controller\Setting::add('mainDomainId', '0', 4, \Cx\Core\Setting\Controller\Setting::TYPE_DROPDOWN, '{src:\\' . __CLASS__ . '::getDomains()}', 'site')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for Main Domain");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('forceDomainUrl') && !\Cx\Core\Setting\Controller\Setting::add('forceDomainUrl', 'off', 5, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, 'on:TXT_ACTIVATED,off:TXT_DEACTIVATED', 'site')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for Home Page Url");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('coreListProtectedPages') && !\Cx\Core\Setting\Controller\Setting::add('coreListProtectedPages', 'off', 6, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, 'on:TXT_ACTIVATED,off:TXT_DEACTIVATED', 'site')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for Protected Pages");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('searchVisibleContentOnly') && !\Cx\Core\Setting\Controller\Setting::add('searchVisibleContentOnly', 'on', 7, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, 'on:TXT_ACTIVATED,off:TXT_DEACTIVATED', 'site')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for Visible Contents");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('advancedUploadFrontend') && !\Cx\Core\Setting\Controller\Setting::add('advancedUploadFrontend', 'off', 8, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, 'on:TXT_ACTIVATED,off:TXT_DEACTIVATED', 'site')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for Visible Contents");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('forceProtocolFrontend') && !\Cx\Core\Setting\Controller\Setting::add('forceProtocolFrontend', 'none', 9, \Cx\Core\Setting\Controller\Setting::TYPE_DROPDOWN, '{src:\\' . __CLASS__ . '::getPortOptions()}', 'site')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for Protocol In Use");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('portFrontendHTTP') && !\Cx\Core\Setting\Controller\Setting::add('portFrontendHTTP', 80, 1, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'site')) {
\DBG::log("Failed to add Setting entry for core HTTP Port (Frontend)");
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for core HTTP Port (Frontend)");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('portFrontendHTTPS') && !\Cx\Core\Setting\Controller\Setting::add('portFrontendHTTPS', 443, 1, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'site')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for core HTTPS Port (Frontend)");
}
//administrationArea group
\Cx\Core\Setting\Controller\Setting::init('Config', 'administrationArea', 'Yaml', $configPath);
if (!\Cx\Core\Setting\Controller\Setting::isDefined('dashboardNews') && !\Cx\Core\Setting\Controller\Setting::add('dashboardNews', 'off', 1, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, 'on:TXT_ACTIVATED,off:TXT_DEACTIVATED', 'administrationArea')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for Dashboard News");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('dashboardNewsSrc') && !\Cx\Core\Setting\Controller\Setting::add('dashboardNewsSrc', 'http://www.contrexx.com/feed/news_headlines_de.xml', 1, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'component')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for dashboardNewsSrc");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('dashboardStatistics') && !\Cx\Core\Setting\Controller\Setting::add('dashboardStatistics', 'on', 2, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, 'on:TXT_ACTIVATED,off:TXT_DEACTIVATED', 'administrationArea')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for Dashboard Statistics");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('advancedUploadBackend') && !\Cx\Core\Setting\Controller\Setting::add('advancedUploadBackend', 'on', 3, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, 'on:TXT_ACTIVATED,off:TXT_DEACTIVATED', 'administrationArea')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for advanced Upload Tools");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('sessionLifeTime') && !\Cx\Core\Setting\Controller\Setting::add('sessionLifeTime', '3600', 4, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'administrationArea')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for session Length");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('sessionLifeTimeRememberMe') && !\Cx\Core\Setting\Controller\Setting::add('sessionLifeTimeRememberMe', '1209600', 5, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'administrationArea')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for session Length Remember");
}
if (in_array('SystemInfo', \Env::get('cx')->getLicense()->getLegalComponentsList())) {
if (!\Cx\Core\Setting\Controller\Setting::isDefined('dnsServer') && !\Cx\Core\Setting\Controller\Setting::add('dnsServer', 'ns1.contrexxhosting.com', 6, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'administrationArea')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for Dns Server");
}
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('timezone') && !\Cx\Core\Setting\Controller\Setting::add('timezone', 'Europe/Zurich', 7, \Cx\Core\Setting\Controller\Setting::TYPE_DROPDOWN, '{src:\\' . __CLASS__ . '::getTimezoneOptions()}', 'administrationArea')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for Time zone");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('forceProtocolBackend') && !\Cx\Core\Setting\Controller\Setting::add('forceProtocolBackend', 'none', 8, \Cx\Core\Setting\Controller\Setting::TYPE_DROPDOWN, '{src:\\' . __CLASS__ . '::getPortOptions()}', 'administrationArea')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for Protocol In Use Administrator");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('portBackendHTTP') && !\Cx\Core\Setting\Controller\Setting::add('portBackendHTTP', 80, 1, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'administrationArea')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for core HTTP Port (Backend)");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('portBackendHTTPS') && !\Cx\Core\Setting\Controller\Setting::add('portBackendHTTPS', 443, 1, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'administrationArea')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for core HTTPS Port (Backend)");
}
//security group
\Cx\Core\Setting\Controller\Setting::init('Config', 'security', 'Yaml', $configPath);
if (!\Cx\Core\Setting\Controller\Setting::isDefined('coreIdsStatus') && !\Cx\Core\Setting\Controller\Setting::add('coreIdsStatus', 'off', 1, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, 'on:TXT_ACTIVATED,off:TXT_DEACTIVATED', 'security')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for Security system notifications ");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('passwordComplexity') && !\Cx\Core\Setting\Controller\Setting::add('passwordComplexity', 'off', 2, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, 'on:TXT_ACTIVATED,off:TXT_DEACTIVATED', 'security')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for Passwords must meet the complexity requirements");
}
//contactInformation group
\Cx\Core\Setting\Controller\Setting::init('Config', 'contactInformation', 'Yaml', $configPath);
if (!\Cx\Core\Setting\Controller\Setting::isDefined('coreAdminName') && !\Cx\Core\Setting\Controller\Setting::add('coreAdminName', 'Administrator', 1, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'contactInformation')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for core Admin Name");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('coreAdminEmail') && !\Cx\Core\Setting\Controller\Setting::add('coreAdminEmail', 'info@example.com', 2, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'contactInformation')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for core Admin Email");
}
if (!\Cx\Core\Setting\Controller\Setting::isDefined('contactFormEmail') && !\Cx\Core\Setting\Controller\Setting::add('contactFormEmail', 'info@example.com', 3, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'contactInformation')) {
throw new \Cx\Lib\Update_DatabaseException("Failed to add Setting entry for contact Form Email");
//.........这里部分代码省略.........
示例5: deactivateSetting
private function deactivateSetting($config)
{
if (\Permission::checkAccess(17, 'static', true)) {
\Cx\Core\Setting\Controller\Setting::init('Config', 'administrationArea', 'Yaml');
if (!\Cx\Core\Setting\Controller\Setting::isDefined($config)) {
$status = \Cx\Core\Setting\Controller\Setting::add($config, 'off', 1, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, 'on:TXT_ACTIVATED,off:TXT_DEACTIVATED', 'administrationArea');
} else {
\Cx\Core\Setting\Controller\Setting::set($config, 'off');
$status = \Cx\Core\Setting\Controller\Setting::update($config);
}
if ($status) {
die('success');
}
}
die('error');
}
示例6: createProfilAttributes
/**
*
* This code creates the crm setting for company size, customerType and industryType if the do not exist and
* also creates the profile attributes and links them with the new settings in the crm
*
* @global <type> $_CORELANG
* @global <type> $_ARRAYLANG
* @autor Adrian Berger <ab@comvation.com>
* @return void
*/
function createProfilAttributes()
{
global $_CORELANG, $_ARRAYLANG;
$objFWUser = \FWUser::getFWUserObject();
$objUser = $objFWUser->objUser;
$objInit = \Env::get('init');
// save lang id and arrayLangs, because they will be replaced temporary with another language and after that
// we need the arrays in this language, because otherwise the user gets the site in a wrong language
$backendLangId = $objInit->backendLangId;
$_tempCORELANG = $_CORELANG;
$_tempARRAYLANG = $_ARRAYLANG;
// get all languages, so we can load the placeholder for all languages
$FWLanguages = new \FWLanguage();
$languages = $FWLanguages->getLanguageArray();
$attributNameAfterLang = array('TXT_CRM_COMPANY_SIZE' => 'user_profile_attribute_company_size', 'TXT_CRM_INDUSTRY_TYPE' => 'user_profile_attribute_industry_type', 'TXT_CRM_CUSTOMER_TYPE' => 'user_profile_attribute_customer_type');
\Cx\Core\Setting\Controller\Setting::init('Crm', 'config');
foreach ($attributNameAfterLang as $key => $attributName) {
if (!\Cx\Core\Setting\Controller\Setting::isDefined($attributName)) {
if (!$objUser->objAttribute->getAttributeIdByName($_ARRAYLANG[$key]) !== null) {
$attribut = $objUser->objAttribute->getById(0);
$attribut->init();
$placeholderArr = array();
foreach ($languages as $language) {
$objInit->backendLangId = $language["id"];
$langArr = $objInit->loadLanguageData();
$placeholderArr[$language["id"]] = $langArr[$key];
}
$attribut->setNames($placeholderArr);
$attribut->setType('text');
$attribut->setParent(0);
if (!$attribut->store()) {
throw new \Cx\Modules\Crm\Controller\CrmSettingsException('Failed to create User_Profile_Attribute for ' . $key);
}
}
\CX\Core\Setting\Controller\Setting::add($attributName, $objUser->objAttribute->getAttributeIdByName($_ARRAYLANG[$key]), false, 'dropdown_user_custom_attribute', '', 'config');
}
}
// restore the original language settings, so the page loads in the correct language
$objInit->backendLangId = $backendLangId;
$_CORELANG = $_tempCORELANG;
$_ARRAYLANG = $_tempARRAYLANG;
}
示例7: createNewDynamicAccessId
/**
* Generates a new dynamic access-ID
*
* @return mixed Returns the newly created dynamic access-ID or FALSE on failure.
*/
public static function createNewDynamicAccessId()
{
\Cx\Core\Setting\Controller\Setting::init('Config', 'core', 'Yaml');
if (!\Cx\Core\Setting\Controller\Setting::isDefined('lastAccessId')) {
$newAccessId = 1;
\Cx\Core\Setting\Controller\Setting::add('lastAccessId', $newAccessId, 1, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, '', 'core');
} else {
$newAccessId = \Cx\Core\Setting\Controller\Setting::getValue('lastAccessId', 'Config') + 1;
\Cx\Core\Setting\Controller\Setting::set('lastAccessId', $newAccessId);
if (!\Cx\Core\Setting\Controller\Setting::update('lastAccessId')) {
return false;
}
}
// verify that the update was successful
\Cx\Core\Setting\Controller\Setting::init('Config', 'core', 'Yaml');
if (\Cx\Core\Setting\Controller\Setting::getValue('lastAccessId', 'Config') != $newAccessId) {
return false;
}
return $newAccessId;
}
示例8: _saveSettings
/**
* Save the settings associated to the block system
*
* @access private
* @param array $arrSettings
*/
function _saveSettings($arrSettings)
{
\Cx\Core\Setting\Controller\Setting::init('Config', 'component', 'Yaml');
if (isset($arrSettings['blockStatus'])) {
if (!\Cx\Core\Setting\Controller\Setting::isDefined('blockStatus')) {
\Cx\Core\Setting\Controller\Setting::add('blockStatus', $arrSettings['blockStatus'], 1, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, '1:TXT_ACTIVATED,0:TXT_DEACTIVATED', 'component');
} else {
\Cx\Core\Setting\Controller\Setting::set('blockStatus', $arrSettings['blockStatus']);
\Cx\Core\Setting\Controller\Setting::update('blockStatus');
}
}
if (isset($arrSettings['blockRandom'])) {
if (!\Cx\Core\Setting\Controller\Setting::isDefined('blockRandom')) {
\Cx\Core\Setting\Controller\Setting::add('blockRandom', $arrSettings['blockRandom'], 1, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, '1:TXT_ACTIVATED,0:TXT_DEACTIVATED', 'component');
} else {
\Cx\Core\Setting\Controller\Setting::set('blockRandom', $arrSettings['blockRandom']);
\Cx\Core\Setting\Controller\Setting::update('blockRandom');
}
}
}
示例9: storeGeneral
/**
* Store general settings
*
* @return boolean true on success, false otherwise.
* @static
*/
static function storeGeneral()
{
if (empty($_POST['general'])) {
return;
}
// TODO: Use
// \Cx\Core\Setting\Controller\Setting::storeFromPost();
\Cx\Core\Setting\Controller\Setting::set('email', trim(strip_tags(contrexx_input2raw($_POST['email']))));
\Cx\Core\Setting\Controller\Setting::set('email_confirmation', trim(strip_tags(contrexx_input2raw($_POST['email_confirmation']))));
// added: shop company name and address
\Cx\Core\Setting\Controller\Setting::set('company', trim(strip_tags(contrexx_input2raw($_POST['company']))));
\Cx\Core\Setting\Controller\Setting::set('address', trim(strip_tags(contrexx_input2raw($_POST['address']))));
\Cx\Core\Setting\Controller\Setting::set('telephone', trim(strip_tags(contrexx_input2raw($_POST['telephone']))));
\Cx\Core\Setting\Controller\Setting::set('fax', trim(strip_tags(contrexx_input2raw($_POST['fax']))));
\Cx\Core\Setting\Controller\Setting::set('country_id', intval($_POST['country_id']));
// Thumbnail settings
\Cx\Core\Setting\Controller\Setting::set('thumbnail_max_width', intval($_POST['thumbnail_max_width']));
\Cx\Core\Setting\Controller\Setting::set('thumbnail_max_height', intval($_POST['thumbnail_max_height']));
\Cx\Core\Setting\Controller\Setting::set('thumbnail_quality', intval($_POST['thumbnail_quality']));
// Extended settings
// New in V2.something
\Cx\Core\Setting\Controller\Setting::set('weight_enable', !empty($_POST['weight_enable']));
\Cx\Core\Setting\Controller\Setting::set('show_products_default', empty($_POST['show_products_default']) ? 0 : intval($_POST['show_products_default']));
// Mind that this defaults to 1, zero is not a valid value
\Cx\Core\Setting\Controller\Setting::set('product_sorting', empty($_POST['product_sorting']) ? 1 : intval($_POST['product_sorting']));
// Order amount lower limit (new in 3.1.0)
$orderItemsAmountMin = empty($_POST['orderitems_amount_min']) ? 0 : floatval($_POST['orderitems_amount_min']);
if (!\Cx\Core\Setting\Controller\Setting::isDefined('orderitems_amount_min')) {
\Cx\Core\Setting\Controller\Setting::add('orderitems_amount_min', $orderItemsAmountMin, false, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'config');
} else {
\Cx\Core\Setting\Controller\Setting::set('orderitems_amount_min', $orderItemsAmountMin);
}
// Order amount upper limit (applicable when using Saferpay)
\Cx\Core\Setting\Controller\Setting::set('orderitems_amount_max', empty($_POST['orderitems_amount_max']) ? 0 : floatval($_POST['orderitems_amount_max']));
// New in V3.0.0
\Cx\Core\Setting\Controller\Setting::set('use_js_cart', intval($_POST['use_js_cart']));
\Cx\Core\Setting\Controller\Setting::set('shopnavbar_on_all_pages', intval($_POST['shopnavbar_on_all_pages']));
\Cx\Core\Setting\Controller\Setting::set('register', trim(strip_tags(contrexx_input2raw($_POST['register']))));
\Cx\Core\Setting\Controller\Setting::set('numof_customers_per_page_backend', intval($_POST['numof_customers_per_page_backend']));
\Cx\Core\Setting\Controller\Setting::set('numof_manufacturers_per_page_backend', intval($_POST['numof_manufacturers_per_page_backend']));
\Cx\Core\Setting\Controller\Setting::set('numof_mailtemplate_per_page_backend', intval($_POST['numof_mailtemplate_per_page_backend']));
\Cx\Core\Setting\Controller\Setting::set('usergroup_id_customer', intval($_POST['usergroup_id_customer']));
\Cx\Core\Setting\Controller\Setting::set('usergroup_id_reseller', intval($_POST['usergroup_id_reseller']));
\Cx\Core\Setting\Controller\Setting::set('user_profile_attribute_customer_group_id', intval($_POST['user_profile_attribute_customer_group_id']));
\Cx\Core\Setting\Controller\Setting::set('user_profile_attribute_notes', intval($_POST['user_profile_attribute_notes']));
// New in V3.0.4 or V3.1.0
if (!\Cx\Core\Setting\Controller\Setting::set('numof_products_per_page_backend', intval($_POST['numof_products_per_page_backend']))) {
\Cx\Core\Setting\Controller\Setting::add('numof_products_per_page_backend', intval($_POST['numof_products_per_page_backend']), 53, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'config');
}
if (!\Cx\Core\Setting\Controller\Setting::set('numof_orders_per_page_backend', intval($_POST['numof_orders_per_page_backend']))) {
\Cx\Core\Setting\Controller\Setting::add('numof_orders_per_page_backend', intval($_POST['numof_orders_per_page_backend']), 54, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'config');
}
if (!\Cx\Core\Setting\Controller\Setting::set('numof_coupon_per_page_backend', intval($_POST['numof_coupon_per_page_backend']))) {
\Cx\Core\Setting\Controller\Setting::add('numof_coupon_per_page_backend', intval($_POST['numof_coupon_per_page_backend']), 58, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'config');
}
if (!\Cx\Core\Setting\Controller\Setting::set('numof_products_per_page_frontend', intval($_POST['numof_products_per_page_frontend']))) {
\Cx\Core\Setting\Controller\Setting::add('numof_products_per_page_frontend', intval($_POST['numof_products_per_page_frontend']), null, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'config');
}
if (!\Cx\Core\Setting\Controller\Setting::set('num_categories_per_row', intval($_POST['num_categories_per_row']))) {
\Cx\Core\Setting\Controller\Setting::add('num_categories_per_row', intval($_POST['num_categories_per_row']), null, \Cx\Core\Setting\Controller\Setting::TYPE_TEXT, null, 'config');
}
}
示例10: getCustomCSSVariables
/**
* find all custom css variables and return an array with the values
*
* @param integer $skinId skin id, default is 0
* @return array List with needed wysiwyg options
*/
public function getCustomCSSVariables($skinId)
{
$themeRepo = new \Cx\Core\View\Model\Repository\ThemeRepository();
$skin = '';
$content = '';
$cssArr = array();
$ymlOption = array();
$componentData = array();
\Cx\Core\Setting\Controller\Setting::init('Wysiwyg', 'config', 'Yaml');
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");
}
//0 is default theme so you dont must change the themefolder
if (!empty($skinId)) {
$skin = $themeRepo->findById($skinId)->getFoldername();
$componentData = $themeRepo->findById($skinId)->getComponentData();
} else {
$skin = $themeRepo->getDefaultTheme()->getFoldername();
$componentData = $themeRepo->getDefaultTheme()->getComponentData();
}
if (\Cx\Core\Setting\Controller\Setting::getValue('specificStylesheet', 'Wysiwyg')) {
$path = $this->cx->getClassLoader()->getFilePath($this->cx->getCodeBaseThemesPath() . '/' . $skin . '/index.html');
if ($path) {
$content = file_get_contents($path);
$cssArr = \JS::findCSS($content);
}
}
if (!empty($componentData['rendering']['wysiwyg'])) {
$ymlOption = $componentData['rendering']['wysiwyg'];
}
if (!empty($ymlOption['css'])) {
if ($this->cx->getClassLoader()->getFilePath($this->cx->getCodeBaseThemesPath() . '/' . $skin . '/' . $ymlOption['css'])) {
$cssArr[] = $this->cx->getWebsiteOffsetPath() . '/' . $skin . '/' . $ymlOption['css'];
}
}
return array('css' => $cssArr, 'bodyClass' => !empty($ymlOption['bodyClass']) ? $ymlOption['bodyClass'] : '', 'bodyId' => !empty($ymlOption['bodyId']) ? $ymlOption['bodyId'] : '');
}
示例11: _saveSettings
function _saveSettings()
{
global $_CORELANG;
$feedNewsMLStatus = isset($_POST['feedSettingsUseNewsML']) ? intval($_POST['feedSettingsUseNewsML']) : 0;
\Cx\Core\Setting\Controller\Setting::init('Config', 'component', 'Yaml');
if (isset($feedNewsMLStatus)) {
if (!\Cx\Core\Setting\Controller\Setting::isDefined('feedNewsMLStatus')) {
\Cx\Core\Setting\Controller\Setting::add('feedNewsMLStatus', $feedNewsMLStatus, 1, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, '1:TXT_ACTIVATED,0:TXT_DEACTIVATED', 'component');
} else {
\Cx\Core\Setting\Controller\Setting::set('feedNewsMLStatus', $feedNewsMLStatus);
\Cx\Core\Setting\Controller\Setting::update('feedNewsMLStatus');
}
}
$_SESSION['strOkMessage'] = $_CORELANG['TXT_SETTINGS_UPDATED'];
}
示例12: _updateHomeContentSettings
function _updateHomeContentSettings()
{
\Cx\Core\Setting\Controller\Setting::init('Config', 'component', 'Yaml');
$status = false;
if (isset($_POST['setHomeContent'])) {
$setHomeContent = intval($_POST['setHomeContent']);
if (!\Cx\Core\Setting\Controller\Setting::isDefined('podcastHomeContent')) {
$status = \Cx\Core\Setting\Controller\Setting::add('podcastHomeContent', $setHomeContent, 1, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, '1:TXT_ACTIVATED,0:TXT_DEACTIVATED', 'component');
} else {
\Cx\Core\Setting\Controller\Setting::set('podcastHomeContent', $setHomeContent);
$status = \Cx\Core\Setting\Controller\Setting::update('podcastHomeContent');
}
}
return $status;
}
示例13: updateSettings
/**
* Validate and save new settings.
*
* @global ADONewConnection
* @global array
* @global array
*/
function updateSettings()
{
global $objDatabase, $_ARRAYLANG;
//update settings table and write new settings file for /config
if (isset($_POST['set_homecontent_submit'])) {
//update settings
\Cx\Core\Setting\Controller\Setting::init('Config', 'component', 'Yaml');
if (isset($_POST['setHomeContent'])) {
$setHomeContent = intval($_POST['setHomeContent']);
if (!\Cx\Core\Setting\Controller\Setting::isDefined('forumHomeContent')) {
\Cx\Core\Setting\Controller\Setting::add('forumHomeContent', $setHomeContent, 1, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, '1:TXT_ACTIVATED,0:TXT_DEACTIVATED', 'component');
} else {
\Cx\Core\Setting\Controller\Setting::set('forumHomeContent', $setHomeContent);
\Cx\Core\Setting\Controller\Setting::update('forumHomeContent');
}
}
if (isset($_POST['setTagContent'])) {
$forumTagContent = intval($_POST['setTagContent']);
if (!\Cx\Core\Setting\Controller\Setting::isDefined('forumTagContent')) {
\Cx\Core\Setting\Controller\Setting::add('forumTagContent', $forumTagContent, 1, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, '1:TXT_ACTIVATED,0:TXT_DEACTIVATED', 'component');
} else {
\Cx\Core\Setting\Controller\Setting::set('forumTagContent', $forumTagContent);
\Cx\Core\Setting\Controller\Setting::update('forumTagContent');
}
}
}
foreach ($_POST['setvalue'] as $intSetId => $strSetValue) {
switch ($intSetId) {
case 1:
$strSetValue = intval($strSetValue) == 0 ? $this->_arrSettings['thread_paging'] : intval($strSetValue);
break;
case 2:
$strSetValue = intval($strSetValue) == 0 ? $this->_arrSettings['posting_paging'] : intval($strSetValue);
break;
case 3:
$strSetValue = intval($strSetValue) == 0 ? $this->_arrSettings['latest_entries_count'] : intval($strSetValue);
break;
default:
}
$objDatabase->Execute(' UPDATE ' . DBPREFIX . 'module_forum_settings
SET value="' . addslashes($strSetValue) . '"
WHERE id=' . intval($intSetId) . '
LIMIT 1');
}
$this->_arrSettings = $this->createSettingsArray();
// $objCache = new \CacheManager();
// $objCache->deleteAllFiles();
$this->_strOkMessage = $_ARRAYLANG['TXT_FORUM_SETTINGS_UPDATE_OK'];
}
示例14: initConfig
/**
* Fixes database errors.
*
* @return boolean
* @throws GeoIpException
*/
static function initConfig()
{
try {
\Cx\Core\Setting\Controller\Setting::init('GeoIp', '', 'Yaml');
//setup config
\Cx\Core\Setting\Controller\Setting::init('GeoIp', 'config', 'Yaml');
if (!\Cx\Core\Setting\Controller\Setting::isDefined('serviceStatus') && !\Cx\Core\Setting\Controller\Setting::add('serviceStatus', 0, 1, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, '1:TXT_ACTIVATED,0:TXT_DEACTIVATED', 'config')) {
throw new GeoIpException("Failed to add Setting entry for GeoIp Service Status");
}
} catch (\Exception $e) {
\DBG::msg($e->getMessage());
}
// Always!
return false;
}
示例15: updateSettings
/**
* update settings
* @access public
* @global array
* @global ADONewConnection
* @global array
* @global array
*/
function updateSettings()
{
global $objDatabase, $_CORELANG, $_ARRAYLANG;
if (isset($_POST['set_sys_submit'])) {
//get post data
foreach ($_POST['setvalue'] as $id => $value) {
//update settings
// check for description field to be required
if ($id == 13 && $value == 1) {
$objDatabase->Execute("UPDATE `" . DBPREFIX . "module_directory_inputfields` SET active='1', is_required='1', active_backend='1' WHERE name='description'");
}
if (ini_get('allow_url_fopen') == false && $id == 19) {
$objResult = $objDatabase->Execute("UPDATE " . DBPREFIX . "module_directory_settings SET setvalue='0' WHERE setid=" . intval($id));
} else {
$objResult = $objDatabase->Execute("UPDATE " . DBPREFIX . "module_directory_settings SET setvalue='" . contrexx_addslashes($value) . "' WHERE setid=" . intval($id));
}
}
$this->strOkMessage = $_ARRAYLANG['TXT_DIR_SETTINGS_SUCCESFULL_SAVE'];
}
if (isset($_POST['set_google_submit'])) {
//get post data
foreach ($_POST['setvalue'] as $id => $value) {
//update settings
$objResult = $objDatabase->Execute("UPDATE " . DBPREFIX . "module_directory_settings_google SET setvalue='" . contrexx_addslashes($value) . "' WHERE setid=" . intval($id));
}
$this->strOkMessage = $_ARRAYLANG['TXT_DIR_SETTINGS_SUCCESFULL_SAVE'];
}
if (isset($_POST['set_homecontent_submit'])) {
//update settings
\Cx\Core\Setting\Controller\Setting::init('Config', 'component', 'Yaml');
if (isset($_POST['setHomeContent'])) {
if (!\Cx\Core\Setting\Controller\Setting::isDefined('directoryHomeContent')) {
\Cx\Core\Setting\Controller\Setting::add('directoryHomeContent', contrexx_addslashes($_POST['setHomeContent']), 1, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, '1:TXT_ACTIVATED,0:TXT_DEACTIVATED', 'component');
} else {
\Cx\Core\Setting\Controller\Setting::set('directoryHomeContent', contrexx_addslashes($_POST['setHomeContent']));
\Cx\Core\Setting\Controller\Setting::update('directoryHomeContent');
}
}
\Cx\Core\Csrf\Controller\Csrf::header('Location: ?cmd=Directory&act=settings&tpl=homecontent');
exit;
$this->strOkMessage = $_ARRAYLANG['TXT_DIR_SETTINGS_SUCCESFULL_SAVE'];
}
if (isset($_POST['set_mail_submit'])) {
//update settings
$objResult = $objDatabase->Execute("UPDATE " . DBPREFIX . "module_directory_mail SET title='" . contrexx_addslashes($_POST['mailConfirmTitle']) . "', content='" . $_POST['mailConfirmContent'] . "' WHERE id='1'");
$objResult = $objDatabase->Execute("UPDATE " . DBPREFIX . "module_directory_mail SET title='" . contrexx_addslashes($_POST['mailRememberTitle']) . "', content='" . $_POST['mailRememberContent'] . "' WHERE id='2'");
$objResult = $objDatabase->Execute("UPDATE " . DBPREFIX . "module_directory_settings SET setvalue='" . contrexx_addslashes($_POST['mailRememberAdress']) . "' WHERE setid='30'");
$this->strOkMessage = $_ARRAYLANG['TXT_DIR_SETTINGS_SUCCESFULL_SAVE'];
}
if (isset($_POST['set_inputs_submit'])) {
//update settings
// title field should stay active, required and available for search
$objResult = $objDatabase->Execute("UPDATE " . DBPREFIX . "module_directory_inputfields SET active='0' Where id !='1'");
$objResult = $objDatabase->Execute("UPDATE " . DBPREFIX . "module_directory_inputfields SET is_search='0' Where id !='1'");
$objResult = $objDatabase->Execute("UPDATE " . DBPREFIX . "module_directory_inputfields SET is_required='0' Where id !='1'");
$objResult = $objDatabase->Execute("UPDATE " . DBPREFIX . "module_directory_inputfields SET active_backend='0' Where id !='1'");
//get post data
if ($_POST['setStatus'] != "") {
$addressElements = 0;
$googleMapIsEnabled = false;
foreach ($_POST['setStatus'] as $id => $value) {
//update settings
$objResult = $objDatabase->Execute("SELECT `name` FROM " . DBPREFIX . "module_directory_inputfields WHERE id=" . intval($id));
$name = $objResult->fields['name'];
switch ($name) {
case 'country':
case 'zip':
case 'street':
case 'city':
$addressElements++;
break;
case 'googlemap':
$googleMapIsEnabled = true;
break;
default:
}
$objResult = $objDatabase->Execute("UPDATE " . DBPREFIX . "module_directory_inputfields SET active='" . contrexx_addslashes($value) . "' WHERE id=" . intval($id));
}
if ($googleMapIsEnabled && $addressElements < 4) {
$objResult = $objDatabase->Execute("UPDATE " . DBPREFIX . "module_directory_inputfields SET active='1' WHERE name='country'");
$objResult = $objDatabase->Execute("UPDATE " . DBPREFIX . "module_directory_inputfields SET active='1' WHERE name='zip'");
$objResult = $objDatabase->Execute("UPDATE " . DBPREFIX . "module_directory_inputfields SET active='1' WHERE name='street'");
$objResult = $objDatabase->Execute("UPDATE " . DBPREFIX . "module_directory_inputfields SET active='1' WHERE name='city'");
$this->strOkMessage = $_ARRAYLANG['TXT_DIRECTORY_GOOGLEMAP_REQUIRED_FIELDS_MISSING'];
}
}
//get post data
if ($_POST['setStatusBackend'] != "") {
$addressElements = 0;
$googleMapIsEnabled = false;
foreach ($_POST['setStatusBackend'] as $id => $value) {
//update settings
//.........这里部分代码省略.........