<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://3.19.219.109/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kevin</id>
		<title>WHMCS Documentation - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://3.19.219.109/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kevin"/>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/Special:Contributions/Kevin"/>
		<updated>2026-04-03T21:19:30Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.29.1</generator>

	<entry>
		<id>http://3.19.219.109/index.php?title=Editing_Client_Area_Menus&amp;diff=15963</id>
		<title>Editing Client Area Menus</title>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/index.php?title=Editing_Client_Area_Menus&amp;diff=15963"/>
				<updated>2015-09-22T20:24:15Z</updated>
		
		<summary type="html">&lt;p&gt;Kevin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;WHMCS version 6 introduces a programmatic way to interact with the client area navigation and sidebars through hooks and modules.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-warning&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;In a hurry?&amp;lt;/strong&amp;gt; We have made available two guides containing copy &amp;amp; paste ready code samples for common customisations performed to the dynamic navigation and sidebar menus.&lt;br /&gt;
* [[Client Area Navigation Menus Cheatsheet]]&lt;br /&gt;
* [[Client Area Sidebars Cheatsheet]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Menu structure=&lt;br /&gt;
&lt;br /&gt;
The client area's navigation and sidebars are defined in a tree structure of [http://docs.whmcs.com/classes/classes/WHMCS.View.Menu.Item.html menu item objects]. Each menu item has one parent item and can have many child items. The only menu item with no parent an invisible root item that is not displayed on the page.&lt;br /&gt;
&lt;br /&gt;
==Navigation bars==&lt;br /&gt;
&lt;br /&gt;
Navigation bars consist of the invisible menu root with children representing every item displayed in the navigation bar. Each of these items may have their own child items. These child items are rendered as that navigation bar item's dropdown menu. &lt;br /&gt;
&lt;br /&gt;
* ''Navigation bar root Item''&lt;br /&gt;
** navigation item&lt;br /&gt;
** navigation item&lt;br /&gt;
*** dropdown item&lt;br /&gt;
** navigation item&lt;br /&gt;
*** dropdown item&lt;br /&gt;
*** dropdown item &lt;br /&gt;
*** dropdown item&lt;br /&gt;
** navigation item &lt;br /&gt;
&lt;br /&gt;
Navigation bars are displayed on every page in the client area, but their contents may change if a client is logged in or not. For instance, the navigation bar may show login and password recovery links if a user isn't logged in.&lt;br /&gt;
&lt;br /&gt;
==Sidebars==&lt;br /&gt;
&lt;br /&gt;
Like the navigation bar, the sidebars in WHMCS begin with an invisible menu root, but each child represents an individual panel in the side bar. Each panel item is rendered as an item within the panel in the WHMCS client area.&lt;br /&gt;
&lt;br /&gt;
* ''Sidebar root Item''&lt;br /&gt;
** panel&lt;br /&gt;
*** panel item&lt;br /&gt;
*** panel item&lt;br /&gt;
*** panel item&lt;br /&gt;
** panel&lt;br /&gt;
*** panel item&lt;br /&gt;
*** panel item&lt;br /&gt;
** panel&lt;br /&gt;
*** panel item&lt;br /&gt;
*** panel item&lt;br /&gt;
*** panel item&lt;br /&gt;
&lt;br /&gt;
Sidebars help provide context for the data displayed on the page. Different pages in the client area may have different sidebar items. For example, a page to view an account may contain sidebar links to view that client’s open tickets or unpaid invoices.&lt;br /&gt;
&lt;br /&gt;
=Menu layout=&lt;br /&gt;
&lt;br /&gt;
==Desktop mode==&lt;br /&gt;
&lt;br /&gt;
[[Image:Desktop mode.png|thumb|The WHMCS 6.0 client area layout in desktop mode]] There are two navigation bars in WHMCS’ client area. The primary navigation bar contains the bulk of the menu and floats to the left of the secondary navigation bar. The secondary navigation bar contains user-specific items and changes if a client is logged in to WHMCS. When a client is not logged in then the secondary navigation contains a login link, and when a client is logged in then the secondary menu contains links to the client’s account.&lt;br /&gt;
&lt;br /&gt;
Likewise there are two sidebars on every client area page. The primary sidebar is displayed above the secondary side bar on the left side of the page. Sidebar content varies per page, though the primary sidebar typically displays information directly relevant to the page content while the secondary sidebar usually contains more general links. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Responsive mode==&lt;br /&gt;
&lt;br /&gt;
[[Image:Responsive mode.png|thumb|The WHMCS 6.0 client area layout in responsive mode]] Responsive mode is activated when WHMCS’ client area is viewed on a smaller screen device such as a phone or tablet. WHMCS rearranges the page layout in responsive mode for best display on mobile devices. &lt;br /&gt;
&lt;br /&gt;
In responsive mode the primary and secondary navigation bars are displayed above the primary sidebar, followed by the page’s content with the secondary sidebar displayed at the bottom of the page. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Menu items=&lt;br /&gt;
&lt;br /&gt;
Menu items are modeled in code by the [http://docs.whmcs.com/classes/classes/WHMCS.View.Menu.Item.html &amp;lt;tt&amp;gt;\WHMCS\View\Menu\Item&amp;lt;/tt&amp;gt;] class. These objects contain all of the information needed to render that menu item within a template, including their parent and child menu item relationships. Menu items can have the following aspects:&lt;br /&gt;
&lt;br /&gt;
* A single parent item&lt;br /&gt;
* Multiple optional child items&lt;br /&gt;
* A name used to internally refer to the menu item&lt;br /&gt;
* A label to display when the item is rendered to the page. If no label is defined, then WHMCS render's the menu item's name&lt;br /&gt;
* A URI to link to when the user clicks or taps on a menu item&lt;br /&gt;
* An optional icon displayed to the left of the label. WHMCS has access to both the [http://getbootstrap.com/components/#glyphicons Glyphicons] and [http://fortawesome.github.io/Font-Awesome/ Font Awesome] libraries. &lt;br /&gt;
* An optional badge displayed to the right of the label, usually used for contextual information, such as the number of tickets in a status next to that statuses' name&lt;br /&gt;
* The order that a menu item is displayed in its parent's list of children.&lt;br /&gt;
&lt;br /&gt;
=Menu item arrangement=&lt;br /&gt;
&lt;br /&gt;
==Navigation bars==&lt;br /&gt;
&lt;br /&gt;
[[Image:Navbar item.png|thumb|A client area navigation bar item represented as menu item properties.]] This diagram represents an individual menu item in the navigation bars. All of the menu item’s children are rendered as dropdown menu items. All menu items are rendered with icons to the left of a link to the menu item’s URI followed by the menu item’s badge. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sidebars==&lt;br /&gt;
&lt;br /&gt;
[[Image:Sidebar panel.png|thumb|A client area sidebar panel represented as menu item properties.]] This diagram represents an individual menu item in the sidebars. Unlike the navigation bars this menu item renders a panel in the side bar. Items in the panel rendered by the menu item’s children. Note how body and footer HTML content are also rendered around sidebar panel items. All menu items are rendered with icons to the left of a link to the menu item’s URI followed by the menu item’s badge.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Interacting with menus=&lt;br /&gt;
&lt;br /&gt;
==Hooks==&lt;br /&gt;
&lt;br /&gt;
WHMCS 6.0 introduces a number of hooks to allow menu interaction before they’re sent to the template renderer. Use WHMCS’ &amp;lt;tt&amp;gt;add_hook()&amp;lt;/tt&amp;gt; function to call custom code when WHMCS reaches these hook points during page generation. &lt;br /&gt;
&lt;br /&gt;
* '''ClientAreaPrimaryNavbar'''&lt;br /&gt;
** Called prior to rendering navigation bars.&lt;br /&gt;
** Passes the primary navigation bar object to the hook function.&lt;br /&gt;
* '''ClientAreaSecondaryNavbar'''&lt;br /&gt;
** Called prior to rendering navigation bars.&lt;br /&gt;
** Passes the secondary navigation bar object to the hook function.&lt;br /&gt;
* '''ClientAreaNavbars'''&lt;br /&gt;
** Called prior to rendering navigation bars.&lt;br /&gt;
** Passes no parameters to the hook function.&lt;br /&gt;
* '''ClientAreaPrimarySidebar'''&lt;br /&gt;
** Called prior to rendering sidebars.&lt;br /&gt;
** Passes the primary side bar object to the hook function.&lt;br /&gt;
* '''ClientAreaSecondarySidebar'''&lt;br /&gt;
** Called prior to rendering sidebars.&lt;br /&gt;
** Passes the secondary side bar object to the hook function.&lt;br /&gt;
* '''ClientAreaSidebars'''&lt;br /&gt;
** Called prior to rendering sidebars.&lt;br /&gt;
** Passes no parameters to the hook function&lt;br /&gt;
&lt;br /&gt;
==Direct Access==&lt;br /&gt;
&lt;br /&gt;
WHMCS allows direct manipulation of menu objects outside the hooks system for modules and other custom code that don’t use the hooks system. The built-in &amp;lt;tt&amp;gt;Menu&amp;lt;/tt&amp;gt; class is an alias to an object repository that can retrieve all of WHMCS’ menu objects. Please note that if the menu isn’t generated by the page yet then an empty menu structure may exist that is overwritten by normal page generation. WHMCS recommends using the hooks system to interact with menus.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Menu&amp;lt;/tt&amp;gt; class has four static methods to retrieve menus:&lt;br /&gt;
&lt;br /&gt;
* ''Item'' '''Menu::primaryNavbar()'''&lt;br /&gt;
** Retrieve the primary navigation bar.&lt;br /&gt;
* ''Item'' '''Menu::secondaryNavbar()'''&lt;br /&gt;
** Retrieve the secondary navigation bar.&lt;br /&gt;
* ''Item'' '''Menu::primarySidebar()'''&lt;br /&gt;
** Retrieve the primary sidebar.&lt;br /&gt;
* ''Item'' '''Menu::secondarySidebar()'''&lt;br /&gt;
** Retrieve the secondary sidebar.&lt;br /&gt;
&lt;br /&gt;
WHMCS employs a number of pre-built sidebars in its built-in pages. These side bars are available to hook and module developers through the &amp;lt;tt&amp;gt;Menu::PrimarySidebar()&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Menu::SecondarySidebar()&amp;lt;/tt&amp;gt; methods. Call either of these methods with the name of the sidebar  as the first parameter to retrieve the pre-built sidebar. WHMCS will build the side bar if it isn't already defined. See the table below for the currently defined pre-built sidebars and which pages they are used on.&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
&lt;br /&gt;
WHMCS’ menus, especially the sidebars, render information specific to the page in the client area that’s being accessed by the user. For instance, client information is passed to the “my account” page and ticket information is passed to the “view ticket page”. This data is passed to menu item objects as context. Context can be any PHP object or data type. The &amp;lt;tt&amp;gt;Menu&amp;lt;/tt&amp;gt; class has two static methods for setting and retrieving context items:&lt;br /&gt;
&lt;br /&gt;
* ''void'' '''Menu::addContext(string $key, mixed $value)'''&lt;br /&gt;
** Add $value to the menu context at the key $key, overriding existing values.&lt;br /&gt;
* ''mixed|null'' '''Menu::context(string $key)'''&lt;br /&gt;
** Retrieve the menu context at $key or null if no context exists at the key.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Pre-set sidebars used per page&lt;br /&gt;
|-&lt;br /&gt;
! Sidebar name&lt;br /&gt;
! Pages used on&lt;br /&gt;
! Context&lt;br /&gt;
|-&lt;br /&gt;
! affiliateView&lt;br /&gt;
| &lt;br /&gt;
* &amp;lt;tt&amp;gt;affiliates.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in&lt;br /&gt;
|-&lt;br /&gt;
! announcementList&lt;br /&gt;
| &lt;br /&gt;
* &amp;lt;tt&amp;gt;announcements.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in&lt;br /&gt;
* ''[[collection]] of [https://github.com/briannesbitt/Carbon \Carbon\Carbon]'': '''monthsWithAnnouncements'''&lt;br /&gt;
** The past ten months in which announcements have been published.&lt;br /&gt;
|-&lt;br /&gt;
! clientAddFunds&lt;br /&gt;
| &lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=addfunds&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in&lt;br /&gt;
|-&lt;br /&gt;
! clientRegistration&lt;br /&gt;
| &amp;lt;tt&amp;gt;register.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in.&lt;br /&gt;
* ''[[collection]] of [http://docs.whmcs.com/classes/classes/WHMCS.User.Client.SecurityQuestion.html \WHMCS\User\Client\SecurityQuestion]'': '''securityQuestions'''&lt;br /&gt;
** The configured system security questions.&lt;br /&gt;
|-&lt;br /&gt;
! clientQuoteList&lt;br /&gt;
| &lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=quotes&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in.&lt;br /&gt;
|-&lt;br /&gt;
! clientView&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=addcontact&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=changepw&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=contacts&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=creditcard&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=details&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=emails&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=security&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in.&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | domainList&lt;br /&gt;
| &lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=domains&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | If the &amp;lt;tt&amp;gt;q&amp;lt;/tt&amp;gt; request variable is defined, then the client's associated domain counts in the primary sidebar are filtered to those domains whose names contain &amp;lt;tt&amp;gt;q&amp;lt;/tt&amp;gt;'s value.&lt;br /&gt;
|-&lt;br /&gt;
! domainView&lt;br /&gt;
| style=&amp;quot;white-space:nowrap&amp;quot; | &lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=domaincontacts&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=domaindetails&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=domaindns&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=domainemailforwarding&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=domaingetepp&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=domainregisterns&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in.&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.Domain.Domain.html \WHMCS\Domain\Domain]'': '''domain'''&lt;br /&gt;
** The domain that the client is viewing on the page.&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | downloadList	&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;tt&amp;gt;dl.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;downloads.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in&lt;br /&gt;
* ''[[collection]] of [http://docs.whmcs.com/classes/classes/WHMCS.Download.Download.html \WHMCS\Download\Download]'': '''topFiveDownloads'''&lt;br /&gt;
** The five most downloaded files that are not hidden or in a hidden download category, ordered by number of downloads in descending order.&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.Download.Category.html \WHMCS\Download\Category]'': '''downloadCategory'''&lt;br /&gt;
** The download category the user is currently viewing.&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | The ''topFiveDownloads'' and 'downloadCategory'' contexts are only passed to &amp;lt;tt&amp;gt;download.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
! invoiceList&lt;br /&gt;
| &lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=invoices&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=masspay&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in&lt;br /&gt;
|-&lt;br /&gt;
! networkIssueList&lt;br /&gt;
| &amp;lt;tt&amp;gt;serverstatus.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in.&lt;br /&gt;
* ''array'': '''networkIssueStatusCounts'''&lt;br /&gt;
** A key/value pair of network issue statuses and the number of network issues with each status.&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | orderFormView&lt;br /&gt;
| &amp;lt;tt&amp;gt;cart.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in.&lt;br /&gt;
* ''[[collection]] of [http://docs.whmcs.com/classes/classes/WHMCS.Product.Group.html \WHMCS\Product\Group]'': '''productGroups'''&lt;br /&gt;
** A WHMCS installation's configured product groups.&lt;br /&gt;
* ''int'': '''productGroupId'''&lt;br /&gt;
** The current ''gid'' GET parameter value. &lt;br /&gt;
* ''bool'': '''domainRegistrationEnabled'''&lt;br /&gt;
** Whether or not WHMCS is configured to register domains.&lt;br /&gt;
* ''bool'': '''domainTransferEnabled'''&lt;br /&gt;
** Whether or not WHMCS is configured to transfer domains.&lt;br /&gt;
* ''bool'': '''domainRenewalEnabled'''&lt;br /&gt;
** Whether or not WHMCS is configured to renew domains.&lt;br /&gt;
* ''string'': '''domain'''&lt;br /&gt;
** When configuring domain options, the name of the domain in the shopping cart.&lt;br /&gt;
* ''string'': '''currency'''&lt;br /&gt;
** The user's configured currency, or the system currency if no user is logged in. Eg: &amp;quot;USD&amp;quot;, &amp;quot;GBP&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Only the secondary sidebar is supported on &amp;lt;tt&amp;gt;cart.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | serviceList&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=hosting&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=products&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=services&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in.&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | If the &amp;lt;tt&amp;gt;q&amp;lt;/tt&amp;gt; request variable is defined, then the client's associated service counts in the primary sidebar are filtered to those services whose domain names contain &amp;lt;tt&amp;gt;q&amp;lt;/tt&amp;gt;'s value.&lt;br /&gt;
|-&lt;br /&gt;
! serviceUpgrade&lt;br /&gt;
| &lt;br /&gt;
* &amp;lt;tt&amp;gt;upgrade.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in.&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.Service.Service.html \WHMCS\Service\Service]'': '''service'''&lt;br /&gt;
** The service currently being upgraded.&lt;br /&gt;
|-&lt;br /&gt;
! serviceView&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=cancel&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;clientarea.php?action=productdetails&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in.&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.Service.Service.html \WHMCS\Service\Service]'': '''service'''&lt;br /&gt;
** The service that the client is viewing on the page.&lt;br /&gt;
|-&lt;br /&gt;
! sslCertificateOrderView&lt;br /&gt;
| &lt;br /&gt;
* &amp;lt;tt&amp;gt;configuressl.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.Service.Service.html \WHMCS\Service\Service]|null'': '''service'''&lt;br /&gt;
** The service object representing the SSL certificate being ordered&lt;br /&gt;
* ''string'': '''orderStatus'''&lt;br /&gt;
** The current status of the SSL certificate order &lt;br /&gt;
* ''array'': '''displayData'''&lt;br /&gt;
** A key/value pair of additional SSL certificate data that is displayed on the page on step two of the order process&lt;br /&gt;
* ''int'': '''step'''&lt;br /&gt;
** The current step of the order process&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | support&lt;br /&gt;
| ''various''&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | The support secondary sidebar is displayed when a contact does not have permission to perform an action in the client area.&lt;br /&gt;
|-&lt;br /&gt;
! supportKnowledgeBase&lt;br /&gt;
| &lt;br /&gt;
* &amp;lt;tt&amp;gt;knowledgebase.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in&lt;br /&gt;
* ''array'': '''knowledgeBaseTags'''&lt;br /&gt;
** An array of knowledge base tags and the number of articles with each tag.&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | ticketFeedback&lt;br /&gt;
| &lt;br /&gt;
* &amp;lt;tt&amp;gt;viewticket.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in.&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | Only used on viewticket.php when a user is entering feedback for a recently closed ticket.&lt;br /&gt;
|-&lt;br /&gt;
! ticketList&lt;br /&gt;
| &lt;br /&gt;
* &amp;lt;tt&amp;gt;supporttickets.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in.&lt;br /&gt;
* ''array'': '''ticketStatusCounts'''&lt;br /&gt;
** A key/value pair of ticket statuses with the number of tickets in that status.&lt;br /&gt;
|-&lt;br /&gt;
! ticketSubmit&lt;br /&gt;
| &lt;br /&gt;
* &amp;lt;tt&amp;gt;submitticket.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in.&lt;br /&gt;
|-&lt;br /&gt;
! ticketView&lt;br /&gt;
| &lt;br /&gt;
* &amp;lt;tt&amp;gt;viewticket.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* ''[http://docs.whmcs.com/classes/classes/WHMCS.User.Client.html \WHMCS\User\Client]|null'': '''client'''&lt;br /&gt;
** The client currently logged in, or &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if no client is logged in.&lt;br /&gt;
* ''int'': '''ticketId'''&lt;br /&gt;
** The id number of the ticket the user is viewing.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Examples=&lt;br /&gt;
&lt;br /&gt;
==Add a social media panel to the end of the sidebar==&lt;br /&gt;
&lt;br /&gt;
[[Image:Custom social media sidebar panel.png|thumb|The WHMCS 6 client area support secondary sidebar with a custom social media panel highlighted.]] Let's say we’re a hosting company who wants to better connect with our clients by using social media. The menu hooks introduced in WHMCS 6.0 allow us to insert links to our company’s Facebook, Twitter, and Google+ profiles directly into the interface. We’ll put them at the end of the secondary sidebar so they’re rendered last and won’t interrupt our users’ experience. &lt;br /&gt;
&lt;br /&gt;
This example uses the '''ClientAreaSecondarySidebar''' hook and the menu item’s &amp;lt;tt&amp;gt;addChild()&amp;lt;/tt&amp;gt;and &amp;lt;tt&amp;gt;moveToBack()&amp;lt;/tt&amp;gt; methods. To add panel with links to the sidebar we must:&lt;br /&gt;
&lt;br /&gt;
# Create a panel at the end of the sidebar.&lt;br /&gt;
# Retrieve the panel we just created.&lt;br /&gt;
# Add social media links to the panel.&lt;br /&gt;
&lt;br /&gt;
Fortunately the Font Awesome library already has icons for all of these services. Create the &amp;lt;tt&amp;gt;includes/hooks/socialMediaPanel.php&amp;lt;/tt&amp;gt; file in your WHMCS installation and enter the code below. Save the file and reload your WHMCS installation’s client area. WHMCS automatically loads all hooks the includes/hooks directory. The '''SecondarySidebar''' hook is registered with &amp;lt;tt&amp;gt;add_hook()&amp;lt;/tt&amp;gt; and is consequently loaded every time WHMCS renders the secondary sidebar on page load.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use WHMCS\View\Menu\Item as MenuItem;&lt;br /&gt;
&lt;br /&gt;
// Add social media links to the end of all secondary sidebars.&lt;br /&gt;
add_hook('ClientAreaSecondarySidebar', 1, function (MenuItem $secondarySidebar)&lt;br /&gt;
{&lt;br /&gt;
    // Add a panel to the end of the secondary sidebar for social media links.&lt;br /&gt;
    // Declare it with the name &amp;quot;social-media&amp;quot; so we can easily retrieve it&lt;br /&gt;
    // later.&lt;br /&gt;
    $secondarySidebar-&amp;gt;addChild('social-media', array(&lt;br /&gt;
        'label' =&amp;gt; 'Social Media',&lt;br /&gt;
        'uri' =&amp;gt; '#',&lt;br /&gt;
        'icon' =&amp;gt; 'fa-thumbs-up',&lt;br /&gt;
    ));&lt;br /&gt;
&lt;br /&gt;
    // Retrieve the panel we just created.&lt;br /&gt;
    $socialMediaPanel = $secondarySidebar-&amp;gt;getChild('social-media');&lt;br /&gt;
&lt;br /&gt;
    // Move the panel to the end of the sorting order so it's always displayed&lt;br /&gt;
    // as the last panel in the sidebar.&lt;br /&gt;
    $socialMediaPanel-&amp;gt;moveToBack();&lt;br /&gt;
&lt;br /&gt;
    // Add a Facebook link to the panel.&lt;br /&gt;
    $socialMediaPanel-&amp;gt;addChild('facebook-link', array(&lt;br /&gt;
        'uri' =&amp;gt; 'https://facebook.com/our-great-company',&lt;br /&gt;
        'label' =&amp;gt; 'Like us on Facebook!',&lt;br /&gt;
        'order' =&amp;gt; 1,&lt;br /&gt;
        'icon' =&amp;gt; 'fa-facebook',&lt;br /&gt;
    ));&lt;br /&gt;
&lt;br /&gt;
    // Add a Twitter link to the panel after the Facebook link.&lt;br /&gt;
    $socialMediaPanel-&amp;gt;addChild('twitter-link', array(&lt;br /&gt;
        'uri' =&amp;gt; 'https://twitter.com/ourgreatcompany',&lt;br /&gt;
        'label' =&amp;gt; 'Follow us on Twitter!',&lt;br /&gt;
        'order' =&amp;gt; 2,&lt;br /&gt;
        'icon' =&amp;gt; 'fa-twitter',&lt;br /&gt;
    ));&lt;br /&gt;
&lt;br /&gt;
    // Add a Google+ link to the panel after the Twitter link.&lt;br /&gt;
    $socialMediaPanel-&amp;gt;addChild('google-plus-link', array(&lt;br /&gt;
        'uri' =&amp;gt; 'https://plus.google.com/1234567890123456',&lt;br /&gt;
        'label' =&amp;gt; 'Add us to your circles!',&lt;br /&gt;
        'order' =&amp;gt; 3,&lt;br /&gt;
        'icon' =&amp;gt; 'fa-google-plus',&lt;br /&gt;
    ));&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Add a special offer image and link to the top of the topmost sidebar==&lt;br /&gt;
&lt;br /&gt;
[[Image:Custom panel body html highlighted.png|thumb|The WHMCS 6 client area announcements sidebar panel with a custom special offer highlighted.]] Your web host is doing amazing and to celebrate is offering a discount to all users. The marketing folks want a small image and message in the top of the first sidebar panel on every page that links to a page with the special offer. &lt;br /&gt;
&lt;br /&gt;
This example uses the '''ClientAreaPrimarySidebar''' hook and the menu item’s &amp;lt;tt&amp;gt;getFirstChild()&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setBodyHtml()&amp;lt;/tt&amp;gt; methods. To add panel with links to the sidebar we must:&lt;br /&gt;
&lt;br /&gt;
# Get the first panel from the primary sidebar.&lt;br /&gt;
# Set the panel’s body HTML.&lt;br /&gt;
&lt;br /&gt;
Create the &amp;lt;tt&amp;gt;includes/hooks/specialOfferInSidebar.php&amp;lt;/tt&amp;gt; file in your WHMCS installation and enter the code below. As with the previous example the new file and hook within the file is run on page load and adds the image and link to the topmost panel in the primary sidebar, no matter which page the client is accessing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use WHMCS\View\Menu\Item as MenuItem;&lt;br /&gt;
&lt;br /&gt;
add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar)&lt;br /&gt;
{&lt;br /&gt;
    // The HTML for the link to the the special offer.&lt;br /&gt;
    $specialOfferHtml = &amp;lt;&amp;lt;&amp;lt;EOT&lt;br /&gt;
&amp;lt;a href=&amp;quot;//myawesomecompany.com/special-offer/&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;img src=&amp;quot;/assets/img/catdeals.png&amp;quot; alt=&amp;quot;Click here for amazing deals!&amp;quot;&amp;gt;&lt;br /&gt;
   Kitten says &amp;lt;strong&amp;gt;&amp;lt;em&amp;gt;thanks&amp;lt;/em&amp;gt;&amp;lt;/strong&amp;gt; for making us the best web host!&lt;br /&gt;
&amp;lt;/a&amp;gt;&lt;br /&gt;
EOT;&lt;br /&gt;
&lt;br /&gt;
     // Add a link to the special to the first panel's body HTML. It will render&lt;br /&gt;
    // above the panel's menu item list.&lt;br /&gt;
    $firstSidebar = $primarySidebar-&amp;gt;getFirstChild();&lt;br /&gt;
    if ($firstSidebar) {&lt;br /&gt;
    	$firstSidebar-&amp;gt;setBodyHtml($specialOfferHtml);&lt;br /&gt;
    }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Move the “Contact Us” link to the secondary navigation bar and add more contact options==&lt;br /&gt;
&lt;br /&gt;
[[Image:Custom navbar menu highlighted.png|thumb|The WHMCS 6 client area navbars with the Contact Us link moved to the secondary navbar with a custom dropdown menu.]] The graphic designer feels that our awesome hosting company’s WHMCS installation will more closely match the main site if the “Contact Us” link is moved to the right hand side of the installation’s navigation bars before the “Account” link. They also want a dropdown under the link with links specifically to email the sales team, call us, and provide a map to the company via Google Maps.&lt;br /&gt;
&lt;br /&gt;
This example requires manipulating more than one menu bar. To do that we’ll use the '''ClientAreaNavbars''' hook and the &amp;lt;tt&amp;gt;Menu&amp;lt;/tt&amp;gt; class to retrieve the primary and secondary navigation bars. We’ll use the menu item’s &amp;lt;tt&amp;gt;getChild()&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;removeChild()&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;addChild()&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;moveToFront()&amp;lt;/tt&amp;gt; methods and the static &amp;lt;tt&amp;gt;Menu::primaryNavbar()&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Menu::secondaryNavbar()&amp;lt;/tt&amp;gt; methods. Here’s what we’ll do:&lt;br /&gt;
&lt;br /&gt;
# Save the “Contact Us” link from the primary navigation bar.&lt;br /&gt;
# Remove the “Contact Us” link from the primary navigation bar.&lt;br /&gt;
# Add an email link child to the “Contact Us” link.&lt;br /&gt;
# Add a phone link child to the “Contact Us” link.&lt;br /&gt;
# Add a map link child to the “Contact Us” link.&lt;br /&gt;
# Add the “Contact Us” link to the secondary navigation bar then move it to the beginning of the menu.&lt;br /&gt;
&lt;br /&gt;
Create the &amp;lt;tt&amp;gt;includes/hooks/moveContactUsLink.php&amp;lt;/tt&amp;gt; file in your WHMCS installation and enter the code below. As with the other examples this hook file is picked up on page load and rearranges the navigation bars with the appropriate dropdown items.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
add_hook('ClientAreaNavbars', 1, function ()&lt;br /&gt;
{&lt;br /&gt;
    // Get the current navigation bars.&lt;br /&gt;
    $primaryNavbar = Menu::primaryNavbar();&lt;br /&gt;
    $secondaryNavbar = Menu::secondaryNavbar();&lt;br /&gt;
&lt;br /&gt;
    // Save the &amp;quot;Contact Us&amp;quot; link and remove it from the primary navigation bar.&lt;br /&gt;
    $contactUsLink = $primaryNavbar-&amp;gt;getChild('Contact Us');&lt;br /&gt;
    $primaryNavbar-&amp;gt;removeChild('Contact Us');&lt;br /&gt;
&lt;br /&gt;
    // Add the email sales link to the link's drop-down menu.&lt;br /&gt;
    $contactUsLink-&amp;gt;addChild('email-sales', array(&lt;br /&gt;
        'label' =&amp;gt; 'Email our sales team',&lt;br /&gt;
        'uri' =&amp;gt; 'sales@my-awesome-company.com',&lt;br /&gt;
        'order' =&amp;gt; 1,&lt;br /&gt;
        'icon' =&amp;gt; 'fa-diamond',&lt;br /&gt;
    ));&lt;br /&gt;
&lt;br /&gt;
    // Add the call us link to the link's drop-down menu.&lt;br /&gt;
    $contactUsLink-&amp;gt;addChild('call-us', array(&lt;br /&gt;
        'label' =&amp;gt; 'Call us',&lt;br /&gt;
        'uri' =&amp;gt; 'tel:+18005551212',&lt;br /&gt;
        'order' =&amp;gt; 2,&lt;br /&gt;
        'icon' =&amp;gt; 'fa-mobile',&lt;br /&gt;
    ));&lt;br /&gt;
&lt;br /&gt;
    // Add the map to the company to the link's drop-down menu.&lt;br /&gt;
    $contactUsLink-&amp;gt;addChild('map', array(&lt;br /&gt;
        'label' =&amp;gt; '123 Main St. AnyTown, TX 11223, USA',&lt;br /&gt;
        'uri' =&amp;gt; 'https:\/\/maps.google.com/maps/place/some-map-data',&lt;br /&gt;
        'order' =&amp;gt; 3,&lt;br /&gt;
        'icon' =&amp;gt; 'fa-map-marker',&lt;br /&gt;
    ));&lt;br /&gt;
&lt;br /&gt;
    // Add the link and its drop-down children to the secondary navigation bar.&lt;br /&gt;
    $secondaryNavbar-&amp;gt;addChild($contactUsLink);&lt;br /&gt;
&lt;br /&gt;
    // Make sure the contact us link appears as the first item in the&lt;br /&gt;
    // secondary navigation bar.&lt;br /&gt;
    $contactUsLink-&amp;gt;moveToFront();&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Add support hours and a custom message to the sidebar on the submit ticket page==&lt;br /&gt;
&lt;br /&gt;
[[Image:Custom support hours panel.png|thumb|The WHMCS 6 submit ticket page in responsive mode with support hours and a custom message in the primary sidebar.]] Your business has really taken off, and it's finally time to hire someone to help answer support tickets and sales inquiries. The new hire can't work 24 hours a day, 7 days a week, so it's time to implement official support hours. Your UX people feel that it's best to notify your users of these support hours on the submit ticket page, but only the submit ticket page. They'd like the hours at the top of the primary sidebar, so they're in plain view for the users. They'd also love it if we could notify the users that they can expect a reply from us soon or if they have to wait until the next business day.&lt;br /&gt;
&lt;br /&gt;
Since the powers that be want this to appear at the top of the sidebars we'll manipulate the primary sidebar via the '''ClientAreaPrimarySidebar''' hook. We’ll use the menu item’s &amp;lt;tt&amp;gt;addChild()&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;moveToFront()&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;setBodyHtml()&amp;lt;/tt&amp;gt; methods to add the new panel. The special message to the user addresses the logged in user by first name. Every sidebar has a &amp;quot;client&amp;quot; context available which contains the record of the client that is logged in or ''null'' if no client is logged in. The &amp;lt;tt&amp;gt;Menu::context()&amp;lt;/tt&amp;gt; method will retrieve the client record for us. If the client is logged in then we'll use the client object's &amp;lt;tt&amp;gt;firstName&amp;lt;/tt&amp;gt; property to address the user by name. Version 6.0 uses the very helpful [https://github.com/briannesbitt/Carbon Carbon date library] internally. Carbon is available to third party developers, so we'll use it to determine if support is currently open. Here’s what we’ll do:&lt;br /&gt;
&lt;br /&gt;
# Determine if the user is visiting &amp;lt;tt&amp;gt;submitticket.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Add a &amp;quot;Support Hours&amp;quot; panel to the primary sidebar and move it to the front so it displays at the top.&lt;br /&gt;
# Create child items in the support hours panel saying when support is open and closed.&lt;br /&gt;
# Determine if support is currently open.&lt;br /&gt;
# If there is a user logged in then determine their first name.&lt;br /&gt;
# Assign the support hours' panel body HTML to a special message depending on the logged in user's first name and whether support is currently open.&lt;br /&gt;
&lt;br /&gt;
Create the &amp;lt;tt&amp;gt;includes/hooks/addSupportHours.php&amp;lt;/tt&amp;gt; file in your WHMCS installation and enter the code below. As with the other examples this hook file is picked up on page load and adds the custom panel and message to the primary sidebar before the submit ticket page renders.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Carbon\Carbon;&lt;br /&gt;
use WHMCS\View\Menu\Item as MenuItem;&lt;br /&gt;
&lt;br /&gt;
// Add a helpful support hours notice to the top of the sidebar on the submit&lt;br /&gt;
// ticket page.&lt;br /&gt;
if (App::getCurrentFilename() == 'submitticket') {&lt;br /&gt;
    add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) &lt;br /&gt;
    {&lt;br /&gt;
        // Create the support hours panel and make sure it's the first one&lt;br /&gt;
        // displayed.&lt;br /&gt;
        /** @var MenuItem $supportHours */&lt;br /&gt;
        $supportHours = $primarySidebar-&amp;gt;addChild('Support Hours');&lt;br /&gt;
        $supportHours-&amp;gt;moveToFront();&lt;br /&gt;
&lt;br /&gt;
        // Add hours to the panel.&lt;br /&gt;
        $supportHours-&amp;gt;addChild(&lt;br /&gt;
            '&amp;lt;strong&amp;gt;Open&amp;lt;/strong&amp;gt; 08:00-17:00 M-F',&lt;br /&gt;
            array(&lt;br /&gt;
                'icon'  =&amp;gt; 'fa-smile-o',&lt;br /&gt;
                'order' =&amp;gt; 1,&lt;br /&gt;
            )&lt;br /&gt;
        );&lt;br /&gt;
        $supportHours-&amp;gt;addChild(&lt;br /&gt;
            '&amp;lt;strong&amp;gt;Closed&amp;lt;/strong&amp;gt; Weekends',&lt;br /&gt;
            array(&lt;br /&gt;
                'icon'  =&amp;gt; 'fa-frown-o',&lt;br /&gt;
                'order' =&amp;gt; 2,&lt;br /&gt;
            )&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Add a custom notice to the support hours panel with the logged in&lt;br /&gt;
        // client's first name and a different message depending on whether&lt;br /&gt;
        // support is open.&lt;br /&gt;
        /** @var \WHMCS\User\Client $client */&lt;br /&gt;
        $client = Menu::context('client');&lt;br /&gt;
        $greeting = is_null($client)&lt;br /&gt;
            ? ''&lt;br /&gt;
            : &amp;quot;, &amp;lt;strong&amp;gt;{$client-&amp;gt;firstName}&amp;lt;/strong&amp;gt;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
        $now = Carbon::now();&lt;br /&gt;
        $supportIsOpen = $now-&amp;gt;isWeekday()&lt;br /&gt;
            &amp;amp;&amp;amp; $now-&amp;gt;hour &amp;gt;= 8&lt;br /&gt;
            &amp;amp;&amp;amp; $now-&amp;gt;hour &amp;lt;= 17;&lt;br /&gt;
&lt;br /&gt;
        $supportHours-&amp;gt;setBodyHtml(&lt;br /&gt;
            $supportIsOpen&lt;br /&gt;
                ? &amp;quot;Hi{$greeting}! We're open and will respond to your ticket soon!&amp;quot;&lt;br /&gt;
                : &amp;quot;Don't worry{$greeting}! We will respond on the next business day. Sit tight!&amp;quot;&lt;br /&gt;
        );&lt;br /&gt;
    });&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>	</entry>

	<entry>
		<id>http://3.19.219.109/index.php?title=Hooks&amp;diff=15426</id>
		<title>Hooks</title>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/index.php?title=Hooks&amp;diff=15426"/>
				<updated>2015-07-09T04:26:27Z</updated>
		
		<summary type="html">&lt;p&gt;Kevin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is a Hook?==&lt;br /&gt;
&lt;br /&gt;
Action Hooks allow you to add your own code to WHMCS that runs when specific events or actions occur inside the system.  WHMCS has over 100 different hook points that you can tie custom code into, and more are being added with each new release.&lt;br /&gt;
&lt;br /&gt;
The possibilities with hooks are endless, but some common examples of what you might use them for are:&lt;br /&gt;
&lt;br /&gt;
*Registering users in another system when they signup via WHMCS&lt;br /&gt;
*Keeping user details in sync with third party applications&lt;br /&gt;
*Performing additional custom actions when an order is placed in WHMCS&lt;br /&gt;
*Sending notifications when certain events occur&lt;br /&gt;
&lt;br /&gt;
{{Hook_Categories}}&lt;br /&gt;
&lt;br /&gt;
There is also an [[Hooks:Alphabetical|alphabetical list]] of hooks available&lt;br /&gt;
&lt;br /&gt;
==Creating a Hook==&lt;br /&gt;
&lt;br /&gt;
Hooks work by defining a function, and then tieing that function into a hook point. Most custom hook functions are created as a standalone hook, and thus reside in the /includes/hooks/ folder. But hooks can also be part of modules (more details later on this).&lt;br /&gt;
&lt;br /&gt;
Custom hook functions are usually passed variables when they are called, with the variables depending on the action the hook point relates to. Some hook points will also accept a return from your custom hook function, and that allows you to influence what the system does next from your custom code.&lt;br /&gt;
&lt;br /&gt;
We recommend naming hook functions always starting with &amp;quot;hook_&amp;quot;, followed by the filename, and then the particular action or task that hook is performing.  For example &amp;quot;hook_filename_action&amp;quot; - &amp;quot;hook_forumsetup_addclient&amp;quot;.  This helps to ensure that no 2 hook functions from 2 separate developers ever conflict due to naming issues.&lt;br /&gt;
&lt;br /&gt;
==Sample Code==&lt;br /&gt;
&lt;br /&gt;
The best way to see how a hook works is with an example. So here's a sample hook function integrated into the Client Signup hook event:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function hook_create_forum_account($vars) &lt;br /&gt;
{&lt;br /&gt;
    $firstname = $vars['firstname'];&lt;br /&gt;
    $lastname = $vars['lastname'];&lt;br /&gt;
    $email = $vars['email'];&lt;br /&gt;
&lt;br /&gt;
    # Run code to create remote forum account here...&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
add_hook('ClientAdd', 1, 'hook_create_forum_account');&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Add Hook Function==&lt;br /&gt;
&lt;br /&gt;
This is the key function for hooks, and is how you define to WHMCS at what point your custom hook function should be called.&lt;br /&gt;
&lt;br /&gt;
*The first part defines the hook point.  This must be one of the hook points WHMCS has implemented (listed in the pages below)&lt;br /&gt;
*The number defines the priority of the hook, so for example if you have more than 1 hook for the ClientAdd function, the order in which the hooks should run&lt;br /&gt;
*The third argument tells WHMCS which function to call from this hook point and so this is where you put the name of the custom hook file you create&lt;br /&gt;
&lt;br /&gt;
A commented out example hook file is included in WHMCS which you can use as a template. You'll find that in the folder /includes/hooks/&lt;br /&gt;
&lt;br /&gt;
==Module Hooks==&lt;br /&gt;
&lt;br /&gt;
As of WHMCS V4.4, addon modules support hooks being defined that relate to a module within the module directory in /modules/addons/&lt;br /&gt;
&lt;br /&gt;
And as of WHMCS V5.0, both product/server/provisioning modules and domain registrar modules also support hooks being defined within the relevant modules directories.&lt;br /&gt;
&lt;br /&gt;
To define hooks as part of a module, simple create a file named &amp;quot;hooks.php&amp;quot; within the module folder, and include all module specific hook related code within that file.&lt;br /&gt;
&lt;br /&gt;
''Note to Developers:'' Hook files in module folders are only called for active modules. And active modules that contain hooks are cached. So if you add a hooks file to a module retrospectively, once the module is already active, then before the system will detect and start running that module, you must edit and resave either the addon module configuration, product configuration or domain registrar configuration for the respective module for it to be detected.&lt;br /&gt;
&lt;br /&gt;
==Hook Points==&lt;br /&gt;
&lt;br /&gt;
We've divided the hooks up into categories to help make the list more managable. So simply choose an option from below to see the hooks which exist for that category.&lt;br /&gt;
&lt;br /&gt;
{{Hook_Categories}}&lt;br /&gt;
&lt;br /&gt;
There is also an [[Hooks:Alphabetical|alphabetical list]] of hooks available&lt;br /&gt;
&lt;br /&gt;
{{Developer_Links}}&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>	</entry>

	<entry>
		<id>http://3.19.219.109/index.php?title=Working_With_Client_Area_Home_Page_Panels&amp;diff=15423</id>
		<title>Working With Client Area Home Page Panels</title>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/index.php?title=Working_With_Client_Area_Home_Page_Panels&amp;diff=15423"/>
				<updated>2015-07-08T21:54:13Z</updated>
		
		<summary type="html">&lt;p&gt;Kevin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Like the client area's navigation and sidebars, the panels displayed on the client area home page are based on a tree structure of menu item objects. These panels are displayed on the home page to present quick information to a client after they log in, such as overdue invoices, links to active products and services, and domains that are soon to expire. Like the client area's navigation and sidebars, these panels can be modified programmatically. Working with these panels is nearly identical to modifying navbars and side bars. &lt;br /&gt;
&lt;br /&gt;
=Panel Structure=&lt;br /&gt;
&lt;br /&gt;
The client area's panels have an invisible root item. Each panel is a child of that invisible root item. Many panels in turn have their own child items that are rendered as lists of links inside the panel. &lt;br /&gt;
&lt;br /&gt;
* ''root item''&lt;br /&gt;
** panel item&lt;br /&gt;
*** line item&lt;br /&gt;
*** line item&lt;br /&gt;
*** line item&lt;br /&gt;
** panel item&lt;br /&gt;
*** line item&lt;br /&gt;
*** line item&lt;br /&gt;
** panel item&lt;br /&gt;
&lt;br /&gt;
=Panel Layout=&lt;br /&gt;
&lt;br /&gt;
==Desktop Mode==&lt;br /&gt;
&lt;br /&gt;
[[Image:Desktop mode client panels.png|thumb|The WHMCS 6.0 client area homepage panel layout in desktop mode]] When viewed in desktop mode, typically on desktop web browsers, client are homepage panels are rendered in two columns. Odd numbered panels are rendered on the left column and even numbered panels are rendered on the right column.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Responsive Mode==&lt;br /&gt;
&lt;br /&gt;
[[Image:Responsive mode client panels.png|thumb|The WHMCS 6.0 client area homepage panel layout in responsive mode]] Responsive mode is activated when the client ares is viewed on a smaller screen, typically on a phone or tablet. Responsive mode renders all panels in a single column, with the left column placed over the right column. This means that odd numbered panels are displayed above even numbered panels in responsive mode. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Differences With Navigation And Sidebar Menu Items=&lt;br /&gt;
&lt;br /&gt;
[[Image:Client area panel item.png|thumb|A client area home page panel represented as menu item properties]] When rendered, a client area home page panel resembles a panel in the sidebar. It uses the same underlying structure as the menu item objects that render the sidebar, though with a number of changes:&lt;br /&gt;
&lt;br /&gt;
A home page panel's label is not a clickable link. Setting a URI on a home page panel has no effect in WHMCS.&lt;br /&gt;
&lt;br /&gt;
Panels can be rendered in a custom color to give it a unique effect. Define the '''color''' menu item attribute to set this color. The following colors are available:&lt;br /&gt;
&lt;br /&gt;
* gold&lt;br /&gt;
* green&lt;br /&gt;
* red&lt;br /&gt;
* blue&lt;br /&gt;
* orange&lt;br /&gt;
* pink&lt;br /&gt;
* purple&lt;br /&gt;
* lime&lt;br /&gt;
* magenta&lt;br /&gt;
* teal&lt;br /&gt;
* turquoise&lt;br /&gt;
* emerald&lt;br /&gt;
* amethyst&lt;br /&gt;
* wet-asphalt&lt;br /&gt;
* midnight-blue&lt;br /&gt;
* sun-flower&lt;br /&gt;
* pomegranate&lt;br /&gt;
* silver&lt;br /&gt;
* asbestos&lt;br /&gt;
&lt;br /&gt;
Finally, a home page panel has an optional button rendered to the right of the panel's label and badge. Define the following menu item extras to render a button in a home page panel:&lt;br /&gt;
&lt;br /&gt;
* '''btn-link''': The URL to load in the user's web browser when the button is clicked.&lt;br /&gt;
* '''btn-text''': The text within the button.&lt;br /&gt;
* '''btn-icon''': An optional Font Awesome icon to display to the left of the button's text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Default Panels=&lt;br /&gt;
&lt;br /&gt;
The following panels are defined by default.  Please note that hooks can register additional panels as well as interact with the default ones, so there is no guarantee that these panels will be visible, or necessarily in the given display orders.&lt;br /&gt;
&lt;br /&gt;
In addition, most of the panels are conditional. They only display when certain conditions are met in addition to the user having the appropriate permissions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name&lt;br /&gt;
! Order&lt;br /&gt;
! Required Permission&lt;br /&gt;
! Conditions for Display&lt;br /&gt;
|-&lt;br /&gt;
| Unpaid Invoices&lt;br /&gt;
| 10&lt;br /&gt;
| Invoices&lt;br /&gt;
| At least one unpaid invoice with no overdue invoices&lt;br /&gt;
|-&lt;br /&gt;
| Overdue Invoices&lt;br /&gt;
| 10&lt;br /&gt;
| Invoices&lt;br /&gt;
| At least one overdue invoices&lt;br /&gt;
|-&lt;br /&gt;
| Domains Expiring Soon&lt;br /&gt;
| 50&lt;br /&gt;
| Manage Domains&lt;br /&gt;
| At least one domain expiring within 30 days&lt;br /&gt;
|-&lt;br /&gt;
| Active Products/Services&lt;br /&gt;
| 100&lt;br /&gt;
| Manage Products &lt;br /&gt;
| ''None''&lt;br /&gt;
|-&lt;br /&gt;
| Recent Support Tickets&lt;br /&gt;
| 150&lt;br /&gt;
| Support Tickets&lt;br /&gt;
| ''None''&lt;br /&gt;
|-&lt;br /&gt;
| Register a New Domain&lt;br /&gt;
| 200&lt;br /&gt;
| Orders&lt;br /&gt;
| Domain registration enabled&lt;br /&gt;
|-&lt;br /&gt;
| Your Files&lt;br /&gt;
| 250&lt;br /&gt;
| ''None''&lt;br /&gt;
| At least one file associated with the client's account&lt;br /&gt;
|- &lt;br /&gt;
| Affiliate Program&lt;br /&gt;
| 300&lt;br /&gt;
| Affiliate&lt;br /&gt;
| An active affiliate account&lt;br /&gt;
|-&lt;br /&gt;
| Recent News&lt;br /&gt;
| 500&lt;br /&gt;
| ''None''&lt;br /&gt;
| ''None''&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Interacting With Home Page Panels=&lt;br /&gt;
&lt;br /&gt;
WHMCS 6.0 introduce a hook to allow manipulation of the client area home page's panels. Use WHMCS’ &amp;lt;tt&amp;gt;add_hook()&amp;lt;/tt&amp;gt; function to call custom code when WHMCS is ready to render these panels.&lt;br /&gt;
&lt;br /&gt;
* '''ClientAreaHomepagePanels'''&lt;br /&gt;
** Called prior to assigning the panel object to the view template.&lt;br /&gt;
** Passes the client area home panels' root item to the hook function.&lt;br /&gt;
&lt;br /&gt;
=Examples=&lt;br /&gt;
&lt;br /&gt;
==Add a local temperature panel to the homepage==&lt;br /&gt;
&lt;br /&gt;
[[Image:Local temperatures home page panel.png|thumb|The WHMCS 6 client area home page with a custom local temperatures panel highlighted.]] &lt;br /&gt;
&lt;br /&gt;
:''Please note that this example makes use of a free third party service unrelated to WHMCS. WHMCS cannot guarantee the state of this service and uses it for example purposes only.''&lt;br /&gt;
&lt;br /&gt;
The powers that be at your hosting company have decided that they want to be their clients' single stop for everything and want to start providing a seamless general portal experience in addition to quality hosting. They feel that showing a simple temperature forecast after the user logs in is a good start to achieving it. Luckily, WHMCS provides a way to easily add this to the interface. &lt;br /&gt;
&lt;br /&gt;
This example uses the '''ClientAreaHomepagePanels''' hook and the menu item's &amp;lt;tt&amp;gt;addChild()&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;moveToFront()&amp;lt;/tt&amp;gt; methods. The &amp;lt;tt&amp;gt;WHMCS\User\Client&amp;lt;/tt&amp;gt; class contains the information to query for weather data. This calls the United States National Weather Service's [http://graphical.weather.gov/xml/ National Digital Forecast Database web service] and requires [http://php.net/manual/en/book.soap.php SOAP] support in your PHP installation. It also uses the [https://github.com/briannesbitt/Carbon Carbon] library for date manipulation and display. The Carbon library is bundled with WHMCS version 6. To add this panel to the client area home page we must:&lt;br /&gt;
&lt;br /&gt;
# Translate the logged in user's zip code into a latitude/longitude pair.&lt;br /&gt;
# Send the user's latitude/longitude pair to the NDFD service to retrieve their local forecast.&lt;br /&gt;
# Add a child panel to the home page panels list that has the label &amp;quot;Local Temperatures&amp;quot; and has today's temperatures in the panel's body HTML.&lt;br /&gt;
# Add child items to the panel for the next five days of temperatures. WHMCS will display these temperatures in a list inside the panel.&lt;br /&gt;
# Move the local temperatures to the beginning so it's displayed first.&lt;br /&gt;
&lt;br /&gt;
Create the &amp;lt;tt&amp;gt;includes/hooks/clientWeatherPanel.php&amp;lt;/tt&amp;gt; file in your WHMCS installation and enter the code below. WHMCS will parse the file and hook on page load and will run the hook function when the client visits the home page after logging in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Carbon\Carbon;&lt;br /&gt;
use WHMCS\User\Client;&lt;br /&gt;
use WHMCS\View\Menu\Item;&lt;br /&gt;
&lt;br /&gt;
add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels)&lt;br /&gt;
{&lt;br /&gt;
    /** @var \WHMCS\User\Client $currentUser */&lt;br /&gt;
    $currentUser = Client::find($_SESSION['uid']);&lt;br /&gt;
    $today = Carbon::now()-&amp;gt;startOfDay();&lt;br /&gt;
&lt;br /&gt;
    // Connect to the United States' National Weather Service.&lt;br /&gt;
    // See http://graphical.weather.gov/xml/ for more information.&lt;br /&gt;
    $soapClient = new SoapClient('http://graphical.weather.gov/xml/DWMLgen/wsdl/ndfdXML.wsdl');&lt;br /&gt;
&lt;br /&gt;
    // The weather API takes a latitude/longitude pair as input. Translate the&lt;br /&gt;
    // current user's zip code into a coordinate pair.&lt;br /&gt;
    $response = simplexml_load_string($soapClient-&amp;gt;LatLonListZipCode($currentUser-&amp;gt;postcode));&lt;br /&gt;
    list ($latitude, $longitude) = explode(',', $response-&amp;gt;latLonList);&lt;br /&gt;
&lt;br /&gt;
    // Query for the weather forecast and turn it into display data.&lt;br /&gt;
    $response = simplexml_load_string($soapClient-&amp;gt;NDFDGen($latitude, $longitude, 'glance'));&lt;br /&gt;
    $maximumTemperatures = (array)$response-&amp;gt;data-&amp;gt;parameters-&amp;gt;temperature[0]-&amp;gt;value;&lt;br /&gt;
    $minimumTemperatures = (array)$response-&amp;gt;data-&amp;gt;parameters-&amp;gt;temperature[1]-&amp;gt;value;&lt;br /&gt;
&lt;br /&gt;
    // Build the new temperature panel by adding a child panel to the panel&lt;br /&gt;
    // list.&lt;br /&gt;
    $todaysMaximum = $maximumTemperatures[0];&lt;br /&gt;
    $todaysMinimum = $minimumTemperatures[0];&lt;br /&gt;
&lt;br /&gt;
    $weatherPanel = $homePagePanels-&amp;gt;addChild('local temperatures', array(&lt;br /&gt;
        'label' =&amp;gt; 'Local Temperatures',&lt;br /&gt;
        'icon' =&amp;gt; 'fa-cloud',&lt;br /&gt;
        'extras' =&amp;gt; array(&lt;br /&gt;
            'color' =&amp;gt; 'blue',&lt;br /&gt;
        ),&lt;br /&gt;
        'bodyHtml' =&amp;gt; &amp;quot;&amp;lt;p&amp;gt;Today's temperature in {$currentUser-&amp;gt;city}: {$todaysMinimum}&amp;amp;deg;F / {$todaysMaximum}&amp;amp;deg;F&amp;lt;/p&amp;gt;&amp;quot;,&lt;br /&gt;
    ));&lt;br /&gt;
&lt;br /&gt;
    // Add the 5-day temperature forecast as child items to the panel so WHMCS&lt;br /&gt;
    // can present them nicely in a list.&lt;br /&gt;
    for ($i = 1; $i &amp;lt;= 5; $i++) {&lt;br /&gt;
        $day = $today-&amp;gt;addDays(1);&lt;br /&gt;
        $minimumTemperature = $minimumTemperatures[$i];&lt;br /&gt;
        $maximumTemperature = $maximumTemperatures[$i];&lt;br /&gt;
&lt;br /&gt;
        $weatherPanel-&amp;gt;addChild($day-&amp;gt;format('l, F j'), array(&lt;br /&gt;
            'label' =&amp;gt; $day-&amp;gt;format('l, F j'),&lt;br /&gt;
            'icon' =&amp;gt; 'fa-angle-double-right',&lt;br /&gt;
            'badge' =&amp;gt; &amp;quot;{$minimumTemperature}&amp;amp;deg;F / {$maximumTemperature}&amp;amp;deg;F&amp;quot;,&lt;br /&gt;
            'order' =&amp;gt; $i,&lt;br /&gt;
        ));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Finally, move the panel to the beginning of the panel list so it's&lt;br /&gt;
    // displayed first.&lt;br /&gt;
    $weatherPanel-&amp;gt;moveToFront();&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Add a promotional offer panel==&lt;br /&gt;
&lt;br /&gt;
[[Image:Redeem offer home page panel.png|thumb|The WHMCS 6 client area home page in responsive mode with custom special offer panel highlighted.]] After a lengthy beta period, your company has just released the latest version of its flagship product. The users love it, and the orders are rolling in. The public beta period was so successful that management wants to offer a free month of the service to all existing clients. The promo page is ready to go, so all that's left is to inform the users. The sales team wants it to show up after any unpaid or overdue invoice notices. There's a business to run, after all. Thankfully WHMCS provides an easy way to let the users know about the special offer right after they log in.&lt;br /&gt;
&lt;br /&gt;
Like the previous example, this example uses the '''ClientAreaHomepagePanels''' hook and the menu item's &amp;lt;tt&amp;gt;addChild()&amp;lt;/tt&amp;gt; method. Unlike the previous examples though it doesn't need a list of child items, but it will use a panel's body HTML and custom button in the corner. To add this panel to the client area home page we must:&lt;br /&gt;
&lt;br /&gt;
# Add a child panel to the home page panels list that has the the following extras:&lt;br /&gt;
#* A '''btn-link''' extra containing a link to the special promo.&lt;br /&gt;
#* A '''btn-text''' extra containing the text of the button.&lt;br /&gt;
# Define body and footer HTML in the panel to make the promotion conform to WHMCS' look and feel.&lt;br /&gt;
# Set the order to 20 to place it after the default unpaid and overdue invoice panels.&lt;br /&gt;
&lt;br /&gt;
Create the &amp;lt;tt&amp;gt;includes/hooks/specialOfferPanel.php&amp;lt;/tt&amp;gt; file in your WHMCS installation and enter the code below. As with the precious example, WHMCS will parse the file and hook on page load and will run the hook function when the client visits the home page after logging in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use WHMCS\View\Menu\Item;&lt;br /&gt;
&lt;br /&gt;
add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels)&lt;br /&gt;
{&lt;br /&gt;
    $thankYouMessage = &amp;lt;&amp;lt;&amp;lt;EOT&lt;br /&gt;
&amp;lt;p&amp;gt;Thanks for beta testing our latest offerings! To show our appreciation we'd&lt;br /&gt;
like to provide next month of service &amp;lt;strong&amp;gt;on the house&amp;lt;/strong&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
EOT;&lt;br /&gt;
&lt;br /&gt;
    // Add a homepage panel with a link to a free month promo and mode it to the&lt;br /&gt;
    // front of the panel list.&lt;br /&gt;
    $homePagePanels-&amp;gt;addChild('thanks', array(&lt;br /&gt;
        'label' =&amp;gt; 'Thanks for the help!',&lt;br /&gt;
        'icon' =&amp;gt; 'fa-thumbs-up',&lt;br /&gt;
        'order' =&amp;gt; 20,&lt;br /&gt;
        'extras' =&amp;gt; array(&lt;br /&gt;
            'color' =&amp;gt; 'gold',&lt;br /&gt;
            'btn-link' =&amp;gt; 'https://example.org/free-month-promo',&lt;br /&gt;
            'btn-text' =&amp;gt; 'Redeem Your Free Month',&lt;br /&gt;
            'btn-icon' =&amp;gt; 'fa-arrow-right',&lt;br /&gt;
        ),&lt;br /&gt;
        'bodyHtml' =&amp;gt; $thankYouMessage,&lt;br /&gt;
        'footerHtml' =&amp;gt; 'Act fast! This offer expires soon!',&lt;br /&gt;
    ));&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>	</entry>

	<entry>
		<id>http://3.19.219.109/index.php?title=Version_6_Template_Migration_Guide&amp;diff=15326</id>
		<title>Version 6 Template Migration Guide</title>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/index.php?title=Version_6_Template_Migration_Guide&amp;diff=15326"/>
				<updated>2015-07-08T07:07:02Z</updated>
		
		<summary type="html">&lt;p&gt;Kevin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Smarty Templating Changes=&lt;br /&gt;
&lt;br /&gt;
WHMCS has gone through a number of backend changes in version 6. Included amongst them was the internal upgrade from Smarty 2 to Smarty 3.1. Most custom templates won't need any updates to be compatible with version 6, but those that used features only available in Smarty 2 will need to be migrated to ensure a smooth transition to the latest version. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-info&amp;quot;&amp;gt;The inverse of this change is also true. Custom templates made for WHMCS 6 that use Smarty 3 specific syntax are not compatible with previous versions of WHMCS.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=={literal} Changes==&lt;br /&gt;
&lt;br /&gt;
Smarty 3's engine changes the way whitespace is interpreted in templates, removing the need for {literal} tags around &amp;quot;{&amp;quot; and &amp;quot;}&amp;quot; characters in CSS and Javascript blocks.&lt;br /&gt;
&lt;br /&gt;
For example, the following Javascript from a Smarty template: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smarty&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    function example() &lt;br /&gt;
    {literal}{{/literal}&lt;br /&gt;
        alert('example');&lt;br /&gt;
    {literal}}{/literal}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smarty&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    function example() &lt;br /&gt;
    {&lt;br /&gt;
        alert('example');&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=={php} Block Syntax==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-info&amp;quot;&amp;gt;An option was added to WHMCS 6 to enable use of the potentially dangerous {php} tag in custom templates. This option is disabled by default but can be enabled if required in '''Setup &amp;gt; General Settings &amp;gt; Security'''. We strongly encourage using hook functions over php code blocks inside of templates for backend interaction.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Smarty 3's backwards compatibility layer defines the {php} tag as a block plugin instead of a method native to the Smarty object. Combined with Smarty's internal rewrite in version 3, some syntax available within a Smarty 2 {php} block will need small modification.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
! Original syntax&lt;br /&gt;
! New syntax&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;$this&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;$template&amp;lt;/tt&amp;gt;&lt;br /&gt;
| All Smarty 3 block plugins have a &amp;lt;tt&amp;gt;$template&amp;lt;/tt&amp;gt; parameter containing the current Smarty instance. &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;white-space: nowrap&amp;quot; | &amp;lt;tt&amp;gt;$this-&amp;gt;_tpl_vars&amp;lt;/tt&amp;gt;&lt;br /&gt;
| &amp;lt;tt&amp;gt;$template-&amp;gt;getVariable('variableName')&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;$template-&amp;gt;getTemplateVars()&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Template variables are represented by &amp;lt;tt&amp;gt;Smarty_Variable&amp;lt;/tt&amp;gt; objects in Smarty 3, which have a value property. &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For example, the following {php} block: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
{php}&lt;br /&gt;
&lt;br /&gt;
// Retrieve a single template variable. &lt;br /&gt;
$myValue = $this-&amp;gt;_tpl_vars['myVariable'];&lt;br /&gt;
&lt;br /&gt;
// Loop through all template variables.&lt;br /&gt;
foreach ($this-&amp;gt;_tpl_vars as $key =&amp;gt; $value) {&lt;br /&gt;
   echo &amp;quot;{$key}: {$value}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Assign a new template variable.&lt;br /&gt;
$this-&amp;gt;assign('myNewVariable', 'myNewValue');&lt;br /&gt;
&lt;br /&gt;
{/php}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
{php}&lt;br /&gt;
&lt;br /&gt;
// Retrieve a single template variable. &lt;br /&gt;
$myValue = $template-&amp;gt;getVariable('myVariable')-&amp;gt;value;&lt;br /&gt;
&lt;br /&gt;
// Loop through all template variables. &lt;br /&gt;
foreach ($template-&amp;gt;getTemplateVars() as $key =&amp;gt; $variable) {&lt;br /&gt;
   echo &amp;quot;{$key}: {$variable-&amp;gt;value}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// The assign() method works as it did before, though it must now be &lt;br /&gt;
// called on the $template object instead of $this.&lt;br /&gt;
$template-&amp;gt;assign('myNewVariable', 'myNewValue');&lt;br /&gt;
&lt;br /&gt;
{/php}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also importing to note that because of these changes, PHP code blocks that close in the middle of a condition, such as the below example, are now no longer possible and result in a fatal error.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
{php}&lt;br /&gt;
if ($foo) {&lt;br /&gt;
{/php}&lt;br /&gt;
    &amp;lt;div&amp;gt;&lt;br /&gt;
        Lots of HTML here...&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
{/php}&lt;br /&gt;
}&lt;br /&gt;
{/php}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Migrating From {php} Tags To Hooks===&lt;br /&gt;
&lt;br /&gt;
It's a good practice to separate backend logic from display logic. In most cases a template's {php} block can be migrated to a hook file. Hooks are very useful for performing custom actions at specific points in WHMCS's page generation routines. See [[PHP Logic within Templates]] for more information.&lt;br /&gt;
&lt;br /&gt;
For instance, one can reference existing template variables or define new template variables in a PHP file in the &amp;lt;tt&amp;gt;includes/hooks&amp;lt;/tt&amp;gt; directory. Inspect and assign variables using the &amp;quot;ClientAreaPage&amp;quot; hook.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
add_hook('ClientAreaPage', 1, function($templateVariables)&lt;br /&gt;
{&lt;br /&gt;
    // Look for an existing template variable.&lt;br /&gt;
    foreach ($templateVariables as $name =&amp;gt; $variable) {&lt;br /&gt;
        doThings();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Define new variables to send to the template.&lt;br /&gt;
    return array(&lt;br /&gt;
        'myCustomVariable' =&amp;gt; 'myCustomValue',&lt;br /&gt;
    );&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And then reference the newly assigned variable in the template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smarty&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;My custom variable value is: {$myCustomVariable}.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=The $client Object=&lt;br /&gt;
&lt;br /&gt;
All client area templates now have a &amp;lt;tt&amp;gt;$client&amp;lt;/tt&amp;gt; variable that represents the currently logged in client. &amp;lt;tt&amp;gt;$client&amp;lt;/tt&amp;gt; is either a &amp;lt;tt&amp;gt;WHMCS\Client\User&amp;lt;/tt&amp;gt; object or ''null'' if no client is logged in. See [[Using Models]] for more information on how to work with model-based objects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smarty&amp;quot;&amp;gt;&lt;br /&gt;
{if $client === null}&lt;br /&gt;
    &amp;lt;p&amp;gt;Nobody is logged in. :(&amp;lt;/p&amp;gt;&lt;br /&gt;
{else}&lt;br /&gt;
    &amp;lt;p&amp;gt;Hello, {$client-&amp;gt;firstName} {$client-&amp;gt;lastName}!&amp;lt;/p&amp;gt;&lt;br /&gt;
{/if}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>	</entry>

	</feed>