3 * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
\r
6 * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
\r
13 * @param $config Configuration name/value array.
\r
15 function SpellChecker(&$config) {
\r
16 $this->_config = $config;
\r
20 * Simple loopback function everything that gets in will be send back.
\r
22 * @param $args.. Arguments.
\r
23 * @return {Array} Array of all input arguments.
\r
25 function &loopback(/* args.. */) {
\r
26 return func_get_args();
\r
30 * Spellchecks an array of words.
\r
32 * @param {String} $lang Language code like sv or en.
\r
33 * @param {Array} $words Array of words to spellcheck.
\r
34 * @return {Array} Array of misspelled words.
\r
36 function &checkWords($lang, $words) {
\r
41 * Returns suggestions of for a specific word.
\r
43 * @param {String} $lang Language code like sv or en.
\r
44 * @param {String} $word Specific word to get suggestions for.
\r
45 * @return {Array} Array of suggestions for the specified word.
\r
47 function &getSuggestions($lang, $word) {
\r
52 * Throws an error message back to the user. This will stop all execution.
\r
54 * @param {String} $str Message to send back to user.
\r
56 function throwError($str) {
\r
57 die('{"result":null,"id":null,"error":{"errstr":"' . addslashes($str) . '","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}');
\r