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


PHP FSS_Settings::GetAllViewSettings方法代码示例

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


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

示例1: display

 function display($tpl = null)
 {
     JHTML::_('behavior.modal');
     $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');
     $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::GetAllViewSettings();
     // CHANGE
     $db = JFactory::getDBO();
     if ($what == "save") {
         $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;
             }
             $qry = "REPLACE INTO #__fss_settings_view (setting, value) VALUES ('";
             $qry .= FSSJ3Helper::getEscaped($db, $setting) . "','";
             $qry .= FSSJ3Helper::getEscaped($db, $value) . "')";
             $db->setQuery($qry);
             $db->Query();
         }
         $link = 'index.php?option=com_fss&view=settingsview#' . $this->tab;
         if (JRequest::getVar('task') == "save") {
             $link = 'index.php?option=com_fss';
         }
         $mainframe = JFactory::getApplication();
         $mainframe->redirect($link, JText::_("View_Settings_Saved"));
         exit;
     } else {
         $document = JFactory::getDocument();
         $document->addStyleSheet(JURI::root() . 'administrator/components/com_fss/assets/css/js_color_picker_v2.css');
         $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/color_functions.js');
         $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/js_color_picker_v2.js');
         $this->settings = $settings;
         JToolBarHelper::title(JText::_("FREESTYLE_SUPPORT_PORTAL") . ' - ' . JText::_("VIEW_SETTINGS"), 'fss_viewsettings');
         JToolBarHelper::apply();
         JToolBarHelper::save();
         JToolBarHelper::cancel('cancellist');
         FSSAdminHelper::DoSubToolbar();
         parent::display($tpl);
     }
 }
开发者ID:vstorm83,项目名称:propertease,代码行数:56,代码来源:view.html.php

示例2: ReplaceGlossary

 static function ReplaceGlossary($text)
 {
     if (stripos($text, "id='XXX_GLOSSARY_DONE_XXX'") !== FALSE) {
         return $text;
     }
     self::GetGlossary();
     FSS_Settings::GetAllViewSettings();
     if (count(self::$glossary) == 0) {
         return $text;
     }
     // build a rough list of terms in the document in question. This means less stuff for the preg to check later on
     self::$glo_ref = array();
     foreach (self::$glossary as $offset => &$data) {
         $data->limit = 999;
         if (FSS_Settings::get('glossary_word_limit') > 0) {
             $data->limit = FSS_Settings::get('glossary_word_limit');
         }
         if (empty($data->linkword)) {
             $data->linkword = $data->word;
         }
         $data->anc = self::MakeAnchor($data->word);
         $data->ref = $data->id . "-" . $data->anc;
         $linkanc = self::MakeAnchor($data->linkword);
         $linkref = $data->id . "-" . $data->anc;
         $data->href = "#";
         $data->cs = self::isWordCS($data);
         // word for regex
         $rword = preg_quote($data->word);
         $rword = str_replace("/", "\\/", $rword);
         $data->regex = "/\\b({$rword})\\b/";
         if (!$data->cs) {
             $data->regex .= "i";
         }
         if (FSS_Settings::get('glossary_link')) {
             if (FSS_Settings::$fss_view_settings['glossary_long_desc'] == 1 && $data->longdesc) {
                 // link directly to the item
                 $data->href = FSSRoute::_("index.php?option=com_fss&view=glossary&layout=word&word=" . $linkref, false);
             } else {
                 $data->href = FSSRoute::_('index.php?option=com_fss&view=glossary&letter=' . strtolower(substr($data->linkword, 0, 1)) . '#' . $linkanc, false);
             }
         }
         if (stripos($text, $data->word) !== FALSE) {
             self::$glo_ref[$data->ref] = $offset;
             $data->inuse = true;
         }
     }
     // setup empty dom object
     libxml_use_internal_errors(TRUE);
     $dom = new DOMDocument('1.0', 'UTF-8');
     FSS_Glossary::$cdom = $dom;
     $dom->substituteEntities = false;
     $dom->recover = true;
     $dom->strictErrorChecking = false;
     $dom->resolveExternals = false;
     // load the xml file. Add padding tags as the dom adds crap to the start of the output
     $dom->loadHTML('<?xml version="1.0" encoding="UTF-8"?><meta http-equiv="content-type" content="text/html; charset=utf-8"><xxxglossaryxxx>' . $text . "</xxxglossaryxxx>");
     // get list of html tags to ignore
     $tag_ignore = FSS_Settings::get('glossary_exclude');
     $tag_ignore = explode(",", $tag_ignore);
     $tags = array();
     $tags[] = "a";
     foreach ($tag_ignore as $tag) {
         $tag = trim($tag);
         if (!$tag) {
             continue;
         }
         $tags[] = $tag;
     }
     // replace all glossary terms
     FSS_Glossary::preg_replace_dom($dom->documentElement, $tags);
     // get resultant html
     $result = $dom->saveHTML();
     //$result = str_replace("&amp;","&", $result);
     // use padding added earlier to remove appended content
     $pos1 = strpos($result, "<xxxglossaryxxx>") + 16;
     $pos2 = strrpos($result, "</xxxglossaryxxx>");
     $result = substr($result, $pos1, $pos2 - $pos1) . "<div style='display: none' id='XXX_GLOSSARY_DONE_XXX'></div>";
     return $result;
 }
开发者ID:vstorm83,项目名称:propertease,代码行数:79,代码来源:glossary.php


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