Child pages
  • WHM API 1 Functions - list_styles

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Description

Excerpt

This function lists the server's cPanel styles.

Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone
Expand
titleJSON API
Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/json-api/list_styles?api.version=1
Expand
titleXML API
Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/list_styles?api.version=1
Expand
titleCommand Line
Code Block
languagebash
whmapi1 list_styles

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote

Expand
titleOutput (JSON)
Code Block
languagetext
linenumberstrue
{  
   "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
         }
      ]
   }
}
Expand
titleOutput (XML)
Code Block
languagetext
linenumberstrue
<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>

Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote

   

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