From e1b9b8633c359bb1afcaa6b4ebcc1dd941309551 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Fri, 9 Mar 2007 06:11:56 +0000 Subject: [PATCH] Add (un)collapse buttons git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12327 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- plugins/preview_pane/functions.php | 55 ++++++++++++++++++++++++++++++ plugins/preview_pane/setup.php | 17 +++++++++ 2 files changed, 72 insertions(+) diff --git a/plugins/preview_pane/functions.php b/plugins/preview_pane/functions.php index 8bb06b7d..4afe4716 100644 --- a/plugins/preview_pane/functions.php +++ b/plugins/preview_pane/functions.php @@ -72,11 +72,66 @@ 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; + $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\n" + . '
' + . '' + . '' + . '' + . '
'; + + return array('provider_link_before' => $output); + +} + + /** * Construct button that clears out any preview pane * contents and inserts JavaScript function used by diff --git a/plugins/preview_pane/setup.php b/plugins/preview_pane/setup.php index 9a4ed434..e0ac59fa 100644 --- a/plugins/preview_pane/setup.php +++ b/plugins/preview_pane/setup.php @@ -29,6 +29,8 @@ function squirrelmail_plugin_init_preview_pane() = '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'; } @@ -120,3 +122,18 @@ function preview_pane_change_message_target() +/** + * 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(); + +} + + + -- 2.25.1