if (!show_preview_pane()) return;
- global $data_dir, $username, $base_uri;
+ global $data_dir, $username, $base_uri, $oTemplate;
$previewPane_vertical_split = getPref($data_dir, $username, 'previewPane_vertical_split', 0);
if ($previewPane_vertical_split)
{
$previewPane_size = getPref($data_dir, $username, 'previewPane_size', 300);
+ $oTemplate->assign('previewPane_size', $previewPane_size);
+ $oTemplate->assign('base_uri', $base_uri);
+ $oTemplate->assign('split', $split);
+ $oTemplate->assign('down_arrow', $down_arrow);
+ $oTemplate->assign('up_arrow', $up_arrow);
- $output = "\n<script type=\"text/javascript\">\n"
- . "<!--\n"
- . " function set_preview_pane_size(new_size)\n"
- . " {\n"
- . " if (document.all)\n"
- . " {\n"
- . " parent.document.all[\"fs2\"].$split = \"*, \" + new_size;\n"
- . " }\n"
- . " else if (this.document.getElementById)\n"
- . " {\n"
- . " parent.document.getElementById(\"fs2\").$split = \"*, \" + new_size;\n"
- . " }\n"
- . " }\n"
- . "// -->\n</script>\n"
- . '<form style="margin:0">'
- . '<input type="button" value="' . $down_arrow . '" onclick="set_preview_pane_size(0)" />'
- . '<input type="button" value="X" onclick="parent.bottom.document.location=\'' . $base_uri . 'plugins/preview_pane/empty_frame.php\'" />'
- . '<input type="button" value="' . $up_arrow . '" onclick="set_preview_pane_size(' . $previewPane_size . ')" />'
- . '</form>';
+ $output = $oTemplate->fetch('plugins/preview_pane/collapse_buttons.tpl');
return array('provider_link_before' => $output);
--- /dev/null
+<?php
+
+/**
+ * collapse_buttons.tpl
+ *
+ * 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
+ * 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
+ * + $base_uri - The SquirrelMail base URI
+ * + $previewPane_size - The user's configured size of the preview pane
+ *
+ * @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);
+
+
+?><script type="text/javascript">
+<!--
+
+ function set_preview_pane_size(new_size)
+ {
+ if (document.all)
+ {
+ parent.document.all["fs2"].<?php echo $split; ?> = "*, " + new_size;
+ }
+ else if (this.document.getElementById)
+ {
+ parent.document.getElementById("fs2").<?php echo $split; ?> = "*, " + new_size;
+ }
+ }
+// -->\n</script>
+<form style="margin:0">
+ <input type="button" value="<?php echo $down_arrow; ?>" onclick="set_preview_pane_size(0)" />
+ <input type="button" value="X" onclick="parent.bottom.document.location='<?php echo $base_uri; ?>plugins/preview_pane/empty_frame.php'" />
+ <input type="button" value="<?php echo $up_arrow; ?>" onclick="set_preview_pane_size(<?php echo $previewPane_size; ?>)" />
+</form>