Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation



integrationblogcta.jpg

Branding Module Documentation

The Branding module allows access to cPanel's theming system. You may also use this module to list cPanel applications a particular user can access.

The functions within this module may or may not be governed by a feature list. The required feature list may vary from function to function, to review a total list of the available features sets on a cPanel server, please see "Feature Manager" in WHM.

Branding::file

API Version: 1 - Click here for documentation
Syntax: Branding::file( file, isvar, pkg, inline, needfile, skipdefault, checkmain )
Description: Search for a particular file within a theme, and return the URI fragment pointing to its location, with the current "cpanel magic revision" built in, such as: /cPanel_magic_revision_1267840609/branding/contactinfo_include.html
Parameters:  
  file (string)
  The name of the file for which to search.
  isvar (boolean)
  A value of 1 returns the variable instead of the URI path to the file. This parameter is not useable via any API. Set this parameter to 0 or null.
  pkg (string)
  A value of 1 causes the function to check the specified style under the account's /cpanelbranding directory. Values can be any style name, such as 'the_beach' or 'falltheme'.
  inline (boolean)
  A value of 1 prints contents of the file from the function.
  needfile (boolean)
  A value of 1 causes the function to return the location of the file. This parameter is not useable via API. Set this parameter to 0 or null.
  skipdefault (boolean)
  A value of 1 causes the function to only search the branding package. This parameter is not useable via API.
  checkmain (boolean)
  A value of 1 specifies that the account's /cpanelbranding directory should be searched.
Returns:  
 
The output depends on the parameters used as input. If the file is not found or is not an HTML file, the function may return:
/unprotected/broken.tmpl
Where '*.tmpl' will match the extension of the file specified in the $file parameter.

Branding::setupdirs

API Version: 1 - Click here for documentation
Syntax: Branding::setupdirs( )
Description: Verify and create the account's ~/cpanelbranding directory and subdirectories, setting permissions accordingly. Non-resellers may lack sufficient permissions to create the directories, if they do not exist.
Returns:  
 
This function will not display any output.

Branding::image

API Version: 1 - Click here for documentation
Syntax: Branding::image( imagefile, isvar, pkg, needfile, nomagic, needboth, reqext, skip_logo_check )
Description: Display the URL to a branding image.
Parameters:  
  imagefile (string)
  The name of the image file, without the path or extension.
  isvar (boolean)
  A value of 1 returns the URL value as a variable rather than printing it. This parameter is only used when the function is called from a Perl script.
  pkg (string)
  The name of the branding package from which to retrieve the image.
  needfile (boolean)
  A value of 1 causes the function to truncate the /cPanel_magic_revision_.../ section of the URL.
  nomagic (boolean)
  A value of 1 causes the function to return the full path to the file, rather than using the cpanel_magic_revision URL.
  needboth (boolean)
  A value of 1 causes the function to return both the file and the URL. This parameter is only used when the function is called from a Perl script.
  reqext (boolean)
  A value of 1 causes the function to include the filename extension of the image.
  skip_logo_check (boolean)
  A value of 1 causes the function to return the file rather than the URL to the file.
Returns:  
 
The output should resemble the following:
/cPanel_magic_revision_1161741169/frontend/x3/branding/image.jpg.

Branding::killimg

API Version: 1 - Click here for documentation
Syntax: Branding::killimg( imgname )
Description: Remove an image from a branding style.
Parameters:  
  imgname (string)
  The name of the image to remove.
Returns:  
 
This function does not produce any output.

Branding::setmyacctspkg

API Version: 1 - Click here for documentation
Syntax: Branding::setmyacctspkg( brandingpkg, allaccounts )
Description: Change the branding package for a reseller and all accounts owned by that reseller.
Parameters:  
  brandingpkg (string)
  The name of the branding package for the reseller to use.
  allaccounts (boolean)
  A value of 1 specifies that accounts owned by the reseller should also use the specified package.
Returns:  
 
This function does not produce any output.

Branding::setbrandingpkg

API Version: 1 - Click here for documentation
Syntax: Branding::setbrandingpkg( brandingpkg )
Description: Change the account's branding package.
Parameters:  
  brandingpkg (string)
  The name of the branding package to use for the account.
Returns:  
 
This function does not produce any output.

Branding::tempsetbrandingpkg

API Version: 1 - Click here for documentation
Syntax: Branding::tempsetbrandingpkg( brandingpkg )
Description: Temporarily change an account's branding package.
Parameters:  
  brandingpkg (string)
  The name of the branding package to use temporarily.
Returns:  
 
This function does not produce any output.

Topic revision: r2 - 27 Mar 2012 - 17:34:19 - Main.JenniferDoubrava