From 1873fa94f309b4acc2c16eea2b26387d540ae55f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 14 Jun 2016 17:13:54 +0200 Subject: Add documentation --- doc/main_page_warnings | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/main_page_warnings (limited to 'doc/main_page_warnings') diff --git a/doc/main_page_warnings b/doc/main_page_warnings new file mode 100644 index 00000000..e69a6125 --- /dev/null +++ b/doc/main_page_warnings @@ -0,0 +1,17 @@ +The warning messages that can appear on the main site (after logging in) +can be added by hooks now, too, so the page.inc.php of the "main" module +doesn't contain code specific to a dozen other modules. + +If you want to add a hook, create a file in your module: +./modules//hooks/main-warning.inc.php +The file contains flat code, no classes or functions. You should +do your checks, and then call Message::addError (or the likes). +You could also render your own template if you feel fancy. +Remember you're running in the context of the main module, so your +message ID should use the full syntax module.id, or add your +module's name to the Render::addTemplate call. + +If you also want to enable the "configuration incomplete" global +warning, set $needSetup to true. + +See modules "vmstore", "minilinux" or "sysconfig" for an example. -- cgit v1.2.3-55-g7522