DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:searchform

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:searchform [2014-06-19 23:58] Klap-inplugin:searchform [2024-02-08 08:34] (current) – old revision restored (2024-02-08 07:16) date correct, commit log was copy paste error 2a02:a44a:3b00:1:41c4:9e04:ded6:a58b
Line 1: Line 1:
-====== searchform plugin ======+====== searchform Plugin ======
  
 ---- plugin ---- ---- plugin ----
-description: Adds the standard search form to any page +description: Adds the search form to any page. Namespace configurable. 
-author     : Adolfo González Blázquez +author     : Gerrit Uitslag (original author: Adolfo González Blázquez) 
-email      : code@infinicode.org+email      : klapinklapin@gmail.com
 type       : syntax type       : syntax
-lastupdate : 2008-10-10 +lastupdate : 2024-02-08 
-compatible : 2008-05-05+compatible : Greebo, Hogfather, Igor, Jack Jackrum, Kaos
 depends    :  depends    : 
 conflicts  conflicts 
 similar    :  similar    : 
-tags       : search, form, include +tags       : search, form 
-downloadurl: http://www.infinicode.org/code/dw/files/searchform-plugin-2008-10-10.tar.gz+downloadurl: https://github.com/Klap-in/dokuwiki-plugin-searchform/archive/master.zip 
 +sourcerepo : https://github.com/Klap-in/dokuwiki-plugin-searchform 
 +bugtracker : https://github.com/Klap-in/dokuwiki-plugin-searchform/issues
 ---- ----
  
-===== Download and Installation =====+===== Installation =====
  
-Download and install the plugin using the [[plugin:plugin|Plugin Manager]] using the following URL. Refer to [[:Plugins]] on how to install plugins manually.+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
-  * {{http://www.infinicode.org/code/dw/files/searchform-plugin-2008-10-10.tar.gz|searchform-plugin-2008-10-10.tar.gz}} FIXME+===== Syntax =====
  
-You can also get the svn version using this command+To include a searchform in any page you add the syntax
-  * ''svn co http://svn.infinicode.org/dw/trunk/searchform/'' FIXME+<code> 
 +{searchform
 +</code>
  
-To install ither extract the downloaded zip file manually into ''./lib/plugins/'' or use the provided Download URL with the [[plugin]] manager.+It will show a search box that searches default in the namespace where that page is. 
 + 
 +To perform searches in other namespaces you add the option ''ns=<your:namespace>'' or ''-ns=<namespace:skipped>'' 
 +<code> 
 +{searchform ns=wiki} 
 +{searchform ns=} 
 +{searchform ns=other:namespace} 
 +{searchform -ns=exclude:namespace} 
 +</code> 
 +These boxes searches respectively in ''wiki:'', all namespaces or in the subnamespace ''other:namespace''The last one does //not// search in ''exclude:namespace''.
  
-===== Syntax ===== 
  
-To use this plugin, just add ''{searchform}'' to any page you want.+=====Layout===== 
 +This plugin reuses the layout of the quick search field at the top of the page. For the default 'dokuwikitemplate this works fine. Maybe that other templates need some improvements.
  
-===== More information =====+===Last commits=== 
 +{{rss>https://github.com/Klap-in/dokuwiki-plugin-searchform/commits/master.atom date 5}}
  
-You can get more information on the plugin's website: [[http://www.infinicode.org/code/dw/]] FIXME 
  
 ===== Development ===== ===== Development =====
-A fork is available at [[https://github.com/Klap-in/dokuwiki-plugin-searchform|GitHub]] ([[https://github.com/Klap-in/dokuwiki-plugin-searchform/archive/master.zip|zip-archive]]) by [[user>klap-in]]+This plugin is adopted by [[user>Klap-in]] in 2014.
  
 Changes: Changes:
-  * The searchform search always in the current namespace (config option via syntax not yet done)+  * The searchform searches default in the namespace of the page where it is included 
 +  * or searches the namespace given by syntax option ''ns=<your:namespace>''
   * Multiple searchforms at one page are possible   * Multiple searchforms at one page are possible
   * Reformatting and refactoring of the code   * Reformatting and refactoring of the code
  
-===== Source =====+Previous release by [[code@infinicode.org|Adolfo González Blázquez]], last updated at 2008-10-10:
  
-<file php lib/plugins/searchform/syntax.php> +  available as first commit [[https://github.com/Klap-in/dokuwiki-plugin-searchform/commit/201f22cfb41b619208bfc671971367b6208189b2|201f22cfb4]] of this fork
-<?php +
-/*+
- * Plugin Search Form: Inserts a search form in any page +
- *  +
- * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html) +
- * @author     Adolfo González Blázquez <code@infinicode.org> +
- */ +
-  +
-// must be run within Dokuwiki +
-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); +
-if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); +
-require_once(DOKU_PLUGIN.'syntax.php'); +
-  +
-/** +
- * All DokuWiki plugins to extend the parser/rendering mechanism +
- * need to inherit from this class +
- */ +
-class syntax_plugin_searchform extends DokuWiki_Syntax_Plugin { +
-  +
- function getInfo(){ +
- return array( +
- 'author' => 'Adolfo González Blázquez', +
- 'email'  => 'code@infinicode.org', +
- 'date'   => '2008-10-09', +
- 'name'   => 'Search Form Plugin', +
- 'desc'   => 'Inserts a search form in any page', +
- 'url'    => 'http://www.infinicode.org/code/dw/', +
- ); +
-    } +
-  +
-    function getType() { return 'substition';+
-    function getSort() { return 138; } +
-     +
-    function connectTo($mode) { +
- $this->Lexer->addSpecialPattern('\{searchform\}',$mode,'plugin_searchform'); +
-    } +
-     +
-    function handle($match, $state, $pos, &$handler) {   +
-    return array($match, $state, $pos); +
-    } +
-     +
-    function render($mode, &$renderer, $data) { +
-   +
-  global $lang; +
-   +
- if ($mode == 'xhtml') {+
  
- $renderer->doc .= '<div id="searchform_plugin">'."\n"; 
- $renderer->doc .= '<form action="'.wl().'" accept-charset="utf-8" class="search" id="dw__search"><div class="no">'."\n"; 
- $renderer->doc .= '<input type="hidden" name="do" value="search" />'."\n"; 
- $renderer->doc .= '<input type="text" '; 
- if($ACT == 'search') $renderer->doc .= 'value="'.htmlspecialchars($_REQUEST['id']).'" '; 
- if(!$autocomplete) $renderer->doc .= 'autocomplete="off" '; 
- $renderer->doc .= 'id="qsearch__in" accesskey="f" name="id" class="edit" title="[ALT+F]" />'."\n"; 
- $renderer->doc .= '<input type="submit" value="'.$lang['btn_search'].'" class="button" title="'.$lang['btn_search'].'" />'."\n"; 
- if($ajax) $renderer->doc .= '<div id="qsearch__out" class="ajax_qsearch JSpopup"></div>'."\n"; 
- $renderer->doc .= '</div></form>'."\n"; 
- $renderer->doc .= '</div>'."\n"; 
- return true; 
- } 
- return false; 
- } 
-} 
-?> 
-</file> 
plugin/searchform.1403215126.txt.gz · Last modified: 2014-06-19 23:58 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki