Danse Posted April 16, 2019 Share Posted April 16, 2019 Hi, can someone help me with just a simple Text Sidebar. I need a Hook which inserts a Sidebar to Client Area if i hit a Checkbox in Backend within Client. (Checkbox from Customfields) <?php use WHMCS\View\Menu\Item as MenuItem; // Add Sidebar Panel if Customer didn't signed Document. add_hook('ClientAreaSecondarySidebar', 1, function (MenuItem $secondarySidebar) { // IF Customfield is AKTIV then Hide, otherwise show following Sidebar. $client_custom_filed_name = 'av-checkbox'; $clientid = $clientobj->userid; // Get Client Details $clientdata = Capsule::table('tblcustomfieldsvalues') ->select('value') ->join('tblcustomfields', 'tblcustomfields.id', '=', 'tblcustomfieldsvalues.fieldid') ->where('tblcustomfields.fieldname', '=', $client_custom_filed_name) ->where('tblcustomfields.type', '=', 'client') ->where('tblcustomfieldsvalues.relid', '=', $clientid) ->first(); if ($clientdata->value == 'off') { // Add a panel to secondary sidebar $secondarySidebar->addChild('av-contract', array( 'label' => 'CustomTitel', 'uri' => '#', 'icon' => 'fa-file-contract', )) // Retrieve the panel $customPanel = $secondarySidebar->getChild('av-contract'); // Add a Link $customPanel->addChild('av-link', array( 'label' => 'Linkname', 'uri' => '', 'icon' => 'fa-file-contract', )); } }); Any Idea? 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.