mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-27 16:29:22 +01:00
testing out new hooks option
This commit is contained in:
parent
601993e029
commit
798ac55a33
@ -622,19 +622,32 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function hook($location = "") {
|
function hook($location = "", $order = ""){
|
||||||
global $phpgw, $phpgw_info;
|
global $phpgw, $phpgw_info;
|
||||||
|
|
||||||
|
if ($order == ""){$order[] = $phpgw_info["flags"]["currentapp"];}
|
||||||
|
// if ($order == ""){$order = Array();}
|
||||||
/* First include the apps own hook file */
|
/* First include the apps own hook file */
|
||||||
$appname = $phpgw_info["flags"]["currentapp"];
|
reset ($order);
|
||||||
|
while (list ($key, $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";
|
||||||
$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);}
|
||||||
|
|
||||||
/* 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"])){
|
||||||
if ($appname != "" || $appname != $phpgw_info["flags"]["currentapp"]){
|
if ($appname != "" ){
|
||||||
|
//eval($processed);
|
||||||
$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);}
|
||||||
|
Loading…
Reference in New Issue
Block a user