These are the files which contain user web interface implementation. This interface allows for administering a module operation (launch, stop a module, set parameters, etc.). The following file is obligatory to have:
<PRODUCT_ROOT_D>/admin/htdocs/modules/<module_name>/index.php - the main page of the module management interface. This file is called in when a user moves to the module management page (see here).
Besides this file, this directory may contain any required set of additional scripts, available trough DOCUMENT_ROOT (see example).
Also the <PRODUCT_ROOT_D>/admin/htdocs/modules/<module_name>/locales/<locale_name>/ and <PRODUCT_ROOT_D>/admin/htdocs/modules/<module_name>/images/ directories might contain localization help files for some locales (see more) and files with images for module management operations buttons (see example).
Note: Names of locales must correspond to the format used in Plesk on the basis of IETF RFC1766, ISO 639 and ISO 3166. The locale name should look as follows: <locale name> = <language code>-<country code>. For example, for USA English, it looks like en-US, for British English, it's en-GB, for German in Germany it's de-DE, for German in Austria, it's de-AT.
The <PRODUCT_ROOT_D>/admin/plib/modules/<module name>/ directory may contain any required number of additional scripts (linked inside of other managing scripts through the include directive) (see example).
Also, this directory may contain user interface localization files: locales/<locale_name>/conhelp_<locale_name>.php - context help localization and locales/<locale_name>/messages_<locale_name>.php - localization of inscriptions and user interface messages. For this system to function, the module interface files must support locale changes (see example).
At change of localization the following mechanism is used: it is defined locale_name the chosen localization, existence of a directory with the files containing this localization is checked and loading of contents of corresponding files in files with line messages of the user interface is made. This functionality should be realized in a file <PRODUCT_ROOT_D>/admin/plib/modules/<module name>/locale.php.
Example:
|
function load_module_locale() $locale = get_locale(); if (!is_dir(PRODUCT_ROOT_D
. '/admin/plib/modules/firewall/locales/$locale')) global $lmsg_arr; if ($locale != $defaultLocale) require_once("modules/firewall/locales/$defaultLocale/messages_$defaultLocale.php"); $lmsg_arr = array_merge($lmsg_main,
$lmsg_arr, $lmsg_custom); global $session; $reload = false; if (!isset($specific_conhelp["firewall__$defaultLocale"]))
{ if (!isset($specific_conhelp["firewall__$locale"]))
{ if ($reload) { |
<PRODUCT_ROOT_D> - the directory the Plesk system is installed in by default (for Plesk for Unix this is /usr/local/psa. You can always get this info from /etc/psa/psa.conf).