From 3a1c8acfbbbed580cc2c096bd4b8e23d982d532e Mon Sep 17 00:00:00 2001 From: jengo Date: Mon, 18 Dec 2000 21:33:02 +0000 Subject: [PATCH] Fixed navbar showing up twice when using frames and calling phpgw_header() manually --- admin/editaccount.php | 2 +- index.php | 2 +- phpgwapi/phpgw.inc.php | 2 +- phpgwapi/phpgw_common.inc.php | 10 +++++++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/admin/editaccount.php b/admin/editaccount.php index f44c400bc6..2a9f4171a7 100755 --- a/admin/editaccount.php +++ b/admin/editaccount.php @@ -72,7 +72,7 @@ $phpgw->common->phpgw_header(); $phpgw->common->navbar(); - + $userData = $phpgw->accounts->read_userData($account_id); $db_perms = $phpgw->accounts->read_apps($userData["account_lid"]); diff --git a/index.php b/index.php index 189c55aa25..94725f5cc3 100755 --- a/index.php +++ b/index.php @@ -50,7 +50,7 @@ } if ($navbarframe) { $phpgw->common->phpgw_header(); - $phpgw->common->navbar(); + $phpgw->common->navbar(True); } } else { $phpgw->common->phpgw_header(); diff --git a/phpgwapi/phpgw.inc.php b/phpgwapi/phpgw.inc.php index 8e1b728a6d..840b3620bf 100644 --- a/phpgwapi/phpgw.inc.php +++ b/phpgwapi/phpgw.inc.php @@ -383,7 +383,7 @@ \**************************************************************************/ if (($phpgw_info["user"]["preferences"]["common"]["useframes"] && $phpgw_info["server"]["useframes"] == "allowed") || ($phpgw_info["server"]["useframes"] == "always")) { - $phpgw_info["flags"]["navbar_target"] = "phpgw_body"; + $phpgw_info["flags"]["navbar_target"] = "phpgw_body"; } /**************************************************************************\ diff --git a/phpgwapi/phpgw_common.inc.php b/phpgwapi/phpgw_common.inc.php index 5007bd99c7..4d41de226c 100644 --- a/phpgwapi/phpgw_common.inc.php +++ b/phpgwapi/phpgw_common.inc.php @@ -294,9 +294,17 @@ } } - function navbar() + function navbar($force = False) { global $cd,$phpgw,$phpgw_info,$colspan,$PHP_SELF; + + if (($phpgw_info["user"]["preferences"]["common"]["useframes"] && $phpgw_info["server"]["useframes"] == "allowed") + || ($phpgw_info["server"]["useframes"] == "always")) { + if (! $force) { + return False; + } + } + $tpl = new Template($phpgw_info["server"]["template_dir"]); $tpl->set_file(array("navbar" => "navbar.tpl", "navbar_row" => "navbar_row.tpl",