From ef0223f75b6db3ecc2a0f284113fd2ecba8a7733 Mon Sep 17 00:00:00 2001 From: jengo Date: Tue, 19 Dec 2000 17:38:27 +0000 Subject: [PATCH] Fixed a few problems with changing the theme with frames and merged in patch for changetheme --- index.php | 55 +++++++++++++++++++++---------------- preferences/changetheme.php | 22 +++++++++++---- 2 files changed, 47 insertions(+), 30 deletions(-) diff --git a/index.php b/index.php index 94725f5cc3..09a8eea1ff 100755 --- a/index.php +++ b/index.php @@ -20,38 +20,45 @@ $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "home", "enable_network_class" => True, "enable_calendar_class" => True, "enable_todo_class" => True, "enable_addressbook_class" => True - ); + ); include("header.inc.php"); // Note: I need to add checks to make sure these apps are installed. if (($phpgw_info["user"]["preferences"]["common"]["useframes"] && $phpgw_info["server"]["useframes"] == "allowed") || ($phpgw_info["server"]["useframes"] == "always")) { - if (! $navbarframe && ! $framebody) { - $tpl = new Template($phpgw_info["server"]["template_dir"]); - $tpl->set_file(array("frames" => "frames.tpl", - "frame_body" => "frames_body.tpl", - "frame_navbar" => "frames_navbar.tpl" - )); + if ($cd == "yes") { - $tpl->set_var("navbar_link",$phpgw->link("index.php","navbarframe=True")); - $tpl->set_var("body_link",$phpgw->link("index.php","framebody=True")); - - if ($phpgw_info["user"]["preferences"]["common"]["frame_navbar_location"] == "bottom") { - $tpl->set_var("frame_size","*,60"); - $tpl->parse("frames_","frame_body",True); - $tpl->parse("frames_","frame_navbar",True); - } else { - $tpl->set_var("frame_size","60,*"); - $tpl->parse("frames_","frame_navbar",True); - $tpl->parse("frames_","frame_body",True); + if (! $navbarframe && ! $framebody) { + $tpl = new Template($phpgw_info["server"]["template_dir"]); + $tpl->set_file(array("frames" => "frames.tpl", + "frame_body" => "frames_body.tpl", + "frame_navbar" => "frames_navbar.tpl" + )); + + $tpl->set_var("navbar_link",$phpgw->link("index.php","navbarframe=True&cd=yes")); + if ($forward) { + $tpl->set_var("body_link",$phpgw->link($phpgw_info["server"]["webserver_url"] . $forward)); + } else { + $tpl->set_var("body_link",$phpgw->link("index.php","framebody=True&cd=yes")); + } + + if ($phpgw_info["user"]["preferences"]["common"]["frame_navbar_location"] == "bottom") { + $tpl->set_var("frame_size","*,60"); + $tpl->parse("frames_","frame_body",True); + $tpl->parse("frames_","frame_navbar",True); + } else { + $tpl->set_var("frame_size","60,*"); + $tpl->parse("frames_","frame_navbar",True); + $tpl->parse("frames_","frame_body",True); + } + $tpl->pparse("out","frames"); } - $tpl->pparse("out","frames"); - } - if ($navbarframe) { - $phpgw->common->phpgw_header(); - $phpgw->common->navbar(True); - } + if ($navbarframe) { + $phpgw->common->phpgw_header(); + $phpgw->common->navbar(True); + } + } } else { $phpgw->common->phpgw_header(); $phpgw->common->navbar(); diff --git a/preferences/changetheme.php b/preferences/changetheme.php index 17a2e408d6..4146ef1279 100755 --- a/preferences/changetheme.php +++ b/preferences/changetheme.php @@ -16,14 +16,19 @@ include("../header.inc.php"); - if ($ntheme) { - $phpgw->preferences->change("common","theme",$ntheme); + if ($theme) { + $phpgw->preferences->change("common","theme"); $phpgw->preferences->commit(); - Header("location: " . $phpgw->link("changetheme.php")); + if ($phpgw_info["server"]["useframes"] != "never") { + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/index.php","forward=/preferences/changetheme.php&cd=yes")); + Header("Window-Target: _top"); + } else { + Header("Location: " . $phpgw->link("changetheme.php")); + } exit; } - $dh = opendir($phpgw_info["server"]["server_root"] . "/themes"); + $dh = opendir($phpgw_info["server"]["api_dir"] . "/themes"); while ($file = readdir($dh)) { if (eregi("\.theme$", $file)) { $installed_themes[] = substr($file,0,strpos($file,".")); @@ -38,8 +43,13 @@ echo "
"; for ($i=0; $ilink("changetheme.php","ntheme=" - . $installed_themes[$i]) . "\">" . $installed_themes[$i] . "\n"; + echo '
' . $installed_themes[$i] . ''; + + if ($phpgw_info["server"]["useframes"] != "never") { +// echo '
' . $installed_themes[$i] . ''; + } } $phpgw->common->phpgw_footer();