Tom Wilson Posted April 2, 2019 Share Posted April 2, 2019 Hi peeps, Trying out the hooks and would like the following, for some reason it just is not working! I am using tawk.to and have a script: <script> Tawk_API.onStatusChange = function(status){ if (status === 'online') { <?php add_hook('ClientAreaHomepagePanels', 1, function($homePagePanels) { $newPanel = $homePagePanels->addChild( 'unique-css-name', array( 'name' => 'Friendly Name', 'label' => 'Translated Language String', 'icon' => 'fas fa-calendar-alt', //see http://fortawesome.github.io/Font-Awesome/icons/ 'order' => '99', 'extras' => array( 'color' => 'pomegranate', //see Panel Accents in template styles.css 'btn-link' => 'https://www.whmcs.com', 'btn-text' => Lang::trans('go'), 'btn-icon' => 'fas fa-arrow-right', ), ) ); // Repeat as needed to add enough children $newPanel->addChild( 'unique-css-name-id1', array( 'label' => 'Panel Row Text Goes Here', 'uri' => 'index.php?m=yourmodule', 'order' => 10, ) ); });?> } else if(status === 'away') { <?php add_hook('ClientAreaHomepagePanels', 1, function($homePagePanels) { $newPanel = $homePagePanels->addChild( 'unique-css-name', array( 'name' => 'Friendly Name', 'label' => 'Translated Language String', 'icon' => 'fas fa-calendar-alt', //see http://fortawesome.github.io/Font-Awesome/icons/ 'order' => '99', 'extras' => array( 'color' => 'pomegranate', //see Panel Accents in template styles.css 'btn-link' => 'https://www.whmcs.com', 'btn-text' => Lang::trans('go'), 'btn-icon' => 'fas fa-arrow-right', ), ) ); // Repeat as needed to add enough children $newPanel->addChild( 'unique-css-name-id1', array( 'label' => 'Panel Row Text Goes Here - away', 'uri' => 'index.php?m=yourmodule', 'order' => 10, ) ); });?> } else { } }; </script> That however, is only showing the 'away' section - even if it is online. Any ideas? 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.