* This contains functions that display mailbox information, such as the
* table row that has sender, date, subject, etc...
*
- * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @copyright © 1999-2007 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
$thread_name = _("Thread View");
$newsort = $aMailbox['SORT'] + SQSORT_THREAD;
}
- $thread_link_str = '<small>[<a href="' . $baseurl . '&srt='
- . $newsort . '&startMessage=1">' . $thread_name
- . '</a>]</small>';
+ $thread_link_uri = $baseurl . '&srt=' . $newsort
+ . '&startMessage=1';
} else {
- $thread_link_str ='';
+ $thread_link_uri ='';
+ $thread_name = '';
}
$sort = $aMailbox['SORT'];
$aTemplate['trash_folder'] = $trash_folder;
$aTemplate['sent_folder'] = $sent_folder;
$aTemplate['draft_folder'] = $draft_folder;
- $aTemplate['thread_link_str'] = $thread_link_str;
+ $aTemplate['thread_link_uri'] = $thread_link_uri;
+ $aTemplate['thread_name'] = $thread_name;
$aTemplate['php_self'] = str_replace('&','&',$php_self);
$aTemplate['mailbox'] = $sMailbox;
+//FIXME: javascript_on is always assigned to the template object in places like init.php; is there some reason to reassign it here? is there some chance that it was changed? if not, please remove this line!
$aTemplate['javascript_on'] = (isset($aProps['config']['javascript_on'])) ? $aProps['config']['javascript_on'] : false;
$aTemplate['enablesort'] = (isset($aProps['config']['enablesort'])) ? $aProps['config']['enablesort'] : false;
$aTemplate['icon_theme'] = (isset($aProps['config']['icon_theme'])) ? $aProps['config']['icon_theme'] : false;
*/
function handleMessageListForm($imapConnection,&$aMailbox,$sButton='',$aUid = array()) {
/* incoming formdata */
- $sButton = (sqgetGlobalVar('moveButton', $sTmp, SQ_POST)) ? 'move' : $sButton;
- $sButton = (sqgetGlobalVar('copyButton', $sTmp, SQ_POST)) ? 'copy' : $sButton;
- $sButton = (sqgetGlobalVar('expungeButton', $sTmp, SQ_POST)) ? 'expunge' : $sButton;
- $sButton = (sqgetGlobalVar('forward', $sTmp, SQ_POST)) ? 'forward' : $sButton;
- $sButton = (sqgetGlobalVar('delete', $sTmp, SQ_POST)) ? 'setDeleted' : $sButton;
- $sButton = (sqgetGlobalVar('undeleteButton', $sTmp, SQ_POST)) ? 'unsetDeleted' : $sButton;
- $sButton = (sqgetGlobalVar('markRead', $sTmp, SQ_POST)) ? 'setSeen' : $sButton;
- $sButton = (sqgetGlobalVar('markUnread', $sTmp, SQ_POST)) ? 'unsetSeen' : $sButton;
- $sButton = (sqgetGlobalVar('markFlagged', $sTmp, SQ_POST)) ? 'setFlagged' : $sButton;
- $sButton = (sqgetGlobalVar('markUnflagged', $sTmp, SQ_POST)) ? 'unsetFlagged' : $sButton;
- sqgetGlobalVar('targetMailbox', $targetMailbox, SQ_POST);
- sqgetGlobalVar('bypass_trash', $bypass_trash, SQ_POST);
- sqgetGlobalVar('msg', $msg, SQ_POST);
- if (sqgetGlobalVar('account', $iAccount, SQ_POST) === false) {
+ $sButton = (sqgetGlobalVar('moveButton', $sTmp, SQ_FORM)) ? 'move' : $sButton;
+ $sButton = (sqgetGlobalVar('copyButton', $sTmp, SQ_FORM)) ? 'copy' : $sButton;
+ $sButton = (sqgetGlobalVar('expungeButton', $sTmp, SQ_FORM)) ? 'expunge' : $sButton;
+ $sButton = (sqgetGlobalVar('forward', $sTmp, SQ_FORM)) ? 'forward' : $sButton;
+ $sButton = (sqgetGlobalVar('delete', $sTmp, SQ_FORM)) ? 'setDeleted' : $sButton;
+ $sButton = (sqgetGlobalVar('undeleteButton', $sTmp, SQ_FORM)) ? 'unsetDeleted' : $sButton;
+ $sButton = (sqgetGlobalVar('markRead', $sTmp, SQ_FORM)) ? 'setSeen' : $sButton;
+ $sButton = (sqgetGlobalVar('markUnread', $sTmp, SQ_FORM)) ? 'unsetSeen' : $sButton;
+ $sButton = (sqgetGlobalVar('markFlagged', $sTmp, SQ_FORM)) ? 'setFlagged' : $sButton;
+ $sButton = (sqgetGlobalVar('markUnflagged', $sTmp, SQ_FORM)) ? 'unsetFlagged' : $sButton;
+ sqgetGlobalVar('targetMailbox', $targetMailbox, SQ_FORM);
+ sqgetGlobalVar('bypass_trash', $bypass_trash, SQ_FORM);
+ sqgetGlobalVar('msg', $msg, SQ_FORM);
+ if (sqgetGlobalVar('account', $iAccount, SQ_FORM) === false) {
$iAccount = 0;
}
$sError = '';
* @author Marc Groot Koerkamp
*/
function attachSelectedMessages($imapConnection,$aMsgHeaders) {
- global $username, $attachment_dir,
- $data_dir;
-
sqgetGlobalVar('composesession', $composesession, SQ_SESSION);
sqgetGlobalVar('compose_messages', $compose_messages, SQ_SESSION);
sqsession_register($composesession,'composesession');
}
- $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
-
$composeMessage = new Message();
$rfc822_header = new Rfc822Header();
$composeMessage->rfc822_header = $rfc822_header;
$body = implode('', $body_a);
$body .= "\r\n";
- $localfilename = GenerateRandomString(32, 'FILE', 7);
- $full_localfilename = "$hashed_attachment_dir/$localfilename";
-
- $fp = fopen( $full_localfilename, 'wb');
+ $filename = sq_get_attach_tempfile();
+ $fp = fopen($filename, 'wb');
fwrite ($fp, $body);
fclose($fp);
+
$composeMessage->initAttachment('message/rfc822',$subject.'.msg',
- $full_localfilename);
+ $filename);
}
}
sqsession_register($compose_messages,'compose_messages');
return $composesession;
}
+