MDL-42400 mod_wiki: data generator for wiki

This commit is contained in:
Marina Glancy
2013-10-26 14:00:27 +11:00
parent 7b22ba41b7
commit 20dff4b97e
3 changed files with 250 additions and 9 deletions
+6 -9
View File
@@ -21,6 +21,7 @@ class wiki_parser_proxy {
}
$type = strtolower($type);
self::$parsers[$type] = null; // Reset the current parser because it may have other options.
if(self::create_parser_instance($type)) {
return self::$parsers[$type]->parse($string, $options);
}
@@ -56,15 +57,11 @@ class wiki_parser_proxy {
private static function create_parser_instance($type) {
if(empty(self::$parsers[$type])) {
if(include(self::$basepath."markups/$type.php")) {
$class = strtolower($type)."_parser";
if(class_exists($class)) {
self::$parsers[$type] = new $class;
return true;
}
else {
return false;
}
include_once(self::$basepath."markups/$type.php");
$class = strtolower($type)."_parser";
if(class_exists($class)) {
self::$parsers[$type] = new $class;
return true;
}
else {
return false;