Jelajahi Sumber

Ticket #4440 - Update profile switcher.

AntonLV 3 tahun lalu
induk
melakukan
7a9528b93a

+ 1 - 1
install/sql/system.sql

@@ -5817,7 +5817,7 @@ INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title_system`, `
 
 ('sys_account_profile_switcher', 1, 'system', '', '_sys_page_block_title_account_profile_create', 11, 0, 0, 2147483647, 'menu', 'sys_add_profile', 0, 1, 1, 1),
 
-('sys_account_profile_switcher', 1, 'system', '', '_sys_page_block_title_account_profile_switcher', 11, 0, 0, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:24:"account_profile_switcher";s:6:"params";a:0:{}s:5:"class";s:20:"TemplServiceProfiles";}', 0, 1, 1, 2),
+('sys_account_profile_switcher', 1, 'system', '', '_sys_page_block_title_account_profile_switcher', 11, 0, 0, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:28:"account_profile_switcher_all";s:6:"params";a:0:{}s:5:"class";s:20:"TemplServiceProfiles";}', 0, 1, 1, 2),
 
 ('sys_profile_settings_cfilter', 1, 'system', '', '_sys_page_block_title_profile_settings_cfilter', 11, 0, 0, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:24:"profile_settings_cfilter";s:6:"params";a:0:{}s:5:"class";s:20:"TemplServiceProfiles";}', 0, 1, 1, 2),
 

+ 1 - 5
modules/boonex/artificer/data/template/system/scripts/BxTemplFunctions.php

@@ -199,10 +199,6 @@ class BxTemplFunctions extends BxBaseFunctions
         if(!$oProfile)
             return '';
 
-        $sSwitcher = '';
-        if(($aSwitcher = bx_srv('system', 'account_profile_switcher', [], 'TemplServiceProfiles')) !== false) 
-            $sSwitcher = $aSwitcher['content'];
-
         $aTmplVarsColorSchemeSwitcher = [];
         $bTmplVarsColorSchemeSwitcher = BxDolModule::getInstance($this->_sModule)->_oConfig->getColorScheme() == 'auto';
         if($bTmplVarsColorSchemeSwitcher) {
@@ -217,7 +213,7 @@ class BxTemplFunctions extends BxBaseFunctions
                 'popup' => BxTemplFunctions::getInstance()->transBox('bx-sb-theme-switcher-menu', $oMenu->getCode(), true)
             ];
         }
-        
+
         $sMenuAccountPopup = 'sys_account_popup';
         $oMenuAccountPopup = BxTemplMenu::getObjectInstance($sMenuAccountPopup);
 

+ 0 - 1
template/profile_switch_row.html

@@ -1,5 +1,4 @@
 <bx_repeat:row>
-    <hr class="bx-def-hr" />
     <div class="sys-profile-switch-row bx-def-padding-leftright bx-def-padding-sec-topbottom">
         <div class="sys-profile-switch-row-unit">__unit__</div>
         <div class="sys-profile-switch-row-control bx-def-margin-left">

+ 1 - 1
template/scripts/BxBaseMenuToolbar.php

@@ -33,7 +33,7 @@ class BxBaseMenuToolbar extends BxTemplMenu
             if($r['name'] != 'account')
                 continue;
 
-            if($a[$k]['bx_if:image']['condition'])
+            if($a[$k]['bx_if:image']['condition'] || $a[$k]['bx_if:icon-html']['condition'])
                 break;
 
             $oProfile = BxDolProfile::getInstance(bx_get_logged_profile_id());

+ 5 - 0
template/scripts/BxBaseServiceProfiles.php

@@ -865,6 +865,11 @@ class BxBaseServiceProfiles extends BxDol
         );
     }
 
+    public function serviceAccountProfileSwitcherAll ($iAccountId = false, $iActiveProfileId = null, $sUrlProfileAction = '', $bShowAll = true, $sButtonTitle = '', $sProfileTemplate = '')
+    {
+        return $this->serviceAccountProfileSwitcher($iAccountId, $iActiveProfileId, $sUrlProfileAction, $bShowAll, $sButtonTitle, $sProfileTemplate);
+    }
+
     public function serviceProfileSettingsCfilter($iProfileId = false)
     {
         if(!BxDolContentFilter::getInstance()->isEnabled()) {