function math_filter($courseid, $text) { global $TAGS; global $CFG; WF_initmathfilter(); return WF_filter_math($text, FALSE); }
function wiris_filter($courseid, $text) { WF_initappletfilter(); WF_initmathfilter(); // Perform transformations if necessary $text = WF_filter_fix($text); $text = WF_filter_applet($text); $text = WF_filter_math($text, FALSE); return $text; }
echo $TRANSLATION['Test 5: testing getting wiris cache']; ?> </h3> <?php preg_match("/(\\S{32}).png\"/", $imageCode, $md5); // Gets md5 code from <img> posted $wrscache = get_record("cache_filters", "filter", "wiris", "md5key", $md5[1]); // Finally, php search in database the same md5. If exists in database, it doesn't create the image, only it reloads the saved image. print $TRANSLATION['Raw text from database (parsed)'] . ': ' . $wrscache->rawtext . "<br>\n"; print "md5: " . $wrscache->md5key . "<br>\n"; print $TRANSLATION['Image'] . ": <img align='middle' src='./filter/wrs_showimage.php/" . $wrscache->md5key . ".png'>\n"; ?> <h3><?php echo $TRANSLATION['Test 6: testing creating image']; ?> </h3> <?php $mathml = "«math xmlns=¨http://www.w3.org/1998/Math/MathML¨»«mrow»«mn»" . rand(0, 9999) . "«/mn»«/mrow»«/math»"; // At first, we create random image (is very improbable that exists in wiris cache) print $TRANSLATION['Raw text'] . $mathml . "<br>\n"; $imageCode = WF_filter_math($mathml, TRUE); print $TRANSLATION['Image'] . $imageCode . "\n"; // WF_filter_math parses your text to right format. Then, checks its md5sum and creates the image. The md5sum is about mathml PARSED text. ?> </body> </html> <?php error_reporting($error_rep); ini_set("display_errors", $displ_err);