advanced" template set
* Only works with 1.5.2+
- v1.3 2007/01/19 Paul Lesniewski <paul@squirrelmail.org>
+ v1.3 2007/05/17 Paul Lesniewski <paul@squirrelmail.org>
+ * Added ability to close/open the preview pane using buttons below
+ the "Sign Out" link (Thanks to Edwin Taylor <hagfish@ntlworld.com>)
+ * Added reduced message header functionality (also works even when
+ preview pane is not turned on) (Thanks to Daniel Watts <d@nielwatts.com>)
+ * Added auto-hide functionality (Thanks to Daniel Watts <d@nielwatts.com>)
* 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
+ * Added 1.4.9 patch; versions between 1.4.3 and 1.4.10 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
always 100% reliable.
* No longer support replacement source files; patches are more than enough
* Fully compatible with Windows plugin, version 1.7+
+ * Fully compatible with Sent Confirmation plugin, version 1.7+ (upgrade
+ required)
v1.2 2004/06/08 Paul Lesniewski <paul@squirrelmail.org>
* Added javascript fix so delete link will work when messages are
'caption' => _("Always Refresh Message List<br />When Using Preview Pane"),
'type' => SMOPT_TYPE_BOOLEAN,
'initial_value' => $pp_refresh_message_list,
- 'refresh' => SMOPT_REFRESH_ALL,
+ 'refresh' => SMOPT_REFRESH_NONE,
);
}
$previewPane_vertical_split = getPref($data_dir, $username, 'previewPane_vertical_split', 0);
if ($previewPane_vertical_split)
{
- $split = 'cols';
+ $orientation = 'cols';
$up_arrow = '←';
$down_arrow = '→';
}
else
{
- $split = 'rows';
+ $orientation = 'rows';
$up_arrow = '↑';
$down_arrow = '↓';
}
$oTemplate->assign('previewPane_size', $previewPane_size);
$oTemplate->assign('base_uri', $base_uri);
- $oTemplate->assign('split', $split);
+ $oTemplate->assign('orientation', $orientation);
$oTemplate->assign('down_arrow', $down_arrow);
$oTemplate->assign('up_arrow', $up_arrow);
{
// 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";
+ $output .= "<script type=\"text/javascript\" language=\"JavaScript\">\n<!--\n function pp_refresh() { document.location = '$request_uri'; }\n// -->\n</script>\n";
}
// don't let message list load into preview pane at all
//
- . "\n<script language='javascript' type='text/javascript'>\n"
+ . "\n<script language='JavaScript' type='text/javascript'>\n"
. "<!--\n"
. "\n"
. " if (self.name == 'bottom')\n"
* (and possibly refresh message list as well)
*
*/
-function preview_pane_change_message_target_do()
+function preview_pane_change_message_target_do($args)
{
if (!checkForJavascript()) return;
if (getPref($data_dir, $username, 'use_previewPane', 0) == 1)
{
$pp_refresh_message_list = getPref($data_dir, $username, 'pp_refresh_message_list', 1);
+ $aMsg = $args[3];
$target = 'bottom';
- if ($pp_refresh_message_list)
-// introduce a delay so read messages actually refresh after they are read
+
+
+ // introduce a delay so read messages actually
+ // refresh after they are read, but only if they
+ // have not already been seen
+ //
+ if ($pp_refresh_message_list && empty($aMsg['FLAGS']['\seen']))
+// old code without refresh delay
// $onclick .= ' onclick="document.location=\'' . $request_uri . '\'; " ';
$onclick .= ' setTimeout(\'pp_refresh()\', 500); ';
}
* (and possibly refresh message list as well)
*
*/
-function preview_pane_change_message_target()
+function preview_pane_change_message_target($args)
{
include_once(SM_PATH . 'plugins/preview_pane/functions.php');
- preview_pane_change_message_target_do();
+ preview_pane_change_message_target_do($args);
}
* Template for building (un)collapse (and clear) buttons for preview pane.
*
* The following variables are available in this template:
- * + $split - Either "cols" or "rows" depending on how the
+ * + $orientation - Either "cols" or "rows" depending on how the
* preview pane is oriented
* + $down_arrow - The value to be displayed on the collapse button
* + $up_arrow - The value to be displayed on the uncollapse button
extract($t);
-?><script type="text/javascript">
+?><script type="text/javascript" language="JavaScript">
<!--
function set_preview_pane_size(new_size)
{
if (document.all)
{
- parent.document.all["fs2"].<?php echo $split; ?> = "*, " + new_size;
+ parent.document.all["fs2"].<?php echo $orientation; ?> = "*, " + new_size;
}
else if (this.document.getElementById)
{
- parent.document.getElementById("fs2").<?php echo $split; ?> = "*, " + new_size;
+ parent.document.getElementById("fs2").<?php echo $orientation; ?> = "*, " + new_size;
}
}
// -->\n</script>
</div>
<br />
<!-- End Header Navigation Table -->
-<script type="text/javascript">
+<script type="text/javascript" language="JavaScript">
<!--
var delayed_page_load_uri = '';
function delayed_page_load(page_uri)
</tr>
</table>
</div>
+<?php
+// do a conditional refresh of message list if needed
+// "pp_rr" = "preview pane read refresh"
+if (sqGetGlobalVar('pp_rr', $pp_rr, SQ_FORM) && $show_preview_pane && $first_time_reading) {
+ echo "<script language=\"JavaScript\" type=\"text/javascript\">\n<!--\nif (self.name == 'bottom') { refresh_message_list(); }\n// -->\n</script>\n";
+}
<script>
<!--
function refresh_message_list()
- { parent.right.delayed_page_load("<?php echo $message_list_href; ?>"); }
+ {
+ if (typeof(parent.right.delayed_page_load) != 'undefined')
+ parent.right.delayed_page_load("<?php echo $message_list_href; ?>");
+ }
// -->
</script>
<?php }
echo _("Previous");
} else {
?>
- <a href="<?php echo $prev_href; ?>"<?php
+ <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! */
+ refresh message list frame too, but only if we are in the bottom frame!
+ and make sure the refresh is conditional upon the seen flag of the
+ message after it is loaded (see read_headers.tpl) */
if ($show_preview_pane && $pp_refresh_message_list)
- echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
+ // old code: unconditional refresh
+ //echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
+ echo '&pp_rr=1';
-echo '>' . _("Previous"); ?></a>
+echo '">' . _("Previous"); ?></a>
<?php
}
?> |
echo _("Next");
} else {
?>
- <a href="<?php echo $next_href; ?>"<?php
+ <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! */
+ refresh message list frame too, but only if we are in the bottom frame!
+ and make sure the refresh is conditional upon the seen flag of the
+ message after it is loaded (see read_headers.tpl) */
if ($show_preview_pane && $pp_refresh_message_list)
- echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
+ // old code: unconditional refresh
+ //echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
+ echo '&pp_rr=1';
-echo '>' . _("Next"); ?></a>
+echo '">' . _("Next"); ?></a>
<?php
}
?>