by 2261422 » Thu Apr 29, 2010 10:23 am
I want to create my own plugin, but I don't understand the OJS's plugin structure, for example I don't know against which Hook must I register my plugin.
I have seen the register and callback functions but I need more informaton, can somebody help me?
Hooks are used by plugins as a notification tool and to override behaviors built into OJS and in the OJS technical reference manual there is an example to add an entry to the Journal Manager's list of functions, available by following the “Journal Manager” link from User Home.
and here is a code's part:
<?php
import('classes.plugins.GenericPlugin');
class ExamplePlugin extends GenericPlugin {
function register($category, $path) {
if (parent::register($category, $path)) {
HookRegistry::register(
'Templates::Manager::Index::ManagementPages',
array(&$this, 'callback')
);return true;
}
return false;
}[*]
is here where I don't know how to proceed, I wanna add a portion of code in the respective search tpl, when the “search” link is clicked, but I don't know against which hook I must register my new plugin. in the above example the HookRegistry class use the method register agains ('Templates::Manager::Index::ManagementPages'), to what correspond Templates and its "methods" (::Manager::Index::ManagementPages for the manager)?
I watched a hook list but I don't find the one that I need for the code to be added when the search link is clicked,how can I know for a "generic plugin" which hook must be called when?
thanks