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

This commit is contained in:
seek3r 2000-12-21 19:32:50 +00:00
parent b68557126a
commit ae23b3fc29

View File

@ -328,6 +328,8 @@
if ($appname == "logout") { if ($appname == "logout") {
$target = ' target="_top"'; $target = ' target="_top"';
} }
}elseif ($appname == "about") {
$target = ' target="AboutWindow"';
} else { } else {
$target = ""; $target = "";
} }
@ -350,15 +352,18 @@
$output_text = "<A href=\"" . $phpgw->link($urlbasename."/logout.php"); $output_text = "<A href=\"" . $phpgw->link($urlbasename."/logout.php");
} elseif ($appname == "about") { } elseif ($appname == "about") {
$output_text = "<A href=\"" . $phpgw->link($urlbasename."/".$phpgw_info["flags"]["currentapp"]."/about.php"); $output_text = "<A href=\"" . $phpgw->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 = "<SCRIPT> function launchabout() {window.open(\"".$phpgw->link($urlbasename."/".$phpgw_info["flags"]["currentapp"]."/about.php")."\", \"phpGroupWare About Window\", \"width=400,height=300,location=no,menubar=no,directories=no,toolbar=no,scrollbars=yes,resizable=yes,status=yes\");}</SCRIPT>";
// $output_text .= '<a href="javascript:launchabout()';
} elseif ($appname == "print") { } elseif ($appname == "print") {
$output_text = "<A href=\"javascript:window.print();\""; $output_text = "<A href=\"javascript:window.print();\"";
// Changed by Skeeter 03 Dec 00 2000 GMT // Changed by Skeeter 03 Dec 00 2000 GMT
// This is to allow for the calendar app to have a default page view. // This is to allow for the calendar app to have a default page view.
} elseif ($appname == "calendar") { } elseif ($appname == "calendar") {
if(isset($phpgw_info["user"]["preferences"]["common"]["defaultcalendar"])) if(isset($phpgw_info["user"]["preferences"]["common"]["defaultcalendar"]))
$view = $phpgw_info["user"]["preferences"]["common"]["defaultcalendar"]; $view = $phpgw_info["user"]["preferences"]["common"]["defaultcalendar"];
else else
$view = "index.php"; $view = "index.php";
$output_text = "<A href=\"" . $phpgw->link($urlbasename."/$appname/".$view); $output_text = "<A href=\"" . $phpgw->link($urlbasename."/$appname/".$view);
// end change // end change
} else { } else {
@ -483,7 +488,7 @@
$this->show_icon(&$tpl,$td_width,"preferences","Preferences"); $this->show_icon(&$tpl,$td_width,"preferences","Preferences");
if (file_exists($phpgw_info["server"]["app_root"]."/about.php")) { 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"); $this->show_icon(&$tpl,$td_width,"logout","Logout");
@ -681,7 +686,6 @@
if (file_exists($f)) {include($f);} if (file_exists($f)) {include($f);}
$completed_hooks[$appname] = True; $completed_hooks[$appname] = True;
} }
/* 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"])){
@ -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 = ""){ function hook_count($location = ""){
global $phpgw, $phpgw_info; global $phpgw, $phpgw_info;
reset ($phpgw_info["user"]["app_perms"]); reset ($phpgw_info["user"]["app_perms"]);