*/
function show_preview_pane()
{
+ global $data_dir, $username;
$use_previewPane = getPref($data_dir, $username, 'use_previewPane', 0);
return (checkForJavascript() && $use_previewPane);
}
+/**
+ * Adds preview pane open/close (and clear) buttons next to
+ * "provider link"
+ *
+ */
+function preview_pane_open_close_buttons_do()
+{
+
+ if (!show_preview_pane()) return;
+
+ global $data_dir, $username, $base_uri;
+ $previewPane_vertical_split = getPref($data_dir, $username, 'previewPane_vertical_split', 0);
+ if ($previewPane_vertical_split)
+ {
+ $split = 'cols';
+ $up_arrow = '←';
+ $down_arrow = '→';
+ }
+ else
+ {
+ $split = 'rows';
+ $up_arrow = '↑';
+ $down_arrow = '↓';
+ }
+
+
+ $previewPane_size = getPref($data_dir, $username, 'previewPane_size', 300);
+
+
+ $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>';
+
+ return array('provider_link_before' => $output);
+
+}
+
+
/**
* Construct button that clears out any preview pane
* contents and inserts JavaScript function used by
= 'preview_pane_show_options';
$squirrelmail_plugin_hooks['template_construct_message_list.tpl']['preview_pane']
= 'preview_pane_message_list';
+ $squirrelmail_plugin_hooks['template_construct_page_header.tpl']['preview_pane']
+ = 'preview_pane_open_close_buttons';
}
+/**
+ * Adds preview pane open/close (and clear) buttons next to
+ * "provider link"
+ *
+ */
+function preview_pane_open_close_buttons()
+{
+
+ include_once(SM_PATH . 'plugins/preview_pane/functions.php');
+ return preview_pane_open_close_buttons_do();
+
+}
+
+
+