Plesk SDK API allows you to embed custom data into lists of Plesk
objects (such as domains, service plans, and so on).
Note: This API works only for Zend pages (pages whose URLs contain
/admin
or /smb
)
To embed in lists that already exist in the Plesk GUI implement the
pm_Hook_SimpleList
abstract class. It provides the following methods:
-
isEnabled($controller, $action,
$activeList)
- defines which list will be handled by the hook. -
getDataProvider($controller, $action, $activeList,
$data)
- extends or overrides the original data provider. A data provider
can be an array or an instance of Zend_Db_Select.Note: You cannot change the type of $data from array to
Zend_Db_Select and vice versa. This method is primarily used to
add and/or delete rows in the dataset. -
getData($controller, $action, $activeList,
$data)
- extends or overrides the original data set before it is send to the
client. This method is mainly used for small changes like filtering
and sorting data on the current page.We strongly recommend you to use a prefix (for example,
ext<YourExtensionId>) for naming new fields. -
getColumns($controller, $action,
$activeList)
- describes the columns that will be added to the list.Columns are defined similarly to the
pm_View_List_Simple::setColumns()
method.By default, the new column will be added at the end. To determine the
position of the new column you can set the insertBefore or
insertAfter parameters in the column definition. These parameters
can take the following values:- A positive integer - column number from the start.
- A negative integer - column number from end.
- A string - a dataIndex property of an existing column.
- <p class="…