Przeglądaj źródła

Ticket #268 - Styles changer.

AntonLV 10 lat temu
rodzic
commit
98b0605cf2

+ 6 - 0
install/sql/system.sql

@@ -1013,6 +1013,12 @@ SET @iIdHandler = LAST_INSERT_ID();
 INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
 ('system', 'save_setting', @iIdHandler);
 
+INSERT INTO `sys_alerts_handlers` (`name`, `service_call`) VALUES
+('sys_settings_sys_images_custom_file_deleted', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:45:"alert_response_sys_images_custom_file_deleted";s:6:"params";a:0:{}s:5:"class";s:27:"TemplStudioSettingsServices";}');
+SET @iIdHandler = LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('sys_images_custom', 'file_deleted', @iIdHandler);
 
 -- --------------------------------------------------------
 

+ 19 - 0
modules/boonex/air/data/template/studio/scripts/BxTemplStudioSettingsServices.php

@@ -0,0 +1,19 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    TridentView Trident Studio Representation classes
+ * @ingroup     TridentStudio
+ * @{
+ */
+defined('BX_DOL') or die('hack attempt');
+
+class BxTemplStudioSettingsServices extends BxBaseStudioSettingsServices
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+}
+/** @} */

+ 19 - 0
modules/boonex/ocean/data/template/studio/scripts/BxTemplStudioSettingsServices.php

@@ -0,0 +1,19 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    TridentView Trident Studio Representation classes
+ * @ingroup     TridentStudio
+ * @{
+ */
+defined('BX_DOL') or die('hack attempt');
+
+class BxTemplStudioSettingsServices extends BxBaseStudioSettingsServices
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+}
+/** @} */

+ 19 - 0
modules/boonex/uni/data/template/studio/scripts/BxTemplStudioSettingsServices.php

@@ -0,0 +1,19 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    TridentView Trident Studio Representation classes
+ * @ingroup     TridentStudio
+ * @{
+ */
+defined('BX_DOL') or die('hack attempt');
+
+class BxTemplStudioSettingsServices extends BxBaseStudioSettingsServices
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+}
+/** @} */

+ 4 - 4
modules/boonex/uni/install/sql/install.sql

@@ -22,17 +22,17 @@ SET @iCategoryId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
 (@iCategoryId, CONCAT(@sName, '_header_bg_color'), '_bx_uni_stg_cpt_option_header_bg_color', 'rgba(59, 134, 134, 1)', 'rgba', '', '', '', 1),
-	(@iCategoryId, CONCAT(@sName, '_header_bg_image'), '_bx_uni_stg_cpt_option_header_bg_image', '', 'image', '', '', '', 2),
+(@iCategoryId, CONCAT(@sName, '_header_bg_image'), '_bx_uni_stg_cpt_option_header_bg_image', '', 'image', '', '', '', 2),
 (@iCategoryId, CONCAT(@sName, '_header_border_color'), '_bx_uni_stg_cpt_option_header_border_color', 'rgb(208, 208, 208)', 'rgb', '', '', '', 3),
 (@iCategoryId, CONCAT(@sName, '_header_border_size'), '_bx_uni_stg_cpt_option_header_border_size', '0px', 'digit', '', '', '', 4),
 (@iCategoryId, CONCAT(@sName, '_site_bg_color'), '_bx_uni_stg_cpt_option_site_bg_color', 'rgb(255, 255, 255)', 'rgb', '', '', '', 11),
-	(@iCategoryId, CONCAT(@sName, '_site_bg_image'), '_bx_uni_stg_cpt_option_site_bg_image', '', 'image', '', '', '', 12),
+(@iCategoryId, CONCAT(@sName, '_site_bg_image'), '_bx_uni_stg_cpt_option_site_bg_image', '', 'image', '', '', '', 12),
 (@iCategoryId, CONCAT(@sName, '_footer_bg_color'), '_bx_uni_stg_cpt_option_footer_bg_color', 'rgb(255, 255, 255, 1)', 'rgba', '', '', '', 21),
