author | Dan |
Sat, 10 Jan 2009 14:07:54 -0500 | |
changeset 48 | d793361a27ec |
parent 8 | 0acb8d9a3194 |
permissions | -rw-r--r-- |
8 | 1 |
<?php |
2 |
||
3 |
global $eb_hooks; |
|
4 |
$eb_hooks = array(); |
|
5 |
||
6 |
function eb_hook($hook_name, $code) |
|
7 |
{ |
|
8 |
global $eb_hooks; |
|
9 |
if ( !isset($eb_hooks[$hook_name]) ) |
|
10 |
$eb_hooks[$hook_name] = array(); |
|
11 |
||
12 |
$eb_hooks[$hook_name][] = $code; |
|
13 |
} |
|
14 |
||
15 |
function eb_fetch_hook($hook_name) |
|
16 |
{ |
|
17 |
global $eb_hooks; |
|
18 |
return ( isset($eb_hooks[$hook_name]) ) ? implode("\n", $eb_hooks[$hook_name]) : 'eb_void();'; |
|
19 |
} |
|
20 |
||
21 |
// null function for filling empty hooks |
|
22 |
function eb_void() |
|
23 |
{ |
|
24 |
} |
|
25 |