]> git.mjollnir.org Git - moodle.git/commitdiff
Added a hook to the text formatting, so that if the library module
authormoodler <moodler>
Tue, 26 Aug 2003 18:44:09 +0000 (18:44 +0000)
committermoodler <moodler>
Tue, 26 Aug 2003 18:44:09 +0000 (18:44 +0000)
is activated, then all Moodle text is parsed by it to have links
added to words.

lib/weblib.php

index 056fc2dda47d50e7daa941d179999a338953d9f6..b44f438f893f4f0e29c472ab07dab26fae072525 100644 (file)
@@ -458,6 +458,8 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL) {
 /// $text is raw text (originally from a user)
 /// $format is one of the format constants, defined above
 
+    global $CFG;
+
     switch ($format) {
         case FORMAT_HTML:
             replace_smilies($text);
@@ -483,6 +485,12 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL) {
             if (!isset($options->para)) {
                 $options->para=true;
             }
+            if (!empty($CFG->librarypath)) {
+                if (file_exists("$CFG->dirroot/$CFG->librarypath/librarylib.php")) {
+                    include_once("$CFG->dirroot/$CFG->librarypath/librarylib.php");
+                    $text = librarytexttohtml($text);
+                }
+            }
             return text_to_html($text, $options->smiley, $options->para);
             break;
     }