testing out new hooks option

This commit is contained in:
seek3r 2000-12-20 08:09:02 +00:00
parent b5e78d4ce4
commit af99c453fa
2 changed files with 9 additions and 6 deletions

View File

@ -621,26 +621,26 @@
return $e_password;
}
function hook($location = "", $order = ""){
global $phpgw, $phpgw_info;
if ($order == ""){$order[] = $phpgw_info["flags"]["currentapp"];}
/* First include the apps own hook file */
/* First include the ordered apps hook file */
reset ($order);
while (list ($key, $appname) = each ($order)){
while (list (, $appname) = each ($order)){
$f = $phpgw_info["server"]["server_root"] . "/" . $appname . "/inc/hook_".$phpgw_info["flags"]["currentapp"];
if ($location != ""){$f .= "_".$location.".inc.php";}else{$f .= ".inc.php"; }
if (file_exists($f)) {include($f);}
$processed .= '|| $appname != "'.$appname.'" ';
}
$processed = 'if ($appname != "" '.$processed.'){';
echo "processed: ".$processed."<br>\n";
//echo "processed: ".$processed."<br>\n";
/* Then add the rest */
reset ($phpgw_info["user"]["app_perms"]);
while (list (, $appname) = each ($phpgw_info["user"]["app_perms"])){
if ($appname != "" ){
//eval($processed);
if ($appname != "" ){
$f = $phpgw_info["server"]["server_root"] . "/" . $appname . "/inc/hook_".$phpgw_info["flags"]["currentapp"];
if ($location != ""){$f .= "_".$location.".inc.php";}else{$f .= ".inc.php"; }
if (file_exists($f)) {include($f);}

View File

@ -37,7 +37,10 @@
echo "</TD></TR></TABLE>\n\n";
}
$phpgw->common->hook();
$order[] = "notes";
$order[] = "email";
$order[] = "preferences";
$phpgw->common->hook("",$order);
$phpgw->common->phpgw_footer();
?>