ocs  2.3.6
About: OCS (Open Conference System) is a Web publishing tool that will create a complete Web presence for your scholarly conference.
  Fossies Dox: ocs-2.3.6.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

HookRegistry.inc.php
Go to the documentation of this file.
1 <?php
2 
15 // $Id$
16 
17 
18 class HookRegistry {
22  function &getHooks() {
23  $hooks =& Registry::get('hooks', true, array());
24  return $hooks;
25  }
26 
33  function setHooks($hookName, $hooks) {
34  $hooks =& HookRegistry::getHooks();
35  $hooks[$hookName] =& $hooks;
36  }
37 
42  function clear($hookName) {
43  $hooks =& HookRegistry::getHooks();
44  unset($hooks[$hookName]);
45  return $hooks;
46  }
47 
53  function register($hookName, $callback) {
54  $hooks =& HookRegistry::getHooks();
55  if (!isset($hooks[$hookName])) {
56  $hooks[$hookName] = array();
57  }
58  $hooks[$hookName][] =& $callback;
59  }
60 
72  function call($hookName, $args = null) {
73  $hooks =& HookRegistry::getHooks();
74  if (!isset($hooks[$hookName])) {
75  return false;
76  }
77 
78  foreach ($hooks[$hookName] as $hook) {
79  if ($result = call_user_func($hook, $hookName, $args)) {
80  break;
81  }
82  }
83 
84  return $result;
85  }
86 }
87 
88 ?>
HookRegistry
Class for linking core functionality with plugins.
Definition: HookRegistry.inc.php:18
HookRegistry\call
call($hookName, $args=null)
Definition: HookRegistry.inc.php:72
HookRegistry\getHooks
& getHooks()
Definition: HookRegistry.inc.php:22
HookRegistry\clear
clear($hookName)
Definition: HookRegistry.inc.php:42
php
config TEMPLATE inc php
Definition: config.inc.php:4
Registry\get
& get($key, $createIfEmpty=false, $createWithDefault=null)
Definition: Registry.inc.php:37
HookRegistry\setHooks
setHooks($hookName, $hooks)
Definition: HookRegistry.inc.php:33