3 * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
5 * @package MCManager.includes
7 * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
14 * @param $config Configuration name/value array.
16 function SpellChecker(&$config) {
17 $this->_config = $config;
21 * Simple loopback function everything that gets in will be send back.
23 * @param $args.. Arguments.
24 * @return {Array} Array of all input arguments.
26 function &loopback(/* args.. */) {
27 return func_get_args();
31 * Spellchecks an array of words.
33 * @param {String} $lang Language code like sv or en.
34 * @param {Array} $words Array of words to spellcheck.
35 * @return {Array} Array of misspelled words.
37 function &checkWords($lang, $words) {
42 * Returns suggestions of for a specific word.
44 * @param {String} $lang Language code like sv or en.
45 * @param {String} $word Specific word to get suggestions for.
46 * @return {Array} Array of suggestions for the specified word.
48 function &getSuggestions($lang, $word) {
53 * Throws an error message back to the user. This will stop all execution.
55 * @param {String} $str Message to send back to user.
57 function throwError($str) {
58 die('{"result":null,"id":null,"error":{"errstr":"' . addslashes($str) . '","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}');