The pm_Pathbar class presents a GUI element of the same name. A pathbar is a GUI element displayed on top of Plesk pages and looking like a path string. For instance, the pathbar for any service on example.com can look as follows:
Domains > example.com >
The pathbar GUI element is designed to display the navigation history of the current page. The current page itself is not displayed in the pathbar. The names of previous pages serve as bookmarks, i.e. they can behave as links if one wants to proceed to the relevant page.
To describe the pathbar GUI element, the pm_Pathbar class has a special multi-dimensional array. Its first element stores the session context – a string that specifies the section of the navigation pane of Plesk Control panel from which the navigation is started (e.g. 'clients', 'domains', 'server', etc.). The first element of the array (the context) is always present.
Elements of the 'pathbar' array indexed 1 and higher specify previous pages (the current page is not stored in the 'pathbar' array). Each element of the 'pathbar' array is an array of parameters making up the description of the relevant page. The page names are displayed in the order they arrive in the array. The 'pathbar' array gets a new item to its tail at drill-down to some new page and gets truncated at drill-up to the previous page.
A page is specified in the 'pathbar' array as follows:
$pathbar = array(
[0] => '<session_context>',
[1] => array(
'url' => '<page_url>',
// the key associated with the page caption to be displayed:
'name' => '<localization_key>',
// 'action' parameter of the form:
'page' => '<PHP_script_file_name>',
'previous_page' => '<prev_page_url>',
'return_conhelp' => '<conhelp_localization_key>'
),
[2] => array(…),
[3] => array(…),
…
);
Thus, a page is described by five parameters: its URL, URL of the previous page, its title, its 'action' parameter, and its context help. A page is identified by two parameters - by its URL and by a PHP script file set in its ACTION parameter. The remaining parameters serve as an additional description.
Methods |
Access |
Description |
public |
Constructor. Initializes member variables. |
|
public |
Saves the current session parameters to the global scope. |
|
set($url, $name, $in_context, $return_conhelp, $page, $top_page) |
public |
Rewrites the 'pathbar' array at drill-down or drill-up in the hierarchy of pages. |
public |
Truncates the 'pathbar' array up to the specified page at drill-up. |
|
public |
Clears the 'pathbar' array and sets the specified context. |
|
public |
Returns the identifier of URL of the page displayed previously. |
|
public |
Sets the name of the PHP script file for the page being displayed. |
|
public |
Returns the 'pathbar' array truncated right before the specified page. |
|
public |
Forms HTML code of the pathbar GUI element. |
|
public |
Forms HTML code of the Up Level button. |
|
public |
Returns a 'pathbar' sub-array describing the specified page. |
|
public |
Returns URL of the specified page. |
|
public |
Returns a 'pathbar' sub-array describing the page located one level higher in the hierarchy than the specified page. |
|
public |
Returns URL of the page located one level higher in the hierarchy than the specified page. |
|
public |
Returns the name of the PHP script file associated with the page located one level higher in the hierarchy than the specified page. |
Include: pm.php.