Modules API Functions

This section of Plesk Modules API Reference contains syntax and semantic information for the Plesk Modules API functions.

FUNCTION

DESCRIPTION

pm_alert

Shows the specified error message in case an error occurs.

pm_comm_button

Returns the HTML formatted code used to represent a button HTML element on the HTML page.

pm_get_gpc

Returns the value of the specified variable from the array of parameters passed in to a script via GET, POST, or COOKIE HTML method.

pm_get_locale

Gets the currently set locale.

pm_go_to

Opens a certain URL in the specified window frame in the browser, plus allows to specify some actions to perform before URL is opened.

pm_go_to_uplevel

Loads the upper-level URL to the currently active window frame in the browser. Also, allows to specify some actions to perform before URL is opened.

pm_isset_gpc

Checks whether the specified variable is present in the array of parameters passed in to a script via GET, POST, or COOKIE HTML method.

pm_ldate

Returns the specified date in the format defined in the $def_date_format global variable.

pm_ldatetime

Returns the specified date in the format defined in the $def_datetime_format global variable.

pm_link_button

Returns the HTML formatted code used to represent a link button HTML element on the HTML page.

pm_lmsg

Translates the specified index into the message text taking into account the current locale settings.

pm_ltime

Returns the specified date in the format defined in the $def_time_format global variable.

pm_plesk_mail

Forms an email envelope for Plesk email user on basis of the standard set of information (to, subject, message, etc).

pm_psaerror

This function throws Plesk fatal exception.

pm_safetyhtml

Modifies the specified HTML string (replaces HTML escape sequences with codes, etc.)

pm_set_gpc

Sets the specified variable to the global array of parameters passed in to a script via GET, POST, or COOKIE HTML method.

pm_size_b_printing

Accepts a string with the number of bytes and returns the formatted value in bytes for printing.

pm_size_kb_printing

Accepts a string with the number of bytes and returns the formatted value in kilobytes for printing.

pm_size_mb_printing

Accepts a string with the number of bytes and returns the formatted value in megabytes for printing.

pm_size_pretty_printing

A universal function that converts the passed in number of bytes to the best format (bytes/ KB/MB/GB/TB) so that the resulting value has a non-zero integer part as small as possible.

pm_time_pretty_printing

Converts the number of seconds to a pretty format (e.g. exp: 2day(s) 12:45)

pm_topnote

The function adds a warning message with the specified text to the global array of messages of type MSG_WARNING according to its ID.

pm_util_exec

Safely runs the specified utility within Plesk exec wrapper.

pm_util_io_exec

Safely executes the specified utility, passing in the data to the utility's input and reading the utility's output.

pm_warning

Adds a warning message with the specified text and without ID to the global array of messages of type MSG_WARNING.

In addition to these API functions, there are two more GUI functions that serve the pathbar GUI control located on the form. The pm_pathbarMaker() function should be called to guarantee the creation of the only instance of the pm_Pathbar class on the form. The pm_pathbarDestructor() function is designed to guarantee the destruction of the pathbar with its parameters being saved to the global scope first.

FUNCTION

DESCRIPTION

pm_pathbarMaker

Creates the only instance of the pm_Pathbar class on the HTML form.

pm_pathbarDestructor

Saves parameters of the pathbar GUI control to the global scope before this control is destroyed.