Changeset 1652 in subversion


Ignore:
Timestamp:
Aug 15, 2008 6:00:33 PM (5 years ago)
Author:
thomasb
Message:

Respect spellcheck_uri in tinyMCE spellchecker (#1484196)

Location:
trunk/roundcubemail
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r1651 r1652  
    88- Added pspell support patch by Kris Steinhoff (#1483960) 
    99- Enable spellchecker for HTML editor (#1485114) 
     10- Respect spellcheck_uri in tinyMCE spellchecker (#1484196) 
    1011 
    11122008/08/09 (alec) 
  • trunk/roundcubemail/program/js/tiny_mce/plugins/spellchecker/classes/GoogleSpell.php

    r1651 r1652  
    5454                $port = 443; 
    5555                $path = "/tbproxy/spell?lang=" . $lang . "&hl=en"; 
    56                 $host = "www.google.com"; 
    57                 $url = "https://" . $server; 
     56                $ssl = true; 
     57                 
     58                // spell check uri is configured (added by RoundCube) 
     59                if (!empty($this->_config['rpc_uri'])) { 
     60                        $a_uri = parse_url($this->_config['rpc_uri']); 
     61                        $ssl = ($a_uri['scheme']=='https' || $a_uri['scheme']=='ssl'); 
     62                        $port = $a_uri['port'] ? $a_uri['port'] : ($ssl ? 443 : 80); 
     63                        $server = $a_uri['host']; 
     64                        $path = $a_uri['path'] . ($a_uri['query'] ? '?'.$a_uri['query'] : '') . $lang; 
     65                } 
    5866 
    5967                // Setup XML request 
     
    7583                        // Use curl 
    7684                        $ch = curl_init(); 
    77                         curl_setopt($ch, CURLOPT_URL,$url); 
     85                        curl_setopt($ch, CURLOPT_URL, ($ssl ? "https://" : "http://") . $server); 
    7886                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    7987                        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header); 
     
    8391                } else { 
    8492                        // Use raw sockets 
    85                         $fp = fsockopen("ssl://" . $server, $port, $errno, $errstr, 30); 
     93                        $fp = fsockopen(($ssl ? "ssl://" : "") . $server, $port, $errno, $errstr, 30); 
    8694                        if ($fp) { 
    8795                                // Send request 
  • trunk/roundcubemail/program/js/tiny_mce/plugins/spellchecker/config.php

    r1651 r1652  
    88        $rcmail_config = new rcube_config(); 
    99        $config['general.engine'] = $rcmail_config->get('spellcheck_engine') == 'pspell' ? 'PSpell' : 'GoogleSpell'; 
     10        $config['GoogleSpell.rpc_uri'] = $rcmail_config->get('spellcheck_uri'); 
    1011         
    1112        /** end RoundCube specific code */ 
Note: See TracChangeset for help on using the changeset viewer.