-	(@iCategoryId, CONCAT(@sName, '_footer_bg_image'), '_bx_uni_stg_cpt_option_footer_bg_image', '', 'image', '', '', '', 22),
+(@iCategoryId, CONCAT(@sName, '_footer_bg_image'), '_bx_uni_stg_cpt_option_footer_bg_image', '', 'image', '', '', '', 22),
 (@iCategoryId, CONCAT(@sName, '_footer_border_color'), '_bx_uni_stg_cpt_option_footer_border_color', 'rgb(208, 208, 208)', 'rgb', '', '', '', 23),
 (@iCategoryId, CONCAT(@sName, '_footer_border_size'), '_bx_uni_stg_cpt_option_footer_border_size', '1px', 'digit', '', '', '', 24),
 (@iCategoryId, CONCAT(@sName, '_block_bg_color'), '_bx_uni_stg_cpt_option_block_bg_color', 'rgb(255, 255, 255, 1)', 'rgba', '', '', '', 31),
-	(@iCategoryId, CONCAT(@sName, '_block_bg_image'), '_bx_uni_stg_cpt_option_block_bg_image', '', 'image', '', '', '', 32),
+(@iCategoryId, CONCAT(@sName, '_block_bg_image'), '_bx_uni_stg_cpt_option_block_bg_image', '', 'image', '', '', '', 32),
 (@iCategoryId, CONCAT(@sName, '_block_border_color'), '_bx_uni_stg_cpt_option_block_border_color', 'rgb(208, 208, 208)', 'rgb', '', '', '', 33),
 (@iCategoryId, CONCAT(@sName, '_block_border_size'), '_bx_uni_stg_cpt_option_block_border_size', '0px', 'digit', '', '', '', 34),
 (@iCategoryId, CONCAT(@sName, '_block_border_radius'), '_bx_uni_stg_cpt_option_block_border_radius', '0px', 'digit', '', '', '', 35),

+ 1 - 1
studio/classes/BxDolStudioSettings.php

@@ -140,7 +140,7 @@ class BxDolStudioSettings extends BxTemplStudioPage
     			$oStorage = BxDolStorage::getObjectInstance($this->sStorage);
 		        if(!$oStorage)
 					break;
-            
+
     			$iProfileId = bx_get_logged_profile_id();
     			foreach($aIds as $iId) {
     				$mixedValue = $iId;

+ 5 - 0
studio/classes/BxDolStudioSettingsQuery.php

@@ -117,6 +117,11 @@ class BxDolStudioSettingsQuery extends BxDolStudioPageQuery
            $sOrderClause = "ORDER BY `to`.`order` ASC";
 
         switch($aParams['type']) {
+        	case 'by_id':
+                $aMethod['name'] = 'getRow';
+                $sWhereClause .= $this->prepare("AND `to`.`id`=?", $aParams['value']);
+                $sLimitClause .= "LIMIT 1";
+                break;
             case 'by_name':
                 $aMethod['name'] = 'getRow';
                 $sWhereClause .= $this->prepare("AND `to`.`name`=?", $aParams['value']);

+ 36 - 0
studio/template/scripts/BxBaseStudioSettingsServices.php

@@ -0,0 +1,36 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup	TridentStudio Trident Studio
+ * @{
+ */
+
+/**
+ * System services related to Comments.
+ */
+class BxBaseStudioSettingsServices extends BxDol
+{
+	protected $oDb;
+
+    public function __construct()
+    {
+        parent::__construct();
+
+        $this->oDb = new BxDolStudioSettingsQuery();
+    }
+
+	public function serviceAlertResponseSysImagesCustomFileDeleted($oAlert)
+    {
+    	$iOption = (int)$oAlert->aExtras['ghost']['content_id'];
+
+    	$aOption = array();
+    	$this->oDb->getOptions(array('type' => 'by_id', 'value' => $iOption), $aOption, false);
+
+    	if(!empty($aOption) && is_array($aOption))
+    		setParam($aOption['name'], 0);
+    }
+}
+
+/** @} */