From 9170842d523d143ad69931a7518c490d0c047447 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Wed, 26 Jan 2011 12:47:18 +0000 Subject: [PATCH] * eMail: preview now requires user action (click on) --- felamimail/inc/class.uiwidgets.inc.php | 40 ++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/felamimail/inc/class.uiwidgets.inc.php b/felamimail/inc/class.uiwidgets.inc.php index f052a7240d..6003dfd572 100644 --- a/felamimail/inc/class.uiwidgets.inc.php +++ b/felamimail/inc/class.uiwidgets.inc.php @@ -439,12 +439,14 @@ class uiwidgets ' - '.bofelamimail::_strtotime($header['date'],($GLOBALS['egw_info']['user']['preferences']['common']['timeformat']==12?'h:i:s a':'H:i:s'))); $this->t->set_var('size', $this->show_readable_size($header['size'])); - if ($firstuid === null) + // selecting the first message by default for preview + if ($firstuid === null) // only use preview if there is a message selected, so selecting the first message by default is not used anymore { //_debug_array($header); - $firstuid = $header['uid']; - $firstheader = $header; + //$firstuid = $selecteduid = $header['uid']; + //$firstheader = $header; } + // preview the message with the requested (messageToBePreviewed) uid if ($messageToBePreviewed>0 && $GLOBALS['egw_info']['user']['preferences']['felamimail']['PreViewFrameHeight']>0 && $messageToBePreviewed == $header['uid']) @@ -537,8 +539,36 @@ class uiwidgets break; } } - - $IFRAMEBody = $this->updateMessagePreview($firstheader,$_folderType,$_folderName); + if ($firstheader && + $GLOBALS['egw_info']['user']['preferences']['felamimail']['PreViewFrameHeight']>0 && + ($_folderType==0 || $_folderType==1)) // only if not drafts or template folder + { + $IFRAMEBody = $this->updateMessagePreview($firstheader,$_folderType,$_folderName); + } + else + { + if ($GLOBALS['egw_info']['user']['preferences']['felamimail']['PreViewFrameHeight']>0) + { + $IFRAMEBody = " + + + + + + +
+ ".'
'. + "
".(!($_folderType == 2 || $_folderType == 3)?lang("Select a message to switch on its preview (click on subject)"):lang("Preview disabled for Folder: ").$_folderName)."

+
"." +
+   +
"; + } + else + { + $IFRAMEBody = ''; + } + } $this->t->set_var('IFrameForPreview',$IFRAMEBody); $this->t->set_var('messagelist_height',($GLOBALS['egw_info']['user']['preferences']['felamimail']['PreViewFrameHeight']>0 ? ($GLOBALS['egw_info']['user']['preferences']['felamimail']['PreViewFrameHeight']).'px':'auto'));