properties', "/{\\$(?i:property)\\s+(\\w+)\\s*}/e", "GetProperty('$1')"); $Conditions['property'] = "ExprProperty(\$pagename, \$condparm)"; $Conditions['propertyset'] = "ExprPropertySet(\$pagename, \$condparm)"; function SetProperties($args) { global $Properties; $opt = ParseArgs($args); unset($opt['#'], $opt['+']); foreach($opt as $n => $v) if($n == '-') foreach($opt[$n] as $r) unset($GLOBALS[$Properties][$r]); else $GLOBALS[$Properties][$n] = $v; } function GetProperty($n) { global $Properties; return isset($GLOBALS[$Properties][$n]) ? $GLOBALS[$Properties][$n] : ''; } function ExprProperty($pagename, $condparm) { global $Properties; return preg_match('/\\s*(\\w+)\\s+("[^"]*"|\'[^\']*\'|\\S+)\\s*$/', $condparm, $m) ? (GetProperty($m[1]) == $m[2]) : false; } function ExprPropertySet($pagename, $condparm) { global $Properties; preg_match('/\\s*(\\w+)\\s*$/', $condparm, $m); $p = $m[1]; return isset($GLOBALS[$Properties][$p]); }