correct border attribute for frameset
[squirrelmail.git] / src / webmail.php
CommitLineData
59177427 1<?php
c6d6fe73 2
864b1c33 3/**
15e6162e 4 * webmail.php -- Displays the main frameset
5 *
6 * Copyright (c) 1999-2002 The SquirrelMail development team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * This file generates the main frameset. The files that are
10 * shown can be given as parameters. If the user is not logged in
11 * this file will verify username and password.
12 *
13 * $Id$
14 */
21c3249f 15
86725763 16/* Path for SquirrelMail required files. */
17define('SM_PATH','../');
18
19/* SquirrelMail required files. */
20require_once(SM_PATH . 'functions/strings.php');
21require_once(SM_PATH . 'config/config.php');
22require_once(SM_PATH . 'functions/prefs.php');
23require_once(SM_PATH . 'functions/imap.php');
24require_once(SM_PATH . 'functions/plugin.php');
25require_once(SM_PATH . 'functions/i18n.php');
26require_once(SM_PATH . 'functions/auth.php');
a32985a5 27require_once(SM_PATH . 'functions/global.php');
245a6892 28
f3bc099d 29if (!function_exists('sqm_baseuri')){
86725763 30 require_once(SM_PATH . 'functions/display_messages.php');
f3bc099d 31}
32$base_uri = sqm_baseuri();
88fa922a 33
864b1c33 34session_start();
a32985a5 35
36if (isset($_SESSION['username'])) {
37 $username = $_SESSION['username'];
38}
39if (isset($_SESSION['delimiter'])) {
40 $delimiter = $_SESSION['delimiter'];
41}
42if (isset($_SESSION['onetimepad'])) {
43 $onetimepad = $_SESSION['onetimepad'];
44}
45if (isset($_GET['right_frame'])) {
46 $right_frame = $_GET['right_frame'];
47}
48
864b1c33 49is_logged_in();
1b187352 50
148ee1ef 51do_hook('webmail_top');
52
15e6162e 53/**
864b1c33 54 * We'll need this to later have a noframes version
55 *
56 * Check if the user has a language preference, but no cookie.
57 * Send him a cookie with his language preference, if there is
58 * such discrepancy.
59 */
871ab9eb 60$my_language = getPref($data_dir, $username, 'language');
864b1c33 61if ($my_language != $squirrelmail_language) {
62 setcookie('squirrelmail_language', $my_language, time()+2592000, $base_uri);
63}
cf47d363 64
864b1c33 65set_up_language(getPref($data_dir, $username, 'language'));
441f2d33 66
ac50138c 67echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">'.
68 "<html><head>\n" .
fab3baa6 69 "<title>$org_title</title>";
65c3ec94 70
871ab9eb 71$left_size = getPref($data_dir, $username, 'left_size');
72$location_of_bar = getPref($data_dir, $username, 'location_of_bar');
fab3baa6 73
0c660770 74if (isset($languages[$squirrelmail_language]['DIR']) &&
75 strtolower($languages[$squirrelmail_language]['DIR']) == 'rtl') {
fab3baa6 76 $temp_location_of_bar = 'right';
77} else {
78 $temp_location_of_bar = 'left';
79}
80
864b1c33 81if ($location_of_bar == '') {
fab3baa6 82 $location_of_bar = $temp_location_of_bar;
864b1c33 83}
fab3baa6 84$temp_location_of_bar = '';
85
864b1c33 86if ($left_size == "") {
87 if (isset($default_left_size)) {
f740c049 88 $left_size = $default_left_size;
864b1c33 89 }
90 else {
91 $left_size = 200;
92 }
65c3ec94 93}
94
864b1c33 95if ($location_of_bar == 'right') {
3aa19de0 96 echo "<frameset cols=\"*, $left_size\" frameborder=\"1\" id=\"fs1\">";
864b1c33 97}
98else {
3aa19de0 99 echo "<frameset cols=\"$left_size, *\" frameborder=\"1\" id=\"fs1\">";
864b1c33 100}
ad6787f0 101
864b1c33 102/*
103 * There are three ways to call webmail.php
104 * 1. webmail.php
105 * - This just loads the default entry screen.
106 * 2. webmail.php?right_frame=right_main.php&sort=X&startMessage=X&mailbox=XXXX
107 * - This loads the frames starting at the given values.
108 * 3. webmail.php?right_frame=folders.php
109 * - Loads the frames with the Folder options in the right frame.
110 *
111 * This was done to create a pure HTML way of refreshing the folder list since
112 * we would like to use as little Javascript as possible.
113 */
114if (!isset($right_frame)) {
793cc001 115 $right_frame = '';
78194072 116}
864b1c33 117if ($right_frame == 'right_main.php') {
118 $urlMailbox = urlencode($mailbox);
119 $right_frame_url =
3d570ba0 120 "right_main.php?mailbox=$urlMailbox&amp;sort=$sort&amp;startMessage=$startMessage";
65c3ec94 121} elseif ($right_frame == 'options.php') {
864b1c33 122 $right_frame_url = 'options.php';
65c3ec94 123} elseif ($right_frame == 'folders.php') {
864b1c33 124 $right_frame_url = 'folders.php';
78194072 125} else if ($right_frame == '') {
871ab9eb 126 $right_frame_url = 'right_main.php';
78194072 127} else {
128 $right_frame_url = urldecode($right_frame);
864b1c33 129}
9a732bb6 130
864b1c33 131if ($location_of_bar == 'right') {
ff767bed 132 echo "<FRAME SRC=\"$right_frame_url\" NAME=\"right\">" .
133 '<FRAME SRC="left_main.php" NAME="left">';
864b1c33 134}
135else {
ff767bed 136 echo '<FRAME SRC="left_main.php" NAME="left">'.
137 "<FRAME SRC=\"$right_frame_url\" NAME=\"right\">";
864b1c33 138}
753ce838 139do_hook('webmail_bottom');
ad6787f0 140?>
21c3249f 141</FRAMESET>
a507a781 142</HEAD></HTML>