--- /dev/null
+Installing Preview Pane
+=======================
+
+This plugin should only be activated by a skin (template set)
+that is capable of displaying a message preview pane. One
+such skin (template set) is the "default advanced" one that
+comes with the SquirrelMail base package.
+
+No manual activation or installation steps are required.
+
+
--- /dev/null
+Preview Pane plugin for SquirrelMail
+====================================
+Ver 2.0, 2007/01/23
+
+Original author: Paul Lesniewski <paul@squirrelmail.org>
+
+
+Description
+===========
+
+This plugin allows the user to turn on an extra frame below
+the mailbox message list where the messages themselves are
+displayed, very similar to many other popular (typically
+non-web-based) email clients.
+
+Note that users must turn this functionality on by going to
+the Options-->Display Preferences menu.
+
+This plugin is part of the SquirrelMail core package and
+should never be replaced with a downloaded copy (that which
+is available on the SquirrelMail website under Plugins is
+only applicable to SquirrelMail 1.4.x).
+
+This plugin should be activated only by a skin (template set)
+that is capable of displaying a message preview pane. One
+such skin (template set) is the "default advanced" one that
+comes with the SquirrelMail base package.
+
+
+
+License
+=======
+
+This plugin is released under the GNU General Public
+License (see the file COPYING for details).
+
+
+
+Requirements
+============
+
+ * SquirrelMail version 1.5.2+
+
+
+
+Help Requests
+=============
+
+Help requests should be posted to the SquirrelMail Plugins
+mailing list.
+
+Info about the SquirrelMail Plugins mailing list can be found
+on the SquirrelMail web site. It is currently located at:
+
+http://lists.sourceforge.net/mailman/listinfo/squirrelmail-plugins
+squirrelmail-plugins@lists.sourceforge.net
+
+
+
+Change Log
+==========
+
+ v2.0 2007/01/23 Paul Lesniewski
+ * Integration into SquirrelMail core
+ * Strip out most interface functionality; migrate to "default
+ advanced" template set
+ * Only works with 1.5.2+
+
+ v1.3 2007/01/19 Paul Lesniewski <paul@squirrelmail.org>
+ * Introduce slight delay refreshing message list so read messages
+ actually refresh as having been read
+ * Added 1.4.9 patch; versions between 1.4.3 and 1.4.9 should be
+ patch-able with the 1.4.3 patch
+ * Added 1.4.9 patch for delete, move, next plugin
+ * Added 1.5.1 patch, then removed it ;-p 1.5.2 supports this
+ functionality natively.
+ * Patches run from plugin directory now
+ * Translations now kept in SquirrelMail locales packages, not in
+ this plugin; translators please send your translations to the
+ squirrelmail-i18n mailing list
+ * Added requisite informational functions in setup.php per plugin specs
+ * Use $PHP_SELF instead of REQUEST_URI, since apparently the latter is not
+ always 100% reliable.
+ * No longer support replacement source files; patches are more than enough
+ * Fully compatible with Windows plugin, version 1.7+
+
+ v1.2 2004/06/08 Paul Lesniewski <paul@squirrelmail.org>
+ * Added javascript fix so delete link will work when messages are
+ viewed "in new window" - please give feedback if this causes problems
+ * Fixed missing locale switch (Thanks to Alexandros Vellis <avel@noc.uoa.gr>)
+ * Added Greek locale (Thanks to Alexandros Vellis <avel@noc.uoa.gr>)
+ * Updated patch for compatibility with Archive Mail plugin version 1.2
+ * Fixed placement of Clear button (no, non Archive Mail users, that button
+ was never supposed to be so blatantly placed in the middle of your screen)
+ Please report placement problems if they persist.
+ * Updated patch for 1.5.1 (works only against 1.5.1cvs as of approximately
+ 06/08/04)
+ * Added patch for compatibility with the delete_move_next plugin under
+ SquirrelMail 1.4.x
+
+ v1.1 2004/07/03 Paul Lesniewski <paul@squirrelmail.org>
+ * Added option to split frames vertically instead of horizontally
+
+ v1.0 2004/20/02 Paul Lesniewski <paul@squirrelmail.org>
+ * Initial version
+
--- /dev/null
+<?php
+
+/**
+ * SquirrelMail Preview Pane Plugin
+ *
+ * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @author Paul Lesneiwski <paul@squirrelmail.org>
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package plugins
+ * @subpackage preview_pane
+ *
+ */
+
+
+include_once('../../include/init.php');
+
+global $org_title;
+displayHtmlHeader($org_title, '', FALSE, FALSE);
+
+$oTemplate->display('plugins/preview_pane/empty_frame.tpl');
+
+
--- /dev/null
+<?php
+
+/**
+ * SquirrelMail Preview Pane Plugin
+ *
+ * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @author Paul Lesneiwski <paul@squirrelmail.org>
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package plugins
+ * @subpackage preview_pane
+ *
+ */
+
+
+/**
+ * Build user options for display on "Display Preferences" page
+ *
+ */
+function preview_pane_show_options_do()
+{
+
+ if (!checkForJavascript()) return;
+
+ global $data_dir, $username;
+ $use_previewPane = getPref($data_dir, $username, 'use_previewPane', 0);
+ $previewPane_vertical_split = getPref($data_dir, $username, 'previewPane_vertical_split', 0);
+ $previewPane_size = getPref($data_dir, $username, 'previewPane_size', 300);
+ $pp_refresh_message_list = getPref($data_dir, $username, 'pp_refresh_message_list', 1);
+
+
+ global $optpage_data;
+ $optpage_data['vals'][1][] = array(
+ 'name' => 'use_previewPane',
+ 'caption' => _("Show Message Preview Pane"),
+ 'type' => SMOPT_TYPE_BOOLEAN,
+ 'initial_value' => $use_previewPane,
+ 'refresh' => SMOPT_REFRESH_ALL,
+ );
+ $optpage_data['vals'][1][] = array(
+ 'name' => 'previewPane_vertical_split',
+ 'caption' => _("Split Preview Pane Vertically"),
+ 'type' => SMOPT_TYPE_BOOLEAN,
+ 'initial_value' => $previewPane_vertical_split,
+ 'refresh' => SMOPT_REFRESH_ALL,
+ );
+ $optpage_data['vals'][1][] = array(
+ 'name' => 'previewPane_size',
+ 'caption' => _("Message Preview Pane Size"),
+ 'type' => SMOPT_TYPE_INTEGER,
+ 'initial_value' => $previewPane_size,
+ 'refresh' => SMOPT_REFRESH_ALL,
+ 'size' => SMOPT_SIZE_TINY,
+ );
+ $optpage_data['vals'][1][] = array(
+ 'name' => 'pp_refresh_message_list',
+ 'caption' => _("Always Refresh Message List<br />When Using Preview Pane"),
+ 'type' => SMOPT_TYPE_BOOLEAN,
+ 'initial_value' => $pp_refresh_message_list,
+ 'refresh' => SMOPT_REFRESH_ALL,
+ );
+
+}
+
+
+/**
+ * This function determines if the preview pane is in use
+ * (and JavaScript is available)
+ *
+ * @return boolean TRUE if the preview pane should be showing currently.
+ *
+ */
+function show_preview_pane()
+{
+ $use_previewPane = getPref($data_dir, $username, 'use_previewPane', 0);
+ return (checkForJavascript() && $use_previewPane);
+}
+
+
+/**
+ * Construct button that clears out any preview pane
+ * contents and inserts JavaScript function used by
+ * message subject link onclick handler. Also disallows
+ * the message list to be loaded into the bottom frame.
+ *
+ */
+function preview_pane_message_list_do()
+{
+
+ if (!checkForJavascript()) return;
+
+ global $plugins, $archive_mail_button_has_been_printed,
+ $username, $data_dir, $PHP_SELF, $base_uri;
+
+
+ $output = '';
+ $use_previewPane = getPref($data_dir, $username, 'use_previewPane', 0);
+
+
+ // add refresh function called from code built in function
+ // preview_pane_change_message_target_do()
+ //
+ if ($use_previewPane == 1
+ && getPref($data_dir, $username, 'pp_refresh_message_list', 1) == 1)
+ {
+// sqgetGlobalVar('REQUEST_URI', $request_uri, SQ_SERVER);
+ $request_uri = $PHP_SELF;
+ $output .= "<script type=\"text/javascript\">\n<!--\n function pp_refresh() { document.location = '$request_uri'; }\n// -->\n</script>\n";
+ }
+
+
+ if ($use_previewPane == 1)
+ {
+ $output .= '<input type="button" value="' . _("Clear Preview")
+ . '" onclick="parent.bottom.document.location=\'' . SM_PATH
+ . 'plugins/preview_pane/empty_frame.php\'" />'
+
+
+ // don't let message list load into preview pane at all
+ //
+ . "\n<script language='javascript' type='text/javascript'>\n"
+ . "<!--\n"
+ . "\n"
+ . " if (self.name == 'bottom')\n"
+ . " {\n"
+ . " document.location = '" . $base_uri . "plugins/preview_pane/empty_frame.php'\n"
+ . " }\n"
+ . "//-->\n"
+ . "</script>\n";
+ }
+
+ return array('mailbox_index_after' => $output);
+
+}
+
+
+/**
+ * Points message targets to open in the preview pane
+ * (and possibly refresh message list as well)
+ *
+ */
+function preview_pane_change_message_target_do()
+{
+
+ if (!checkForJavascript()) return;
+
+ global $data_dir, $username, $target, $onclick, $PHP_SELF;
+// sqgetGlobalVar('REQUEST_URI', $request_uri, SQ_SERVER);
+ $request_uri = $PHP_SELF;
+
+
+ if (getPref($data_dir, $username, 'use_previewPane', 0) == 1)
+ {
+ $pp_refresh_message_list = getPref($data_dir, $username, 'pp_refresh_message_list', 1);
+
+ $target = 'bottom';
+ if ($pp_refresh_message_list)
+// introduce a delay so read messages actually refresh after they are read
+// $onclick .= ' onclick="document.location=\'' . $request_uri . '\'; " ';
+ $onclick .= ' setTimeout(\'pp_refresh()\', 500); ';
+ }
+
+}
+
+
+
--- /dev/null
+<?php\r
+\r
+/**\r
+ * index.php\r
+ *\r
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team\r
+ * Licensed under the GNU GPL. For full terms see the file COPYING.\r
+ *\r
+ * This file simply takes any attempt to view source files and sends those\r
+ * people to the login screen. At this point no attempt is made to see if\r
+ * the person is logged or not.\r
+ *\r
+ * $Id: index.php,v 1.5 2002/12/31 12:49:33 kink Exp $\r
+ */\r
+\r
+header("Location:../index.php");\r
+\r
+/* pretty impressive huh? */\r
+\r
--- /dev/null
+<?php
+
+/**
+ * SquirrelMail Preview Pane Plugin
+ *
+ * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @author Paul Lesneiwski <paul@squirrelmail.org>
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package plugins
+ * @subpackage preview_pane
+ *
+ */
+
+
+/**
+ * Register this plugin with SquirrelMail
+ *
+ */
+function squirrelmail_plugin_init_preview_pane()
+{
+
+ global $squirrelmail_plugin_hooks;
+
+
+ $squirrelmail_plugin_hooks['subject_link']['preview_pane']
+ = 'preview_pane_change_message_target';
+ $squirrelmail_plugin_hooks['optpage_loadhook_display']['preview_pane']
+ = 'preview_pane_show_options';
+ $squirrelmail_plugin_hooks['template_construct_message_list.tpl']['preview_pane']
+ = 'preview_pane_message_list';
+
+}
+
+
+if (!defined('SM_PATH'))
+ define('SM_PATH', '../');
+
+
+/**
+ * Returns info about this plugin
+ *
+ */
+function preview_pane_info()
+{
+
+ return array(
+ 'english_name' => 'Preview Pane',
+ 'version' => '2.0',
+ 'required_sm_version' => '1.5.2',
+ 'requires_configuration' => 0,
+ 'requires_source_patch' => 0,
+ 'required_plugins' => array(
+ ),
+ 'summary' => 'Provides a third frame below the message list for viewing message bodies.',
+ 'details' => 'This plugin allows the user to turn on an extra frame below the mailbox message list where the messages themselves are displayed, very similar to many other popular (typically non-web-based) email clients.',
+ );
+
+}
+
+
+
+/**
+ * Returns version info about this plugin
+ *
+ */
+function preview_pane_version()
+{
+
+ $info = preview_pane_info();
+ return $info['version'];
+
+}
+
+
+
+/**
+ * Build user options for display on "Display Preferences" page
+ *
+ */
+function preview_pane_show_options()
+{
+
+ include_once(SM_PATH . 'plugins/preview_pane/functions.php');
+ preview_pane_show_options_do();
+
+}
+
+
+
+/**
+ * Construct button that clears out any preview pane
+ * contents and inserts JavaScript function used by
+ * message subject link onclick handler. Also disallows
+ * the message list to be loaded into the bottom frame.
+ *
+ */
+function preview_pane_message_list()
+{
+
+ include_once(SM_PATH . 'plugins/preview_pane/functions.php');
+ return preview_pane_message_list_do();
+
+}
+
+
+
+/**
+ * Points message targets to open in the preview pane
+ * (and possibly refresh message list as well)
+ *
+ */
+function preview_pane_change_message_target()
+{
+
+ include_once(SM_PATH . 'plugins/preview_pane/functions.php');
+ preview_pane_change_message_target_do();
+
+}
+
+
+
--- /dev/null
+<?php
+
+/**
+ * empty_frame.tpl
+ *
+ * Template for showing a blank frame.
+ *
+ * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @author Paul Lesneiwski <paul@squirrelmail.org>
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package plugins
+ * @subpackage preview_pane
+ *
+ */
+
+
+// retrieve the template vars
+//
+extract($t);
+
+
+?><body>
+</body>
+</html>
--- /dev/null
+Preview Pane
+2.0-1.5.2
* will be disabled, and only those in $add_plugins will be enabled.
*
*/
-$add_plugins = array();
+$add_plugins = array('preview_pane',);
$remove_plugins = array();
--- /dev/null
+<?php
+
+/**
+ * page_header.tpl
+ *
+ * Template to create the header for each page.
+ *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id: page_header.tpl 12135 2007-01-15 08:27:10Z pdontthink $
+ * @package squirrelmail
+ * @subpackage templates
+ */
+
+/* retrieve the template vars */
+extract($t);
+
+
+$current_folder_str = '';
+if ( $shortBoxName <> '' && strtolower( $shortBoxName ) <> 'none' ) {
+ $current_folder_str .= _("Current Folder") . ": <em>$shortBoxName </em>\n";
+} else {
+ $current_folder_str .= ' ';
+}
+
+// Define our default link text.
+$signout_link_default = _("Sign Out");
+$compose_link_default = _("Compose");
+$address_link_default = _("Addresses");
+$folders_link_default = _("Folders");
+$options_link_default = _("Options");
+$search_link_default = _("Search");
+$help_link_default = _("Help");
+
+/*
+ * Create strings to use for links. If tempalte authors
+ * wish to use images instead, they may change the values
+ * below to img tags.
+
+ * Example w/ image:
+ * $compose_str = '<img src="compose.png" border="0" ' .
+ * 'alt="'.$compose_link_default.'" ' .
+ * 'title="'.$compose_link_default.'" />';
+ */
+
+$signout_str = $signout_link_default;
+$compose_str = $compose_link_default;
+$address_str = $address_link_default;
+$folders_str = $folders_link_default;
+$options_str = $options_link_default;
+$search_str = $search_link_default;
+$help_str = $help_link_default;
+
+$compose_link = makeComposeLink ('src/compose.php?mailbox='.$urlMailbox.'&startMessage='.$startMessage, $compose_str);
+$signout_link = makeInternalLink ('src/signout.php', $signout_str, $frame_top);
+$address_link = makeInternalLink ('src/addressbook.php', $address_str);
+$folders_link = makeInternalLink ('src/folders.php', $folders_str);
+$search_link = makeInternalLink ('src/search.php?mailbox='.$urlMailbox, $search_str);
+$options_link = makeInternalLink ('src/options.php', $options_str);
+$help_link = makeInternalLink ('src/help.php', $help_str);
+
+?>
+<body <?php echo $body_tag_js; ?>>
+<?php
+
+ /** if preview pane turned on, do not show menubar above message view */
+ global $data_dir, $username, $PHP_SELF;
+ $use_previewPane = getPref($data_dir, $username, 'use_previewPane', 0);
+ $show_preview_pane = checkForJavascript() && $use_previewPane;
+ $current_page_is_read_body = (strpos($PHP_SELF, '/read_body.php') !== FALSE);
+ if (!$current_page_is_read_body || !$show_preview_pane) {
+
+?>
+<div id="page_header">
+<a name="pagetop"></a>
+<!-- Begin Header Navigation Table -->
+<table class="table_empty" cellspacing="0">
+ <tr>
+ <td class="sqm_currentFolder">
+ <?php echo $current_folder_str; ?>
+ </td>
+ <td class="sqm_headerSignout">
+ <?php echo $signout_link; ?>
+ </td>
+ </tr>
+ <tr>
+ <td class="sqm_topNavigation"<?php echo ($hide_sm_attributions ? ' colspan="2"' : ''); ?>>
+ <?php echo $compose_link; ?>
+ <?php echo $address_link; ?>
+ <?php echo $folders_link; ?>
+ <?php echo $options_link; ?>
+ <?php echo $search_link; ?>
+ <?php echo $help_link; ?>
+ <?php /* FIXME: no hooks in templates!! */ global $null; do_hook('menuline', $null); ?>
+ </td>
+ <?php if (!empty($sm_attribute_str))
+ echo '<td class="sqm_providerInfo">'
+ . $sm_attribute_str
+ . "</td>\n"; ?>
+ </tr>
+</table>
+</div>
+<br />
+<!-- End Header Navigation Table -->
+<script type="text/javascript">
+<!--
+ var delayed_page_load_uri = '';
+ function delayed_page_load(page_uri)
+ { page_load_uri = page_uri; setTimeout('page_load()', 500); }
+ function page_load()
+ { document.location = page_load_uri; }
+// -->
+</script>
+<?php }
--- /dev/null
+<?php
+/**
+ * read_menubar_buttons.tpl
+ *
+ * Tempalte for displaying the action buttons, e.g. Reply, Reply All, Forward,
+ * etc., while reading a message. When combined with the read_menubar_nav template,
+ * the entire menu bar is displayed.
+ *
+ * The following variables are available in this template:
+ * $nav_on_top - boolean TRUE if the navigation buttons are on top of the
+ * action buttons generated here.
+ * $prev_href - URL to move to the previous message. Empty if not avilable.
+ * $up_href - URL to move up in the message. Empty if not available.
+ * $next_href - URL to move to the next nessage. Empty when N/A.
+ * $del_prev_href - URL to delete this message and move to the next one. Empty if N/A.
+ * $del_next_href - URL to delete this message and move to the next one. Empty if N/A.
+ * $view_msg_href - URL to go back to the main message. Empty if N/A.
+ * $msg_list_href - URL to go to the message list.
+ * $search_href - URL to go back to the serach results. Empty if N/A.
+ * $form_extra - Extra elements required by the forms to delete, move or copy
+ * $compose_href - Base URL to forward, reply, etc. Note that a specific action
+ * must also be given by the form or in this URL.
+ * $on_click - Onclick event string for all buttons
+ * $forward_as_attachment_enabled - boolean TRUE if forwarding as attachments
+ * has been enabled.
+ * $can_resume_draft - boolean TRUE if the "resume draft" is legitimate for
+ * this message.
+ * $can_edit_as_new - boolean TRUE if the "reasume as new" action is legitimate
+ * for this message
+ * $mailboxes - array containing list of mailboxes available for move/copy action.
+ * $can_be_deleted - boolean TRUE if this message can be deleted.
+ * $can_be_moved - boolean TRUE if this message can be moved.
+ * $cab_be_copied - boolean TRUE if this message can be copied to another folder.
+ * $move_delete_form_action - the value for the ACTION attribute of forms to
+ * move, copy or delete a message
+ * $delete_form_extra - additional input elements needed by the DELETE form
+ * $move_form_extra - additional input elements needed by the MOVE form.
+ * $last_move_target - the last folder that a message was moved/copied to.
+ *
+ *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id: read_menubar_buttons.tpl 11850 2006-10-06 21:57:26Z stevetruckstuff $
+ * @package squirrelmail
+ * @subpackage templates
+ */
+
+/** add required includes **/
+
+/** extract template variables **/
+extract($t);
+
+
+/*FIXME: This is a place where Marc's idea for putting all the buttons and
+ links and other widgets into an array is sorely needed instead of
+ hard-coding everything. Whomever implements that, PLEASE, PLEASE
+ look at how the preview pane plugin code is used here to change
+ some links and buttons and make sure your implementation can support
+ it (tip: it may or may not be OK to let a plugin do the modification
+ of the widgets, since a template set can turn on the needed plugin,
+ but that might not be the most clear way to solve said issue).*/
+
+
+/** preview pane prep */
+global $data_dir, $username, $base_uri;
+$pp_refresh_message_list = getPref($data_dir, $username, 'pp_refresh_message_list', 1);
+$use_previewPane = getPref($data_dir, $username, 'use_previewPane', 0);
+$show_preview_pane = checkForJavascript() && $use_previewPane;
+$empty_frame_uri = $base_uri . 'plugins/preview_pane/empty_frame.php';
+if ($show_preview_pane) { ?>
+ <script>
+ <!--
+ function refresh_message_list()
+ { parent.right.delayed_page_load("<?php echo $message_list_href; ?>"); }
+ // -->
+ </script>
+<?php }
+
+
+/** Begin template **/
+if ($nav_on_top) {
+ $table_class = 'bottom';
+ $plugin_hook = 'read_body_menu_buttons_top';
+} else {
+ $table_class = 'top';
+ $plugin_hook = 'read_body_menu_buttons_bottom';
+}
+?>
+<div class="readMenuBar">
+<table class="<?php echo $table_class; ?>" cellspacing="0">
+ <tr class="buttons">
+ <td class="buttons">
+ <form name="composeForm" action="<?php echo $compose_href; ?>" <?php echo $form_extra; ?> >
+ <small>
+ <?php
+ if ($can_resume_draft) {
+ ?>
+ <input type="submit" name="smaction_draft" value="<?php echo _("Resume Draft"); ?>" <?php echo $button_onclick; ?> />
+ <?php
+ } elseif ($can_edit_as_new) {
+ ?>
+ <input type="submit" name="smaction_edit_new" value="<?php echo _("Edit Message as New"); ?>" <?php echo $button_onclick; ?> />
+ <?php
+ }
+ ?>
+ <input type="submit" name="smaction_reply" value="<?php echo _("Reply"); ?>" <?php echo $button_onclick; ?> />
+ <input type="submit" name="smaction_reply_all" value="<?php echo _("Reply All"); ?>" <?php echo $button_onclick; ?> />
+ |
+ <input type="submit" name="smaction_forward" value="<?php echo _("Forward"); ?>" <?php echo $button_onclick; ?> />
+ <?php
+ if ($forward_as_attachment_enabled) {
+ ?>
+ <input type="checkbox" name="smaction_attache" id="smaction_attache">
+ <label for="smaction_attache"><?php echo _("As Attachment"); ?></label>
+ <?php
+ }
+ ?>
+ </small>
+ </form>
+ |
+ <?php
+ if ($can_be_deleted) {
+ ?>
+ <form name="deleteMessageForm" action="<?php echo $move_delete_form_action; ?>" method="POST">
+ <?php echo $delete_form_extra; ?>
+ <small>
+ <input type="submit" name="delete" value="<?php
+
+echo _("Delete") .'"';
+
+/** if preview pane turned on with "always refresh message list",
+ refresh message list frame too, but only if we are in the bottom frame! */
+if ($show_preview_pane && $pp_refresh_message_list)
+ echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
+
+echo ' />'; ?>
+
+ <input type="checkbox" name="bypass_trash" id="bypass_trash"><label for="bypass_trash"><?php echo _("Bypass Trash"); ?></label>
+ </small>
+ </form>
+ <?php
+ }
+ ?>
+ <?php if(!empty($plugin_output[$plugin_hook])) echo $plugin_output[$plugin_hook]; ?>
+ </td>
+ <td class="move">
+ <?php
+ if ($can_be_moved) {
+ ?>
+ <form name="moveMessageForm" action="<?php echo $move_delete_form_action; ?>" method="POST">
+ <?php echo $move_form_extra; ?>
+ <small>
+ <?php echo _("Move To"); ?>:
+ <select name="targetMailbox">
+ <?php
+ foreach ($mailboxes as $value=>$option) {
+ echo '<option value="'. $value .'"' . ($value==$last_move_target ? ' selected="selected"' : '').'>' . $option .'</option>'."\n";
+ }
+ ?>
+ </select>
+ <input type="submit" name="moveButton" value="<?php
+
+echo _("Move") . '"';
+
+/** if preview pane turned on with "always refresh message list",
+ refresh message list frame too, but only if we are in the bottom frame! */
+if ($show_preview_pane && $pp_refresh_message_list)
+ echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
+
+echo ' />';
+
+
+ if ($can_be_copied) {
+ ?>
+ <input type="submit" name="copyButton" value="<?php echo _("Copy"); ?>" />
+ <?php
+ }
+ ?>
+ </small>
+ </form>
+ <?php
+ }
+ ?>
+ </td>
+ </tr>
+</table>
+</div>
--- /dev/null
+<?php
+/**
+ * read_menubar_nav.tpl
+ *
+ * Template to generate the nav buttons while reading a message, e.g. "Previous",
+ * "Next", "Delete & Previous", etc. When used in conjunction with the
+ * read_menubar_nav tempalte, the entire menubar is generated.
+ *
+ * The following variables are available in this template:
+ * $nav_on_top - boolean TRUE if the navigation buttons are on top of the
+ * action buttons generated here.
+ * $prev_href - URL to move to the previous message. Empty if not avilable.
+ * $up_href - URL to move up in the message. Empty if not available.
+ * $next_href - URL to move to the next nessage. Empty when N/A.
+ * $del_prev_href - URL to delete this message and move to the next one. Empty if N/A.
+ * $del_next_href - URL to delete this message and move to the next one. Empty if N/A.
+ * $view_msg_href - URL to go back to the main message. Empty if N/A.
+ * $msg_list_href - URL to go to the message list.
+ * $search_href - URL to go back to the serach results. Empty if N/A.
+ * $form_extra - Extra elements required by the forms to delete, move or copy
+ * $compose_href - Base URL to forward, reply, etc. Note that a specific action
+ * must also be given by the form or in this URL.
+ * $on_click - Onclick event string for all buttons
+ * $forward_as_attachment_enabled - boolean TRUE if forwarding as attachments
+ * has been enabled.
+ * $can_resume_draft - boolean TRUE if the "resume draft" is legitimate for
+ * this message.
+ * $can_edit_as_new - boolean TRUE if the "reasume as new" action is legitimate
+ * for this message
+ * $mailboxes - array containing list of mailboxes available for move/copy action.
+ * $can_be_deleted - boolean TRUE if this message can be deleted.
+ * $can_be_moved - boolean TRUE if this message can be moved.
+ * $cab_be_copied - boolean TRUE if this message can be copied to another folder.
+ * $move_delete_form_action - the value for the ACTION attribute of forms to
+ * move, copy or delete a message
+ * $delete_form_extra - additional input elements needed by the DELETE form
+ * $move_form_extra - additional input elements needed by the MOVE form.
+ * $last_move_target - the last folder that a message was moved/copied to.
+ * *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id: read_menubar_nav.tpl 11850 2006-10-06 21:57:26Z stevetruckstuff $
+ * @package squirrelmail
+ * @subpackage templates
+ */
+
+/** add required includes **/
+
+/** extract template variables **/
+extract($t);
+
+
+/*FIXME: This is a place where Marc's idea for putting all the buttons and
+ links and other widgets into an array is sorely needed instead of
+ hard-coding everything. Whomever implements that, PLEASE, PLEASE
+ look at how the preview pane plugin code is used here to change
+ some links and buttons and make sure your implementation can support
+ it (tip: it may or may not be OK to let a plugin do the modification
+ of the widgets, since a template set can turn on the needed plugin,
+ but that might not be the most clear way to solve said issue).*/
+
+
+/** preview pane prep */
+global $data_dir, $username, $base_uri;
+$pp_refresh_message_list = getPref($data_dir, $username, 'pp_refresh_message_list', 1);
+$use_previewPane = getPref($data_dir, $username, 'use_previewPane', 0);
+$show_preview_pane = checkForJavascript() && $use_previewPane;
+$empty_frame_uri = $base_uri . 'plugins/preview_pane/empty_frame.php';
+if ($show_preview_pane) { ?>
+ <script>
+ <!--
+ function refresh_message_list()
+ { parent.right.delayed_page_load("<?php echo $message_list_href; ?>"); }
+ // -->
+ </script>
+<?php }
+
+
+/** Begin template **/
+
+if ($nav_on_top) {
+ $table_class = 'top';
+ $plugin_hook = 'read_body_menu_nav_top';
+} else {
+ $table_class = 'bottom';
+ $plugin_hook = 'read_body_menu_nav_bottom';
+}
+?>
+<div class="readMenuBar">
+<table cellspacing="0" class="<?php echo $table_class; ?>">
+ <tr class="nav">
+ <td class="nav">
+ <small>
+ [
+ <?php
+ if (empty($prev_href)) {
+ echo _("Previous");
+ } else {
+ ?>
+ <a href="<?php echo $prev_href; ?>"<?php
+
+/** if preview pane turned on with "always refresh message list",
+ refresh message list frame too, but only if we are in the bottom frame! */
+if ($show_preview_pane && $pp_refresh_message_list)
+ echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
+
+
+echo '>' . _("Previous"); ?></a>
+ <?php
+ }
+ ?> |
+ <?php
+ if (empty($up_href)) {
+ # Do nothing
+ } else {
+ ?>
+ <a href="<?php echo $up_href; ?>"><?php echo _("Up"); ?></a> |
+ <?php
+ }
+
+ if (empty($next_href)) {
+ echo _("Next");
+ } else {
+ ?>
+ <a href="<?php echo $next_href; ?>"<?php
+
+/** if preview pane turned on with "always refresh message list",
+ refresh message list frame too, but only if we are in the bottom frame! */
+if ($show_preview_pane && $pp_refresh_message_list)
+ echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
+
+
+echo '>' . _("Next"); ?></a>
+ <?php
+ }
+ ?>
+ ]
+
+ <?php
+ if (!empty($del_prev_href) || !empty($del_next_href)) {
+ ?>
+ [
+ <?php
+ if (empty($del_prev_href)) {
+ echo _("Delete & Previous");
+ } else {
+ ?>
+ <a href="<?php echo $del_prev_href; ?>"<?php
+
+/** if preview pane turned on with "always refresh message list",
+ refresh message list frame too, but only if we are in the bottom frame! */
+if ($show_preview_pane && $pp_refresh_message_list)
+ echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
+
+
+echo '>' . _("Delete & Previous"); ?></a>
+ <?php
+ }
+ ?>
+ |
+ <?php
+ if (empty($del_next_href)) {
+ echo _("Delete & Next");
+ } else {
+ ?>
+ <a href="<?php echo $del_next_href; ?>"<?php
+
+/** if preview pane turned on with "always refresh message list",
+ refresh message list frame too, but only if we are in the bottom frame! */
+if ($show_preview_pane && $pp_refresh_message_list)
+ echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
+
+
+echo '>' . _("Delete & Next"); ?></a>
+ <?php
+ }
+ ?>
+ ]
+
+ <?php
+ }
+
+ if (!empty($view_msg_href)) {
+ ?>
+ [ <a href="<?php echo $view_msg_href; ?>"><?php echo _("View Message"); ?></a> ]
+
+ <?php
+ }
+ ?>
+ [ <a href="<?php echo $message_list_href; ?>"<?php
+
+/** if preview pane turned on, retarget to message list frame & clear
+ bottom frame, but only if we are in the bottom frame! */
+if ($show_preview_pane)
+ echo ' onclick="if (self.name == \'bottom\') { parent.right.document.location=\'' . $message_list_href . '\'; document.location=\'' . $empty_frame_uri . '\'; return false; } "';
+
+
+echo '>' . _("Message List"); ?></a>
+ <?php
+ if (!empty($search_href)) {
+ ?>
+ | <a href="<?php echo $search_href; ?>"><?php echo _("Search Results"); ?></a>
+ <?php
+ }
+ ?>
+ ]
+ </small>
+ <?php if(!empty($plugin_output[$plugin_hook])) echo $plugin_output[$plugin_hook]; ?>
+ </td>
+ </tr>
+</table>
+</div>
--- /dev/null
+<?php
+/**
+ * webmail.tpl
+ *
+ * Template for rendering the main squirrelmail window
+ *
+ * The following variables are available in this template:
+ * $nav_size - integer width of the navigation frame
+ * $nav_on_left - boolean TRUE if the mavigation from should be on the
+ * left side of the page. FALSE if it is on the right.
+ *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id: webmail.tpl 12092 2007-01-07 15:44:12Z kink $
+ * @package squirrelmail
+ * @subpackage templates
+ */
+
+/** add required includes */
+
+
+/** extract variables */
+extract($t);
+
+/** set up for adding preview pane if turned on */
+global $data_dir, $username;
+$use_previewPane = getPref($data_dir, $username, 'use_previewPane', 0);
+$show_preview_pane = checkForJavascript() && $use_previewPane;
+if ($show_preview_pane) {
+ $previewPane_size = getPref($data_dir, $username, 'previewPane_size', 300);
+ $previewPane_vertical_split = getPref($data_dir, $username, 'previewPane_vertical_split', 0);
+ if ($previewPane_vertical_split)
+ $split = 'cols';
+ else
+ $split = 'rows';
+}
+
+
+$output = '';
+if ($nav_on_left) {
+ $output .= "<frameset cols=\"$nav_size, *\" id=\"fs1\">\n";
+}
+else {
+ $output .= "<frameset cols=\"*, $nav_size\" id=\"fs1\">\n";
+}
+
+
+$left_frame = '<frame src="left_main.php" name="left" frameborder="1" title="'. _("Folder List") .'" />'."\n";
+
+
+/** use preview pane? */
+if ($show_preview_pane) {
+ $right_frame = "<frameset $split=\"*, $previewPane_size\" id=\"fs2\">\n"
+ . "<frame src=\"$right_frame_url\" name=\"right\" title=\"" . _("Message List") . "\" frameborder=\"1\" />\n"
+ . "<frame src=\"" . SM_PATH . "plugins/preview_pane/empty_frame.php\" name=\"bottom\" title=\"" . _("Message Preview") . "\" frameborder=\"1\" />\n"
+ . "</frameset>\n";
+
+/** no preview pane */
+} else {
+ $right_frame = '<frame src="'.$right_frame_url.'" name="right" frameborder="1" title="'. _("Message List") .'" />'."\n";
+}
+
+
+if ($nav_on_left) {
+ $output .= $left_frame . $right_frame;
+} else {
+ $output .= $right_frame . $left_frame;
+}
+
+echo $output ."\n</frameset>\n</html>";