From ae23b3fc29a804209a92e6a497ba695867b2669b Mon Sep 17 00:00:00 2001 From: seek3r Date: Thu, 21 Dec 2000 19:32:50 +0000 Subject: [PATCH] tweaked out the about window feature, and added a new hook function so that an admin can pick a single app they want to have hook into them. This is good for apps that are looping thru apps for various other reasons --- phpgwapi/inc/phpgw_common.inc.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/phpgw_common.inc.php b/phpgwapi/inc/phpgw_common.inc.php index e304502ab0..8784c47cfc 100644 --- a/phpgwapi/inc/phpgw_common.inc.php +++ b/phpgwapi/inc/phpgw_common.inc.php @@ -328,6 +328,8 @@ if ($appname == "logout") { $target = ' target="_top"'; } + }elseif ($appname == "about") { + $target = ' target="AboutWindow"'; } else { $target = ""; } @@ -350,15 +352,18 @@ $output_text = "link($urlbasename."/logout.php"); } elseif ($appname == "about") { $output_text = "link($urlbasename."/".$phpgw_info["flags"]["currentapp"]."/about.php"); +// This might be fixable so that the size of the popup window can be limited. I havent been able to get it to work at this point -Seek3r +// $output_text = ""; +// $output_text .= 'link($urlbasename."/$appname/".$view); // end change } else { @@ -483,7 +488,7 @@ $this->show_icon(&$tpl,$td_width,"preferences","Preferences"); if (file_exists($phpgw_info["server"]["app_root"]."/about.php")) { - $this->show_icon(&$tpl,$td_width,"about","About"); + $this->show_icon(&$tpl,$td_width,"about","About ".$phpgw_info["flags"]["currentapp"]); } $this->show_icon(&$tpl,$td_width,"logout","Logout"); @@ -681,7 +686,6 @@ if (file_exists($f)) {include($f);} $completed_hooks[$appname] = True; } - /* Then add the rest */ reset ($phpgw_info["user"]["app_perms"]); while (list (, $appname) = each ($phpgw_info["user"]["app_perms"])){ @@ -693,6 +697,15 @@ } } + function hook_single($location = "", $appname = ""){ + global $phpgw, $phpgw_info; + if ($appname == ""){$appname = $phpgw_info["flags"]["currentapp"];} + /* First include the ordered apps hook file */ + $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);} + } + function hook_count($location = ""){ global $phpgw, $phpgw_info; reset ($phpgw_info["user"]["app_perms"]);