From: <var...@us...> - 2021-12-09 17:41:42
|
Revision: 10765 http://sourceforge.net/p/phpwiki/code/10765 Author: vargenau Date: 2021-12-09 17:41:41 +0000 (Thu, 09 Dec 2021) Log Message: ----------- SearchHighlight plugin: add noheader and hits arguments in Help page, test they are booleans Modified Paths: -------------- trunk/lib/plugin/SearchHighlight.php trunk/pgsrc/Help%2FSearchHighlightPlugin Modified: trunk/lib/plugin/SearchHighlight.php =================================================================== --- trunk/lib/plugin/SearchHighlight.php 2021-12-09 17:15:52 UTC (rev 10764) +++ trunk/lib/plugin/SearchHighlight.php 2021-12-09 17:41:41 UTC (rev 10765) @@ -46,11 +46,12 @@ function getDefaultArguments() { // s, engine and engine_url are picked from the request - return array('noheader' => false, //don't print the header - 'hits' => false, //print the list of lines with lines terms additionally - 's' => false, - 'case_exact' => false, //not yet supported - 'regex' => false, //not yet supported + return array( + 's' => '', // search term + 'noheader' => false, // don't print the header + 'hits' => false, // print the list of lines with lines terms additionally + 'case_exact' => false, // not yet supported + 'regex' => '', // not yet supported ); } @@ -72,6 +73,24 @@ } extract($args); + if (!is_bool($noheader)) { + if (($noheader == '0') || ($noheader == 'false')) { + $noheader = false; + } elseif (($noheader == '1') || ($noheader == 'true')) { + $noheader = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "noheader")); + } + } + if (!is_bool($hits)) { + if (($hits == '0') || ($hits == 'false')) { + $hits = false; + } elseif (($hits == '1') || ($hits == 'true')) { + $hits = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "hits")); + } + } if (!is_bool($case_exact)) { if (($case_exact == '0') || ($case_exact == 'false')) { $case_exact = false; Modified: trunk/pgsrc/Help%2FSearchHighlightPlugin =================================================================== --- trunk/pgsrc/Help%2FSearchHighlightPlugin 2021-12-09 17:15:52 UTC (rev 10764) +++ trunk/pgsrc/Help%2FSearchHighlightPlugin 2021-12-09 17:41:41 UTC (rev 10765) @@ -1,4 +1,4 @@ -Date: Tue, 23 Feb 2021 09:05:00 +0000 +Date: Thu, 9 Dec 2021 18:39:25 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.6.0) Content-Type: application/x-phpwiki; pagename=Help%2FSearchHighlightPlugin; @@ -10,8 +10,7 @@ which is only used internally. When someone is referred from a search engine like Google, Yahoo -or our own fulltextsearch, the terms the user searched for are highlighted. -See also [[http://wordpress.org/about/shots/1.2/plugins.png]]. +or our own FullTextSearch, the terms the user searched for are highlighted. == Arguments == @@ -23,15 +22,23 @@ |- | **s** | The search term -| //none// +| //empty// |- +| **noheader** +| Boolean. If true, header should be omitted. +| false +|- +| **hits** +| Boolean. If true, print the list of lines with lines terms additionally. +| false +|- | **case_exact** -| Boolean. If true, highlight only case exact searches. +| Boolean. If true, highlight only case exact searches. Not yet supported. | false |- | **regex** -| not yet supported -| false +| Not yet supported. +| //empty// |} <noinclude> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |