AntonLV il y a 5 ans
Parent
commit
2c3d328a7e
3 fichiers modifiés avec 26 ajouts et 3 suppressions
  1. 6 2
      inc/classes/BxDolPreloader.php
  2. 1 1
      install/sql/system.sql
  3. 19 0
      template/scripts/BxBaseServices.php

+ 6 - 2
inc/classes/BxDolPreloader.php

@@ -72,10 +72,14 @@ class BxDolPreloader extends BxDolFactory implements iBxDolSingleton
             if(!in_array($sType, $aTypesAvail))
                 continue;
 
-            $sMethod = $this->_aTypes[$sType];
+            if(BxDolService::isSerializedService($aEntry['content']))
+                $aEntry['content'] = BxDolService::callSerialized($aEntry['content']);
+
             $sContent = bx_replace_markers($aEntry['content'], $this->_aMarkers);
+            if(empty($sContent))
+                continue;
 
-            $oTemplateSystem->$sMethod($sContent);
+            $oTemplateSystem->{$this->_aTypes[$sType]}($sContent);
         }
     }
 }

+ 1 - 1
install/sql/system.sql

@@ -5513,7 +5513,7 @@ INSERT INTO `sys_preloader`(`module`, `type`, `content`, `active`, `order`) VALU
 ('system', 'css_system', '{dir_plugins_public}marka/|marka.min.css', 1, 1),
 ('system', 'css_system', '{dir_plugins_public}at.js/css/|jquery.atwho.min.css', 1, 2),
 ('system', 'css_system', '{dir_plugins_public}prism/|prism.css', 1, 3),
-('system', 'css_system', '{dir_plugins_public}tailwind/css/|tailwind.min.css', 1, 4),
+('system', 'css_system', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:21:"get_preloader_content";s:6:"params";a:1:{i:0;s:8:"tailwind";}s:5:"class";s:13:"TemplServices";}', 1, 4),
 ('system', 'css_system', 'common.css', 1, 10),
 ('system', 'css_system', 'default.less', 1, 11),
 ('system', 'css_system', 'general.css', 1, 12),

+ 19 - 0
template/scripts/BxBaseServices.php

@@ -70,6 +70,25 @@ class BxBaseServices extends BxDol implements iBxDolProfileService
         );
     }
 
+    public function serviceGetPreloaderContent($sName) {
+        $sResult = '';
+
+        switch($sName) {
+            case 'tailwind':
+                /**
+                 * Note. For now Tailwind isn't needed in Studio.
+                 */
+                list($sPageUrl, $sPageParams) = bx_get_base_url_inline();
+                if(!empty($sPageUrl) && strncmp($sPageUrl, BX_DOL_URL_STUDIO, strlen(BX_DOL_URL_STUDIO)) == 0)
+                    break;
+
+                $sResult = '{dir_plugins_public}tailwind/css/|tailwind.min.css';
+                break;
+        }
+
+        return $sResult;
+    }
+            
     /**
      * @page service Service Calls
      * @section bx_system_general System Services