changed git call from https to git readonly
[atutor.git] / mods / wiki / plugins / mpi / mpi+cdml.php
1 <?php
2
3 /*
4    This plugin adds the "CDML"-Syntax (as found in ProWiki) to the
5    mpi framework - you must load mpi.php also to make this work! Then
6    you could write
7
8      [[PluginName][arg1=val1][arg2=...]
9       ... more text here
10      ]
11
12    instead of the regular mpi <?plugin PluginName ... ?> syntax.
13 */
14
15
16 $ewiki_plugins["format_source"][] = "ewiki_mpi_cdml_syntax";
17
18 function ewiki_mpi_cdml_syntax(&$src) {
19    $src = preg_replace(
20      '/\[\[(\w+)\]([^\[\]]*)(\[\w+=[^\]]+?\])*([^\]]+)\]/imse',
21      '"<?plugin " . "$1" .
22       ($2 ? stripslashes(" $2 ") : "") .
23       ($3 ? strtr(stripslashes("$3"), "[]", "  ") : "") .
24       ($4 ? stripslashes(" $4") : "") .
25       " ?>"     
26      ', $src
27    );
28 }
29
30
31 ?>