Internal structure and code guidelines - aix27249/agiliarepo GitHub Wiki

TODO: describe internal API.

UI

Pages

Each page is configured by ui/pages/(page_name).php file. Page consists of a set of modules placed in areas.

Modules

Each module should begin from from modules/(module name)/module.php. UI module should contain class named Module_(name of module) and implement run() method. All Module_* classes should extend Module class.

There are two static fields in Module_* class, named $styles and $scripts. Both are arrays. $styles contains names of css files related to module, and scripts contains names of javascript files. If path is relative, it will be considered relative to module directory.

Function run() is called when module is requested to output something. Usually it's a page.

Module may require another module. To do so, call Page::loadModule('module name') at the beginning of module.php file. After that call, module code will be loaded, and it's css and javascript files will be added to stack. Note that run() method of requested module is not called, so no additional output will be performed.

TODO: continue description