xref: /plugin/elasticsearch/helper/form.php (revision 80f56a95b9dd8548ac1141c2745d060cad3f2594)
1<?php
2/**
3 * DokuWiki Plugin elasticsearch (Helper Component)
4 *
5 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6 * @author  Andreas Gohr <gohr@cosmocode.de>
7 */
8
9// must be run within Dokuwiki
10if(!defined('DOKU_INC')) die();
11
12class helper_plugin_elasticsearch_form extends DokuWiki_Plugin {
13
14    /**
15     * Replacement for the standard search form
16     *
17     * @return bool always true
18     */
19    public function tpl() {
20        global $lang;
21        global $ACT;
22        global $QUERY;
23
24        print '<form action="' . wl() . '" accept-charset="utf-8" class="search" id="dw__search" method="get" role="search"><div class="no">';
25        print '<input type="hidden" name="do" value="elasticsearch" />';
26        print '<input type="text" ';
27        if($ACT == 'elasticsearch') print 'value="' . htmlspecialchars($QUERY) . '" ';
28        print 'accesskey="f" name="id" class="edit" title="[F]" />';
29        print '<input type="submit" value="' . $lang['btn_search'] . '" class="button" title="' . $lang['btn_search'] . '" />';
30        print '</div></form>';
31        return true;
32    }
33}