當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FSS_Helper::styles_incl方法代碼示例

本文整理匯總了PHP中FSS_Helper::styles_incl方法的典型用法代碼示例。如果您正苦於以下問題:PHP FSS_Helper::styles_incl方法的具體用法?PHP FSS_Helper::styles_incl怎麽用?PHP FSS_Helper::styles_incl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FSS_Helper的用法示例。


在下文中一共展示了FSS_Helper::styles_incl方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: StylesAndJS

 static function StylesAndJS($params = array(), $css = array(), $js = array())
 {
     $document = JFactory::getDocument();
     $force_jquery = false;
     if (isset($params['force_jquery'])) {
         $force_jquery = true;
         unset($params['force_jquery']);
     }
     if (in_array('force_jquery', $params)) {
         $force_jquery = true;
         $key = array_search('force_jquery', $params);
         unset($params[$key]);
     }
     if (!self::$styles_incl) {
         // jquery with its various options
         self::IncludeJQuery($force_jquery);
         // bootstrap (css and javascript)
         self::Bootstrap();
         //$document->addStyleSheet(FSSRoute::_( "index.php?option=com_fss&view=css&layout=default&old=1" )); // Add old stylesheets to page
         FSS_CSSParse::OutputCSS('components/com_fss/assets/css/fss.less');
         if (!FSSJ3Helper::IsJ3()) {
             FSS_CSSParse::OutputCSS('components/com_fss/assets/css/fss_j25.less');
         }
         if (FSS_Settings::get('hide_warnings')) {
             $document->addScriptDeclaration('var fss_no_warn = true;');
         }
         $document->addScript(JURI::root(true) . '/components/com_fss/assets/js/main.js');
         if (FSS_Settings::get('bootstrap_v3')) {
             FSS_CSSParse::OutputCSS('components/com_fss/assets/css/bs3_fixes.less');
             $document->addScript(JURI::root(true) . '/components/com_fss/assets/js/bs3_fixes.js');
         }
         self::$styles_incl = true;
     }
     foreach ($params as $param) {
         if (array_key_exists($param, self::$styles_sub_incl)) {
             continue;
         }
         switch ($param) {
             case 'autoscroll':
                 $document->addScript(JURI::root(true) . '/components/com_fss/assets/js/jquery/jquery.autoscroll.js');
                 break;
             case 'tooltip':
                 $document->addScript(JURI::root(true) . '/components/com_fss/assets/js/fss_tooltip.js');
                 break;
             case 'glossary':
                 $document->addScript(JURI::root(true) . '/components/com_fss/assets/js/glossary.js');
                 break;
             case 'translate':
                 $document->addScript(JURI::root(true) . '/administrator/components/com_fss/assets/js/translate.js');
                 $document->addScript(JURI::root(true) . '/administrator/components/com_fss/assets/js/popup.js');
                 $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_fss/assets/css/popup.css');
                 break;
             case 'csstest':
                 $document->addScript(JURI::root(true) . '/administrator/components/com_fss/assets/js/csstest.js');
                 break;
             case 'admin_css':
                 $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_fss/assets/css/main.css');
                 break;
             case 'calendar':
                 $document->addStyleSheet(JURI::root(true) . '/components/com_fss/assets/css/calendar.css');
                 $document->addStyleSheet(JURI::root(true) . '/components/com_fss/assets/css/calendar_omega.css');
                 $document->addScript(JURI::root(true) . '/components/com_fss/assets/js/calendar.js');
                 break;
             case 'base64':
                 $document->addScript(JURI::root(true) . '/components/com_fss/assets/js/base64.js');
                 break;
             case 'ticket_list':
                 FSS_Translate_Helper::CalenderLocale();
                 $document->addScript(JURI::root(true) . '/components/com_fss/assets/js/ticket_list.js');
                 break;
             case 'cookie':
                 $document->addScript(JURI::root(true) . '/components/com_fss/assets/js/jquery/jquery.cookie.js');
                 break;
         }
         self::$styles_sub_incl[$param] = 1;
     }
     foreach ($css as $c) {
         if (array_key_exists($c, self::$styles_sub_incl)) {
             continue;
         }
         $document->addStyleSheet(JURI::root(true) . "/" . $c);
         self::$styles_sub_incl[$c] = 1;
     }
     foreach ($js as $j) {
         if (array_key_exists($j, self::$styles_sub_incl)) {
             continue;
         }
         $document->addScript(JURI::root(true) . "/" . $j);
         self::$styles_sub_incl[$j] = 1;
     }
     /* Joomla 3.4 fix for admin pagination problem */
     if (JFactory::getApplication()->isAdmin()) {
         $version = new JVersion();
         if ($version->RELEASE >= 3.4) {
             $script = "\n\t\t\t\tjQuery(document).ready( function () {\n\t\t\t\t\tjQuery('.pagination-list').removeClass('pagination');\n\t\t\t\t\tjQuery('.pagination-toolbar').addClass('pagination');\n\t\t\t\t});";
             $document->addScriptDeclaration($script);
         }
     }
 }
開發者ID:vstorm83,項目名稱:propertease,代碼行數:99,代碼來源:helper.php


注:本文中的FSS_Helper::styles_incl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。