Description

This function lists the server's cPanel styles.

Examples 


https://hostname.example.com:2087/cpsess##########/json-api/list_styles?api.version=1
https://hostname.example.com:2087/cpsess##########/xml-api/list_styles?api.version=1
whmapi1 list_styles

{  
   "metadata":{  
      "version":1,
      "command":"list_styles",
      "result":1,
      "reason":"OK"
   },
   "data":{  
      "list":[  
         {  
            "default":1,
            "preview":1,
            "type":"default",
            "name":"basic",
            "display_name":"Basic"
         },
         {  
            "display_name":"retro",
            "name":"retro",
            "type":"default",
            "preview":1
         }
      ]
   }
}
<result>
    <metadata>
        <version>1</version>
        <command>list_styles</command>
        <reason>OK</reason>
        <result>1</result>
    </metadata>
    <data>
        <list>
            <preview>1</preview>
            <default>1</default>
            <type>default</type>
            <name>basic</name>
            <display_name>Basic</display_name>
        </list>
        <list>
            <name>retro</name>
            <display_name>retro</display_name>
            <type>default</type>
            <preview>1</preview>
        </list>
    </data>
</result>

   

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
listarray of hashesAn array of hashes of cPanel styles on the server.Each hash contains the default, preview, type, name, and display_name returns. 

default

Boolean

Whether the style is the server's default style.

The function returns this value in the list hash.

  • 1 — Default style.
  • 0 — Not the default style.
1

preview

Boolean

Whether the style includes a preview image.

The function returns this value in the list hash.

  • 1 — Includes a preview image.
  • 0 — Does not include a preview image.
1

type

string

The style type.

The function returns this value in the list hash.

  • default
  • global
  • reseller
  • user
default

name

string

The style's name within the server's files.

The function returns this value in the list hash.

A valid string. The system uses the style's directory name (the compressed style's filename) as the style name.

basic

display_name

string

The style's name as it appears within cPanel & WHM interfaces.

The function returns this value in the list hash.

A valid string.

Basic