Custom Buttons: custombutton Utility

The custombutton utility is used to create custom buttons and manage their properties (interface location, button names, URLs, context help messages, and other parameters) through CLI.

Custom buttons of the following types can be created and managed by using this utility:

Syntax

custombutton <command> [

<option_1> [<param>]

[<option_2> [<param>]]

…[<option_N> [<param>]]

]

Example 1

The following command line creates custom button CustomButton that opens URL example.com/webstore, places the custom button on domain administration pages, includes domain ID#, domain name, and client ID# in browser requests generated by clicking on the button, sets the context help message for the button as "Click to go to http://example.com/webstore", and makes the button available in control panels of all domain users.

# ./custombutton --create -text CustomButton -url http://example.com/webstore -url_comp dom_id,dom_name,cl_id -conhelp "Click to go http://example.com/webstore" -location domain -public true

Example 2

The following command line creates custom button named SiteApp linked to site application SiteApplication installed on domain example.com and accessible at URL http://example.com/SiteApplication, and sets the context help message for the button as "Click to open SiteApplication".

# ./custombutton --create -tex SiteApp -url http://example.com/SiteApplication -siteapp-link -siteapp-domain example.com -siteapp-name SiteApplication -conhelp "Click to open SiteApplication"

Commands

Command

Parameter

Description

Example

--create or -m

 

Creates new custom button.

Requires the use of the -text and -url options.

