86030f14 |
1 | <?php |
2 | |
3 | /** |
4 | * webmail.tpl |
5 | * |
6 | * Template for rendering the main squirrelmail window |
7 | * |
8 | * @copyright © 1999-2006 The SquirrelMail Project Team |
9 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
10 | * @version $Id$ |
11 | * @package squirrelmail |
12 | * @subpackage templates |
13 | */ |
14 | |
15 | /** add required includes */ |
16 | |
17 | |
18 | /** extract variables */ |
19 | extract($t); |
20 | $output = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\"\n". |
21 | " \"http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd\">\n". |
22 | "<html><head>\n" . |
23 | "<meta name=\"robots\" content=\"noindex,nofollow\">\n" . |
24 | "<title>$org_title</title>\n". |
25 | "</head>"; |
26 | |
27 | $left_size = getPref($data_dir, $username, 'left_size'); |
28 | $location_of_bar = getPref($data_dir, $username, 'location_of_bar'); |
29 | |
30 | if (isset($languages[$squirrelmail_language]['DIR']) && |
31 | strtolower($languages[$squirrelmail_language]['DIR']) == 'rtl') { |
32 | $temp_location_of_bar = 'right'; |
33 | } else { |
34 | $temp_location_of_bar = 'left'; |
35 | } |
36 | |
37 | if ($location_of_bar == '') { |
38 | $location_of_bar = $temp_location_of_bar; |
39 | } |
40 | $temp_location_of_bar = ''; |
41 | |
42 | if ($left_size == "") { |
43 | if (isset($default_left_size)) { |
44 | $left_size = $default_left_size; |
45 | } |
46 | else { |
47 | $left_size = 200; |
48 | } |
49 | } |
50 | |
51 | if ($location_of_bar == 'right') { |
52 | $output .= "<frameset cols=\"*, $left_size\" id=\"fs1\">\n"; |
53 | } |
54 | else { |
55 | $output .= "<frameset cols=\"$left_size, *\" id=\"fs1\">\n"; |
56 | } |
57 | |
58 | /* |
59 | * There are three ways to call webmail.php |
60 | * 1. webmail.php |
61 | * - This just loads the default entry screen. |
62 | * 2. webmail.php?right_frame=right_main.php&sort=X&startMessage=X&mailbox=XXXX |
63 | * - This loads the frames starting at the given values. |
64 | * 3. webmail.php?right_frame=folders.php |
65 | * - Loads the frames with the Folder options in the right frame. |
66 | * |
67 | * This was done to create a pure HTML way of refreshing the folder list since |
68 | * we would like to use as little Javascript as possible. |
69 | * |
70 | * The test for // should catch any attempt to include off-site webpages into |
71 | * our frameset. |
72 | */ |
73 | |
74 | if (empty($right_frame) || (strpos(urldecode($right_frame), '//') !== false)) { |
75 | $right_frame = ''; |
76 | } |
77 | |
78 | if ( strpos($right_frame,'?') ) { |
79 | $right_frame_file = substr($right_frame,0,strpos($right_frame,'?')); |
80 | } else { |
81 | $right_frame_file = $right_frame; |
82 | } |
83 | |
84 | switch($right_frame) { |
85 | case 'right_main.php': |
86 | $right_frame_url = "right_main.php?mailbox=".urlencode($mailbox) |
87 | . (!empty($sort)?"&sort=$sort":'') |
88 | . (!empty($startMessage)?"&startMessage=$startMessage":''); |
89 | break; |
90 | case 'options.php': |
91 | $right_frame_url = 'options.php'; |
92 | break; |
93 | case 'folders.php': |
94 | $right_frame_url = 'folders.php'; |
95 | break; |
96 | case 'compose.php': |
97 | $right_frame_url = 'compose.php?' . $mailto; |
98 | break; |
99 | case '': |
100 | $right_frame_url = 'right_main.php'; |
101 | break; |
102 | default: |
103 | $right_frame_url = urlencode($right_frame); |
104 | break; |
105 | } |
106 | |
107 | $left_frame = '<frame src="left_main.php" name="left" frameborder="1" title="'. |
108 | _("Folder List") ."\" />\n"; |
109 | $right_frame = '<frame src="'.$right_frame_url.'" name="right" frameborder="1" title="'. |
110 | _("Message List") ."\" />\n"; |
111 | |
112 | if ($location_of_bar == 'right') { |
113 | $output .= $right_frame . $left_frame; |
114 | } |
115 | else { |
116 | $output .= $left_frame . $right_frame; |
117 | } |
118 | $ret = concat_hook_function('webmail_bottom', $output); |
119 | if($ret != '') { |
120 | $output = $ret; |
121 | } |
122 | |
123 | echo $output . '</frameset>'; |
124 | /** |
125 | * $Log$ |
126 | * Revision 1.1 2006/07/09 21:55:33 vanmer |
127 | * - Initial revision of a template to render the main squirrelmail HTML (current a frameset) |
128 | * |
129 | **/ |
130 | ?> |