File: changes.txt

package info (click to toggle)
moodle 1.6.3-2%2Betch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 37,172 kB
  • ctags: 51,688
  • sloc: php: 231,916; sql: 5,631; xml: 2,688; sh: 1,185; perl: 638; makefile: 48; pascal: 36
file content (51 lines) | stat: -rw-r--r-- 2,005 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Add $CFG->aspellpath = '/path/to/aspell' to config.php

copy speller folder to /moodle/lib/

weblib.php
function use_html_editor($name="",$courseid=0) {

/// 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 malier@lsi.upc.es
/// 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 {
        if(!empty($CFG->aspellpath)) {
        //START LUDO
            echo "function clickHandler(editor, buttonId) {";
            echo "editor._textArea.value = editor.getHTML();";
            echo "var speller = new spellChecker( editor._textArea );";
            echo "speller.popUpUrl ='$CFG->wwwroot/lib/speller/spellchecker.html';";
            echo "speller.spellCheckScript = '$CFG->wwwroot/lib/speller/server-scripts/spellchecker.php?id=$courseid';";
            echo "speller._moogle_edit=1;";
            echo "speller._editor=editor;";
            echo "speller.openChecker();";
            //echo "    editor.setHTML(editor._textArea.value);";
            echo "}\n"  ;
            echo "var config = new HTMLArea.Config();\n";
            echo "config.registerButton(\"spell-check\",  \"spell-check\", \"".$CFG->wwwroot."/lib/speller/spell.gif\", false, clickHandler);";
            echo "config.toolbar.push([\"spell-check\"]);\n";
            echo "HTMLArea.replace('$name', config);\n";
        // FI LUDO */
        } else {
            echo "HTMLArea.replace('$name');\n";
        }
    }
    echo "</script>\n";
}