Skip to content
Permalink
Browse files

shortened new search configs

shorter names are more in line with what we already use, makes less
layout problems in the documentation and is easier to type when telling
people about it.
  • Loading branch information...
splitbrain committed Apr 11, 2018
1 parent 37c80e0 commit 13ce475d48f846c56b4bf52ae5fc6c1216dc8deb
@@ -156,8 +156,8 @@
$conf['xsendfile'] = 0; //Use X-Sendfile (1 = lighttpd, 2 = standard)
$conf['renderer_xhtml'] = 'xhtml'; //renderer to use for main page generation
$conf['readdircache'] = 0; //time cache in second for the readdir operation, 0 to deactivate.
$conf['search_limit_to_first_ns'] = 0; //Option to limit the search to the current X namespaces
$conf['search_default_fragment_behaviour'] = 'exact'; // Option to specify the default fragment search behavior
$conf['search_nslimit'] = 0; //limit the search to the current X namespaces
$conf['search_fragment'] = 'exact'; //specify the default fragment search behavior
/* Network Settings */
$conf['dnslookups'] = 1; //disable to disallow IP to hostname lookups
@@ -72,7 +72,7 @@ protected function execute()
}
/**
* Adjust the global query accordingly to the config search_limit_to_first_ns and search_default_fragment_behaviour
* Adjust the global query accordingly to the config search_nslimit and search_fragment
*
* This will only do something if the search didn't originate from the form on the searchpage itself
*/
@@ -88,16 +88,16 @@ protected function adjustGlobalQuery()
$parsedQuery = ft_queryParser($Indexer, $QUERY);
if (empty($parsedQuery['ns']) && empty($parsedQuery['notns'])) {
if ($conf['search_limit_to_first_ns'] > 0) {
if ($conf['search_nslimit'] > 0) {
if (getNS($ID) !== false) {
$nsParts = explode(':', getNS($ID));
$ns = implode(':', array_slice($nsParts, 0, $conf['search_limit_to_first_ns']));
$ns = implode(':', array_slice($nsParts, 0, $conf['search_nslimit']));
$QUERY .= " @$ns";
}
}
}
if ($conf['search_default_fragment_behaviour'] !== 'exact') {
if ($conf['search_fragment'] !== 'exact') {
if (empty(array_diff($parsedQuery['words'], $parsedQuery['and']))) {
if (strpos($QUERY, '*') === false) {
$queryParts = explode(' ', $QUERY);
@@ -117,10 +117,10 @@ protected function adjustGlobalQuery()
global $conf;
if ($conf['search_default_fragment_behaviour'] === 'starts_with') {
if ($conf['search_fragment'] === 'starts_with') {
return $part . '*';
}
if ($conf['search_default_fragment_behaviour'] === 'ends_with') {
if ($conf['search_fragment'] === 'ends_with') {
return '*' . $part;
}
@@ -178,12 +178,12 @@
$lang['renderer_xhtml'] = 'Renderer to use for main (xhtml) wiki output';
$lang['renderer__core'] = '%s (dokuwiki core)';
$lang['renderer__plugin'] = '%s (plugin)';
$lang['search_limit_to_first_ns'] = 'Limit the search to the current X namespaces. When a search is executed from a page within a deeper namespace, the first X namespaces will be added as filter';
$lang['search_default_fragment_behaviour'] = 'Specify the default fragment search behavior';
$lang['search_default_fragment_behaviour_o_exact'] = 'exact';
$lang['search_default_fragment_behaviour_o_starts_with'] = 'starts with';
$lang['search_default_fragment_behaviour_o_ends_with'] = 'ends with';
$lang['search_default_fragment_behaviour_o_contains'] = 'contains';
$lang['search_nslimit'] = 'Limit the search to the current X namespaces. When a search is executed from a page within a deeper namespace, the first X namespaces will be added as filter';
$lang['search_fragment'] = 'Specify the default fragment search behavior';
$lang['search_fragment_o_exact'] = 'exact';
$lang['search_fragment_o_starts_with'] = 'starts with';
$lang['search_fragment_o_ends_with'] = 'ends with';
$lang['search_fragment_o_contains'] = 'contains';
/* Network Options */
$lang['dnslookups'] = 'DokuWiki will lookup hostnames for remote IP addresses of users editing pages. If you have a slow or non working DNS server or don\'t want this feature, disable this option';
@@ -219,8 +219,8 @@
$meta['xsendfile'] = array('multichoice','_choices' => array(0,1,2,3),'_caution' => 'warning');
$meta['renderer_xhtml'] = array('renderer','_format' => 'xhtml','_choices' => array('xhtml'),'_caution' => 'warning');
$meta['readdircache'] = array('numeric');
$meta['search_limit_to_first_ns'] = array('numeric', '_min' => 0);
$meta['search_default_fragment_behaviour'] = array('multichoice','_choices' => array('exact', 'starts_with', 'ends_with', 'contains'),);
$meta['search_nslimit'] = array('numeric', '_min' => 0);
$meta['search_fragment'] = array('multichoice','_choices' => array('exact', 'starts_with', 'ends_with', 'contains'),);
$meta['_network'] = array('fieldset');
$meta['dnslookups'] = array('onoff');

0 comments on commit 13ce475

Please sign in to comment.
You can’t perform that action at this time.