File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -603,6 +603,11 @@ This string is displayed as part of the copyright message at the bottom-left cor
603603
604604This path string points to the logo used in the UI header/sidebar and in emails (default: ` images/logotype.png ` ).
605605
606+ ### client.hide_sidebar_sections
607+ <!-- Title: Hide Sidebar Sections -->
608+
609+ This array allows you to globally hide specific sidebar sections for all users, regardless of their preferences.
610+
606611### client.items_per_page
607612<!-- Title: List Items Per Page -->
608613
Original file line number Diff line number Diff line change @@ -512,9 +512,11 @@ app.extend({
512512
513513 // apply user preferences for sidebar sections
514514 var user_sections = app . user . sidebar || config . ui . sidebar_sections . map ( section => section . id ) ;
515+ var hidden_sections = config . hide_sidebar_sections || [ ] ;
516+
515517 config . ui . sidebar_sections . forEach ( function ( section ) {
516518 var $sect = $ ( '.sidebar .sbs_' + section . id ) ;
517- if ( user_sections . includes ( section . id ) ) $sect . show ( ) ;
519+ if ( user_sections . includes ( section . id ) && ! hidden_sections . includes ( section . id ) ) $sect . show ( ) ;
518520 else $sect . removeClass ( 'enabled' ) . hide ( ) ;
519521 } ) ;
520522
Original file line number Diff line number Diff line change @@ -158,14 +158,18 @@ Page.MySettings = class MySettings extends Page.Base {
158158 html += '<div class="box_content" style="margin-bottom:30px">' ;
159159
160160 // sidebar sections
161+ var sidebar_sections = config . ui . sidebar_sections . filter ( function ( section ) {
162+ if ( ! config . hide_sidebar_sections ) return true ;
163+ return ! config . hide_sidebar_sections . includes ( section . id ) ;
164+ } ) ;
161165 html += this . getFormRow ( {
162166 label : 'Sidebar:' ,
163167 content : this . getFormMenuMulti ( {
164168 id : 'fe_ms_sidebar' ,
165169 title : 'Show sidebar sections' ,
166170 placeholder : 'Select sidebar sections to show...' ,
167- options : config . ui . sidebar_sections ,
168- values : user . sidebar || config . ui . sidebar_sections . map ( section => section . id ) ,
171+ options : sidebar_sections ,
172+ values : user . sidebar || sidebar_sections . map ( section => section . id ) ,
169173 onChange : '$P().saveChanges()' ,
170174 'data-hold' : 1 ,
171175 'data-select-all' : 1
Original file line number Diff line number Diff line change 268268 "name" : " xyOps" ,
269269 "company" : " PixlCore LLC" ,
270270 "logo_url" : " /images/logotype.png" ,
271+ "hide_sidebar_sections" : [],
271272
272273 "items_per_page" : 50 ,
273274 "alt_items_per_page" : 25 ,
You can’t perform that action at this time.
0 commit comments