register_hook('DOKUWIKI_STARTED', 'AFTER', $this, '_fixquery'); } /** * Put namespace into search */ function _fixquery(&$event, $param) { global $QUERY; global $ACT; if($ACT != 'search'){ $QUERY = ''; return; } if(trim($_REQUEST['namespace'])){ $QUERY .= ' @'.trim($_REQUEST['namespace']); } } function tpl_searchform() { global $QUERY; $searchnamespaces = explode("\n",$this->getConf('searchnamespaces')); foreach ($searchnamespaces as $ns) { list($namespace,$displayname) = explode("|",$ns); trim($namespace); trim($displayname); $namespaces[$namespace] = $displayname; } $cur_val = isset($_REQUEST['namespace']) ? $_REQUEST['namespace'] : ''; echo '
'; } }