function placeholder_include($name, $params = [])
{
- $path = "$name.php";
+ $path = stream_resolve_include_path("$name.php");
if (!file_exists($path)) {
return '<strong class="warn"><em>'.$name.'</em> ontbreekt</strong>';
}
}
}
+ # keep either login or logout parts depending on user level
+ global $User;
+ $hideclass = empty($User) ? 'login' : 'logout';
+ $doc = preg_replace('{\s*<(p|li|span) class="'.$hideclass.'">.*?</\1>}s', '', $doc);
+
return preg_replace_callback(
- '< \[\[ ([^] ]+) ([^]]*) \]\] >x',
+ '{ (?<! <!--BLOCK: ) \[\[ ([^] ]+) ([^]]*) \]\] }x',
function ($sub) use ($blocks) {
list ($placeholder, $name, $params) = $sub;
if (isset($blocks[$name])) {