Put sample .htaccess in all directories browser does not access directly
[squirrelmail.git] / templates / default_advanced / page_header.tpl
CommitLineData
505e00aa 1<?php
2
3/**
4 * page_header.tpl
5 *
6 * Template to create the header for each page.
7 *
8 * @copyright &copy; 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 */
16extract($t);
17
18
19$current_folder_str = '';
20if ( $shortBoxName <> '' && strtolower( $shortBoxName ) <> 'none' ) {
21 $current_folder_str .= _("Current Folder") . ": <em>$shortBoxName&nbsp;</em>\n";
22} else {
23 $current_folder_str .= '&nbsp;';
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
fbffe024 54$compose_link = makeComposeLink('src/compose.php?mailbox=' . $urlMailbox
55 . '&amp;startMessage=' . $startMessage,
56 $compose_str, '', $accesskey_menubar_compose);
57$signout_link = makeInternalLink('src/signout.php', $signout_str, $frame_top,
58 $accesskey_menubar_signout);
59$address_link = makeInternalLink('src/addressbook.php', $address_str, '',
60 $accesskey_menubar_addresses);
61$folders_link = makeInternalLink('src/folders.php', $folders_str, '',
62 $accesskey_menubar_folders);
63$search_link = makeInternalLink('src/search.php?mailbox='.$urlMailbox,
64 $search_str, '', $accesskey_menubar_search);
65$options_link = makeInternalLink('src/options.php', $options_str, '',
66 $accesskey_menubar_options);
67$help_link = makeInternalLink('src/help.php', $help_str, '',
68 $accesskey_menubar_help);
505e00aa 69
70?>
ca14ebb7 71<body <?php if (!empty($onload)) echo ' onload="' . $onload . '"'; ?>>
505e00aa 72<?php
73
cc107917 74 /** if preview pane turned on, do not show menubar above message */
101068d9 75 global $data_dir, $username, $pp_skip_menubar;
505e00aa 76 $use_previewPane = getPref($data_dir, $username, 'use_previewPane', 0);
77 $show_preview_pane = checkForJavascript() && $use_previewPane;
101068d9 78 $current_page_is_read_body = (defined('PAGE_NAME') && 'PAGE_NAME' == 'read_body');
d8a014ec 79 if (!$pp_skip_menubar && (!$current_page_is_read_body || !$show_preview_pane)) {
cc107917 80// Note: If we want to hide menubar on compose screen, we could do the following,
81// but the compose screen when in the message list frame should not have the menubar
82// hidden... which would require some javascript to detect the current frame name
83// and then use document.write() to output the menubar if needed... and we'll
84// leave that for some other time
85//- if (!$pp_skip_menubar && (!$current_page_is_read_body || !$show_preview_pane)) {
101068d9 86//+ $current_page_is_compose = (defined('PAGE_NAME') && 'PAGE_NAME' == 'compose');
cc107917 87//+ if (!$pp_skip_menubar
88//+ && ((!$current_page_is_read_body && !$current_page_is_compose)
89//+ || !$show_preview_pane)) {
505e00aa 90
91?>
92<div id="page_header">
93<a name="pagetop"></a>
8fc627a7 94<?php if (!empty($plugin_output['page_header_top'])) echo $plugin_output['page_header_top']; ?>
505e00aa 95<!-- Begin Header Navigation Table -->
96<table class="table_empty" cellspacing="0">
97 <tr>
98 <td class="sqm_currentFolder">
99 <?php echo $current_folder_str; ?>
100 </td>
101 <td class="sqm_headerSignout">
102 <?php echo $signout_link; ?>
103 </td>
104 </tr>
105 <tr>
b695734d 106 <td class="sqm_topNavigation">
505e00aa 107 <?php echo $compose_link; ?>&nbsp;&nbsp;
108 <?php echo $address_link; ?>&nbsp;&nbsp;
109 <?php echo $folders_link; ?>&nbsp;&nbsp;
110 <?php echo $options_link; ?>&nbsp;&nbsp;
111 <?php echo $search_link; ?>&nbsp;&nbsp;
112 <?php echo $help_link; ?>&nbsp;&nbsp;
09b143cc 113 <?php if (!empty($plugin_output['menuline'])) echo $plugin_output['menuline']; ?>
505e00aa 114 </td>
b695734d 115 <td class="sqm_providerInfo">
116 <?php
117 if (!empty($plugin_output['provider_link_before']))
118 echo $plugin_output['provider_link_before'];
119 if (!empty($provider_link))
120 echo $provider_link;
8dd3c5c7 121 if (!empty($plugin_output['provider_link_after']))
122 echo $plugin_output['provider_link_after'];
b695734d 123 ?>
124 </td>
505e00aa 125 </tr>
126</table>
127</div>
128<br />
129<!-- End Header Navigation Table -->
a3c4ab30 130<?php
131 }
132
133 // now, some generic javascript for use with preview pane
134
135?>
010ff205 136<script type="text/javascript" language="JavaScript">
505e00aa 137<!--
138 var delayed_page_load_uri = '';
139 function delayed_page_load(page_uri)
d63ec135 140 { delayed_page_load_uri = page_uri; setTimeout('page_load()', 500); }
505e00aa 141 function page_load()
d63ec135 142 { document.location = delayed_page_load_uri; }
a3c4ab30 143 function refresh_message_list()
144 {
5e662037 145<?php if (!empty($message_list_href)) { ?>
a3c4ab30 146 if (typeof(parent.right.delayed_page_load) != 'undefined')
147 parent.right.delayed_page_load("<?php echo $message_list_href; ?>");
5e662037 148<?php } ?>
a3c4ab30 149 }
93081a3e 150<?php
151
152 // autohide the preview pane if desired when not viewing messages,
153 // also maximize any frame with a compose screen in it
154 if ($show_preview_pane
155 && getPref($data_dir, $username, 'previewPane_autohide', 0) == 1)
156 {
93081a3e 157 $previewPane_vertical_split = getPref($data_dir, $username, 'previewPane_vertical_split', 0);
158 if ($previewPane_vertical_split)
159 $orientation = 'cols';
160 else
161 $orientation = 'rows';
162
163 // spit out javascript to maximize compose frame
101068d9 164 if (defined('PAGE_NAME') && PAGE_NAME=='compose')
93081a3e 165 {
166?>
167 var first_frame = 0;
168 var second_frame = 0;
169 if (self.name == 'right')
170 {
171 first_frame = '100%';
172 second_frame = '*';
173 }
174 else if (self.name == 'bottom')
175 {
176 first_frame = '*';
177 second_frame = '100%';
178 }
179 if (first_frame != 0)
180 {
c6526d45 181 if (document.all)
182 {
183 parent.document.all["fs2"].<?php echo $orientation; ?> = first_frame + ", " + second_frame;
184 }
185 else if (this.document.getElementById)
186 {
187 parent.document.getElementById("fs2").<?php echo $orientation; ?> = first_frame + ", " + second_frame;
188 }
93081a3e 189 }
190<?php
191
101068d9 192 // not on the compose screen, either hide or restore preview pane
193 } else {
93081a3e 194
101068d9 195 $previewPane_size = getPref($data_dir, $username, 'previewPane_size', 300);
196 if (defined('PAGE_NAME') && (PAGE_NAME=='right_main'||PAGE_NAME=='search')) {
93081a3e 197 $new_size = $previewPane_size;
101068d9 198 } else {
93081a3e 199 $new_size = 0;
101068d9 200 }
93081a3e 201?>
202 if (self.name == 'right')
203 {
c6526d45 204 if (document.all)
205 {
206 parent.document.all["fs2"].<?php echo $orientation; ?> = "*, " + <?php echo $new_size; ?>;
207 }
208 else if (this.document.getElementById)
209 {
210 parent.document.getElementById("fs2").<?php echo $orientation; ?> = "*, " + <?php echo $new_size; ?>;
211 }
93081a3e 212 }
213
214 // restores the preview pane if it sucked up the whole page for composing a message
215 else if (self.name == 'bottom')
216 {
c6526d45 217 if (document.all)
218 {
219 if (parent.document.all["fs2"].<?php echo $orientation; ?> == "*, 100%")
220 parent.document.all["fs2"].<?php echo $orientation; ?> = "*, " + <?php echo $previewPane_size; ?>;
221 }
222 else if (this.document.getElementById)
223 {
224 if (parent.document.getElementById("fs2").<?php echo $orientation; ?> == "*, 100%")
225 parent.document.getElementById("fs2").<?php echo $orientation; ?> = "*, " + <?php echo $previewPane_size; ?>;
226 }
93081a3e 227 }
228<?php } } ?>
505e00aa 229// -->
230</script>