'!\.(All)?Recent(Changes|Uploads)$!',
'group' => '!\.Group(Print)?(Header|Footer|Attributes)$!',
'self' => str_replace('.', '\\.', "!^$pagename$!")));
## $FPLFormatOpt is a list of options associated with fmt=
## values. 'default' is used for any undefined values of fmt=.
SDVA($FPLFormatOpt, array(
'default' => array('fn' => 'FPLTemplate', 'fmt' => '#default'),
'bygroup' => array('fn' => 'FPLTemplate', 'template' => '#bygroup',
'class' => 'fplbygroup'),
'simple' => array('fn' => 'FPLTemplate', 'template' => '#simple',
'class' => 'fplsimple'),
'group' => array('fn' => 'FPLTemplate', 'template' => '#group',
'class' => 'fplgroup'),
'title' => array('fn' => 'FPLTemplate', 'template' => '#title',
'class' => 'fpltitle', 'order' => 'title'),
'count' => array('fn' => 'FPLCountA'),
));
SDV($SearchResultsFmt, "
\$[SearchFor]
\$MatchList
\$[SearchFound]
");
SDV($SearchQuery, str_replace('$', '$',
htmlspecialchars(stripmagic(@$_REQUEST['q']), ENT_NOQUOTES)));
XLSDV('en', array(
'SearchFor' => 'Results of search for $Needle:',
'SearchFound' =>
'$MatchCount pages found out of $MatchSearched pages searched.'));
SDV($PageListArgPattern, '((?:\\$:?)?\\w+)[:=]');
Markup('pagelist', 'directives',
'/\\(:pagelist(\\s+.*?)?:\\)/ei',
"FmtPageList('\$MatchList', \$pagename, array('o' => PSS('$1 ')))");
Markup('searchbox', 'directives',
'/\\(:searchbox(\\s.*?)?:\\)/e',
"SearchBox(\$pagename, ParseArgs(PSS('$1'), '$PageListArgPattern'))");
Markup('searchresults', 'directives',
'/\\(:searchresults(\\s+.*?)?:\\)/ei',
"FmtPageList(\$GLOBALS['SearchResultsFmt'], \$pagename,
array('req' => 1, 'request'=>1, 'o' => PSS('$1')))");
SDV($SaveAttrPatterns['/\\(:(searchresults|pagelist)(\\s+.*?)?:\\)/i'], ' ');
SDV($HandleActions['search'], 'HandleSearchA');
SDV($HandleAuth['search'], 'read');
SDV($ActionTitleFmt['search'], '| $[Search Results]');
SDVA($PageListFilters, array(
'PageListCache' => 80,
'PageListProtect' => 90,
'PageListSources' => 100,
'PageListPasswords' => 120,
'PageListIf' => 140,
'PageListTermsTargets' => 160,
'PageListVariables' => 180,
'PageListSort' => 900,
));
foreach(array('random', 'size', 'time', 'ctime') as $o)
SDV($PageListSortCmp[$o], "@(\$PCache[\$x]['$o']-\$PCache[\$y]['$o'])");
SDV($PageListSortCmp['title'],
'@strcasecmp($PCache[$x][\'=title\'], $PCache[$y][\'=title\'])');
define('PAGELIST_PRE' , 1);
define('PAGELIST_ITEM', 2);
define('PAGELIST_POST', 4);
## SearchBox generates the output of the (:searchbox:) markup.
## If $SearchBoxFmt is defined, that is used, otherwise a searchbox
## is generated. Options include group=, size=, label=.
function SearchBox($pagename, $opt) {
global $SearchBoxFmt, $SearchBoxOpt, $SearchQuery, $EnablePathInfo;
if (isset($SearchBoxFmt)) return Keep(FmtPageName($SearchBoxFmt, $pagename));
SDVA($SearchBoxOpt, array('size' => '40',
'label' => FmtPageName('$[Search]', $pagename),
'value' => str_replace("'", "'", $SearchQuery)));
$opt = array_merge((array)$SearchBoxOpt, @$_GET, (array)$opt);
$opt['action'] = 'search';
$target = (@$opt['target'])
? MakePageName($pagename, $opt['target']) : $pagename;
$opt['n'] = IsEnabled($EnablePathInfo, 0) ? '' : $target;
$out = FmtPageName(" class='wikisearch' action='\$PageUrl' method='get'>",
$target);
foreach($opt as $k => $v) {
if ($v == '' || is_array($v)) continue;
$v = str_replace("'", "'", $v);
$opt[$k] = $v;
if ($k == 'q' || $k == 'label' || $k == 'value' || $k == 'size') continue;
$k = str_replace("'", "'", $k);
$out .= "";
}
$out .= "";
return '