| | |
| | | <?php
|
| | |
|
| | | /* *
|
| | | * Tiny Spelling Interface for TinyMCE Spell Checking.
|
| | | *
|
| | |
| | |
|
| | | class TinyGoogleSpell {
|
| | | var $lang;
|
| | | var $spellurl;
|
| | |
|
| | | function TinyGoogleSpell(&$config, $lang, $mode, $spelling, $jargon, $encoding) {
|
| | | $this->lang = $lang;
|
| | | $this->spellurl = $config['googlespell.url'];
|
| | | }
|
| | |
|
| | | // Returns array with bad words or false if failed.
|
| | |
| | | }
|
| | |
|
| | | function _getMatches($word_list) {
|
| | | $server = "www.google.com";
|
| | | $port = 443;
|
| | | $path = "/tbproxy/spell?lang=" . $this->lang . "&hl=en";
|
| | | $host = "www.google.com";
|
| | | $url = "https://" . $server;
|
| | | $url = $this->spellurl . "&" . $this->lang;
|
| | |
|
| | | $path = preg_replace("/^https?:\/\//i", "", $url);
|
| | |
|
| | | // Setup XML request
|
| | | $xml = '<?xml version="1.0" encoding="utf-8" ?><spellrequest textalreadyclipped="0" ignoredups="0" ignoredigits="1" ignoreallcaps="1"><text>' . $word_list . '</text></spellrequest>';
|
| | |
| | |
|
| | | // Setup classname, should be the same as the name of the spellchecker class
|
| | | $spellCheckerConfig['class'] = "TinyGoogleSpell";
|
| | |
|
| | | ?>
|