| 30 | |
---|
| 31 | == Providing Additional Control Tab == |
---|
| 32 | This section describes how to extend left sidebar with additional control tabs. |
---|
| 33 | * As with additional pages, the new control tab should be created in the modules directory following the [wiki:adeiNewModule guidelines]. It should define ''module_title'' variable and ''moduleJS'', ''modulePage'' functions (the name of tab should be used instead of ''module'' prefix). |
---|
| 34 | * The ''modulePage'' should provide HTML markup and ''moduleJS'' attach JavaScript handlers to set ADEI variables and, hence, control ADEI engine. The global variable ''adei'' should be used to access ADEI functionality. |
---|
| 35 | * The ''SELECT'' class provides useful interface to generate cascading select controls. |
---|
| 36 | * Like with pages, the [wiki:adeiNewModule XML Module] can be used to fill control context. |
---|
| 37 | * In certain cases the care on resizing should be taken. The following function registering callbacks can be useful: ''adei.popup.RegisterOnCallback'', ''adei.popup.RegisterOffCallback'', ''adei.popup.RegisterReHeightCallback'', ''adei.popup.RegisterReWidthCallback'', ''control_modules''.RegisterCallback'', and some others. For examples, take a look on ''virtual.php'' and ''source.php'' in the modules folder. |
---|
| 38 | * Finally, the module should be enabled. Just add the control name into the $CONTROLS variable in the configuration. The '''false''' value in array will enforce starting of a new line of controls. |
---|
| 39 | |
---|
| 40 | Implementing context dependent control. It is possible to track if the control is currently on display or not using mentioned before functions: 'adei.popup.RegisterOnCallback'', ''adei.popup.RegisterOffCallback'', ''control_modules''.RegisterCallback''. Example is available in ''source.php''. The ''adei.config.GetModule()'' function will return currently opened page. The page change notification callback can be requested using ''adei.module.RegisterCallback'' function. |