Changeset 595 in subversion
- Timestamp:
- Jun 5, 2007 12:26:02 PM (6 years ago)
- Location:
- branches/devel-vnext
- Files:
-
- 4 edited
-
bin/html2text.php (modified) (2 diffs)
-
index.php (modified) (2 diffs)
-
program/include/rcube_imap.inc (modified) (1 diff)
-
program/steps/mail/sendmail.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/devel-vnext/bin/html2text.php
r589 r595 1 1 <?php 2 if ($_SERVER['REQUEST_METHOD'] == 'GET') { 3 echo 'Method not allowed.'; 4 exit; 5 } 6 require_once dirname(__FILE__) . '/../program/lib/html2text.inc'; 2 7 3 require_once('../program/lib/html2text.inc'); 4 5 $htmlText = $HTTP_RAW_POST_DATA; 8 $htmlText = $HTTP_RAW_POST_DATA; 6 9 $converter = new html2text($htmlText); 7 10 … … 9 12 $plaintext = $converter->get_text(); 10 13 11 if (function_exists('html_entity_decode')) 12 print html_entity_decode($plaintext, ENT_COMPAT, 'UTF-8'); 13 else 14 print $plaintext; 15 14 if (function_exists('html_entity_decode')) { 15 echo html_entity_decode($plaintext, ENT_COMPAT, 'UTF-8'); 16 } 17 else { 18 echo $plaintext; 19 } 16 20 ?> -
branches/devel-vnext/index.php
r594 r595 113 113 require_once 'include/main.inc'; 114 114 require_once 'include/cache.inc'; 115 require_once 'lib/html2text.inc';116 115 require_once 'PEAR.php'; 117 116 … … 175 174 if ($_action=='error' && !empty($_GET['_code'])) { 176 175 raise_error(array('code' => hexdec($_GET['_code'])), FALSE, TRUE); 177 }178 179 // handle HTML->text conversion180 if ($_action=='html2text') {181 $htmlText = $HTTP_RAW_POST_DATA;182 $converter = new html2text($htmlText);183 184 // TODO possibly replace with rcube_remote_response()185 header('Content-Type: text/plain');186 $plaintext = $converter->get_text();187 echo $plaintext;188 exit;189 176 } 190 177 -
branches/devel-vnext/program/include/rcube_imap.inc
r592 r595 1285 1285 1286 1286 1287 /**1288 * Set message flag to one or several messages1289 *1290 * @param mixed Message UIDs as array or as comma-separated string1291 * @param string Flag to set: SEEN, UNDELETED, DELETED, RECENT, ANSWERED, DRAFT1292 * @return True on success, False on failure1293 */1294 function set_flag($uids, $flag)1295 { 1296 $flag = strtoupper($flag);1297 $msg_ids = array();1298 if (!is_array($uids))1299 $uids = explode(',',$uids);1300 1301 foreach ($uids as $uid) {1302 $msg_ids[$uid] = $this->_uid2id($uid);1303 }1304 1305 if ($flag=='UNDELETED')1306 $result = iil_C_Undelete($this->conn, $this->mailbox, join(',', array_values($msg_ids)));1307 else if ($flag=='UNSEEN')1308 $result = iil_C_Unseen($this->conn, $this->mailbox, join(',', array_values($msg_ids)));1309 else1310 $result = iil_C_Flag($this->conn, $this->mailbox, join(',', array_values($msg_ids)), $flag);1311 1312 // reload message headers if cached1313 $cache_key = $this->mailbox.'.msg';1314 if ($this->caching_enabled)1315 {1316 foreach ($msg_ids as $uid => $id)1317 {1318 if ($cached_headers = $this->get_cached_message($cache_key, $uid))1319 {1320 $this->remove_message_cache($cache_key, $id);1321 //$this->get_headers($uid);1322 }1323 }1324 1325 // close and re-open connection1326 // this prevents connection problems with Courier1327 $this->reconnect();1328 }1329 1330 // set nr of messages that were flaged1331 $count = count($msg_ids);1332 1333 // clear message count cache1334 if ($result && $flag=='SEEN')1335 $this->_set_messagecount($this->mailbox, 'UNSEEN', $count*(-1));1336 else if ($result && $flag=='UNSEEN')1337 $this->_set_messagecount($this->mailbox, 'UNSEEN', $count);1338 else if ($result && $flag=='DELETED')1339 $this->_set_messagecount($this->mailbox, 'ALL', $count*(-1));1340 1341 return $result;1342 }1343 1344 1345 // append a mail message (source) to a specific mailbox 1346 function save_message($mbox_name, &$message) 1347 {1348 $mbox_name = stripslashes($mbox_name);1349 $mailbox = $this->_mod_mailbox($mbox_name);1350 1351 // make sure mailbox exists1352 if (in_array($mailbox, $this->_list_mailboxes())) 1353 $saved = iil_C_Append($this->conn, $mailbox, $message);1354 1355 if ($saved)1356 {1357 // increase messagecount of the target mailbox1358 $this->_set_messagecount($mailbox, 'ALL', 1);1359 }1360 1361 return $saved;1287 /** 1288 * Set message flag to one or several messages 1289 * 1290 * @param mixed Message UIDs as array or as comma-separated string 1291 * @param string Flag to set: SEEN, UNDELETED, DELETED, RECENT, ANSWERED, DRAFT 1292 * @return True on success, False on failure 1293 */ 1294 function set_flag($uids, $flag) 1295 { 1296 $flag = strtoupper($flag); 1297 $msg_ids = array(); 1298 if (!is_array($uids)) { 1299 $uids = explode(',',$uids); 1300 } 1301 foreach ($uids as $uid) { 1302 $msg_ids[$uid] = $this->_uid2id($uid); 1303 } 1304 1305 if ($flag=='UNDELETED') { 1306 $result = iil_C_Undelete($this->conn, $this->mailbox, join(',', array_values($msg_ids))); 1307 } 1308 elseif ($flag=='UNSEEN') { 1309 $result = iil_C_Unseen($this->conn, $this->mailbox, join(',', array_values($msg_ids))); 1310 } 1311 else { 1312 $result = iil_C_Flag($this->conn, $this->mailbox, join(',', array_values($msg_ids)), $flag); 1313 } 1314 //tfk_debug($result); 1315 // reload message headers if cached 1316 $cache_key = $this->mailbox.'.msg'; 1317 if ($this->caching_enabled) { 1318 foreach ($msg_ids as $uid => $id) { 1319 if ($cached_headers = $this->get_cached_message($cache_key, $uid)) { 1320 $this->remove_message_cache($cache_key, $id); 1321 //$this->get_headers($uid); 1322 } 1323 } 1324 1325 // close and re-open connection 1326 // this prevents connection problems with Courier 1327 $this->reconnect(); 1328 } 1329 1330 // set nr of messages that were flaged 1331 $count = count($msg_ids); 1332 1333 // clear message count cache 1334 if ($result && $flag=='SEEN') { 1335 $this->_set_messagecount($this->mailbox, 'UNSEEN', $count*(-1)); 1336 } 1337 elseif ($result && $flag=='UNSEEN') { 1338 $this->_set_messagecount($this->mailbox, 'UNSEEN', $count); 1339 } 1340 elseif ($result && $flag=='DELETED') { 1341 $this->_set_messagecount($this->mailbox, 'ALL', $count*(-1)); 1342 } 1343 return $result; 1344 } 1345 1346 1347 // append a mail message (source) to a specific mailbox 1348 function save_message($mbox_name, &$message) 1349 { 1350 $mbox_name = stripslashes($mbox_name); 1351 $mailbox = $this->_mod_mailbox($mbox_name); 1352 1353 // make sure mailbox exists 1354 if (in_array($mailbox, $this->_list_mailboxes())) { 1355 $saved = iil_C_Append($this->conn, $mailbox, $message); 1356 } 1357 if ($saved) { 1358 // increase messagecount of the target mailbox 1359 $this->_set_messagecount($mailbox, 'ALL', 1); 1360 } 1361 return $saved; 1362 1362 } 1363 1363 -
branches/devel-vnext/program/steps/mail/sendmail.inc
r592 r595 409 409 return; 410 410 } 411 412 413 // set repliead flag414 if ($_SESSION['compose']['reply_uid']) {415 $IMAP->set_flag($_SESSION['compose']['reply_uid'], 'ANSWERED');416 }417 411 } // End of SMTP Delivery Block 412 // set repliead flag 413 if ($_SESSION['compose']['reply_uid']) { 414 $IMAP->set_flag($_SESSION['compose']['reply_uid'], 'ANSWERED'); 415 } 418 416 } 419 417 // Determine which folder to save message
Note: See TracChangeset
for help on using the changeset viewer.
