Bläddra i källkod

Ticket #3766 - Artificer: Optional stretched Header.

AntonLV 4 år sedan
förälder
incheckning
3efdb922d6

+ 14 - 3
modules/boonex/artificer/data/template/system/scripts/BxTemplFunctions.php

@@ -87,15 +87,26 @@ class BxTemplFunctions extends BxBaseFunctions
 
     public function TemplPageAddComponent($sKey)
     {
-        switch( $sKey ) {
+        $mixedResult = false;
+
+        switch($sKey) {
+            case 'sys_header_width':
+                $mixedResult = '';
+                if(getParam('bx_artificer_header_stretched') != 'on')
+                    $mixedResult = parent::TemplPageAddComponent($sKey);
+                break;
+
             case 'sys_site_search':
                 $oSearch = new BxTemplSearch();
                 $oSearch->setLiveSearch(true);
-                return $oSearch->getForm(BX_DB_PADDING_DEF, false, true) . $oSearch->getResultsContainer();
+                $mixedResult = $oSearch->getForm(BX_DB_PADDING_DEF, false, true) . $oSearch->getResultsContainer();
+                break;
 
             default:
-                return parent::TemplPageAddComponent($sKey);
+                $mixedResult = parent::TemplPageAddComponent($sKey);
         }
+
+        return $mixedResult;
     }    
 
     protected function getInjFooterPopupMenus() 

+ 5 - 4
modules/boonex/artificer/install/langs/en.xml

@@ -8,6 +8,7 @@
     <string name="_bx_artificer_stg_cpt_category_system"><![CDATA[General]]></string>
     <string name="_bx_artificer_stg_cpt_option_switcher_name"><![CDATA[Name in Template Switcher]]></string>	
     <string name="_bx_artificer_stg_cpt_option_page_width"><![CDATA[Page Width]]></string>
+    <string name="_bx_artificer_stg_cpt_option_header_stretched"><![CDATA[Stretched Header]]></string>
 
     <string name="_bx_artificer_stg_cpt_category_styles_custom"><![CDATA[Custom Styles]]></string>
     <string name="_bx_artificer_stg_cpt_option_styles_custom"><![CDATA[Custom Styles]]></string>
@@ -24,10 +25,10 @@
 
     <!-- Other -->
     <string name="_bx_artificer_txt_close_sidebar"><![CDATA[Close sidebar]]></string>
-	
-	<string name="_bx_artificer_txt_color_scheme_light"><![CDATA[Light]]></string>
-	<string name="_bx_artificer_txt_color_scheme_dark"><![CDATA[Dark]]></string>
-	<string name="_bx_artificer_txt_color_scheme_system"><![CDATA[System]]></string>
+
+    <string name="_bx_artificer_txt_color_scheme_light"><![CDATA[Light]]></string>
+    <string name="_bx_artificer_txt_color_scheme_dark"><![CDATA[Dark]]></string>
+    <string name="_bx_artificer_txt_color_scheme_system"><![CDATA[System]]></string>
 
     <string name="_bx_artificer_txt_splash_welcome_l1"><![CDATA[Welcome to]]></string>
     <string name="_bx_artificer_txt_splash_welcome_l2"><![CDATA[the community]]></string>

+ 2 - 1
modules/boonex/artificer/install/sql/install.sql

@@ -13,7 +13,8 @@ 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_artificer_stg_cpt_option_switcher_name', 'Artificer', 'digit', '', '', '', 1), 
-(@iCategoryId, CONCAT(@sName, '_page_width'), '_bx_artificer_stg_cpt_option_page_width', '1280', 'digit', '', '', '', 2);
+(@iCategoryId, CONCAT(@sName, '_page_width'), '_bx_artificer_stg_cpt_option_page_width', '1280', 'digit', '', '', '', 2),
+(@iCategoryId, CONCAT(@sName, '_header_stretched'), '_bx_artificer_stg_cpt_option_header_stretched', '', 'checkbox', '', '', '', 3);
 
 -- SETTINGS: Artificer template Custom Styles
 INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `order`) VALUES 

+ 1 - 1
template/_sub_header.html

@@ -4,7 +4,7 @@
     <bx_injection:top />
 
     <div id="bx-toolbar" class="bx-header bx-def-z-index-nav fixed top-0 w-full ring-1 ring-gray-300 dark:ring-gray-700 bg-white/95 dark:bg-gray-800/95 backdrop-blur shadow">
-        <div class="bx-header-cnt bx-def-page-width mx-auto px-3 md:px-4 lg:px-6 box-border">
+        <div class="bx-header-cnt __sys_header_width__ mx-auto px-3 md:px-4 lg:px-6 box-border">
             <div class="bx-toolbar-content-wrapper">
                 <div id="bx-toolbar-content" class="bx-toolbar-content relative flex items-center justify-start h-16">
                     <!-- Mobile: Hamburger -->

+ 6 - 3
template/css/forms.css

@@ -473,12 +473,12 @@
     background-color:#e7938a;
 }
 .bx-form-element-wrapper-oneline .bx-form-element {
-	display: -webkit-flex;
+    display: -webkit-flex;
     display: flex;
     -webkit-flex-flow: row nowrap;
     flex-flow: row nowrap;
-    -webkit-align-items: flex-start;
-    align-items: flex-start;
+    -webkit-align-items: center;
+    align-items: center;
     -webkit-justify-content: flex-start;
     justify-content: flex-start;
 }
@@ -486,6 +486,9 @@
 .bx-form-caption-oneline {
     float: none;
 }
+.bx-form-caption-oneline {
+    margin-bottom: 0;
+}
 .bx-form-caption-oneline-switcher {
     line-height:26px;
 }

+ 8 - 5
template/scripts/BxBaseFunctions.php

@@ -60,12 +60,15 @@ class BxBaseFunctions extends BxDolFactory implements iBxDolSingleton
 
     function TemplPageAddComponent($sKey)
     {
-        switch( $sKey ) {
-            case 'something':
-                return false; // return here additional components
-            default:
-                return false; // if you have not such component, return false!
+        $mixedResult = false; // if you have not such component, return false!
+
+        switch($sKey) {
+            case 'sys_header_width':
+                $mixedResult = 'bx-def-page-width';
+                break;
         }
+
+        return $mixedResult;
     }
 
     function msgBox($sText, $iTimer = 0, $sOnClose = "")