当前位置: 首页>>代码示例>>PHP>>正文


PHP Setting::init方法代码示例

本文整理汇总了PHP中Cx\Core\Setting\Controller\Setting::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::init方法的具体用法?PHP Setting::init怎么用?PHP Setting::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cx\Core\Setting\Controller\Setting的用法示例。


在下文中一共展示了Setting::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: preContentLoad

 /**
  * Do something before content is loaded from DB
  * 
  * @param \Cx\Core\ContentManager\Model\Entity\Page $page       The resolved page
  */
 public function preContentLoad(\Cx\Core\ContentManager\Model\Entity\Page $page)
 {
     global $_CONFIG, $cl, $lang, $objInit, $dataBlocks, $lang, $dataBlocks, $themesPages, $page_template;
     // Initialize counter and track search engine robot
     \Cx\Core\Setting\Controller\Setting::init('Config', 'component', 'Yaml');
     if (\Cx\Core\Setting\Controller\Setting::getValue('dataUseModule') && $cl->loadFile(ASCMS_MODULE_PATH . '/Data/Controller/DataBlocks.class.php')) {
         $lang = $objInit->loadLanguageData('Data');
         $dataBlocks = new \Cx\Modules\Data\Controller\DataBlocks($lang);
         \Env::get('cx')->getPage()->setContent($dataBlocks->replace(\Env::get('cx')->getPage()->getContent()));
         $themesPages = $dataBlocks->replace($themesPages);
         $page_template = $dataBlocks->replace($page_template);
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:18,代码来源:ComponentController.class.php

示例2: __construct

 /**
  * Constructor for PHP5
  *
  * @param int $lang
  */
 function __construct()
 {
     global $objInit;
     \Cx\Core\Setting\Controller\Setting::init('Config', 'component', 'Yaml');
     if (\Cx\Core\Setting\Controller\Setting::getValue('dataUseModule')) {
         $this->active = true;
     } else {
         return;
     }
     $this->_arrSettings = $this->createSettingsArray();
     $this->_objTpl = new \Cx\Core\Html\Sigma(ASCMS_THEMES_PATH);
     \Cx\Core\Csrf\Controller\Csrf::add_placeholder($this->_objTpl);
     $this->langVars = $objInit->loadLanguageData('Data');
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:19,代码来源:DataBlocks.class.php

示例3: postContentLoad

 /**
  * Do something after content is loaded from DB
  *
  * @param \Cx\Core\ContentManager\Model\Entity\Page $page       The resolved page
  */
 public function postContentLoad(\Cx\Core\ContentManager\Model\Entity\Page $page)
 {
     switch ($this->cx->getMode()) {
         case \Cx\Core\Core\Controller\Cx::MODE_FRONTEND:
             // Show the Shop navbar in the Shop, or on every page if configured to do so
             if (!Shop::isInitialized()) {
                 \Cx\Core\Setting\Controller\Setting::init('Shop', 'config');
                 if (\Cx\Core\Setting\Controller\Setting::getValue('shopnavbar_on_all_pages', 'Shop')) {
                     Shop::init();
                     Shop::setNavbar();
                 }
             }
             break;
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:20,代码来源:ComponentController.class.php

示例4: postInit

 /**
  * postInit
  *
  * @param \Cx\Core\Core\Controller\Cx $cx
  *
  * @return null
  */
 public function postInit(\Cx\Core\Core\Controller\Cx $cx)
 {
     $componentController = $this->getComponent('MultiSite');
     if (!$componentController) {
         return;
     }
     \Cx\Core\Setting\Controller\Setting::init('MultiSite', 'config', 'FileSystem');
     if (\Cx\Core\Setting\Controller\Setting::getValue('mode', 'MultiSite') != \Cx\Core_Modules\MultiSite\Controller\ComponentController::MODE_WEBSITE) {
         return;
     }
     $updateFile = $cx->getWebsiteTempPath() . '/Update/' . \Cx\Core_Modules\Update\Model\Repository\DeltaRepository::PENDING_DB_UPDATES_YML;
     if (!file_exists($updateFile)) {
         return;
     }
     $componentController->setCustomerPanelDomainAsMainDomain();
     $updateController = $this->getController('Update');
     $updateController->applyDelta();
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:25,代码来源:ComponentController.class.php

示例5: showDefault

 /**
  * Show the general setting options
  * 
  * @global array $_ARRAYLANG
  */
 public function showDefault()
 {
     global $_ARRAYLANG;
     \Cx\Core\Setting\Controller\Setting::init('LinkManager', 'config');
     //get post values
     $settings = isset($_POST['setting']) ? $_POST['setting'] : array();
     if (isset($_POST['save'])) {
         $includeFromSave = array('entriesPerPage');
         foreach ($settings as $settingName => $settingValue) {
             if (in_array($settingName, $includeFromSave)) {
                 \Cx\Core\Setting\Controller\Setting::set($settingName, $settingValue);
                 \Cx\Core\Setting\Controller\Setting::update($settingName);
                 \Message::ok($_ARRAYLANG['TXT_CORE_MODULE_LINKMANAGER_SUCCESS_MSG']);
             }
         }
     }
     //get the settings values from DB
     $this->template->setVariable(array($this->moduleNameLang . '_ENTRIES_PER_PAGE' => \Cx\Core\Setting\Controller\Setting::getValue('entriesPerPage', 'LinkManager')));
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:24,代码来源:SettingsController.class.php

示例6: showFeedBackForm

 /**
  * FeedBack Form
  * 
  * @global array $_ARRAYLANG
  */
 public function showFeedBackForm()
 {
     global $_ARRAYLANG;
     $objUser = \FWUser::getFWUserObject();
     //feed back types
     $feedBackTypes = array($_ARRAYLANG['TXT_SUPPORT_FEEDBACK_SELECT_FEEDBACK'], $_ARRAYLANG['TXT_SUPPORT_FEEDBACK_BUG_REPORT'], $_ARRAYLANG['TXT_SUPPORT_FEEDBACK_FEATURE_REQUEST'], $_ARRAYLANG['TXT_SUPPORT_FEEDBACK_HAVE_QUESTION']);
     \Cx\Core\Setting\Controller\Setting::init('Support', 'setup', 'Yaml');
     $faqUrl = \Cx\Core\Setting\Controller\Setting::getValue('faqUrl', 'Support');
     $recipientMailAddress = \Cx\Core\Setting\Controller\Setting::getValue('recipientMailAddress', 'Support');
     $faqLink = '<a target="_blank" title="click to FAQ page" href=' . $faqUrl . '>' . $_ARRAYLANG['TXT_SUPPORT_FEEDBACK_FAQ'] . '</a>';
     //Get License information
     $license = \Env::get('cx')->getLicense();
     $licenseName = $license->getEditionName();
     $licenseValid = date(ASCMS_DATE_FORMAT_DATE, $license->getValidToDate());
     $licenseVersion = $license->getVersion()->getNumber();
     //get the input datas
     $feedBackType = isset($_POST['feedBackType']) ? contrexx_input2raw($_POST['feedBackType']) : '';
     $feedBackSubject = isset($_POST['feedBackSubject']) ? contrexx_input2raw($_POST['feedBackSubject']) : '';
     $feedBackComment = isset($_POST['feedBackComment']) ? contrexx_input2raw($_POST['feedBackComment']) : '';
     $customerName = isset($_POST['customerName']) ? contrexx_input2raw($_POST['customerName']) : '';
     $customerEmailId = isset($_POST['customerEmailId']) ? contrexx_input2raw($_POST['customerEmailId']) : '';
     $feedBackUrl = isset($_POST['feedBackUrl']) ? contrexx_input2raw($_POST['feedBackUrl']) : '';
     if (isset($_POST['sendAndSave'])) {
         if (!empty($feedBackSubject) && !empty($feedBackComment)) {
             //get the hostname domain
             $domainRepo = new \Cx\Core\Net\Model\Repository\DomainRepository();
             $domain = $domainRepo->findOneBy(array('id' => 0));
             $arrFields = array('name' => contrexx_raw2xhtml($customerName), 'fromEmail' => contrexx_raw2xhtml($customerEmailId), 'feedBackType' => $feedBackType != 0 ? contrexx_raw2xhtml($feedBackTypes[$feedBackType]) : '', 'url' => $faqUrl, 'comments' => contrexx_raw2xhtml($feedBackComment), 'subject' => contrexx_raw2xhtml($feedBackSubject), 'firstName' => $objUser->objUser->getProfileAttribute('firstname'), 'lastName' => $objUser->objUser->getProfileAttribute('lastname'), 'phone' => !$objUser->objUser->getProfileAttribute('phone_office') ? $objUser->objUser->getProfileAttribute('phone_mobile') : $objUser->objUser->getProfileAttribute('phone_office'), 'company' => $objUser->objUser->getProfileAttribute('company'), 'toEmail' => $recipientMailAddress, 'licenseName' => $licenseName, 'licenseValid' => $licenseValid, 'licenseVersion' => $licenseVersion, 'domainName' => $domain ? $domain->getName() : '');
             //send the feedBack mail
             $this->sendMail($arrFields) ? \Message::ok($_ARRAYLANG['TXT_SUPPORT_FEEDBACK_EMAIL_SEND_SUCESSFULLY']) : \Message::error($_ARRAYLANG['TXT_SUPPORT_FEEDBACK_EMAIL_SEND_FAILED']);
         } else {
             \Message::error($_ARRAYLANG['TXT_SUPPORT_ERROR_MSG_FIELDS_EMPTY']);
             $this->template->setVariable(array('TXT_SUPPORT_ERROR_CLASS_SUBJECT' => !empty($feedBackSubject) ? "" : "errBoxStyle", 'TXT_SUPPORT_ERROR_CLASS_COMMENT' => !empty($feedBackComment) ? "" : "errBoxStyle", 'SUPPORT_FEEDBACK_SUBJECT' => contrexx_raw2xhtml($feedBackSubject), 'SUPPORT_FEEDBACK_COMMENT' => contrexx_raw2xhtml($feedBackComment)));
         }
     }
     //show FeedBack Types
     foreach ($feedBackTypes as $key => $feedbackType) {
         $this->template->setVariable(array('SUPPORT_FEEDBACK_TYPES' => $feedbackType, 'SUPPORT_FEEDBACK_SELECTED_TYPE' => !empty($feedBackType) && $feedBackType == $key ? 'selected' : '', 'SUPPORT_FEEDBACK_ID' => $key));
         $this->template->parse('showFeedBackTypes');
     }
     $this->template->setVariable(array('SUPPORT_FEEDBACK_FAQ' => $faqLink, 'SUPPORT_FEEDBACK_CUSTOMER_NAME' => $objUser->objUser->getUsername(), 'SUPPORT_FEEDBACK_CUSTOMER_EMAIL' => $objUser->objUser->getEmail()));
     $this->template->setVariable(array('TXT_SUPPORT_FEEDBACK' => $_ARRAYLANG['TXT_SUPPORT_FEEDBACK'], 'TXT_SUPPORT_FEEDBACK_SUBJECT' => $_ARRAYLANG['TXT_SUPPORT_FEEDBACK_SUBJECT'], 'TXT_SUPPORT_FEEDBACK_COMMENTS' => $_ARRAYLANG['TXT_SUPPORT_FEEDBACK_COMMENTS']));
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:48,代码来源:DefaultController.class.php

示例7: preContentLoad

 /**
  * Do something before content is loaded from DB
  * 
  * @param \Cx\Core\ContentManager\Model\Entity\Page $page       The resolved page
  */
 public function preContentLoad(\Cx\Core\ContentManager\Model\Entity\Page $page)
 {
     global $knowledgeInterface, $page_template, $themesPages;
     switch ($this->cx->getMode()) {
         case \Cx\Core\Core\Controller\Cx::MODE_FRONTEND:
             // get knowledge content
             \Cx\Core\Setting\Controller\Setting::init('Config', 'component', 'Yaml');
             if (MODULE_INDEX < 2 && \Cx\Core\Setting\Controller\Setting::getValue('useKnowledgePlaceholders', 'Config')) {
                 $knowledgeInterface = new KnowledgeInterface();
                 if (preg_match('/{KNOWLEDGE_[A-Za-z0-9_]+}/i', \Env::get('cx')->getPage()->getContent())) {
                     $knowledgeInterface->parse(\Env::get('cx')->getPage()->getContent());
                 }
                 if (preg_match('/{KNOWLEDGE_[A-Za-z0-9_]+}/i', $page_template)) {
                     $knowledgeInterface->parse($page_template);
                 }
                 if (preg_match('/{KNOWLEDGE_[A-Za-z0-9_]+}/i', $themesPages['index'])) {
                     $knowledgeInterface->parse($themesPages['index']);
                 }
             }
             break;
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:27,代码来源:ComponentController.class.php

示例8: 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;
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:47,代码来源:BackendController.class.php

示例9: SearchFindContent

 public function SearchFindContent($search)
 {
     $term_db = $search->getTerm();
     $flagIsReseller = false;
     $objUser = \FWUser::getFWUserObject()->objUser;
     if ($objUser->login()) {
         $objCustomer = \Cx\Modules\Shop\Controller\Customer::getById($objUser->getId());
         \Cx\Core\Setting\Controller\Setting::init('Shop', 'config');
         if ($objCustomer && $objCustomer->is_reseller()) {
             $flagIsReseller = true;
         }
     }
     $querySelect = $queryCount = $queryOrder = null;
     list($querySelect, $queryCount, $queryTail, $queryOrder) = \Cx\Modules\Shop\Controller\Products::getQueryParts(null, null, null, $term_db, false, false, '', $flagIsReseller);
     $query = $querySelect . $queryTail . $queryOrder;
     //Search query
     $parseSearchData = function (&$searchData) {
         $searchData['title'] = $searchData['name'];
         $searchData['content'] = $searchData['long'] ? $searchData['long'] : $searchData['short'];
         $searchData['score'] = $searchData['score1'] + $searchData['score2'] + $searchData['score3'];
     };
     $result = new \Cx\Core_Modules\Listing\Model\Entity\DataSet($search->getResultArray($query, 'Shop', 'details', 'productId=', $search->getTerm(), $parseSearchData));
     $search->appendResult($result);
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:24,代码来源:ShopEventListener.class.php

示例10: 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;
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:52,代码来源:CrmSettings.class.php

示例11: terminate

 /**
  * Change Subscription State to Terminate.
  *
  * @throws WebsiteException
  */
 public function terminate()
 {
     global $_ARRAYLANG;
     if ($this->externalSubscriptionId) {
         \Cx\Core\Setting\Controller\Setting::init('MultiSite', '', 'FileSystem');
         $instanceName = \Cx\Core\Setting\Controller\Setting::getValue('payrexxAccount', 'MultiSite');
         $apiSecret = \Cx\Core\Setting\Controller\Setting::getValue('payrexxApiSecret', 'MultiSite');
         if (empty($instanceName) || empty($apiSecret)) {
             return;
         }
         $payrexx = new \Payrexx\Payrexx($instanceName, $apiSecret);
         $subscription = new \Payrexx\Models\Request\Subscription();
         $subscription->setId($this->externalSubscriptionId);
         try {
             $response = $payrexx->cancel($subscription);
             if (isset($response['status']) && $response['status'] != 'success' || isset($response['data']['status']) && $response['data']['status'] != 'cancelled') {
                 throw new SubscriptionException($_ARRAYLANG['TXT_MODULE_ORDER_SUBSCRIPTION_PAYREXX_CANCEL_FAILED']);
             }
         } catch (\Payrexx\PayrexxException $e) {
             throw new SubscriptionException($e->getMessage());
         }
     }
     //set state terminated.
     $this->setState(self::STATE_TERMINATED);
     //Set current date/time
     $this->setTerminationDate(new \DateTime());
     //Trigger the model event terminated on the subscription's product entity.
     \Env::get('cx')->getEvents()->triggerEvent('model/terminated', array(new \Doctrine\ORM\Event\LifecycleEventArgs($this, \Env::get('em'))));
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:34,代码来源:Subscription.class.php

示例12: showFtp

 public function showFtp()
 {
     global $_ARRAYLANG, $objTemplate, $_CONFIG;
     $this->strPageTitle = $_ARRAYLANG['TXT_SETTINGS_FTP'];
     $objTemplate->addBlockfile('ADMIN_CONTENT', 'settings_ftp', 'settings_ftp.html');
     //get the ftp server name
     $domainRepo = \Env::get('em')->getRepository('Cx\\Core\\Net\\Model\\Entity\\Domain');
     $objDomain = $domainRepo->findOneBy(array('id' => 0));
     //get the ftp user name
     \Cx\Core\Setting\Controller\Setting::init('MultiSite', 'website', 'FileSystem');
     $ftpUserName = \Cx\Core\Setting\Controller\Setting::getValue('websiteFtpUser', 'MultiSite');
     if (empty($ftpUserName)) {
         throw new \Exception('FTP Failed to load: Website Ftp User is empty');
     }
     $objTemplate->setVariable(array('FTP_SERVER_NAME' => 'ftp://' . $objDomain->getName(), 'FTP_USER_NAME' => $ftpUserName));
     $objTemplate->setVariable(array('TXT_SETTINGS_FTP' => $_ARRAYLANG['TXT_SETTINGS_FTP'], 'TXT_SETTINGS_FTP_SERVER' => $_ARRAYLANG['TXT_SETTINGS_FTP_SERVER'], 'TXT_SETTINGS_FTP_USER' => $_ARRAYLANG['TXT_SETTINGS_FTP_USER'], 'TXT_SETTINGS_FTP_PASSWORD' => $_ARRAYLANG['TXT_SETTINGS_FTP_PASSWORD'], 'TXT_SETTINGS_RESET_PASSWORD' => $_ARRAYLANG['TXT_SETTINGS_RESET_PASSWORD']));
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:17,代码来源:Config.class.php

示例13: _saveSettings

 /**
  * Global save function for saving the settings into database
  *
  * @return null
  */
 function _saveSettings()
 {
     global $_ARRAYLANG, $objDatabase;
     foreach ($_POST['settings'] as $name => $value) {
         if (is_array($value)) {
             $value = implode(',', $value);
         }
         $query = "UPDATE " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_settings\n                         SET value = '" . contrexx_addslashes($value) . "'\n                       WHERE name = '" . contrexx_addslashes($name) . "'";
         $objResult = $objDatabase->Execute($query);
     }
     if (isset($_POST['settings']['headlinesStatus'])) {
         \Cx\Core\Setting\Controller\Setting::init('Config', 'component', 'Yaml');
         $headLinesStatusIntval = intval($_POST['settings']['headlinesStatus']);
         if (!\Cx\Core\Setting\Controller\Setting::isDefined('calendarheadlines')) {
             \Cx\Core\Setting\Controller\Setting::add('calendarheadlines', $headLinesStatusIntval, 1, \Cx\Core\Setting\Controller\Setting::TYPE_RADIO, '1:TXT_ACTIVATED,0:TXT_DEACTIVATED', 'component');
         } else {
             \Cx\Core\Setting\Controller\Setting::set('calendarheadlines', $headLinesStatusIntval);
             \Cx\Core\Setting\Controller\Setting::update('calendarheadlines');
         }
     }
     if ($objResult !== false) {
         $this->okMessage = $_ARRAYLANG['TXT_CALENDAR_SETTINGS_SUCCESSFULLY_EDITED'];
     } else {
         $this->errMessage = $_ARRAYLANG['TXT_CALENDAR_SETTINGS_CORRUPT_EDITED'];
     }
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:31,代码来源:CalendarSettings.class.php

示例14: errorHandler

 /**
  * Fixes database errors.
  *
  * Also migrates settings from the old Shop settings table to \Cx\Core\Setting.
  * @return  boolean                 False.  Always.
  * @throws  Cx\Lib\Update_DatabaseException
  */
 static function errorHandler()
 {
     global $_CONFIGURATION;
     // ShopSettings
     \Cx\Core\Setting\Controller\Setting::errorHandler();
     \Cx\Core\Setting\Controller\Setting::init('Shop', 'config');
     $table_name = DBPREFIX . 'module_shop_config';
     $i = 0;
     if (\Cx\Lib\UpdateUtil::table_exist($table_name)) {
         // Migrate all entries using the \Cx\Core\Setting\Controller\Setting class
         $query = "\n                SELECT `name`, `value`, `status`\n                  FROM " . DBPREFIX . "module_shop_config\n                 ORDER BY `id` ASC";
         $objResult = \Cx\Lib\UpdateUtil::sql($query);
         if (!$objResult) {
             throw new \Cx\Lib\Update_DatabaseException('Failed to query old Shop settings', $query);
         }
         while (!$objResult->EOF) {
             $name = $objResult->fields['name'];
             $value = $objResult->fields['value'];
             $status = $objResult->fields['status'];
             $name_status = null;
             switch ($name) {
                 // OBSOLETE
                 case 'tax_default_id':
                 case 'tax_enabled':
                 case 'tax_included':
                 case 'tax_number':
                     // Ignore, do not migrate!
                     $name = null;
                     break;
                     // VALUE ONLY (RE: arrConfig\[.*?\]\[.value.\])
                 // VALUE ONLY (RE: arrConfig\[.*?\]\[.value.\])
                 case 'confirmation_emails':
                     $name = 'email_confirmation';
                     break;
                 case 'country_id':
                 case 'datatrans_merchant_id':
                 case 'datatrans_request_type':
                     break;
                 case 'datatrans_status':
                     $name = 'datatrans_active';
                     break;
                 case 'datatrans_use_testserver':
                 case 'email':
                 case 'fax':
                 case 'orderitems_amount_max':
                 case 'paypal_default_currency':
                 case 'postfinance_mobile_ijustwanttotest':
                 case 'postfinance_mobile_sign':
                 case 'postfinance_mobile_status':
                 case 'postfinance_mobile_webuser':
                 case 'product_sorting':
                 case 'saferpay_finalize_payment':
                 case 'saferpay_window_option':
                     break;
                 case 'shop_address':
                 case 'shop_company':
                 case 'shop_show_products_default':
                 case 'shop_thumbnail_max_height':
                 case 'shop_thumbnail_max_width':
                 case 'shop_thumbnail_quality':
                 case 'shop_weight_enable':
                     $name = preg_replace('/^shop_/', '', $name);
                     break;
                 case 'telephone':
                 case 'vat_default_id':
                 case 'vat_enabled_foreign_customer':
                 case 'vat_enabled_foreign_reseller':
                 case 'vat_enabled_home_customer':
                 case 'vat_enabled_home_reseller':
                 case 'vat_included_foreign_customer':
                 case 'vat_included_foreign_reseller':
                 case 'vat_included_home_customer':
                 case 'vat_included_home_reseller':
                 case 'vat_number':
                 case 'vat_other_id':
                     break;
                 case 'yellowpay_accepted_payment_methods':
                 case 'yellowpay_authorization_type':
                 case 'yellowpay_hash_seed':
                 case 'yellowpay_hash_signature_in':
                 case 'yellowpay_hash_signature_out':
                 case 'yellowpay_use_testserver':
                     $name = preg_replace('/^yellowpay(.*)$/', 'postfinance$1', $name);
                     break;
                 case 'yellowpay_id':
                     // Obsolete
                     $name = null;
                     break;
                     // VALUE & STATUS
                 // VALUE & STATUS
                 case 'paypal_account_email':
                     $name_status = 'paypal_active';
                     break;
//.........这里部分代码省略.........
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:101,代码来源:ShopSettings.class.php

示例15: getGlobalSetting

 /**
  * Return the global setting
  *
  * @return string
  * @throws DatabaseError
  * @global $objDatabase
  * @return mixed
  */
 protected function getGlobalSetting()
 {
     //return the global setting('useKnowledgePlaceholders') value
     \Cx\Core\Setting\Controller\Setting::init('Config', 'component', 'Yaml');
     return \Cx\Core\Setting\Controller\Setting::getValue('useKnowledgePlaceholders', 'Config');
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:14,代码来源:KnowledgeLibrary.class.php


注:本文中的Cx\Core\Setting\Controller\Setting::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。