added the ability to specify an order for the apps to show up in

This commit is contained in:
seek3r 2000-12-20 08:50:00 +00:00
parent af99c453fa
commit fc649d6644
2 changed files with 16 additions and 10 deletions

View File

@ -623,7 +623,6 @@
function hook($location = "", $order = ""){ function hook($location = "", $order = ""){
global $phpgw, $phpgw_info; global $phpgw, $phpgw_info;
if ($order == ""){$order[] = $phpgw_info["flags"]["currentapp"];} if ($order == ""){$order[] = $phpgw_info["flags"]["currentapp"];}
/* First include the ordered apps hook file */ /* First include the ordered apps hook file */
reset ($order); reset ($order);
@ -631,16 +630,13 @@
$f = $phpgw_info["server"]["server_root"] . "/" . $appname . "/inc/hook_".$phpgw_info["flags"]["currentapp"]; $f = $phpgw_info["server"]["server_root"] . "/" . $appname . "/inc/hook_".$phpgw_info["flags"]["currentapp"];
if ($location != ""){$f .= "_".$location.".inc.php";}else{$f .= ".inc.php"; } if ($location != ""){$f .= "_".$location.".inc.php";}else{$f .= ".inc.php"; }
if (file_exists($f)) {include($f);} if (file_exists($f)) {include($f);}
$processed .= '|| $appname != "'.$appname.'" '; $completed_hooks[$appname] = True;
} }
$processed = 'if ($appname != "" '.$processed.'){';
//echo "processed: ".$processed."<br>\n";
/* Then add the rest */ /* Then add the rest */
reset ($phpgw_info["user"]["app_perms"]); reset ($phpgw_info["user"]["app_perms"]);
while (list (, $appname) = each ($phpgw_info["user"]["app_perms"])){ while (list (, $appname) = each ($phpgw_info["user"]["app_perms"])){
//eval($processed); if ($appname != "" && $completed_hooks[$appname] != True){
if ($appname != "" ){
$f = $phpgw_info["server"]["server_root"] . "/" . $appname . "/inc/hook_".$phpgw_info["flags"]["currentapp"]; $f = $phpgw_info["server"]["server_root"] . "/" . $appname . "/inc/hook_".$phpgw_info["flags"]["currentapp"];
if ($location != ""){$f .= "_".$location.".inc.php";}else{$f .= ".inc.php"; } if ($location != ""){$f .= "_".$location.".inc.php";}else{$f .= ".inc.php"; }
if (file_exists($f)) {include($f);} if (file_exists($f)) {include($f);}
@ -648,6 +644,19 @@
} }
} }
function hook_count($location = ""){
global $phpgw, $phpgw_info;
reset ($phpgw_info["user"]["app_perms"]);
$count = 0;
while (list (, $appname) = each ($phpgw_info["user"]["app_perms"])){
$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)) {++$count;}
}
return $count;
}
function appsession($data = "##NOTHING##") { function appsession($data = "##NOTHING##") {
global $phpgw_info, $phpgw; global $phpgw_info, $phpgw;

View File

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