Page tree
Skip to end of metadata
Go to start of metadata

Description

This function retrieves an application's information from a specific theme's dynamicui.conf file.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Branding/get_applications?&app_keys=addon_domains,ftp_accounts,anonymous_ftp

Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Get the dynamicui.conf settings for Addon Domains, FTP Accounts, and Anonymous FTP.
$app_info = $cpanel->uapi(
    'Branding', 'get_applications',
    array(
      'app_keys'  => 'addon_domains,ftp_accounts,anonymous_ftp'
    )
);

Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Get the dynamicui.conf settings for Addon Domains, FTP Accounts, and Anonymous FTP.
my $app_info = $cpliveapi->uapi(
    'Branding', 'get_applications',
	{
      'app_keys'  => 'addon_domains,ftp_accounts,anonymous_ftp'
	}
);

Note:

For more information, read our Guide to the LiveAPI System.

 cPanel Template Toolkit
<!-- Get a hash of all the data, then display the file value. -->
[% data = execute( 'Branding', 'get_information_for_application', { 'app_keys' => 'addon_domains,ftp_accounts,anonymous_ftp' } ); %]
[% FOREACH q = data.itemdesc %]
     <p>
         [% q %]
     </p>
[% END %]
 

<!-- Get only a hash of the data. -->
[% execute('Branding', 'get_applications', { 'app_keys' => 'addon_domains,ftp_accounts,anonymous_ftp' } ).data.file %]

Note:

For more information, read our Guide to Template Toolkit documentation. 

 Command Line
uapi --user=username Branding get_applications app_keys=addon_domains,ftp_accounts,anonymous_ftp

Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • We introduced this functionality in cPanel & WHM version 56.

 Output (JSON)
{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
    
  },
  "data": {
    "addon_domains": {
      "width": "48",
      "itemorder": "1",
      "file": "addon_domains",
      "itemdesc": "Addon Domains",
      "height": "48",
      "feature": "addondomains",
      "group": "domains",
      "subtype": "img",
      "imgtype": "icon",
      "searchtext": "Domains Addon domain",
      "url": "addon/index.html",
      "type": "image",
      "implements": "Domains_AddonDomains"
    },
    "ftp_accounts": {
      "width": "48",
      "itemorder": "6",
      "file": "ftp_accounts",
      "itemdesc": "FTP Accounts",
      "height": "48",
      "feature": "ftpaccts",
      "group": "files",
      "subtype": "img",
      "imgtype": "icon",
      "searchtext": "FTP Accounts ftp create",
      "url": "ftp/accounts.html",
      "touch": "ftp",
      "type": "image"
    },
   "anonymous_ftp": {
      "width": "48",
      "itemorder": "8",
      "file": "anonymous_ftp",
      "itemdesc": "Anonymous FTP",
      "height": "48",
      "if": "$hasanonftp",
      "feature": "ftpaccts",
      "group": "files",
      "subtype": "img",
      "imgtype": "icon",
      "searchtext": "Anonymous FTP anonymousftp",
      "url": "ftp/anonymous.html",
      "touch": "ftp",
      "type": "image"
    }
  }
}

Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
app_keysstring

The application's feature name.

If you do not specify this parameter, the output will include all of the applications that the dynamicui.conf file contains.

A comma-separated list of application feature names.

Note:

This value must match an application's feature value in the dynamicui.conf file. For more information, read our Guide to cPanel Interface Customization - Appkeys documentation.

addon_domains,ftp_accounts,anonymous_ftp

Returns

ReturnTypeDescriptionPossible valuesExample
addon_domains
              

 

hash

A hash that lists the details for a feature.

Note:

This parameter returns a feature's app_keys value.

This hash includes the width, itemorder, file, itemdesc, height, feature, group, subtype, imgtype, seachtext, url, type, implements, touch, and if returns.

 

width

integer

The application's icon's width.

The function returns this value in the addon_domains hash.

The application's icon's width, in pixels.

 

48

itemorder

integer

The application's order in the dynamicui.conf file.  

The function returns this value in the addon_domains hash.

A positive integer that represents the application's display order in cPanel's Home interface.

For example, the first item on the cPanel Home interface has an itemorder value of 1.

4

file

string

The application's icon's filename.

The function returns this value in the addon_domains hash.

An image's filename.

 

addon_domains

itemdesc

string

The application's display name.

The function returns this value in the addon_domains hash.

A string value.Addon Domain

height

integer

The application's icon's height.

The function returns this value in the addon_domains hash.

The application's icon's height, in pixels.

48

feature

string

A feature name.

The item will only display if the cPanel user has access to this feature.

The function returns this value in the addon_domains hash.

A feature name.addondomains

group

string

The item's group.

The function returns this value in the addon_domains hash.

A string value.advanced

subtype

string

The item's subtype.

The function returns this value in the addon_domains hash.

img is the only possible value.

img

imgtype

string

The item's image type.

The function returns this value in the addon_domains hash.

icon is the only possible value.icon

searchtext

string

One or more search terms.

The item will display when users enter these search terms in the Quick Find textbox.

The function returns this value in the addon_domains hash.

A space-separated list of search terms.Domains Addon domain

url

string

The location to which the application's icon links.

The function returns this value in the addon_domains hash.

A valid filepath or URL.

 

addon/index.html

type

string

The application's type.

The function returns this value in the addon_domains hash.

image is the only possible value.

image

implements

string

The app_key value that the system modified.

The function returns this value in the addon_domains hash.

An application.

Domains_AddonDomains

touch

string

Conditional arguments that determine whether to display the item, if the touch file exists.

The function returns this value in the addon_domains hash.

A valid string.

ftp

if

string

Conditional arguments that determine whether to display the item, if any exist.

For example, $isreseller indicates that the item only displays for reseller accounts.

For more information, read our Guide to cPanel Variables documentation.

The function returns this value in the addon_domains hash.

A valid string.

 

$is_reseller