Просмотр исходного кода

Ticket #268 - Extended list of customizable parts.

AntonLV 10 лет назад
Родитель
Сommit
f982f218d0

+ 4 - 0
modules/boonex/russian/data/langs/bx_uni/ru.xml

@@ -6,6 +6,10 @@
 	<string name="_bx_uni_stg_cpt_category_system"><![CDATA[Общие]]></string>
 	<string name="_bx_uni_stg_cpt_option_switcher_name"><![CDATA[Название в переключателе тем]]></string>
 
+	<string name="_bx_uni_stg_cpt_category_styles_general"><![CDATA[Общие]]></string>
+	<string name="_bx_uni_stg_cpt_option_general_item_bg_color_hover"><![CDATA[Цвет фона пункта при наведении курсора]]></string>
+	<string name="_bx_uni_stg_cpt_option_general_item_bg_color_active"><![CDATA[Цвет фона активного пункта]]></string>
+
 	<string name="_bx_uni_stg_cpt_category_styles_header"><![CDATA[Заголовок]]></string>
 	<string name="_bx_uni_stg_cpt_option_header_height"><![CDATA[Высота]]></string>
 	<string name="_bx_uni_stg_cpt_option_header_content_padding"><![CDATA[Контентные отступы]]></string>

+ 1 - 0
modules/boonex/uni/classes/BxUniStudioPage.php

