From a44e9a6f9e284d7685c22d6f32ee631370789e9d Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 2 Sep 2015 09:31:47 +0000 Subject: [PATCH] * Mail/preferences: Add Preview Pane option into mail preferences in order to be able to show/hide mail preview pane (split panel) --- mail/inc/class.mail_hooks.inc.php | 11 +++ mail/inc/class.mail_ui.inc.php | 3 + mail/js/app.js | 7 -- mail/templates/default/index.xet | 108 ++++++++++++++++-------------- 4 files changed, 71 insertions(+), 58 deletions(-) diff --git a/mail/inc/class.mail_hooks.inc.php b/mail/inc/class.mail_hooks.inc.php index ae543f3a9a..db62878815 100644 --- a/mail/inc/class.mail_hooks.inc.php +++ b/mail/inc/class.mail_hooks.inc.php @@ -340,6 +340,17 @@ class mail_hooks 'default'=> 0, 'admin' => False, ), + 'previewPane' => array( + 'type' => 'select', + 'label' => 'Preview pane', + 'help' => 'Show/Hide preview pane in mail list view', + 'name' => 'previewPane', + 'values' => array( + '0' => lang('show'), + '1' => lang('hide') + ), + 'default' => '0' + ), array( 'type' => 'section', 'title' => lang('Configuration settings'), diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 1959e7c931..20eb70c975 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -722,6 +722,9 @@ class mail_ui { self::callWizard($e->getMessage(),true, 'error'); } + // Check preview pane is enabled, then show spliter + if ($this->mail_bo->mailPreferences['previewPane']) $etpl->setElementAttribute('mail.index.spliter', 'template', 'mail.index.nospliter'); + return $etpl->exec('mail.mail_ui.index',$content,$sel_options,$readonlys,$preserv); } diff --git a/mail/js/app.js b/mail/js/app.js index 4842b810f7..50004680eb 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -676,17 +676,10 @@ app.classes.mail = AppJS.extend( var splitter = this.et2.getWidgetById('mailSplitter'); // return if there's no splitter we maybe in mobile mode if (typeof splitter == 'undefined' || splitter == null) return; - var splitterDN = splitter.getDOMNode(); - if(splitter.isDocked()) { this.mail_previewAreaActive = false; } - - //this.et2.getWidgetById('mailPreviewHeadersFrom').set_disabled(_value); - //this.et2.getWidgetById('mailPreviewHeadersTo').set_disabled(_value); - //this.et2.getWidgetById('mailPreviewHeadersDate').set_disabled(_value); - //this.et2.getWidgetById('mailPreviewHeadersSubject').set_disabled(_value); this.et2.getWidgetById('mailPreview').set_disabled(_value); //Dock the splitter always if we are browsing with mobile if (_value==true) diff --git a/mail/templates/default/index.xet b/mail/templates/default/index.xet index 46d7ee43af..5618e41ba6 100644 --- a/mail/templates/default/index.xet +++ b/mail/templates/default/index.xet @@ -2,57 +2,7 @@ - -