UAPI Functions - Styles::current

Description

This function returns the user's current style.

Examples 


 cPanel or Webmail Session URL

https://hostname.example.com:2083/cpsess##########/execute/Styles/current

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// Return current user's style.
$current $cpanel->uapi(
    'Styles''current'
);

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# Return current user's style.
my $current $cpliveapi->uapi(
    'Styles''current',
);

 cPanel Template Toolkit

<!-- Display all the attributes for the current style. -->
[% data = execute( 'Styles', 'current' ).data; %]
[% FOREACH q = data %]
    <p>
        <br>Preview: [% q.preview %]</br>
        <br>Name: [% q.name %]</br>
        <br>Default: [% q.default %]</br>
        <br>Type: [% q.type %]</br>
        <br>Selected: [% q.selected %]</br>
        <br>Display Name: [% q.display_name %]</br>
         
    </p>
[% END %]

 Command Line

uapi --user=username Styles current

 

Notes:

  • You must URI-encode values.
  • username represents your account-level username.

 Output (JSON)

   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{ 
 
   },
   "data":{ 
      "preview":1,
      "name":"basic",
      "default":1,
      "type":"default",
      "selected":1,
      "display_name":"Basic"
   }
}

 

Note:

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

 

Parameters

This function does not accept parameters.

Returns

Return

Type

Description

Possible values

 Example 

preview

 Boolean 

 Whether the style contains a preview image. 

  • 1 — Present.
  • 0 — Absent.

1

name

string

The folder that contains the style.

A valid filename.

basic

default

Boolean

Whether the style is the default style.

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

1

type

string

The style type.

  • default
  • global
  • reseller
  • user

default

selected

Boolean

Whether the style is the current style.

  • 1 — The current style.
  • 0 — Not the current style.

1

 display_name 

string

The style name.

A style name.

 The style's directory name determines this name. 

Basic

 

 

  • 6 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....