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


PHP FSS_Settings::reload方法代码示例

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


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

示例1: display

 function display($tpl = null)
 {
     FSS_CSSParse::OutputCSS('components/com_fss/assets/css/bootstrap/bootstrap_fssonly.less');
     $document = JFactory::getDocument();
     $document->addScriptDeclaration("\nvar fss_settings_url = '" . JRoute::_('index.php?option=com_fss&view=settings', false) . "';\n");
     $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/settings.js');
     FSS_Helper::StylesAndJS(array('csstest'));
     JHTML::_('behavior.modal');
     $what = JRequest::getString('what', '');
     $this->tab = JRequest::getVar('tab');
     if (JRequest::getVar('task') == "cancellist") {
         $mainframe = JFactory::getApplication();
         $link = FSSRoute::_('index.php?option=com_fss&view=fsss', false);
         $mainframe->redirect($link);
         return;
     }
     $settings = FSS_Settings::GetAllSettings();
     $db = JFactory::getDBO();
     if ($what == "testref") {
         return $this->TestRef();
     } else {
         if ($what == "testdates") {
             return $this->testdates();
         } else {
             if ($what == "send_test_email") {
                 return $this->test_email_send();
             } else {
                 if ($what == "save") {
                     $support_autoclose = JRequest::getInt('support_autoclose');
                     $support_autoclose_duration = JRequest::getInt('support_autoclose_duration');
                     $support_autoclose_audit = JRequest::getInt('support_autoclose_audit');
                     $support_autoclose_email = JRequest::getInt('support_autoclose_email');
                     $aparams = "addaudit:{$support_autoclose_audit};emailuser:{$support_autoclose_email};closeinterval:{$support_autoclose_duration};";
                     $qry = "UPDATE #__fss_cron SET params = '" . FSSJ3Helper::getEscaped($db, $aparams) . "', published = {$support_autoclose}, `interval` = 5 WHERE class = 'AutoClose'";
                     $db->setQuery($qry);
                     //echo $qry."<br>";
                     $db->Query();
                     unset($_POST['support_autoclose']);
                     unset($_POST['support_autoclose_duration']);
                     unset($_POST['support_autoclose_audit']);
                     unset($_POST['support_autoclose_email']);
                     $large = FSS_Settings::GetLargeList();
                     $templates = FSS_Settings::GetTemplateList();
                     // save any large settings that arent in the templates list
                     foreach ($large as $setting) {
                         // skip any setting that is in the templates list
                         if (array_key_exists($setting, $templates)) {
                             continue;
                         }
                         //
                         $value = JRequest::getVar($setting, '', 'post', 'string', JREQUEST_ALLOWRAW);
                         $qry = "REPLACE INTO #__fss_settings_big (setting, value) VALUES ('";
                         $qry .= FSSJ3Helper::getEscaped($db, $setting) . "','";
                         $qry .= FSSJ3Helper::getEscaped($db, $value) . "')";
                         $db->setQuery($qry);
                         $db->Query();
                         $qry = "DELETE FROM #__fss_settings WHERE setting = '" . FSSJ3Helper::getEscaped($db, $setting) . "'";
                         $db->setQuery($qry);
                         $db->Query();
                         unset($_POST[$setting]);
                     }
                     $data = JRequest::get('POST', JREQUEST_ALLOWRAW);
                     foreach ($data as $setting => $value) {
                         if (array_key_exists($setting, $settings)) {
                             $settings[$setting] = $value;
                         }
                     }
                     foreach ($settings as $setting => $value) {
                         if (!array_key_exists($setting, $data)) {
                             $settings[$setting] = 0;
                             $value = 0;
                         }
                         // skip any setting that is in the templates list
                         if (array_key_exists($setting, $templates)) {
                             continue;
                         }
                         if (array_key_exists($setting, $large)) {
                             continue;
                         }
                         $qry = "REPLACE INTO #__fss_settings (setting, value) VALUES ('";
                         $qry .= FSSJ3Helper::getEscaped($db, $setting) . "','";
                         $qry .= FSSJ3Helper::getEscaped($db, $value) . "')";
                         $db->setQuery($qry);
                         $db->Query();
                         //echo $qry."<br>";
                     }
                     FSS_Settings::reload();
                     $msg = JText::_("Settings_Saved");
                     $msgtytpe = "message";
                     if (!FSS_CSSParse::ParseStaticFiles()) {
                         $msg = "<p>Freestyle Support Portal cannot write to the following files:</p>";
                         $msg .= "<ul>";
                         foreach (FSS_CSSParse::$failed as $file) {
                             $msg .= "<li>" . $file . "</li>";
                         }
                         $msg .= "</ul>";
                         $msg .= "<p>Without this it may not display correctly on your site.</p>";
                         $msgtytpe = "error";
                     }
                     $link = 'index.php?option=com_fss&view=settings#' . $this->tab;
//.........这里部分代码省略.........
开发者ID:vstorm83,项目名称:propertease,代码行数:101,代码来源:view.html.php


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