joedavis Posted September 25, 2014 Share Posted September 25, 2014 (edited) Hello, I am trying to create a template which will allow support staff to view the client summary page (and others) without necessarily viewing all of the content on the page. I would like to hide the Invoices/Billing area for example but not the other areas on the Client Summary page. Within the menu I can check if the user in a role by using this bit of smarty: {if in_array("View Orders",$admin_perms)} But, that array isn't available to the clientsummary.tpl template for some reason. I created a hook for the AdminAreaPage hook to create my own admin permissions array and it works properly, except that the array isn't available on the clientsummary.tpl template. Here's my hook: add_hook("AdminAreaPage",1,"joeadminareahooks_permsarray"); function joeadminareahooks_permsarray($vars) { $vars['_adminPerms'][] = $admin_perms; return $vars; } What in the world do I need to do to get an array to be available on the clientsummary.tpl template? Am I missing something simple somewhere? Edited September 26, 2014 by joedavis trying to fix silly space in code that isn't really there but the editor wants it to be there 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted September 26, 2014 Share Posted September 26, 2014 where is the complete code? is it meant to be like that? "perm sarray" the space i'm talking about 0 Quote Link to comment Share on other sites More sharing options...
joedavis Posted September 26, 2014 Author Share Posted September 26, 2014 That is the complete code. It's very simple. The space isn't supposed to be there and it's not there in my code but for some reason when I pasted it, it shows with a space. I even went back and edited the post, completely removed that line and typed it by hand and the space is still there. I figured there was something screwy in the editor. 0 Quote Link to comment Share on other sites More sharing options...
wellend Posted October 31, 2014 Share Posted October 31, 2014 Hi Joe Did you ever get to the bottom of this - it's exactly what I need to do too. Thanks and regards Jeff 0 Quote Link to comment Share on other sites More sharing options...
joedavis Posted November 4, 2014 Author Share Posted November 4, 2014 Hi Jeff, No I haven't gotten to the bottom of it and WHMCS Support told me today that I need to ask this question, along with this one, in the forums. Hmm, I think I have already done that. 0 Quote Link to comment Share on other sites More sharing options...
mbit Posted November 5, 2014 Share Posted November 5, 2014 Dudes, no need to get grumpy...it's quite simple Here you go, try this: function joeadminareahooks_permsarray() { $command = "getadmindetails"; $results = localAPI($command); if(strpos($results['allowedpermissions'], "View Orders")) echo "Whatever..."; } add_hook("AdminAreaClientSummaryPage",1,"joeadminareahooks_permsarray"); 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.