ffeingol Posted August 23, 2016 Share Posted August 23, 2016 Hello, I'm trying to access the alerts (that are by default in the top/right of the six theme) from the ClientAreaPage hook. I'm pretty sure that they variables are available, but it's just not working for me. I'm looking in particular to access the severity of each alert, but all of the data would be nice. Thanks in advance. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 23, 2016 Share Posted August 23, 2016 from the documentation, there's a getSeverity command you can use... http://docs.whmcs.com/classes/classes/WHMCS.User.Alert.html 0 Quote Link to comment Share on other sites More sharing options...
ffeingol Posted August 23, 2016 Author Share Posted August 23, 2016 Hello, Yes, I saw that. My issue is getting access to the variable/object that contains the data (sorry, I'm not really a programmer). TIA 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 23, 2016 Share Posted August 23, 2016 i'm not sure what you want to do with the alert information, but if it's simpler for you to avoid using hooks, you can access them in the header.tpl template... it's just an array being outputted via a foreach loop. <div class="pull-right nav"> <a href="#" class="quick-nav" data-toggle="popover" id="accountNotifications" data-placement="bottom" title="{lang key="notifications"}"><i class="fa fa-info"></i> {$LANG.notifications} ({$clientAlerts|count})</a> <div id="accountNotificationsContent" class="hidden"> {foreach $clientAlerts as $alert} <div class="clientalert text-{$alert->getSeverity()}">{$alert->getMessage()}{if $alert->getLinkText()} <a href="{$alert->getLink()}" class="btn btn-xs btn-{$alert->getSeverity()}">{$alert->getLinkText()}</a>{/if}</div> {foreachelse} <div class="clientalert text-success"><i class="fa fa-check-square-o"></i> {$LANG.notificationsnone}</div> {/foreach} </div> </div> 0 Quote Link to comment Share on other sites More sharing options...
ffeingol Posted August 23, 2016 Author Share Posted August 23, 2016 Hello, Thank you. I had already discovered where it was in the template code. I'm trying to use Bootstrap badges (based on the severity of the alert) and it just seemed like it would be easier to do in PHP/hook code vs. template code. Worst case I'll do it in the template. Thanks again 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.