monsterit Posted June 29, 2018 Share Posted June 29, 2018 I'm looking to change the attached files label on the client side. at the moment i've got this code from the "editing panel" section. <?php // This hook will adjust the button in the home page panels. You have two // different options of setExtra() or setExtras(). Use of setExtras() requires // passing all 'extra' related vars through the array. use WHMCS\View\Menu\Item; add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels) { $YourFiles = $homePagePanels->getChild('Your Files'); if (!is_null($YourFiles)) { $YourFiles->setExtras( [ 'color' => 'asbestos', ] ); } }); What am i missing? its not changing anything unless i have that button bit included 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 29, 2018 Share Posted June 29, 2018 29 minutes ago, monsterit said: What am i missing? its not changing anything unless i have that button bit included if all you want to do is change the label on the panel, then you have a couple of options... if it's a default homepage panel (e.g one that you haven't created yourself), then it will (should!) use a Language string for the label - if so, then you can change it using a Language Override. $_LANG['clientareafiles'] = "Attached Files by Monster IT"; bear in mind, that you'll have to add language overrides for every language that you want to change the label for. you could use a hook to change the label of a panel and hard-code the label to be the same for all users.... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaHomepagePanels', 1, function(MenuItem $homePagePanels) { if(!is_null($homePagePanels->getChild('Your Files'))){ $homePagePanels->getChild('Your Files') ->setLabel('Attached Files by brian!'); } }); the hook label changes would take precedence over any language override. there is a third way in which you could use the above hook to utilise a language string for the label - but in this instance, if you want to do that, you might as well just change the existing language strings with overrides. 1 Quote Link to comment Share on other sites More sharing options...
monsterit Posted June 29, 2018 Author Share Posted June 29, 2018 Thank you I did the code part you included. This has helped massively thank you. It's a good place to stick their contracts for them to view 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.