Initial Commit of Module
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.DS_Store
|
||||
1069
azuracast/azuracast.php
Normal file
1069
azuracast/azuracast.php
Normal file
File diff suppressed because it is too large
Load Diff
110
azuracast/hooks.php
Normal file
110
azuracast/hooks.php
Normal file
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
/**
|
||||
* WHMCS SDK Sample Provisioning Module Hooks File
|
||||
*
|
||||
* Hooks allow you to tie into events that occur within the WHMCS application.
|
||||
*
|
||||
* This allows you to execute your own code in addition to, or sometimes even
|
||||
* instead of that which WHMCS executes by default.
|
||||
*
|
||||
* WHMCS recommends as good practice that all named hook functions are prefixed
|
||||
* with the keyword "hook", followed by your module name, followed by the action
|
||||
* of the hook function. This helps prevent naming conflicts with other addons
|
||||
* and modules.
|
||||
*
|
||||
* For every hook function you create, you must also register it with WHMCS.
|
||||
* There are two ways of registering hooks, both are demonstrated below.
|
||||
*
|
||||
* @see https://developers.whmcs.com/hooks/
|
||||
*
|
||||
* @copyright Copyright (c) WHMCS Limited 2017
|
||||
* @license https://www.whmcs.com/license/ WHMCS Eula
|
||||
*/
|
||||
|
||||
// Require any libraries needed for the module to function.
|
||||
// require_once __DIR__ . '/path/to/library/loader.php';
|
||||
//
|
||||
// Also, perform any initialization required by the service's library.
|
||||
|
||||
/**
|
||||
* Client edit sample hook function.
|
||||
*
|
||||
* This sample demonstrates making a service call whenever a change is made to a
|
||||
* client profile within WHMCS.
|
||||
*
|
||||
* @param array $params Parameters dependant upon hook function
|
||||
*
|
||||
* @return mixed Return dependant upon hook function
|
||||
*/
|
||||
function hook_azuracast_clientedit(array $params)
|
||||
{
|
||||
try {
|
||||
// Call the service's function, using the values provided by WHMCS in
|
||||
// `$params`.
|
||||
} catch (Exception $e) {
|
||||
// Consider logging or reporting the error.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a hook with WHMCS.
|
||||
*
|
||||
* add_hook(string $hookPointName, int $priority, string|array|Closure $function)
|
||||
*/
|
||||
add_hook('ClientEdit', 1, 'hook_azuracast_clientedit');
|
||||
|
||||
/**
|
||||
* Insert a service item to the client area navigation bar.
|
||||
*
|
||||
* Demonstrates adding an additional link to the Services navbar menu that
|
||||
* provides a shortcut to a filtered products/services list showing only the
|
||||
* products/services assigned to the module.
|
||||
*
|
||||
* @param \WHMCS\View\Menu\Item $menu
|
||||
*/
|
||||
add_hook('ClientAreaPrimaryNavbar', 1, function ($menu)
|
||||
{
|
||||
// Check whether the services menu exists.
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* Render a custom sidebar panel in the secondary sidebar.
|
||||
*
|
||||
* Demonstrates the creation of an additional sidebar panel on any page where
|
||||
* the My Services Actions default panel appears and populates it with a title,
|
||||
* icon, body and footer html output and a child link. Also sets it to be in
|
||||
* front of any other panels defined up to this point.
|
||||
*
|
||||
* @param \WHMCS\View\Menu\Item $secondarySidebar
|
||||
*/
|
||||
add_hook('ClientAreaSecondarySidebar', 1, function ($secondarySidebar)
|
||||
{
|
||||
// determine if we are on a page containing My Services Actions
|
||||
if (!is_null($secondarySidebar->getChild('My Services Actions'))) {
|
||||
|
||||
// define new sidebar panel
|
||||
$customPanel = $secondarySidebar->addChild('AzuraCast Panel');
|
||||
|
||||
// set panel attributes
|
||||
$customPanel->moveToFront()
|
||||
->setIcon('fa-user')
|
||||
->setBodyHtml(
|
||||
'Your HTML output goes here...'
|
||||
)
|
||||
->setFooterHtml(
|
||||
'Footer HTML can go here...'
|
||||
);
|
||||
|
||||
// define link
|
||||
$customPanel->addChild(
|
||||
'Sample Link Menu Item',
|
||||
array(
|
||||
'uri' => 'clientarea.php?action=services&module=azuracast',
|
||||
'icon' => 'fa-list-alt',
|
||||
'order' => 2,
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
});
|
||||
1
azuracast/lib/README.md
Normal file
1
azuracast/lib/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Include libraries and third party modules here.
|
||||
BIN
azuracast/logo.png
Normal file
BIN
azuracast/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
9
azuracast/templates/error.tpl
Normal file
9
azuracast/templates/error.tpl
Normal file
@@ -0,0 +1,9 @@
|
||||
<h2>Oops! Something went wrong.</h2>
|
||||
|
||||
<div class="alert alert-danger">
|
||||
<p>Extra template variables work here too: {$usefulErrorHelper}</p>
|
||||
</div>
|
||||
|
||||
<p>Please go back and try again.</p>
|
||||
|
||||
<p>If the problem persists, please contact support.</p>
|
||||
48
azuracast/templates/manage.tpl
Normal file
48
azuracast/templates/manage.tpl
Normal file
@@ -0,0 +1,48 @@
|
||||
<h2>Custom Client Area Page</h2>
|
||||
|
||||
<p>This is an example of an additional custom page within a module's client area product management pages.</p>
|
||||
|
||||
<p>Everything that is available in the overview is also available in this template file along with any custom defined template variables.</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.orderproduct}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$groupname} - {$product}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
Extra Variable 1
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$extraVariable1}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
Extra Variable 2
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$extraVariable2}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<form method="post" action="clientarea.php?action=productdetails">
|
||||
<input type="hidden" name="id" value="{$serviceid}" />
|
||||
<button type="submit" class="btn btn-default btn-block">
|
||||
<i class="fa fa-arrow-circle-left"></i>
|
||||
Back to Overview
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
288
azuracast/templates/overview.tpl
Normal file
288
azuracast/templates/overview.tpl
Normal file
@@ -0,0 +1,288 @@
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Overview output goes here...</p>
|
||||
|
||||
<p>Please Remember: When overriding the default product overview output, it is important to provide the product details and information that are normally displayed on this page. These are provided below.</p>
|
||||
|
||||
<div class="alert alert-info">
|
||||
Any variables you define inside the ClientArea module function can also be accessed and used here, for example: {$extraVariable1} & {$extraVariable2}
|
||||
</div>
|
||||
|
||||
<h3>{$LANG.clientareaproductdetails}</h3>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.clientareahostingregdate}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$regdate}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.orderproduct}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$groupname} - {$product}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if $type eq "server"}
|
||||
{if $domain}
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.serverhostname}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$domain}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $dedicatedip}
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.primaryIP}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$dedicatedip}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $assignedips}
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.assignedIPs}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$assignedips|nl2br}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $ns1 || $ns2}
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.domainnameservers}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$ns1}<br />{$ns2}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{else}
|
||||
{if $domain}
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.orderdomain}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$domain}
|
||||
<a href="http://{$domain}" target="_blank" class="btn btn-default btn-xs">{$LANG.visitwebsite}</a>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $username}
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.serverusername}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$username}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $password}
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.serverpassword}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$password}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $serverdata}
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.servername}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$serverdata.hostname}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.domainregisternsip}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$serverdata.ipaddress}
|
||||
</div>
|
||||
</div>
|
||||
{if $serverdata.nameserver1 || $serverdata.nameserver2 || $serverdata.nameserver3 || $serverdata.nameserver4 || $serverdata.nameserver5}
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.domainnameservers}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{if $serverdata.nameserver1}{$serverdata.nameserver1} ({$serverdata.nameserver1ip})<br />{/if}
|
||||
{if $serverdata.nameserver2}{$serverdata.nameserver2} ({$serverdata.nameserver2ip})<br />{/if}
|
||||
{if $serverdata.nameserver3}{$serverdata.nameserver3} ({$serverdata.nameserver3ip})<br />{/if}
|
||||
{if $serverdata.nameserver4}{$serverdata.nameserver4} ({$serverdata.nameserver4ip})<br />{/if}
|
||||
{if $serverdata.nameserver5}{$serverdata.nameserver5} ({$serverdata.nameserver5ip})<br />{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{if $dedicatedip}
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.domainregisternsip}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$dedicatedip}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{foreach from=$configurableoptions item=configoption}
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$configoption.optionname}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{if $configoption.optiontype eq 3}
|
||||
{if $configoption.selectedqty}
|
||||
{$LANG.yes}
|
||||
{else}
|
||||
{$LANG.no}
|
||||
{/if}
|
||||
{elseif $configoption.optiontype eq 4}
|
||||
{$configoption.selectedqty} x {$configoption.selectedoption}
|
||||
{else}
|
||||
{$configoption.selectedoption}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
|
||||
{foreach from=$productcustomfields item=customfield}
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$customfield.name}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$customfield.value}
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
|
||||
{if $lastupdate}
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.clientareadiskusage}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$diskusage}MB / {$disklimit}MB ({$diskpercent})
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.clientareabwusage}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$bwusage}MB / {$bwlimit}MB ({$bwpercent})
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.orderpaymentmethod}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$paymentmethod}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.firstpaymentamount}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$firstpaymentamount}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.recurringamount}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$recurringamount}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.clientareahostingnextduedate}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$nextduedate}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.orderbillingcycle}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$billingcycle}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.clientareastatus}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$status}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if $suspendreason}
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{$LANG.suspendreason}
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
{$suspendreason}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
|
||||
{if $packagesupgrade}
|
||||
<div class="col-sm-4">
|
||||
<a href="upgrade.php?type=package&id={$id}" class="btn btn-success btn-block">
|
||||
{$LANG.upgrade}
|
||||
</a>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="col-sm-4">
|
||||
<a href="clientarea.php?action=cancel&id={$id}" class="btn btn-danger btn-block{if $pendingcancellation}disabled{/if}">
|
||||
{if $pendingcancellation}
|
||||
{$LANG.cancellationrequested}
|
||||
{else}
|
||||
{$LANG.cancel}
|
||||
{/if}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user