Fixed a few problems with changing the theme with frames and merged in patch for changetheme

This commit is contained in:
jengo 2000-12-19 17:38:27 +00:00
parent d3c59526f0
commit ef0223f75b
2 changed files with 47 additions and 30 deletions

View File

@ -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();

View File

@ -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 "<br>";
for ($i=0; $i<count($installed_themes); $i++) {
echo "<br><a href=\"" . $phpgw->link("changetheme.php","ntheme="
. $installed_themes[$i]) . "\">" . $installed_themes[$i] . "</a>\n";
echo '<br><a href="' . $phpgw->link("changetheme.php","theme="
. $installed_themes[$i]) . '">' . $installed_themes[$i] . '</a>';
if ($phpgw_info["server"]["useframes"] != "never") {
// echo '<br><a href="' . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/index.php","ntheme="
// . $installed_themes[$i] . "&forward=" . urlencode("preferences/index.php")) . '" target="_new">' . $installed_themes[$i] . '</a>';
}
}
$phpgw->common->phpgw_footer();