X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fpreview_pane%2Ffunctions.php;h=2149f515788578b018b1f89588c2c54a63181191;hp=de9ae3135b72944eb9e1f729ab2e6cc9e7aa736d;hb=7f0dbd10f69bc6e80ae98f86bca0b970e2131f1a;hpb=a67cf4877d741cffdf17affd2fae6359921b12ab
diff --git a/plugins/preview_pane/functions.php b/plugins/preview_pane/functions.php
index de9ae313..2149f515 100644
--- a/plugins/preview_pane/functions.php
+++ b/plugins/preview_pane/functions.php
@@ -27,6 +27,7 @@ function preview_pane_show_options_do()
$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);
+ $previewPane_autohide = getPref($data_dir, $username, 'previewPane_autohide', 0);
global $optpage_data;
@@ -57,6 +58,13 @@ function preview_pane_show_options_do()
'caption' => _("Always Refresh Message List
When Using Preview Pane"),
'type' => SMOPT_TYPE_BOOLEAN,
'initial_value' => $pp_refresh_message_list,
+ 'refresh' => SMOPT_REFRESH_NONE,
+ );
+ $optpage_data['vals'][1][] = array(
+ 'name' => 'previewPane_autohide',
+ 'caption' => _("Automatically Hide Preview Pane
When Not Reading Messages"),
+ 'type' => SMOPT_TYPE_BOOLEAN,
+ 'initial_value' => $previewPane_autohide,
'refresh' => SMOPT_REFRESH_ALL,
);
@@ -72,11 +80,53 @@ function preview_pane_show_options_do()
*/
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, $oTemplate;
+ $previewPane_vertical_split = getPref($data_dir, $username, 'previewPane_vertical_split', 0);
+ if ($previewPane_vertical_split)
+ {
+ $orientation = 'cols';
+ $up_arrow = '←';
+ $down_arrow = '→';
+ }
+ else
+ {
+ $orientation = 'rows';
+ $up_arrow = '↑';
+ $down_arrow = '↓';
+ }
+
+
+ $previewPane_size = getPref($data_dir, $username, 'previewPane_size', 300);
+
+ $oTemplate->assign('previewPane_size', $previewPane_size);
+ $oTemplate->assign('base_uri', $base_uri);
+ $oTemplate->assign('orientation', $orientation);
+ $oTemplate->assign('down_arrow', $down_arrow, FALSE);
+ $oTemplate->assign('up_arrow', $up_arrow, FALSE);
+
+ $output = $oTemplate->fetch('plugins/preview_pane/collapse_buttons.tpl');
+
+ return array('provider_link_before' => $output);
+
+}
+
+
/**
* Construct button that clears out any preview pane
* contents and inserts JavaScript function used by
@@ -112,7 +162,7 @@ function preview_pane_message_list_do()
{
// sqgetGlobalVar('REQUEST_URI', $request_uri, SQ_SERVER);
$request_uri = $PHP_SELF;
- $output .= "\n";
+ $output .= "\n";
}
@@ -129,7 +179,7 @@ function preview_pane_message_list_do()
// don't let message list load into preview pane at all
//
- . "\n