| 1 |
<?php
|
| 2 |
|
| 3 |
//
|
| 4 |
// Copyright (c) 2006 by Sören Petersen
|
| 5 |
//
|
| 6 |
// $Id$
|
| 7 |
//
|
| 8 |
|
| 9 |
// Include my hack version of the MediaWiki parser
|
| 10 |
require_once("mw_parser.inc");
|
| 11 |
|
| 12 |
function liquid_filters_help($section ='') {
|
| 13 |
$output = '';
|
| 14 |
|
| 15 |
switch($section) {
|
| 16 |
case 'admin/modules#description':
|
| 17 |
$output = t('Filter package for the Liquid Wiki Engine.');
|
| 18 |
break;
|
| 19 |
case 'admin/help#liquid_filters':
|
| 20 |
$output = t('Filter package for the Liquid Wiki Engine.');
|
| 21 |
break;
|
| 22 |
}
|
| 23 |
|
| 24 |
return $output;
|
| 25 |
}
|
| 26 |
|
| 27 |
function liquid_filters_filter($op, $delta = 0, $format = -1, $text = '') {
|
| 28 |
switch ($op) {
|
| 29 |
case 'list':
|
| 30 |
$filters = array();
|
| 31 |
$filters[] = t('Liquid MediaWiki Filter (Liquid implementation)');
|
| 32 |
|
| 33 |
return $filters;
|
| 34 |
|
| 35 |
case 'description':
|
| 36 |
$desc = array();
|
| 37 |
$desc[] = t('An implementation of the MediaWiki parser that suports a nearly the full subset of the '.
|
| 38 |
'MediaWiki markup. This parser is a hack and could contain bugs.');
|
| 39 |
|
| 40 |
return $desc[$delta];
|
| 41 |
|
| 42 |
case 'prepare':
|
| 43 |
return $text;
|
| 44 |
|
| 45 |
case 'process':
|
| 46 |
switch ($delta) {
|
| 47 |
case 0:
|
| 48 |
$parser = new mw_parser();
|
| 49 |
$text = $parser->parse($text);
|
| 50 |
return '<div class="wiki-content">'.$text.'</div>';
|
| 51 |
|
| 52 |
default:
|
| 53 |
return $text;
|
| 54 |
}
|
| 55 |
|
| 56 |
case 'no cache':
|
| 57 |
return true;
|
| 58 |
|
| 59 |
default:
|
| 60 |
return $text;
|
| 61 |
}
|
| 62 |
}
|
| 63 |
|
| 64 |
?>
|