demianturner / sgl-docs-tickets-migration-test

0 stars 0 forks source link

Filter to load modules init.php file and auto-add a SetupModule filter to the global filter chain #1691

Open demianturner opened 11 years ago

demianturner commented 11 years ago

Here is an idea to load the modules init.php file. SGL1 loaded the init.php file only, but did not auto-call any filter, so you have always to alter the global filter chain by yourself. (for block and navigation for example)

To retrieve installed modules, a config value 'site.installedModules' is neccessary. Just a comma seperated list of modules in the order to be set up. (Currently only 'default'.)

In the init.php file, a filter with name 'SGL2_Filter_SetupModule' + ModuleName is searched, and if found, is auto-added to the filter chain.

I am not sure, if you have planned any other mechanism for initializing installed modules. Perhaps you want to drop the init.php file? I really would welcome such a mechanism, so no custom filter chain is used for just setting up my modules.

demianturner commented 11 years ago

[biggs] Just another improvement: Split loading modules' init.php files and calling the setup filters. Loading the init.php files should be done quite early. The SetupModule + ModuleName filters should be could when output is ready (and you can add data to output, so for example, block module can add blocks array)

This split makes it possible to have custom filters still in the module's directory, but use them in the custom filter chain on demand. Does it make sense?

demianturner commented 11 years ago

[demian] Hi Phil

These are interesting ideas, thanks for your input. I won't have time to hack on sgl2 until just before christmas but will review this stuff again when I do.