Difference between revisions of "Template:Hook:ClientAreaPageActions"

From WHMCS Documentation

m (Protected "Template:Hook:ClientAreaPageActions": Page Template ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
m
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
=={{{hookName|}}}==
 
=={{{hookName|}}}==
 
+
__NOEDITSECTION__
  
 
===Description===
 
===Description===
 +
__NOEDITSECTION__
 
{{Hook_Categories_Vertical| type = ClientAreaPage}}{{{description|}}}
 
{{Hook_Categories_Vertical| type = ClientAreaPage}}{{{description|}}}
  
 
===Hook Type===
 
===Hook Type===
 +
__NOEDITSECTION__
 
Standard ([[Glossary#Standard_Hook|What does this mean?]])
 
Standard ([[Glossary#Standard_Hook|What does this mean?]])
  
 
===Input Parameters===
 
===Input Parameters===
 
+
__NOEDITSECTION__
 
{| class="wikitable" style="text-align:center;margin:1em 1em 1em 0;background:#F9F9F9;border:1px #AAA solid;border-collapse:collapse;width:65%;"
 
{| class="wikitable" style="text-align:center;margin:1em 1em 1em 0;background:#F9F9F9;border:1px #AAA solid;border-collapse:collapse;width:65%;"
 
|+All the currently defined smarty variables are passed to this hook. Each page has different variables assigned. The below are '''some''' of the fields. This list is not exhaustive.
 
|+All the currently defined smarty variables are passed to this hook. Each page has different variables assigned. The below are '''some''' of the fields. This list is not exhaustive.
Line 114: Line 116:
  
 
===Return Type===
 
===Return Type===
 +
__NOEDITSECTION__
 
None required.
 
None required.
 
An array of field => value combinations can be returned if required.
 
An array of field => value combinations can be returned if required.
  
 
===Example===
 
===Example===
 
+
__NOEDITSECTION__
 
<source lang="php">
 
<source lang="php">
 
add_hook('ClientAreaPageAddContact', 1,
 
add_hook('ClientAreaPageAddContact', 1,
function($vars)
+
    function($vars)
{
+
    {
            $return = array("field1" => "value1", "field2" => "value2");
+
        return array(
            return $return;
+
            "field1" => "value1",
}
+
            "field2" => "value2"
 +
        );
 +
    }
 
);
 
);
 
</source>
 
</source>
  
 
===Changelog===
 
===Changelog===
 +
__NOEDITSECTION__
 
{{{history|}}}
 
{{{history|}}}
  
 
__NOTOC__
 
__NOTOC__

Latest revision as of 15:07, 23 July 2015

Description

This page has moved to https://developers.whmcs.com/hooks/


Hook Type

Standard (What does this mean?)

Input Parameters

All the currently defined smarty variables are passed to this hook. Each page has different variables assigned. The below are some of the fields. This list is not exhaustive.
Variable Type Notes
SCRIPT_NAME String The name of the script being loaded
template String The template name
language String The language being used.
companyname String The Company of the installation.
logo String The logo defined in General Settings
charset String The system Charset
pagetitle String The title of the page.
pageicon String The icon image defined for the page
filename String The current filename
breadcrumb Array An array of breadcrumb information
breadcrumbnav String The breadcrumb navigation as output
todaysdate String Todays date as a string
date_day Integer 2 digit day of the month with leading 0 where appropriate
date_month Integer 2 digit month of the year with leading 0 where appropriate
date_year Integer 4 digit year
systemurl String The System URL
langchange Boolean Is language changing enabled?
setlanguage String Only if langchange == true. The HTML output of the language dropdown
currencies Array An array of defined currencies ordered by "code".
start of currencies array
id Integer The currency ID. tblcurrencies.id
code String The three character currency code.
default Integer 1 for yes, 0 for no
end of currencies array
twitterusername String If enabled, the twitter username entered.

Return Type

None required. An array of field => value combinations can be returned if required.

Example

add_hook('ClientAreaPageAddContact', 1,
    function($vars)
    {
        return array(
            "field1" => "value1",
            "field2" => "value2"
        );
    }
);

Changelog