class pm_Pathbar

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

pm_Pathbar()

public

Constructor. Initializes member variables.

Destructor()

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.

del($url, $page)

public

Truncates the 'pathbar' array up to the specified page at drill-up.

reset($context)

public

Clears the 'pathbar' array and sets the specified context.

getLatestURL()

public

Returns the identifier of URL of the page displayed previously.

setPage($page)

public

Sets the name of the PHP script file for the page being displayed.

getStruct($page)

public

Returns the 'pathbar' array truncated right before the specified page.

getHistory($page)

public

Forms HTML code of the pathbar GUI element.

getButton($page)

public

Forms HTML code of the Up Level button.

getSelfPath($page)

public

Returns a 'pathbar' sub-array describing the specified page.

getSelfURL($page)

public

Returns URL of the specified page.

getUpLevelPath($page)

public

Returns a 'pathbar' sub-array describing the page located one level higher in the hierarchy than the specified page.

getUpLevelURL($page)

public

Returns URL of the page located one level higher in the hierarchy than the specified page.

getUpLevelPage($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.

In this section:

pm_Pathbar::pm_Pathbar Method

pm_Pathbar::Destructor Method

pm_Pathbar::set Method

pm_Pathbar::del Method

pm_Pathbar::reset Method

pm_Pathbar::getLatestURL Method

pm_Pathbar::setPage Method

pm_Pathbar::getStruct Method

pm_Pathbar::getHistory Method

pm_Pathbar::getButton Method

pm_Pathbar::getSelfPath Method

pm_Pathbar::getSelfURL Method

pm_Pathbar::getUpLevelPath Method

pm_Pathbar::getUpLevelURL Method

pm_Pathbar::getUpLevelPage Method