From 4da85078e98eba0662892076dc83c20643b106b6 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 17 Feb 2004 05:22:26 +0000 Subject: [PATCH] Changed the name of all filters to be consistent. Removed texh filter --- filter/censor/{censor.php => filter.php} | 4 +- .../{mediaplugin.php => filter.php} | 6 +- .../multilang/{multilang.php => filter.php} | 5 + filter/tex/{tex_filter.php => filter.php} | 12 +- filter/texh/texh.php | 131 ------------------ 5 files changed, 18 insertions(+), 140 deletions(-) rename filter/censor/{censor.php => filter.php} (92%) rename filter/mediaplugin/{mediaplugin.php => filter.php} (91%) rename filter/multilang/{multilang.php => filter.php} (92%) rename filter/tex/{tex_filter.php => filter.php} (90%) delete mode 100644 filter/texh/texh.php diff --git a/filter/censor/censor.php b/filter/censor/filter.php similarity index 92% rename from filter/censor/censor.php rename to filter/censor/filter.php index 0b79ef7c97..2d4705a07d 100644 --- a/filter/censor/censor.php +++ b/filter/censor/filter.php @@ -6,9 +6,9 @@ // printed text, replacing words with other words // // To activate this filter, add a line like this to your -// config.php: +// list of filters in your Filter configuration: // -// $CFG->textfilter1 = 'filter/censor/censor.php'; +// filter/censor/filter.php // ////////////////////////////////////////////////////////////// diff --git a/filter/mediaplugin/mediaplugin.php b/filter/mediaplugin/filter.php similarity index 91% rename from filter/mediaplugin/mediaplugin.php rename to filter/mediaplugin/filter.php index b7d3dcbbc2..04726f2469 100644 --- a/filter/mediaplugin/mediaplugin.php +++ b/filter/mediaplugin/filter.php @@ -5,10 +5,10 @@ // This filter will replace any links to a media file with // a media plugin that plays that media inline // -// To activate this filter, add his to your list of filters -// in Admin -> Configuration -> Variables +// To activate this filter, add a line like this to your +// list of filters in your Filter configuration: // -// filter/mediaplugin/mediaplugin.php'; +// filter/mediaplugin/filter.php // ////////////////////////////////////////////////////////////// diff --git a/filter/multilang/multilang.php b/filter/multilang/filter.php similarity index 92% rename from filter/multilang/multilang.php rename to filter/multilang/filter.php index b5cb3d4471..bf64f517f3 100644 --- a/filter/multilang/multilang.php +++ b/filter/multilang/filter.php @@ -22,6 +22,11 @@ // // /////////////////////////////////////////////////////////////////////////// // // +// To activate this filter, add a line like this to your // +// list of filters in your Filter configuration: // +// // +// filter/multilang/filter.php // +// // // See README.txt for more information about this module // // // /////////////////////////////////////////////////////////////////////////// diff --git a/filter/tex/tex_filter.php b/filter/tex/filter.php similarity index 90% rename from filter/tex/tex_filter.php rename to filter/tex/filter.php index ed0c28e580..f99a712f77 100644 --- a/filter/tex/tex_filter.php +++ b/filter/tex/filter.php @@ -24,13 +24,17 @@ // NOTE: This Moodle text filter converts TeX expressions delimited // by either $$...$$ or by ... tags to gif images using // mimetex.cgi obtained from http://www.forkosh.com/mimetex.html authored by -// John Forkosh john@forkosh.com. The mimetex.cgi ELF binary compiled for Linux i386 -// is included with this distribution. +// John Forkosh john@forkosh.com. Several binaries of this areincluded with +// this distribution. // Note that there may be patent restrictions on the production of gif images // in Canada and some parts of Western Europe and Japan until July 2004. //------------------------------------------------------------------------- -// You will then need to edit your moodle/config.php to invoke tex_filter.php -//------------------------------------------------------------------------- +///////////////////////////////////////////////////////////////////////////// +// To activate this filter, add a line like this to your // +// list of filters in your Filter configuration: // +// // +// filter/tex/filter.php // +///////////////////////////////////////////////////////////////////////////// $CFG->texfilterdir = "filter/tex"; diff --git a/filter/texh/texh.php b/filter/texh/texh.php deleted file mode 100644 index 771d8a2cff..0000000000 --- a/filter/texh/texh.php +++ /dev/null @@ -1,131 +0,0 @@ - tags into images, using HeVeA // -// // -// Copyright (C) 2001-2003 Bruno Vernier bruno@vsbeducation.ca // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details: // -// // -// http://www.gnu.org/copyleft/gpl.html // -// // -/////////////////////////////////////////////////////////////////////////// - -//------------------------------------------------------------------------- -// -// README PREREQUISITES: -// -// 1: install HeVeA on your server http://pauillac.inria.fr/~maranget/hevea/ -// (debian and rpm available) (it is a TeX to HTML/MathML filter) -// -// 2: must include this file "texh.php" in the filters in config.php -// -// 3: must include TEX in the legal tags list in lib/weblib.php -// CAVEAT: if above not yet done, gets converted to <TEX> -// and can only be fixed by editing in HTML conversion mode -// -// 4: if you are using Windows then the hevea.bat file that comes with the -// windows distribution needs to have the line -// if "%1"=="" goto syn -// removed. -// -//------------------------------------------------------------------------- - -/// These lines are important - the variable must match the name -/// of the actual function below - - $textfilter_function='texh_filter'; - - if (function_exists($textfilter_function)) { - return; - } - - -function texh_pipe_cmd($cmd, $text) { - // general function for external system calls to $cmd, piping in $text, retrieving output - // taken mostly from a php tutorial on php.net website (modified slightly) - $spec = array( - 0 => array("pipe", "r"), // stdin - 1 => array("pipe", "w"), // stdout - ); - $process = proc_open($cmd , $spec, $pipes); - $output=""; - if (is_resource($process)) { - fwrite($pipes[0], $text); - fclose($pipes[0]); - while (!feof($pipes[1])) { - $buffer = fgets($pipes[1], 1024); - $output .= $buffer; - } - fclose($pipes[1]); - proc_close($process); - } - return $output; -} - -function texh_filter ($courseid, $text) { - // TeX conversion with $$ tex code $$ - // written by Bruno Vernier (c) 2004 GPL - - /// Do a quick check using stripos to avoid unnecessary work - if (!(stripos($text, ' some general TeX expression - preg_match_all('/(.+?)<\/tex>/is', $text, $matches); - for ($i=0; $i - -- 2.39.5