Monday 01 February 2010 11:53:35 am
I think that Ez Publish should be more flexible respect to the hook implementation, currently if you only want to add a new functionality to a existing module/view, you need to create a new module and then since here call to first. This is deficient in terms of manteinance and expandability, because you would have to change all the links using the module to point to the new one. Currently EzPublish implements hooks in the module level, but the view must include code for this through the eZModule::runHooks method, also Ez Publish should allow us to run hooks in any module/view. Some people have said me about the kernel class override, but what happen if the view don't use classes, for example the user/preferences. I suggest the following: Create another type of extension. Where you define the module/view, the method to execute, type of hook (pre or post) and the priority (the execution order). The definition file would be something like:
<?php
$eZModulesHooksArray[] =
array( 'view' => <module/view>,
'class' => '<Class Name>',
'method' => <Method Name>,
'script' => <Path to Class definition>,
'type' => <pre | post>,
'priority' => <position in stack execution> );
?> Ez Publish then should automatically register this hooks for the active extensions and execute them implicitly for all module views. A similiar implementation are the WordPress hooks: http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters I think other developers find the same problems and agree with me about a better implementation. Maybe a Ez Publish crew hear us and it will be implemented in a near future.
Web Developer & Modern Philosopher
Visit http://www.laprensa.hn, http://www.diez.hn, http://www.estilo.hn
|