ddceb3083930ca51e0704fb091f96301d7ebbee6
[atutor.git] / mods / wiki / plugins / mpi / mpi+moin.php
1 <?php
2
3 /*
4    MoinMoin-syntax for plugin activation also interfers with linking
5    sometimes, so you should enable this plugin only if you really
6    need it. As it is internally rewritten to mpi markup, you can use
7    all available plugins, but the ones expecting long arguments.
8
9      [[PluginName()][]  - does never work without ()
10      [[Plugin(arg1=val1, arg2=val2)]]
11 */
12
13
14 $ewiki_plugins["format_source"][] = "ewiki_mpi_moin_syntax";
15
16 function ewiki_mpi_moin_syntax(&$src) {
17    $src = preg_replace(
18      '/\[\[(\w+)\([^)]*\)([^\(\)\[\]]+)*\]\]/imse',
19      '"<?plugin $1 " .
20       stripslashes("$2")
21       ($3 ? stripslashes(" $3 ") : "") .
22       " ?>"     
23      ', $src
24    );
25 }
26
27
28 ?>