-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhooks.php
More file actions
35 lines (32 loc) · 825 Bytes
/
hooks.php
File metadata and controls
35 lines (32 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
$hooks=$db->getTableasArray("SELECT hook FROM hooks ORDER BY `order` asc");
$modules=$db->getTableasArray("SELECT hook, module FROM pages WHERE PAGE = '".$db->__($view)."' ORDER BY `order` asc");
/*
* Pushing all modules to be loaded for a hook into an array
* with its hook name as variable name.
* Example: header is a hook, so $header is an array of all the module
* names to be loaded
*
*/
print_r($hooks);
echo '<br><br>';
print_r($modules);
foreach($modules as $module){
if(!isset($$module['hook'])){
$$module['hook']= array();
array_push($$module['hook'],$module['module']);
}
else{
array_push($$module['hook'],$module['module']);
}
}
/*
* Loading all the hooks available in the hooks directory.
*
*/
foreach($hooks as $hook){
if($hook){
include('hooks/'.$hook['hook'].'.php');
}
}
?>