hostonnet Posted July 3, 2017 Share Posted July 3, 2017 How to change Client Details panel color in client area home page. Now using 'panel panel-default'. How to add custom class for this? Also need to remove 'btn-block' class from update button. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 3, 2017 Share Posted July 3, 2017 in general, to add a little colour to the sidebars, you can use a hook along these lines... <?php # Hook To Add A Little Colour to Sidebars! # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Client Details'))) { $primarySidebar->getChild('Client Details') ->setClass('panel-accent-blue'); } }); and with regards to the footer issue (re the update button), take a look at the post below about creating a new sidebar footer via a hook (in that case, it's the support tickets, but the principles exactly the same).... I assume you'll need to make more changes than just removing btn-block as you'll have alignment issues. https://forum.whmcs.com/showthread.php?123690-Clients-can-t-close-tickets&p=496322#post496322 0 Quote Link to comment Share on other sites More sharing options...
AffordableDomainsCanada Posted July 9, 2017 Share Posted July 9, 2017 (edited) This was an amazing little touch! I compiled 2 files for anyone who wants to use these. I think I added all the sidebar menus. Save files in /includes/hooks/ primary_sidebar_menus.php <?php $ca = new WHMCS_ClientArea(); use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar){ $client = Menu::context('client'); if (!is_null($primarySidebar->getChild('Client Details'))) { $primarySidebar->getChild('Client Details') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('My Services Status Filter'))) { $primarySidebar->getChild('My Services Status Filter') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('My Domains Status Filter'))) { $primarySidebar->getChild('My Domains Status Filter') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('My Invoices Summary'))) { $primarySidebar->getChild('My Invoices Summary') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('My Invoices Status Filter'))) { $primarySidebar->getChild('My Invoices Status Filter') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('My Quotes Status Filter'))) { $primarySidebar->getChild('My Quotes Status Filter') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('My Account'))) { $primarySidebar->getChild('My Account') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('Network Status'))) { $primarySidebar->getChild('Network Status') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('Announcements Months'))) { $primarySidebar->getChild('Announcements Months') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('Support Knowledgebase Categories'))) { $primarySidebar->getChild('Support Knowledgebase Categories') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('Ticket List Status Filter'))) { $primarySidebar->getChild('Ticket List Status Filter') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('department-response-times'))) { $primarySidebar->getChild('department-response-times') ->setClass('panel-accent-purple'); } if (!is_null($primarySidebar->getChild('Ticket Information'))) { $primarySidebar->getChild('Ticket Information') ->setClass('panel-accent-red'); } }); secondary_sidebar_menus.php <?php $ca = new WHMCS_ClientArea(); use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar){ $client = Menu::context('client'); if (!is_null($secondarySidebar->getChild('Client Contacts'))) { $secondarySidebar->getChild('Client Contacts') ->setClass('panel-accent-red'); } if (!is_null($secondarySidebar->getChild('Client Shortcuts'))) { $secondarySidebar->getChild('Client Shortcuts') ->setClass('panel-accent-purple'); } if (!is_null($secondarySidebar->getChild('My Services Actions'))) { $secondarySidebar->getChild('My Services Actions') ->setClass('panel-accent-green'); } if (!is_null($secondarySidebar->getChild('My Domains Actions'))) { $secondarySidebar->getChild('My Domains Actions') ->setClass('panel-accent-green'); } if (!is_null($secondarySidebar->getChild('Billing'))) { $secondarySidebar->getChild('Billing') ->setClass('panel-accent-blue'); } if (!is_null($secondarySidebar->getChild('Support'))) { $secondarySidebar->getChild('Support') ->setClass('panel-accent-blue'); } if (!is_null($secondarySidebar->getChild('Popular Downloads'))) { $secondarySidebar->getChild('Popular Downloads') ->setClass('panel-accent-red'); } if (!is_null($secondarySidebar->getChild('Support Knowledgebase Tag Cloud'))) { $secondarySidebar->getChild('Support Knowledgebase Tag Cloud') ->setClass('panel-accent-blue'); } if (!is_null($secondarySidebar->getChild('Recent Tickets'))) { $secondarySidebar->getChild('Recent Tickets') ->setClass('panel-accent-red'); } if (!is_null($secondarySidebar->getChild('department-response-times'))) { $secondarySidebar->getChild('department-response-times') ->setClass('panel-accent-red'); } }); Edited July 9, 2017 by AffordableDomainsCanada 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 9, 2017 Share Posted July 9, 2017 thanks for sharing your code - though I doubt you'll need to use the two lines below... $ca = new WHMCS_ClientArea(); $client = Menu::context('client'); you won't need the second line as you won't need to check if they're logged in... and even if you did, your code isn't doing so. also, if you had to, you could combine them as one file - for those that like a minimum number of hook files! <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar){ if (!is_null($primarySidebar->getChild('Client Details'))) { $primarySidebar->getChild('Client Details') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('My Services Status Filter'))) { $primarySidebar->getChild('My Services Status Filter') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('My Domains Status Filter'))) { $primarySidebar->getChild('My Domains Status Filter') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('My Invoices Summary'))) { $primarySidebar->getChild('My Invoices Summary') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('My Invoices Status Filter'))) { $primarySidebar->getChild('My Invoices Status Filter') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('My Quotes Status Filter'))) { $primarySidebar->getChild('My Quotes Status Filter') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('My Account'))) { $primarySidebar->getChild('My Account') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('Network Status'))) { $primarySidebar->getChild('Network Status') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('Announcements Months'))) { $primarySidebar->getChild('Announcements Months') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('Support Knowledgebase Categories'))) { $primarySidebar->getChild('Support Knowledgebase Categories') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('Ticket List Status Filter'))) { $primarySidebar->getChild('Ticket List Status Filter') ->setClass('panel-accent-red'); } if (!is_null($primarySidebar->getChild('department-response-times'))) { $primarySidebar->getChild('department-response-times') ->setClass('panel-accent-purple'); } if (!is_null($primarySidebar->getChild('Ticket Information'))) { $primarySidebar->getChild('Ticket Information') ->setClass('panel-accent-red'); } }); add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar){ if (!is_null($secondarySidebar->getChild('Client Contacts'))) { $secondarySidebar->getChild('Client Contacts') ->setClass('panel-accent-red'); } if (!is_null($secondarySidebar->getChild('Client Shortcuts'))) { $secondarySidebar->getChild('Client Shortcuts') ->setClass('panel-accent-purple'); } if (!is_null($secondarySidebar->getChild('My Services Actions'))) { $secondarySidebar->getChild('My Services Actions') ->setClass('panel-accent-green'); } if (!is_null($secondarySidebar->getChild('My Domains Actions'))) { $secondarySidebar->getChild('My Domains Actions') ->setClass('panel-accent-green'); } if (!is_null($secondarySidebar->getChild('Billing'))) { $secondarySidebar->getChild('Billing') ->setClass('panel-accent-blue'); } if (!is_null($secondarySidebar->getChild('Support'))) { $secondarySidebar->getChild('Support') ->setClass('panel-accent-blue'); } if (!is_null($secondarySidebar->getChild('Popular Downloads'))) { $secondarySidebar->getChild('Popular Downloads') ->setClass('panel-accent-red'); } if (!is_null($secondarySidebar->getChild('Support Knowledgebase Tag Cloud'))) { $secondarySidebar->getChild('Support Knowledgebase Tag Cloud') ->setClass('panel-accent-blue'); } if (!is_null($secondarySidebar->getChild('Recent Tickets'))) { $secondarySidebar->getChild('Recent Tickets') ->setClass('panel-accent-red'); } if (!is_null($secondarySidebar->getChild('department-response-times'))) { $secondarySidebar->getChild('department-response-times') ->setClass('panel-accent-red'); } }); 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.