diff --git a/modules.md b/modules.md index e2d4153..0c82335 100644 --- a/modules.md +++ b/modules.md @@ -7,21 +7,29 @@ The following directory structure should roughly visualize how modules are struc * Install * Navigation.install.json * Navigation.php - * Install.php + * Update + * yourUpdateFiles.??? + * Activate.php + * Deactivate.php + * Installer.php + * Uninstall.php + * Update.php + * Img + * modulePreviewImage.jpg * Models * YourPhPModels.php * YourJavaScriptModels.js * Theme - * Css - * yourCss_1.0.0.css - * yourScss_1.0.0.scss - * Img - * yourTemplateImages.jpg - * backend + * Backend + * Css + * yourCss_1.0.0.css + * yourScss_1.0.0.scss + * Img + * yourTemplateImages.jpg + * Lang + * en.lang.php + * navigation.en.lang.php * your_template_files.tpl.php - * lang - * backend.en.lang.php - * nav.backend.en.lang.php * Views * YourPhpViews.php * YourJavaScriptViews.js @@ -41,7 +49,7 @@ The content of the navigation install file highly depends on the module and shou Some modules can be used without requiring any additional installations it all depends on how the other modules got implemented. Thats also why many modules don't offer any integration at all and are almost stand-alone without the possibility to get extended. -### Install.php +### Installer.php In contrast to the install file for other moduels this file has to follow more strict standards. The following example shows you the bare minimum requirements of a installation file: @@ -89,14 +97,61 @@ public static function install(Pool $dbPool) } ``` -How the receiving module (e.g. Navigation) is accepting information depends on the module itself. The module documentation will also state how the content of the `install()` method has to look like. At the same time if you write a module and are accepting information from other modules during their installation you have to document very well how they have to provide these information. Very often however it will not be necessary to let other modules pass these information during installation and only do this during runtime. +How the receiving module (e.g. Navigation) is accepting information depends on the module itself. The module documentation will also state how the content of the `install(...)` method has to look like. At the same time if you write a module and are accepting information from other modules during their installation you have to document very well how they have to provide these information. Very often however it will not be necessary to let other modules pass these information during installation and only do this during runtime. The navigation module is a good example of passing navigation links during installation. The navigation module could request the link information during runtime this would mean that all modules would have to be initialized for every request since the navigation module doesn't know if these modules are providing links or not. By providing these information during the installation, the navigation module can store these information in a database table and query these information for every page request without initializing all modules or performing some file readings. ### Update.php -### Delete.php +### Uninstall.php ### Activate.php -### Deactivate.php \ No newline at end of file +### Deactivate.php + +## Img + +All module specific images (not theme specific images). E.g. Module preview images showing when searching for modules. + +## Models + +All models and data mapper classes should be stored in here (PHP & JS). How to create a data mapper for a model is described in the data mapper chapter. All JavaScript files need to be provided unoptimized (not minified or concatenated). + +## Theme + +The Theme directory contains the current theme for every page this module supports. If a module only supports the backend application there will only be a Backend directory containing the theme for the backend. + +### Css + +Every page has its own CSS directory. This application only allows the use of SASS/SCSS as preprocessor. All sass/scss files need to be provided as well as the processed CSS files. Make sure to include the version number in the CSS file name for overwriting the cache on updates. CSS files need to be minimized and if it makes sense concatenated. + +### Img + +This directory contains all images for this page. + +### Lang + +The Lang directory contains all language files for this application. Usually there is one language file for the page which will be loaded automatically wherever the module gets loaded (this language file has to exist). + +A language file should have the following naming convention: + + {ISO 639-1}.lang.php + +The content of the language file is straight forward: + +``` + 'Your localized string', +]; +``` + +All other language files are optional and usually are only required by other modules. The navigation module for example requires an extra language file for the navigation elements. This however should be specified in the modules you want to make use of. + +## Views + +## Controller.php + +## Controller.js + +## info.json \ No newline at end of file