]> git.mjollnir.org Git - moodle.git/commitdiff
Changed the name of all filters to be consistent.
authormoodler <moodler>
Tue, 17 Feb 2004 05:22:26 +0000 (05:22 +0000)
committermoodler <moodler>
Tue, 17 Feb 2004 05:22:26 +0000 (05:22 +0000)
Removed texh filter

filter/censor/filter.php [moved from filter/censor/censor.php with 92% similarity]
filter/mediaplugin/filter.php [moved from filter/mediaplugin/mediaplugin.php with 91% similarity]
filter/multilang/filter.php [moved from filter/multilang/multilang.php with 92% similarity]
filter/tex/filter.php [moved from filter/tex/tex_filter.php with 90% similarity]
filter/texh/texh.php [deleted file]

similarity index 92%
rename from filter/censor/censor.php
rename to filter/censor/filter.php
index 0b79ef7c9777b65baf2e5e2e85722f842164b351..2d4705a07dad856a443d4d33b44c8881cf48d619 100644 (file)
@@ -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
 //
 //////////////////////////////////////////////////////////////
 
similarity index 91%
rename from filter/mediaplugin/mediaplugin.php
rename to filter/mediaplugin/filter.php
index b7d3dcbbc2ae4e39c5ec3a2d3df4e00305e0eac3..04726f2469ba92fb5c045bf1a26886dfa4f74845 100644 (file)
@@ -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
 //
 //////////////////////////////////////////////////////////////
 
similarity index 92%
rename from filter/multilang/multilang.php
rename to filter/multilang/filter.php
index b5cb3d44717e2be0ae6f92848df0def83ad4aa76..bf64f517f3b62e012ec1856304c675cea17459de 100644 (file)
 //                                                                       //\r
 ///////////////////////////////////////////////////////////////////////////\r
 //                                                                       //\r
+//  To activate this filter, add a line like this to your                //\r
+//  list of filters in your Filter configuration:                        //\r
+//                                                                       //\r
+//       filter/multilang/filter.php                                     //\r
+//                                                                       //\r
 // See README.txt for more information about this module                 //\r
 //                                                                       //\r
 ///////////////////////////////////////////////////////////////////////////\r
similarity index 90%
rename from filter/tex/tex_filter.php
rename to filter/tex/filter.php
index ed0c28e58025e9561c2d023a26f87ef7ba74f98a..f99a712f77bedf3d13b918c01a243f8c47aaa2f5 100644 (file)
 // NOTE: This Moodle text filter converts TeX expressions delimited
 // by either $$...$$ or by <tex...>...</tex> 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 (file)
index 771d8a2..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-<?php
-///////////////////////////////////////////////////////////////////////////
-//                                                                       //
-// NOTICE OF COPYRIGHT                                                   //
-//                                                                       //
-// TeXH - convert TeX code in <tex> 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, <TEX> gets converted to &lt;TEX&gt;
-//    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, '<tex') or stripos($text, '$$'))) {
-        return $text;
-    }
-
-    if (isadmin()) { error_reporting (E_ALL); }; //for debugging
-
-    // <TEX> some general TeX expression </TEX> 
-    preg_match_all('/<tex>(.+?)<\/tex>/is', $text, $matches);  
-    for ($i=0; $i<count($matches[0]); $i++) { 
-        $pipe = texh_pipe_cmd("hevea",$matches[1][$i]);  // take the content only (non-math TeX expected)
-        $text = str_replace( $matches[0][$i], $pipe, $text);
-    }
-
-    // $$ some MATHEMATICAL TeX expression $$
-    preg_match_all('/\$\$(.+?)\$\$/', $text, $matches);  
-    for ($i=0; $i<count($matches[0]); $i++) { 
-        $pipe = texh_pipe_cmd("hevea",$matches[0][$i]);  // take everything since the $$ is part of the TeX syntax for math
-        $text = str_replace( $matches[0][$i], $pipe, $text);
-    }
-
-    return $text; 
-
-}
-
-
-
-//  Various Notes and Possibilities for Developers only:    
-    
-//   Note to self:  the following did not work consistently:    
-//   $text = preg_replace('/\$\$(.*?)\$\$/', texh_pipe_cmd('hevea',"\\$0"), $text);
-//   whereas this seems to work consistently:
-//   $text = str_replace( $matches[0][$i], texh_pipe_cmd("hevea",$matches[0][$i]), $text);
-
-
-// TODO:
-//
-// - user-friendly guide to inputting TeX (at least enough for up to high school level math)
-// - caveat regarding square-roots and roots being converted to fractional exponents 
-// - integrate memaid http://memaid.sourceforge.net
-// - compile a list of useful shortcuts and shorthands worth doing here
-
-
-// future possibilities
-// $text = str_replace("my_marks", "my marks are ...%", $text);                   // insert SQL/php_function results here
-// $text = str_replace("my_uptime", "uptime: ". shell_exec("/usr/bin/uptime") , $text);  // a shortcut to a safe system call
-// $text = preg_replace("/vernier/", "Mr. Bruno Vernier" , $text);                // a shortcut expanded
-
-// Version 0.1  Jan 24,2004
-
-?>
-