@@ -31,6 +31,7 @@ class BxUniStudioPage extends BxTemplStudioDesign
     {
     	$sPrefix = $this->MODULE;
     	$aCategories = array(
+    		$sPrefix . '_styles_general',
 			$sPrefix . '_styles_header',
 			$sPrefix . '_styles_footer',
 			$sPrefix . '_styles_body',

+ 17 - 12
modules/boonex/uni/data/template/system/scripts/BxTemplConfig.php

@@ -85,6 +85,11 @@ class BxTemplConfig extends BxBaseConfig
 
 
         //--- Colors
+		if($this->_isModule) {
+	        $this->_aConfig['aLessConfig']['bx-color-hl'] = $this->_setColorRgba($sName . '_general_item_bg_color_hover', 'rgba(196, 248, 156, 0.2)');
+			$this->_aConfig['aLessConfig']['bx-color-active'] = $this->_setColorRgba($sName . '_general_item_bg_color_active', 'rgba(196, 248, 156, 0.4)');
+		}
+
         $this->_aConfig['aLessConfig']['bx-color-header'] = $this->_setColorRgba($sName . '_header_bg_color', 'rgba(59, 134, 134, 1)');
         $this->_aConfig['aLessConfig']['bx-color-footer'] = $this->_setColorRgba($sName . '_footer_bg_color', 'rgba(255, 255, 255, 1)');
         $this->_aConfig['aLessConfig']['bx-color-page'] = $this->_setColorRgb($sName . '_body_bg_color', 'rgb(255, 255, 255)');
@@ -159,18 +164,18 @@ class BxTemplConfig extends BxBaseConfig
 
 		//--- Default Fonts
 		if($this->_isModule) {
-	        $this->_aConfig['aLessConfig']['bx-font-family'] = getParam($sName . '_font_family');
-	        $this->_aConfig['aLessConfig']['bx-font-size-default'] = getParam($sName . '_font_size_default');
-	        $this->_aConfig['aLessConfig']['bx-font-size-small'] = getParam($sName . '_font_size_small');
-	        $this->_aConfig['aLessConfig']['bx-font-size-middle'] = getParam($sName . '_font_size_middle');
-	        $this->_aConfig['aLessConfig']['bx-font-size-large'] = getParam($sName . '_font_size_large');
-	        $this->_aConfig['aLessConfig']['bx-font-size-h1'] = getParam($sName . '_font_size_h1');
-	        $this->_aConfig['aLessConfig']['bx-font-size-h2'] = getParam($sName . '_font_size_h2');
-	        $this->_aConfig['aLessConfig']['bx-font-size-h3'] = getParam($sName . '_font_size_h3');
-
-	        $this->_aConfig['aLessConfig']['bx-font-color-default'] = getParam($sName . '_font_color_default');
-	        $this->_aConfig['aLessConfig']['bx-font-color-grayed'] = getParam($sName . '_font_color_grayed');
-	        $this->_aConfig['aLessConfig']['bx-font-color-contrasted'] = getParam($sName . '_font_color_contrasted');
+	        $this->_aConfig['aLessConfig']['bx-font-family'] = $this->_setValue($sName . '_font_family', 'Helvetica, Arial, sans-serif');
+	        $this->_aConfig['aLessConfig']['bx-font-size-default'] = $this->_setSize($sName . '_font_size_default', '18px');
+	        $this->_aConfig['aLessConfig']['bx-font-size-small'] = $this->_setSize($sName . '_font_size_small', '14px');
+	        $this->_aConfig['aLessConfig']['bx-font-size-middle'] = $this->_setSize($sName . '_font_size_middle', '16px');
+	        $this->_aConfig['aLessConfig']['bx-font-size-large'] = $this->_setSize($sName . '_font_size_large', '22px');
+	        $this->_aConfig['aLessConfig']['bx-font-size-h1'] = $this->_setSize($sName . '_font_size_h1', '38px');
+	        $this->_aConfig['aLessConfig']['bx-font-size-h2'] = $this->_setSize($sName . '_font_size_h2', '24px');
+	        $this->_aConfig['aLessConfig']['bx-font-size-h3'] = $this->_setSize($sName . '_font_size_h3', '18px');
+
+	        $this->_aConfig['aLessConfig']['bx-font-color-default'] = $this->_setColorRgba($sName . '_font_color_default', 'rgba(51, 51, 51, 1)');
+	        $this->_aConfig['aLessConfig']['bx-font-color-grayed'] = $this->_setColorRgba($sName . '_font_color_grayed', 'rgba(153, 153, 153, 1)');
+	        $this->_aConfig['aLessConfig']['bx-font-color-contrasted'] = $this->_setColorRgba($sName . '_font_color_contrasted', 'rgba(255, 255, 255, 1)');
 		}
 
 		//--- Font Family

+ 4 - 0
modules/boonex/uni/install/langs/en.xml

@@ -6,6 +6,10 @@
 	<string name="_bx_uni_stg_cpt_category_system"><![CDATA[General]]></string>
 	<string name="_bx_uni_stg_cpt_option_switcher_name"><![CDATA[Name In Template Switcher]]></string>
 
+	<string name="_bx_uni_stg_cpt_category_styles_general"><![CDATA[General]]></string>
+	<string name="_bx_uni_stg_cpt_option_general_item_bg_color_hover"><![CDATA[On-hover item background color]]></string>
+	<string name="_bx_uni_stg_cpt_option_general_item_bg_color_active"><![CDATA[Active item background color]]></string>
+
 	<string name="_bx_uni_stg_cpt_category_styles_header"><![CDATA[Header]]></string>
 	<string name="_bx_uni_stg_cpt_option_header_height"><![CDATA[Height]]></string>
 	<string name="_bx_uni_stg_cpt_option_header_content_padding"><![CDATA[Content margin]]></string>

+ 25 - 14
modules/boonex/uni/install/sql/install.sql

@@ -14,9 +14,20 @@ SET @iCategoryId = LAST_INSERT_ID();
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
 (@iCategoryId, CONCAT(@sName, '_switcher_title'), '_bx_uni_stg_cpt_option_switcher_name', 'UNI', 'digit', '', '', '', 1);
 
+
+-- SETTINGS: UNI Styles General
+INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
+(@iTypeId, CONCAT(@sName, '_styles_general'), '_bx_uni_stg_cpt_category_styles_general', 2);
+SET @iCategoryId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+(@iCategoryId, CONCAT(@sName, '_general_item_bg_color_hover'), '_bx_uni_stg_cpt_option_general_item_bg_color_hover', 'rgba(196, 248, 156, 0.2)', 'rgba', '', '', '', 1),
+(@iCategoryId, CONCAT(@sName, '_general_item_bg_color_active'), '_bx_uni_stg_cpt_option_general_item_bg_color_active', 'rgba(196, 248, 156, 0.4)', 'rgba', '', '', '', 2);
+
+
 -- SETTINGS: UNI Styles Header
 INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
-(@iTypeId, CONCAT(@sName, '_styles_header'), '_bx_uni_stg_cpt_category_styles_header', 2);
+(@iTypeId, CONCAT(@sName, '_styles_header'), '_bx_uni_stg_cpt_category_styles_header', 3);
 SET @iCategoryId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
@@ -40,7 +51,7 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 -- SETTINGS: UNI Styles Footer
 INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
-(@iTypeId, CONCAT(@sName, '_styles_footer'), '_bx_uni_stg_cpt_category_styles_footer', 3);
+(@iTypeId, CONCAT(@sName, '_styles_footer'), '_bx_uni_stg_cpt_category_styles_footer', 4);
 SET @iCategoryId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
@@ -60,7 +71,7 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 -- SETTINGS: UNI Styles Body
 INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
-(@iTypeId, CONCAT(@sName, '_styles_body'), '_bx_uni_stg_cpt_category_styles_body', 4);
+(@iTypeId, CONCAT(@sName, '_styles_body'), '_bx_uni_stg_cpt_category_styles_body', 5);
 SET @iCategoryId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
@@ -76,7 +87,7 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 -- SETTINGS: UNI Styles Block
 INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
-(@iTypeId, CONCAT(@sName, '_styles_block'), '_bx_uni_stg_cpt_category_styles_block', 5);
+(@iTypeId, CONCAT(@sName, '_styles_block'), '_bx_uni_stg_cpt_category_styles_block', 6);
 SET @iCategoryId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
@@ -99,7 +110,7 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 -- SETTINGS: UNI Styles Card
 INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
-(@iTypeId, CONCAT(@sName, '_styles_card'), '_bx_uni_stg_cpt_category_styles_card', 6);
+(@iTypeId, CONCAT(@sName, '_styles_card'), '_bx_uni_stg_cpt_category_styles_card', 7);
 SET @iCategoryId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
@@ -116,7 +127,7 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 -- SETTINGS: UNI Styles Popups
 INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
-(@iTypeId, CONCAT(@sName, '_styles_popup'), '_bx_uni_stg_cpt_category_styles_popup', 7);
+(@iTypeId, CONCAT(@sName, '_styles_popup'), '_bx_uni_stg_cpt_category_styles_popup', 8);
 SET @iCategoryId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
@@ -137,7 +148,7 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 -- SETTINGS: UNI Styles Slide Menus
 INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
-(@iTypeId, CONCAT(@sName, '_styles_menu_slide'), '_bx_uni_stg_cpt_category_styles_menu_slide', 8);
+(@iTypeId, CONCAT(@sName, '_styles_menu_slide'), '_bx_uni_stg_cpt_category_styles_menu_slide', 9);
 SET @iCategoryId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
@@ -153,7 +164,7 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 -- SETTINGS: UNI Styles Page Menu
 INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
-(@iTypeId, CONCAT(@sName, '_styles_menu_page'), '_bx_uni_stg_cpt_category_styles_menu_page', 9);
+(@iTypeId, CONCAT(@sName, '_styles_menu_page'), '_bx_uni_stg_cpt_category_styles_menu_page', 10);
 SET @iCategoryId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
@@ -170,7 +181,7 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 -- SETTINGS: UNI Styles Forms
 INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
-(@iTypeId, CONCAT(@sName, '_styles_form'), '_bx_uni_stg_cpt_category_styles_form', 10);
+(@iTypeId, CONCAT(@sName, '_styles_form'), '_bx_uni_stg_cpt_category_styles_form', 11);
 SET @iCategoryId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
@@ -188,7 +199,7 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 -- SETTINGS: UNI Styles Large Buttons
 INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
-(@iTypeId, CONCAT(@sName, '_styles_large_button'), '_bx_uni_stg_cpt_category_styles_large_button', 11);
+(@iTypeId, CONCAT(@sName, '_styles_large_button'), '_bx_uni_stg_cpt_category_styles_large_button', 12);
 SET @iCategoryId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
@@ -209,7 +220,7 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 -- SETTINGS: UNI Styles Small Buttons
 INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
-(@iTypeId, CONCAT(@sName, '_styles_small_button'), '_bx_uni_stg_cpt_category_styles_small_button', 12);
+(@iTypeId, CONCAT(@sName, '_styles_small_button'), '_bx_uni_stg_cpt_category_styles_small_button', 13);
 SET @iCategoryId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
@@ -230,7 +241,7 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 -- SETTINGS: UNI Styles Font
 INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
-(@iTypeId, CONCAT(@sName, '_styles_font'), '_bx_uni_stg_cpt_category_styles_font', 13);
+(@iTypeId, CONCAT(@sName, '_styles_font'), '_bx_uni_stg_cpt_category_styles_font', 14);
 SET @iCategoryId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
@@ -254,7 +265,7 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 -- SETTINGS: UNI Viewport Tablet
 INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
-(@iTypeId, CONCAT(@sName, '_viewport_tablet'), '_bx_uni_stg_cpt_category_viewport_tablet', 14);
+(@iTypeId, CONCAT(@sName, '_viewport_tablet'), '_bx_uni_stg_cpt_category_viewport_tablet', 15);
 SET @iCategoryId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
@@ -262,7 +273,7 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 -- SETTINGS: UNI Viewport Mobile
 INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 
-(@iTypeId, CONCAT(@sName, '_viewport_mobile'), '_bx_uni_stg_cpt_category_viewport_mobile', 15);
+(@iTypeId, CONCAT(@sName, '_viewport_mobile'), '_bx_uni_stg_cpt_category_viewport_mobile', 16);
 SET @iCategoryId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES