فهرست منبع

Ticket #4748 - Application mode: Allow to customize icons.

AntonLV 2 سال پیش
والد
کامیت
6ffb58d76e

+ 16 - 0
inc/classes/BxDolTemplate.php

@@ -2217,6 +2217,22 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
         return $sContent;
     }
 
+    public function clearTemplatesCache($sType = '')
+    {
+        if(!$sType)
+            $sType = 'template';
+
+        $this->getTemplatesCacheObject()->removeAllByPrefix($this->getCacheFilePrefix($sType));
+    }
+
+    public function clearImagesCache($sCode = '')
+    {
+        if(!$sCode)
+            $sCode = $this->_sCode;
+
+        BxDolDb::getInstance()->getDbCacheObject()->removeAllByPrefix('sys_layout_images_' . $sCode .  '_');
+    }
+
     /**
      * Add JS file(s) to global output.
      *

+ 11 - 1
modules/boonex/artificer/classes/BxArtificerAlertsResponse.php

@@ -79,7 +79,9 @@ class BxArtificerAlertsResponse extends BxBaseModTemplateAlertsResponse
 
     protected function _processSystemGetLayoutImages($oAlert)
     {
-        $sImages = getParam($this->_oModule->_oConfig->getPrefix('option') . 'images_custom');
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $sImages = getParam($CNF['PARAM_IMAGES_CUSTOM']);
         if(!$sImages)
             return;
         
@@ -136,6 +138,14 @@ class BxArtificerAlertsResponse extends BxBaseModTemplateAlertsResponse
         }
     }
 
+    protected function _processSystemSaveSetting($oAlert)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if($oAlert->aExtras['option'] == $CNF['PARAM_IMAGES_CUSTOM'])
+            BxDolTemplate::getInstance()->clearImagesCache($this->_oModule->_oConfig->getUri());
+    }
+
     protected function _processProfileUnit($oAlert)
     {
         if(!$this->_isActive())

+ 5 - 0
modules/boonex/artificer/classes/BxArtificerConfig.php

@@ -40,6 +40,11 @@ class BxArtificerConfig extends BxBaseModTemplateConfig
     {
         parent::__construct($aModule);
 
+        $this->CNF = array_merge($this->CNF, [
+            // some params
+            'PARAM_IMAGES_CUSTOM' => 'bx_artificer_images_custom',
+        ]);
+
         $this->_aJsClasses = array_merge($this->_aJsClasses, array(
             'utils' => 'BxArtificerUtils'
         ));

+ 1 - 0
modules/boonex/artificer/install/sql/enable.sql

@@ -29,6 +29,7 @@ INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
 ('system', 'change_mark_dark', @iHandler),
 ('system', 'get_object', @iHandler),
 ('system', 'get_layout_images', @iHandler),
+('system', 'save_setting', @iHandler),
 ('profile', 'unit', @iHandler);