To create a new custom button CustomButton (pointing to URL http://example.com) and print its database ID number:

# ./custombutton --create -text CustomButton -url http://example.com -print-id

or

# ./custombutton -c -text CustomButton -url http://example.com -print-id

--info or -i

<id#>

Displays properties of a custom button with the specified ID number.

To display properties of a custom button with the database ID# 14:

# ./custombutton --info 14

or

# ./custombutton -i 14

--remove or -r

*<id#,id#,...>

Deletes one or more custom buttons with the specified ID numbers.

To delete custom buttons with ID# 14 and ID# 56:

# ./custombutton --remove 14,56

or

# ./custombutton -r 14,56

--help or -h

 

Displays help on the use of the utility

To view help on the use of the utility:

# ./custombutton --help

or

# ./custombutton -h

--man or -m

 

Displays detailed help on the use of the utility with examples

To view detailed help with examples on the use of the utility:

# ./custombutton --man

or

# ./custombutton -m

Options

Option

Parameter

Description

Example

-owner

admin|<user login name>|<domain name>

Assigns ownership of a custom button to a Plesk client. Is set to admin by default.

To set the client with login name ClientUser the owner of custom button CustomButton to be created:

# ./custombutton -c -text CustomButton -url http://example.com -owner ClientUser

-sort_key

<int>

Sets the Priority parameter. Is set to100 by default.

To set the priority of appearance of custom button CustomButton on a Plesk page to 3:

# ./custombutton -c -text CustomButton -url http://example.com -sort_key 3

-place

client | domain | admin | navigation

Sets the Location parameter. Is set to client (the Client's Desktop/Home page option) by default. Other possible options: Domain Owner's Desktop/Home page - domain, Navigation panel - navigation, Administrator's desktop - admin.

To select the Domain Owner's Desktop/Home page option for Location parameter for custom button CustomButton:

# ./custombutton -c -text CustomButton -url http://example.com -place domain

-text

<button label>

Specifies the text accompanying a custom button (the Button label parameter).

Required with the --create command

To set Button Label for the custom button to be created to CustomButton:

# ./custombutton -c -text CustomButton -url http://example.com

-url

<URL>

Specifies the URL that a custom button to be created will point to (the URL parameter).

Required for the --create command when creating custom buttons pointing to URLs.

To set the URL parameter to example.com for custom button CustomButton :

# ./custombutton -c -text CustomButton -url http://example.com

-url_comp

dom_id | dom_name | ftp_user | ftp_pass | cl_id | cname | pname | email

Specifies various parameters to be included with the custom button's URL in browser requests.

The following parameters can be included:

dom_id - Include domain ID

dom_name - Include domain name

ftp_user - Include FTP user name

ftp_pass - Include FTP user password

cl_id - Include client ID

cname - Include client's company name

pname - Include client's contact name

email - Include client's e-mail

To include domain ID, domain name, and client ID in the browser requests generated by using custom button CustomButton:

# ./custombutton -c -text CustomButton -url http://example.com -url_comp dom_id,dom_name,cl_id

-conhelp

<text>

Specifies text of a contextual help message associated with a custom button (the Context help tip contents parameter).

To set the context help tip for the custom button CustomButton to "Click to go to example.com/webstore":

# ./custombutton -c -text CustomButton -url http://example.com -conhelp "Click to go to example.com/webstore"

-file

<path>

Specifies path to the image file that will be used as the Background image for a custom button.

To set file ButtonImage.gif as the Background image for the custom button CustomButton:

# ./custombutton -c -text CustomButton -url http://example.com -file "C:\Program Files\SWsoft\Plesk\ Images\PleskInterface\ ButtonImage.gif"

-public

true | false

Specifies whether a custom button appears in control panels of users subordinate to the custom button's owner (the Visible to all sub-logins parameter).

Set to false by default.

To display custom button CustomButton that has the Location parameter set to Domain Owner's Desktop/Home page in control panels of all users on this domain:

# ./custombutton -c -text CustomButton -url http://example.com -place domain -public true

-internal

true | false

Specifies if the button's URL is opened in Plesk's own frame or in the new window (the Open URL in the Control Panel parameter).

Set to false by default.

To enable opening of the CustomButton custom button's URL http://example.com in Plesk's own frame:

# ./custombutton -c -text CustomButton -url http://example.com -place domain -internal true

-print-id

 

Prints the database ID number of a created custom button.

To create new custom button CustomButton with its URL set to example.com and print its database ID number:

# ./custombutton -c -text CustomButton -url http://example.com -print-id

-siteapp-link

 

Links a custom button with a site application installed on a domain.

Requires concomitant use of the -siteapp-domain option.

To create a custom button CustomButton linked to a site application (if there is only a single application installed on a domain) that is accessible at URL http://example.com/SiteApplication:

# ./custombutton -c -text CustomButton -url http://example.com/SiteApplication -siteapp-link -siteapp-domain example.com

If there are more than one application installed on a domain, you need to specify more options to identify the site application of interest.

-siteapp-domain

<domain>

Specifies a domain on which a site application to be linked to a custom button is installed.

Used in conjunction with the -siteapp-link option.

To create a custom button CustomButton linked to a site application SiteApplication installed on domain example.com and accessible at URL http://example.com/SiteApplication:

# ./custombutton -c -text CustomButton -url http://example.com/SiteApplication -siteapp-link -siteapp-domain example.com -siteapp-name SiteApplication

-siteapp-id

<int>

Specifies the database ID# of a site application to be linked to a custom button.

To create a custom button CustomButton linked to a site application with database ID# 12 installed on domain example.com and accessible at URL http://example.com/SiteApplication:

# ./custombutton -c -text CustomButton -url http://example.com/SiteApplication -siteapp-link -siteapp-domain example.com -siteapp-id 12

-siteapp-name

<name>

Specifies the name of a site application to be linked to a custom button.

To create a custom button CustomButton linked to a site application SiteApplication installed on domain example.com and accessible at URL http://example.com/SiteApplication:

# ./custombutton -c -text CustomButton -url http://example.com/SiteApplication -siteapp-link -siteapp-domain example.com -siteapp-name SiteApplication

-siteapp-version

<string>

Specifies the version of a site application to be linked to a custom button.

To create a custom button linked to a site application SiteApplication v.13.44.1 installed on domain example.com and accessible at URL http://example.com/SiteApplication:

# ./custombutton -c -text CustomButton -url http://example.com/SiteApplication -siteapp-link -siteapp-domain example.com -siteapp-name SiteApplication -siteapp-version 13.44.1

-siteapp-release

<string>

Specifies the release number of a site application to be linked to a custom button.

To create a custom button CustomButton linked to a site application SiteApplication with release number 1312.121 installed on domain example.com and accessible at URL http://example.com/SiteApplication:

# ./custombutton -c -text CustomButton -url http://example.com/SiteApplication -siteapp-link -siteapp-domain example.com -siteapp-name SiteApplication -siteapp-version 1312.121

-siteapp-prefix

<directory>

Specifies the path (the Destination directory parameter) to the directory where the application is installed. The Destination directory parameter specifies the site application installation directory relative to the httpdocs directory and is determined when installing site application.

To create a custom button CustomButton linked to a site application SiteApplication which is installed in directory /httpdocs/siteapplication/v123 on domain example.com and accessible at URL http://example.com/SiteApplication:

# ./custombutton -c -text CustomButton -url http://example.com/SiteApplication -siteapp-link -siteapp-domain example.com -siteapp-name SiteApplication -siteapp-prefix siteapplication/123

-siteapp-ssl

true | false

Set this option to true if a custom button is to be linked to a site application installed in the /httpsdocs directory, that is, accessible only through the HTTPS protocol.

To create a custom button CustomButton linked to a site application SiteApplication which is installed in the httpsdocs directory on domain example.com and accessible at URL https://example.com/SiteApplication:

# ./custombutton -c -text CustomButton -url https://example.com/SiteApplication -siteapp-link -siteapp-domain example.com -siteapp-name SiteApplication -siteapp-ssl true

-siteapp-subdomain

<name>

Specifies the name of a subdomain if a site application is installed on a subdomain.

To create a custom button CustomButton linked to a site application SiteApplication which is installed in on the appsubdomain subdomain of domain example.com and accessible at URL http://appsubdomain.example.com/SiteApplication:

# ./custombutton -c -text CustomButton -url http://appsubdomain.example.com/SiteApplication -sitepp-link -siteapp-domain example.com -siteapp-name SiteApplication -siteapp-subdomain appsubdomain