stroebs_za Posted October 3, 2017 Share Posted October 3, 2017 Hi! I'm somewhat of a newbie to WHMCS customisation and still figuring out how a few things work in v7. I can find documentation on how to apply custom buttons (Actions sidebar) in the client area OR a custom template, but not both(?). The pre-built cPanel module seems to be able to do this but I cannot figure out how. My idea is to create a login button just like cPanel does for their Webmail, as well as a custom client area template for my server module. Currently using: function mymodule_ClientArea($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(); return array( 'tabOverviewReplacementTemplate' => $templateFile, 'templateVariables' => array(), ); } 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(), ), ); } } 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Developer WHMCS Andrew Posted October 4, 2017 WHMCS Developer Share Posted October 4, 2017 The cPanel module uses a template which outputs the custom buttons - check modules/servers/cpanel/templates/ In the clientArea function, we have the following (and only the following) return array( 'overrideDisplayTitle' => ucfirst($params['domain']), 'tabOverviewReplacementTemplate' => 'overview.tpl', 'tabOverviewModuleOutputTemplate' => 'loginbuttons.tpl', ); This will load these two templates from the cpanel templates directory. 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.