Fr3DBr Posted August 3, 2016 Share Posted August 3, 2016 Hi, guys. Is there any way to add a new tab here: (red mark) Through a custom server provisioning module ? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 3, 2016 Share Posted August 3, 2016 you should be able to add the Paypal tab by modifying the clientareaproductdetails.tpl template. 0 Quote Link to comment Share on other sites More sharing options...
Fr3DBr Posted August 3, 2016 Author Share Posted August 3, 2016 you should be able to add the Paypal tab by modifying the clientareaproductdetails.tpl template. Is there any other way without touching the template ? Maybe via the server module itself, the same way I've added these buttons for Bandwidth Utilization and Power Management ? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 3, 2016 Share Posted August 3, 2016 Is there any other way without touching the template ? Maybe via the server module itself, the same way I've added these buttons for Bandwidth Utilization and Power Management ? I wouldn't have thought so - I assume your module is just modifying {$moduleclientarea} and outputting via that method... I think you'd have to modify the template to add the new tab in the first place - after that, you may be able to determine whether it's shown or not (and it's content) by a module. i'm sure if that's incorrect, someone will correct me! 0 Quote Link to comment Share on other sites More sharing options...
Fr3DBr Posted August 3, 2016 Author Share Posted August 3, 2016 I wouldn't have thought so - I assume your module is just modifying {$moduleclientarea} and outputting via that method... I think you'd have to modify the template to add the new tab in the first place - after that, you may be able to determine whether it's shown or not (and it's content) by a module. i'm sure if that's incorrect, someone will correct me! I've found this in whmcs repository: /** * Client area output logic handling. * * This function is used to define module specific client area output. It should * return an array consisting of a template file and optional additional * template variables to make available to that template. * * The template file you return can be one of two types: * * * tabOverviewModuleOutputTemplate - The output of the template provided here * will be displayed as part of the default product/service client area * product overview page. * * * tabOverviewReplacementTemplate - Alternatively using this option allows you * to entirely take control of the product/service overview page within the * client area. * * Whichever option you choose, extra template variables are defined in the same * way. This demonstrates the use of the full replacement. * * Please Note: Using tabOverviewReplacementTemplate means you should display * the standard information such as pricing and billing details in your custom * template or they will not be visible to the end user. * * @param array $params common module parameters * * @see http://docs.whmcs.com/Provisioning_Module_SDK_Parameters * * @return array */ function provisioningmodule_ClientArea(array $params) { // Determine the requested action and set service call parameters based on // the action. $requestedAction = isset($_REQUEST['customAction']) ? $_REQUEST['customAction'] : ''; if ($requestedAction == 'manage') { $serviceAction = 'get_usage'; $templateFile = 'templates/manage.tpl'; } else { $serviceAction = 'get_stats'; $templateFile = 'templates/overview.tpl'; } try { // Call the service's function based on the request action, using the // values provided by WHMCS in `$params`. $response = array(); $extraVariable1 = 'abc'; $extraVariable2 = '123'; return array( 'tabOverviewReplacementTemplate' => $templateFile, 'templateVariables' => array( 'extraVariable1' => $extraVariable1, 'extraVariable2' => $extraVariable2, ), ); } catch (Exception $e) { // Record the error in WHMCS's module log. logModuleCall( 'provisioningmodule', __FUNCTION__, $params, $e->getMessage(), $e->getTraceAsString() ); // In an error condition, display an error page. return array( 'tabOverviewReplacementTemplate' => 'error.tpl', 'templateVariables' => array( 'usefulErrorHelper' => $e->getMessage(), ), ); } } But not sure if this is what I'm looking for, I think with this piece of code, I can add information into 'existing tabs', but not sure if I can add extra ones. 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.