Exemple #1
0
    public static function parse(&$string, $type, $options = array()) {

        if(empty(self::$basepath)) {
            global $CFG;
            self::$basepath = $CFG->dirroot.'/mod/wiki/parser/';
        }

        $type = strtolower($type);
        if(self::create_parser_instance($type)) {
            return self::$parsers[$type]->parse($string, $options);
        }
        else {
            return false;
        }
    }
Exemple #2
0
 public static function parse(&$string, $type, $options = array())
 {
     if (empty(self::$basepath)) {
         global $CFG;
         self::$basepath = $CFG->dirroot . '/mod/wiki/parser/';
     }
     $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);
     } else {
         return false;
     }
 }