Jump to content

Client Details panel color change


Recommended Posts

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');
   }
});

CYSo0w4.png

 

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

Link to comment
Share on other sites

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 by AffordableDomainsCanada
Link to comment
Share on other sites

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');
   }
});

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated