Changeset 611 in subversion


Ignore:
Timestamp:
Jun 8, 2007 7:47:57 PM (6 years ago)
Author:
estadtherr
Message:

fixed html2text in editor

Location:
trunk/roundcubemail
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/bin/html2text.php

    r543 r611  
    99$plaintext = $converter->get_text(); 
    1010 
    11 if (function_exists('html_entity_decode')) 
     11$phpver = explode('.', phpversion()); 
     12$vernum = $phpver[0] . $phpver[1] . $phpver[2]; 
     13 
     14# html_entity_decode doesn't handle UTF character sets in PHP 4.x 
     15 
     16if (($vernum >= 500) && function_exists('html_entity_decode')) 
    1217        print html_entity_decode($plaintext, ENT_COMPAT, 'UTF-8'); 
    1318else 
  • trunk/roundcubemail/index.php

    r593 r611  
    8383require_once('include/main.inc'); 
    8484require_once('include/cache.inc'); 
    85 require_once('lib/html2text.inc'); 
    8685require_once('PEAR.php'); 
    8786 
     
    145144if ($_action=='error' && !empty($_GET['_code'])) 
    146145  raise_error(array('code' => hexdec($_GET['_code'])), FALSE, TRUE); 
    147  
    148  
    149 // handle HTML->text conversion 
    150 if ($_action=='html2text') 
    151 { 
    152     $htmlText = $HTTP_RAW_POST_DATA; 
    153     $converter = new html2text($htmlText); 
    154  
    155         // TODO possibly replace with rcube_remote_response() 
    156         header('Content-Type: text/plain'); 
    157         $plaintext = $converter->get_text(); 
    158         print $plaintext; 
    159  
    160         exit; 
    161 } 
    162146 
    163147 
  • trunk/roundcubemail/program/js/editor.js

    r593 r611  
    100100  http_request.onerror = function(o) { rcmail_handle_toggle_error(o); }; 
    101101  http_request.oncomplete = function(o) { rcmail_set_text_value(o); }; 
    102   var url=rcmail.env.comm_path+'&_action=html2text'; 
     102  var url = rcmail.env.bin_path+'html2text.php'; 
     103  console.log('HTTP request: ' + url); 
    103104  http_request.POST(url, htmlText, 'application/octet-stream'); 
    104105  } 
Note: See TracChangeset for help on using the changeset viewer.