with Turck MMCache.
Filter function must now have a particular name
eg resource_filter
where "resource" is the name of the directory that filter.php is in.
//It's based in the glosssary filter by Williams Castillo
//Modifications by stronk7.
- $textfilter_function='activitynames_filter';
-
- if (function_exists($textfilter_function)) {
- return;
- }
-
function activitynames_filter($courseid, $text) {
global $CFG;
$CFG->algebrafilterdirwin = "filter\\algebra";
}
-
-
-/// These lines are important - the variable must match the name
-/// of the actual function below
- $textfilter_function='algebra_filter';
-
- if (function_exists($textfilter_function)) {
- return;
- }
-
-
function string_file_picture_algebra($imagefile, $tex= "", $height="", $width="") {
// Given the path to a picture file in a course, or a URL,
// this function includes the picture in the page.
return $text;
}
-?>
\ No newline at end of file
+?>
//
//////////////////////////////////////////////////////////////
-/// These lines are important - the variable must match the name
-/// of the actual function below
-
- $textfilter_function = 'censor_filter';
-
- if (function_exists($textfilter_function)) {
- return;
- }
-
-
/// This is the filtering function itself. It accepts the
/// courseid and the text to be filtered (in HTML form).
//
//////////////////////////////////////////////////////////////
-/// These lines are important - the variable must match the name
-/// of the actual function below
-
- $textfilter_function = 'mediaplugin_filter';
-
- if (function_exists($textfilter_function)) {
- return;
- }
-
-
/// This is the filtering function itself. It accepts the
/// courseid and the text to be filtered (in HTML form).
// //\r
///////////////////////////////////////////////////////////////////////////\r
\r
-/// These lines are important - the variable must match the name \r
-/// of the actual function below\r
-\r
-$textfilter_function = 'multilang_filter';\r
-\r
-if (function_exists($textfilter_function)) {\r
- return;\r
-}\r
-\r
\r
/// Given XML multilinguage text, return relevant text according to\r
/// current language. i.e.=\r
$CFG->texfilterdir = "filter/tex";
-/// These lines are important - the variable must match the name
-/// of the actual function below
-$textfilter_function='tex_filter';
-
-if (function_exists($textfilter_function)) {
- return;
-}
-
function string_file_picture_tex($imagefile, $tex= "", $height="", $width="") {
// Given the path to a picture file in a course, or a URL,
$textfilters = explode(',', $CFG->textfilters);
foreach ($textfilters as $textfilter) {
if (is_readable("$CFG->dirroot/$textfilter/filter.php")) {
- include("$CFG->dirroot/$textfilter/filter.php");
- $text = $textfilter_function($courseid, $text);
+ include_once("$CFG->dirroot/$textfilter/filter.php");
+ $functionname = basename($textfilter).'_filter';
+ if (function_exists($functionname)) {
+ $text = $functionname($courseid, $text);
+ }
}
}
}
<?PHP // $Id$
- $textfilter_function = 'glossary_dynamic_link';
-
- if (function_exists($textfilter_function)) {
- return;
- }
-
- function glossary_dynamic_link($courseid, $text) {
+ function glossary_filter($courseid, $text) {
global $CFG;
if (empty($courseid)) {
//It's based in the glosssary filter by Williams Castillo
//Modifications by stronk7. Enjoy! :-)
- $textfilter_function='resource_names_filter';
-
- if (function_exists($textfilter_function)) {
- return;
- }
-
- function resource_names_filter($courseid, $text) {
+ function resource_filter($courseid, $text) {
global $CFG;
\r
require_once($CFG->dirroot.'/mod/wiki/lib.php');\r
\r
- $textfilter_function='wiki_page_filter';\r
-\r
- if (function_exists($textfilter_function)) {\r
- return;\r
- }\r
-\r
- function wiki_page_filter($courseid, $text) {\r
+ function wiki_filter($courseid, $text) {\r
\r
global $CFG;\r
\r