| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * page_header.tpl |
| 5 | * |
| 6 | * Template to create the header for each page. |
| 7 | * |
| 8 | * @copyright 1999-2020 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 | /* 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 |
| 55 | . '&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 . '&what=', |
| 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); |
| 69 | |
| 70 | ?> |
| 71 | <body <?php if (!empty($onload)) echo ' onload="' . $onload . '"'; ?>> |
| 72 | <?php |
| 73 | |
| 74 | /** if preview pane turned on, do not show menubar above message */ |
| 75 | global $data_dir, $username, $pp_skip_menubar; |
| 76 | $use_previewPane = getPref($data_dir, $username, 'use_previewPane', 0); |
| 77 | $show_preview_pane = checkForJavascript() && $use_previewPane; |
| 78 | $current_page_is_read_body = (defined('PAGE_NAME') && 'PAGE_NAME' == 'read_body'); |
| 79 | if (!$pp_skip_menubar && (!$current_page_is_read_body || !$show_preview_pane)) { |
| 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)) { |
| 86 | //+ $current_page_is_compose = (defined('PAGE_NAME') && 'PAGE_NAME' == 'compose'); |
| 87 | //+ if (!$pp_skip_menubar |
| 88 | //+ && ((!$current_page_is_read_body && !$current_page_is_compose) |
| 89 | //+ || !$show_preview_pane)) { |
| 90 | |
| 91 | ?> |
| 92 | <div id="page_header"> |
| 93 | <a name="pagetop"></a> |
| 94 | <?php if (!empty($plugin_output['page_header_top'])) echo $plugin_output['page_header_top']; ?> |
| 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> |
| 106 | <td class="sqm_topNavigation"> |
| 107 | <?php echo $compose_link; ?> |
| 108 | <?php echo $address_link; ?> |
| 109 | <?php echo $folders_link; ?> |
| 110 | <?php echo $options_link; ?> |
| 111 | <?php echo $search_link; ?> |
| 112 | <?php echo $help_link; ?> |
| 113 | <?php if (!empty($plugin_output['menuline'])) echo $plugin_output['menuline']; ?> |
| 114 | </td> |
| 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; |
| 121 | if (!empty($plugin_output['provider_link_after'])) |
| 122 | echo $plugin_output['provider_link_after']; |
| 123 | ?> |
| 124 | </td> |
| 125 | </tr> |
| 126 | </table> |
| 127 | </div> |
| 128 | <br /> |
| 129 | <!-- End Header Navigation Table --> |
| 130 | <?php |
| 131 | } |
| 132 | |
| 133 | // now, some generic javascript for use with preview pane |
| 134 | |
| 135 | ?> |
| 136 | <script type="text/javascript" language="JavaScript"> |
| 137 | <!-- |
| 138 | var delayed_page_load_uri = ''; |
| 139 | function delayed_page_load(page_uri) |
| 140 | { delayed_page_load_uri = page_uri; setTimeout('page_load()', 500); } |
| 141 | function page_load() |
| 142 | { document.location = delayed_page_load_uri; } |
| 143 | function refresh_message_list() |
| 144 | { |
| 145 | <?php if (!empty($message_list_href)) { ?> |
| 146 | if (typeof(parent.right.delayed_page_load) != 'undefined') |
| 147 | parent.right.delayed_page_load("<?php echo $message_list_href; ?>"); |
| 148 | <?php } ?> |
| 149 | } |
| 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 | { |
| 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 |
| 164 | if (defined('PAGE_NAME') && PAGE_NAME=='compose') |
| 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 | { |
| 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 | } |
| 189 | } |
| 190 | <?php |
| 191 | |
| 192 | // not on the compose screen, either hide or restore preview pane |
| 193 | } else { |
| 194 | |
| 195 | $previewPane_size = getPref($data_dir, $username, 'previewPane_size', 300); |
| 196 | if (defined('PAGE_NAME') && (PAGE_NAME=='right_main'||PAGE_NAME=='search')) { |
| 197 | $new_size = $previewPane_size; |
| 198 | } else { |
| 199 | $new_size = 0; |
| 200 | } |
| 201 | ?> |
| 202 | if (self.name == 'right') |
| 203 | { |
| 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 | } |
| 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 | { |
| 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 | } |
| 227 | } |
| 228 | <?php } } ?> |
| 229 | // --> |
| 230 | </script> |