505e00aa |
1 | <?php |
2 | |
3 | /** |
4 | * page_header.tpl |
5 | * |
6 | * Template to create the header for each page. |
7 | * |
8 | * @copyright © 1999-2006 The SquirrelMail Project Team |
9 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
10 | * @version $Id: page_header.tpl 12135 2007-01-15 08:27:10Z pdontthink $ |
11 | * @package squirrelmail |
12 | * @subpackage templates |
13 | */ |
14 | |
15 | /* retrieve the template vars */ |
16 | extract($t); |
17 | |
18 | |
19 | $current_folder_str = ''; |
20 | if ( $shortBoxName <> '' && strtolower( $shortBoxName ) <> 'none' ) { |
21 | $current_folder_str .= _("Current Folder") . ": <em>$shortBoxName </em>\n"; |
22 | } else { |
23 | $current_folder_str .= ' '; |
24 | } |
25 | |
26 | // Define our default link text. |
27 | $signout_link_default = _("Sign Out"); |
28 | $compose_link_default = _("Compose"); |
29 | $address_link_default = _("Addresses"); |
30 | $folders_link_default = _("Folders"); |
31 | $options_link_default = _("Options"); |
32 | $search_link_default = _("Search"); |
33 | $help_link_default = _("Help"); |
34 | |
35 | /* |
36 | * Create strings to use for links. If tempalte authors |
37 | * wish to use images instead, they may change the values |
38 | * below to img tags. |
39 | |
40 | * Example w/ image: |
41 | * $compose_str = '<img src="compose.png" border="0" ' . |
42 | * 'alt="'.$compose_link_default.'" ' . |
43 | * 'title="'.$compose_link_default.'" />'; |
44 | */ |
45 | |
46 | $signout_str = $signout_link_default; |
47 | $compose_str = $compose_link_default; |
48 | $address_str = $address_link_default; |
49 | $folders_str = $folders_link_default; |
50 | $options_str = $options_link_default; |
51 | $search_str = $search_link_default; |
52 | $help_str = $help_link_default; |
53 | |
54 | $compose_link = makeComposeLink ('src/compose.php?mailbox='.$urlMailbox.'&startMessage='.$startMessage, $compose_str); |
55 | $signout_link = makeInternalLink ('src/signout.php', $signout_str, $frame_top); |
56 | $address_link = makeInternalLink ('src/addressbook.php', $address_str); |
57 | $folders_link = makeInternalLink ('src/folders.php', $folders_str); |
58 | $search_link = makeInternalLink ('src/search.php?mailbox='.$urlMailbox, $search_str); |
59 | $options_link = makeInternalLink ('src/options.php', $options_str); |
60 | $help_link = makeInternalLink ('src/help.php', $help_str); |
61 | |
62 | ?> |
63 | <body <?php echo $body_tag_js; ?>> |
64 | <?php |
65 | |
cc107917 |
66 | /** if preview pane turned on, do not show menubar above message */ |
101068d9 |
67 | global $data_dir, $username, $pp_skip_menubar; |
505e00aa |
68 | $use_previewPane = getPref($data_dir, $username, 'use_previewPane', 0); |
69 | $show_preview_pane = checkForJavascript() && $use_previewPane; |
101068d9 |
70 | $current_page_is_read_body = (defined('PAGE_NAME') && 'PAGE_NAME' == 'read_body'); |
d8a014ec |
71 | if (!$pp_skip_menubar && (!$current_page_is_read_body || !$show_preview_pane)) { |
cc107917 |
72 | // Note: If we want to hide menubar on compose screen, we could do the following, |
73 | // but the compose screen when in the message list frame should not have the menubar |
74 | // hidden... which would require some javascript to detect the current frame name |
75 | // and then use document.write() to output the menubar if needed... and we'll |
76 | // leave that for some other time |
77 | //- if (!$pp_skip_menubar && (!$current_page_is_read_body || !$show_preview_pane)) { |
101068d9 |
78 | //+ $current_page_is_compose = (defined('PAGE_NAME') && 'PAGE_NAME' == 'compose'); |
cc107917 |
79 | //+ if (!$pp_skip_menubar |
80 | //+ && ((!$current_page_is_read_body && !$current_page_is_compose) |
81 | //+ || !$show_preview_pane)) { |
505e00aa |
82 | |
83 | ?> |
84 | <div id="page_header"> |
85 | <a name="pagetop"></a> |
8fc627a7 |
86 | <?php if (!empty($plugin_output['page_header_top'])) echo $plugin_output['page_header_top']; ?> |
505e00aa |
87 | <!-- Begin Header Navigation Table --> |
88 | <table class="table_empty" cellspacing="0"> |
89 | <tr> |
90 | <td class="sqm_currentFolder"> |
91 | <?php echo $current_folder_str; ?> |
92 | </td> |
93 | <td class="sqm_headerSignout"> |
94 | <?php echo $signout_link; ?> |
95 | </td> |
96 | </tr> |
97 | <tr> |
b695734d |
98 | <td class="sqm_topNavigation"> |
505e00aa |
99 | <?php echo $compose_link; ?> |
100 | <?php echo $address_link; ?> |
101 | <?php echo $folders_link; ?> |
102 | <?php echo $options_link; ?> |
103 | <?php echo $search_link; ?> |
104 | <?php echo $help_link; ?> |
09b143cc |
105 | <?php if (!empty($plugin_output['menuline'])) echo $plugin_output['menuline']; ?> |
505e00aa |
106 | </td> |
b695734d |
107 | <td class="sqm_providerInfo"> |
108 | <?php |
109 | if (!empty($plugin_output['provider_link_before'])) |
110 | echo $plugin_output['provider_link_before']; |
111 | if (!empty($provider_link)) |
112 | echo $provider_link; |
8dd3c5c7 |
113 | if (!empty($plugin_output['provider_link_after'])) |
114 | echo $plugin_output['provider_link_after']; |
b695734d |
115 | ?> |
116 | </td> |
505e00aa |
117 | </tr> |
118 | </table> |
119 | </div> |
120 | <br /> |
121 | <!-- End Header Navigation Table --> |
a3c4ab30 |
122 | <?php |
123 | } |
124 | |
125 | // now, some generic javascript for use with preview pane |
126 | |
127 | ?> |
010ff205 |
128 | <script type="text/javascript" language="JavaScript"> |
505e00aa |
129 | <!-- |
130 | var delayed_page_load_uri = ''; |
131 | function delayed_page_load(page_uri) |
d63ec135 |
132 | { delayed_page_load_uri = page_uri; setTimeout('page_load()', 500); } |
505e00aa |
133 | function page_load() |
d63ec135 |
134 | { document.location = delayed_page_load_uri; } |
a3c4ab30 |
135 | function refresh_message_list() |
136 | { |
5e662037 |
137 | <?php if (!empty($message_list_href)) { ?> |
a3c4ab30 |
138 | if (typeof(parent.right.delayed_page_load) != 'undefined') |
139 | parent.right.delayed_page_load("<?php echo $message_list_href; ?>"); |
5e662037 |
140 | <?php } ?> |
a3c4ab30 |
141 | } |
93081a3e |
142 | <?php |
143 | |
144 | // autohide the preview pane if desired when not viewing messages, |
145 | // also maximize any frame with a compose screen in it |
146 | if ($show_preview_pane |
147 | && getPref($data_dir, $username, 'previewPane_autohide', 0) == 1) |
148 | { |
93081a3e |
149 | $previewPane_vertical_split = getPref($data_dir, $username, 'previewPane_vertical_split', 0); |
150 | if ($previewPane_vertical_split) |
151 | $orientation = 'cols'; |
152 | else |
153 | $orientation = 'rows'; |
154 | |
155 | // spit out javascript to maximize compose frame |
101068d9 |
156 | if (defined('PAGE_NAME') && PAGE_NAME=='compose') |
93081a3e |
157 | { |
158 | ?> |
159 | var first_frame = 0; |
160 | var second_frame = 0; |
161 | if (self.name == 'right') |
162 | { |
163 | first_frame = '100%'; |
164 | second_frame = '*'; |
165 | } |
166 | else if (self.name == 'bottom') |
167 | { |
168 | first_frame = '*'; |
169 | second_frame = '100%'; |
170 | } |
171 | if (first_frame != 0) |
172 | { |
c6526d45 |
173 | if (document.all) |
174 | { |
175 | parent.document.all["fs2"].<?php echo $orientation; ?> = first_frame + ", " + second_frame; |
176 | } |
177 | else if (this.document.getElementById) |
178 | { |
179 | parent.document.getElementById("fs2").<?php echo $orientation; ?> = first_frame + ", " + second_frame; |
180 | } |
93081a3e |
181 | } |
182 | <?php |
183 | |
101068d9 |
184 | // not on the compose screen, either hide or restore preview pane |
185 | } else { |
93081a3e |
186 | |
101068d9 |
187 | $previewPane_size = getPref($data_dir, $username, 'previewPane_size', 300); |
188 | if (defined('PAGE_NAME') && (PAGE_NAME=='right_main'||PAGE_NAME=='search')) { |
93081a3e |
189 | $new_size = $previewPane_size; |
101068d9 |
190 | } else { |
93081a3e |
191 | $new_size = 0; |
101068d9 |
192 | } |
93081a3e |
193 | ?> |
194 | if (self.name == 'right') |
195 | { |
c6526d45 |
196 | if (document.all) |
197 | { |
198 | parent.document.all["fs2"].<?php echo $orientation; ?> = "*, " + <?php echo $new_size; ?>; |
199 | } |
200 | else if (this.document.getElementById) |
201 | { |
202 | parent.document.getElementById("fs2").<?php echo $orientation; ?> = "*, " + <?php echo $new_size; ?>; |
203 | } |
93081a3e |
204 | } |
205 | |
206 | // restores the preview pane if it sucked up the whole page for composing a message |
207 | else if (self.name == 'bottom') |
208 | { |
c6526d45 |
209 | if (document.all) |
210 | { |
211 | if (parent.document.all["fs2"].<?php echo $orientation; ?> == "*, 100%") |
212 | parent.document.all["fs2"].<?php echo $orientation; ?> = "*, " + <?php echo $previewPane_size; ?>; |
213 | } |
214 | else if (this.document.getElementById) |
215 | { |
216 | if (parent.document.getElementById("fs2").<?php echo $orientation; ?> == "*, 100%") |
217 | parent.document.getElementById("fs2").<?php echo $orientation; ?> = "*, " + <?php echo $previewPane_size; ?>; |
218 | } |
93081a3e |
219 | } |
220 | <?php } } ?> |
505e00aa |
221 | // --> |
222 | </script> |