Changes between Version 1 and Version 2 of adeiNewModule
- Timestamp:
- 07/16/09 16:21:24 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
adeiNewModule
v1 v2 1 1 The modules are used to provide information of different types to the user. All enabled modules are displayed in the top menu bellow the ''Search'' input. The current version of ADEI by default implements: 2 2 * ''WiKi'' module provides user-defined information about the system and previews of charts 3 3 * ''Graph'' module is a main ADEI component providing data plots and easy navigation 10 10 * The function ''modulePage'' contains HTML code of the page 11 11 12 Since, the modules are normally dynamically updated during the ADEI execution. The real HTML context should not be set by ''modulesPage'' functions, but provided using services. The ''moduleJS'' function should initialize JavaScript class which will take care of context updating. 12 Since, the modules are normally dynamically updated during the ADEI execution. The real HTML context should not be set by ''modulesPage'' functions, but provided using services. The ''moduleJS'' function should initialize JavaScript object which will take care of context updating and return the name of this 13 object. 13 14 14 15 When the module is ready it should be enabled in the configuration file ''config.php'' (or in the appropriate ''setup'' if it should be used optionally). 17 18 The ADEI includes several JavaScript classes providing standard use-cases. They are described bellow. 18 19 19 === XML Module === 20 == XML Module == 21 This module uses an ''ADEI service'' generating XML content and XSLT stylesheet to update information on the page. The ''modulePage'' function should just define a single ''div'' element: 22 {{{<div id="module_div" class="xml_module">Loading...</div>}}} 23 The ''moduleJS'' function initializes new XMLMODULE object supplying the id of div created in ''modulePage'' function: 24 {{{ module_object = new XMLMODULE("module_div"); }}} 25 and returns the name of created object: 26 {{{ return "module_object"; }}} 27 28 Complete example (alarms module): 29 {{{ 30 $alarms_title = _("Alarms"); 31 function alarmsJS() { 32 echo 'alarms = new XMLMODULE("alarms_div");'; 33 echo 'alarms.SetModuleType(CONTROL_MODULE_TYPE);'; 34 return "alarms"; 35 } 36 function alarmsPage() { 37 echo '<div id="alarms_div" class="xml_module">Loading...</div>'; 38 } 39 }}}