From a751a4e56f6c519714c98836b2f1b87062fffec5 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 26 Aug 2003 18:44:09 +0000 Subject: [PATCH] Added a hook to the text formatting, so that if the library module is activated, then all Moodle text is parsed by it to have links added to words. --- lib/weblib.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/weblib.php b/lib/weblib.php index 056fc2dda4..b44f438f89 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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; } -- 2.39.5