Hello,
here is the new version of the spell checker patch.
Setup instructions: now the directory "speller" must be copied into the "lib" subdirectory.
The file weblib.php must be copied into the "lib" directory.
The config.php file provided shows the usage of three new configuration atributes used to set up the speller feature:
// This setting will activate the Spell checking utility for the HTML Editor
# TODO: Change the aspellpath variable to point to the aspell executable file
# in your system
# is VERY IMPORTANT that you leave the double cuotes insithe the simple ones
# like this $aspellpath = '"c:\usr\Aspell\bin\aspell.exe"';
$CFG->aspellpath='"c:\usr\Aspell\bin\aspell.exe"';
// now add the codes of the language dictionaries that are installed
// to the CFG->aspell_langs array example
// $CFG->aspell_langs= array("en", "es", "ca"); to work with english, spanish
// and catalan dictionaries
$CFG->aspell_langs= array("en", "es", "ca");
$CFG->aspell_default_lang = "en"; // if the current language does not match
// any of the installed then aspell_default_lang will be used
// if is undefined "en" language will be used instead
So that's it good luck,
Marc
ps.Note for code lovers :
A few ninor changes have been added to the file weblib.php. The main change is that now the speller specific code is placed in a function in the speller/lib.php file so the code in weblib.php is cleaner.
function use_html_editor($name="") {
/// Sets up the HTML editor on textareas in the current page.
/// If a field name is provided, then it will only be
/// applied to that field - otherwise it will be used
/// on every textarea in the page.
///
/// In most cases no arguments need to be supplied// Modification by Ludo ( Marc Alier to provide Spell Checking to the
// html editor. August 2004 <font face="courier new,courier,monospace" size="2">malier@lsi.upc.esfont>
/// START LUDO
global $CFG;
if(!empty($CFG->aspellpath)) {
echo "<script src=\"".$CFG->wwwroot."/lib/speller/spellChecker.js\"></script>";
}
/// END LUDO
echo "<script language=\"javascript\" type=\"text/javascript\" defer=\"1\">\n";
if (empty($name)) {
echo "HTMLArea.replaceAll();\n";
} else {//START LUDO
echo "var config = new HTMLArea.Config();\n"; // object used to
// store configuation modifications
if(!empty($CFG->aspellpath)) {
speller_print_add_speller_button();
}
echo "HTMLArea.replace('$name', config);\n";
// END LUDO */// ORIGINAL echo "HTMLArea.replace('$name');\n";
}
echo "</script>\n";
}If somebody wants to add another modification on the HTMLeditor configuration
can modify this function and the variable "config" before tha HTMLarea.replace method is called.