- GPL2
http://meta.wikimedia.org/wiki/Extending_wiki_markup
*/
$wgExtensionFunctions[] = "wfSoci";
function wfSoci() {
global $wgParser;
$wgParser->setHook('lsoci', 'renderLSoci');
}
function renderLSoci($input, $argv, &$parser) {
$dir = '/foo/bar/';
$url_foo = 'http://www.foo.com/';
$output = '
';
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if (($file != '.') and ($file != '..') and (filetype($dir . $file) == 'dir')) {
$output .= '- ' . $file . '
';
}
}
closedir($dh);
}
}
return $output . '
';
}
?>