xref: /plugin/searchindex/admin.php (revision dc6fce527b1d765982edfbc6e7d936d0bd88397c)
1*dc6fce52SAndreas Gohr<?php
2*dc6fce52SAndreas Gohrif(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../../').'/');
3*dc6fce52SAndreas Gohrif(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
4*dc6fce52SAndreas Gohrrequire_once(DOKU_PLUGIN.'admin.php');
5*dc6fce52SAndreas Gohr
6*dc6fce52SAndreas Gohr/**
7*dc6fce52SAndreas Gohr * All DokuWiki plugins to extend the admin function
8*dc6fce52SAndreas Gohr * need to inherit from this class
9*dc6fce52SAndreas Gohr */
10*dc6fce52SAndreas Gohrclass admin_plugin_searchindex extends DokuWiki_Admin_Plugin {
11*dc6fce52SAndreas Gohr 		var $cmd;
12*dc6fce52SAndreas Gohr
13*dc6fce52SAndreas Gohr    /**
14*dc6fce52SAndreas Gohr     * Constructor
15*dc6fce52SAndreas Gohr     */
16*dc6fce52SAndreas Gohr    function admin_plugin_searchindex(){
17*dc6fce52SAndreas Gohr        $this->setupLocale();
18*dc6fce52SAndreas Gohr    }
19*dc6fce52SAndreas Gohr
20*dc6fce52SAndreas Gohr    /**
21*dc6fce52SAndreas Gohr     * return some info
22*dc6fce52SAndreas Gohr     */
23*dc6fce52SAndreas Gohr    function getInfo(){
24*dc6fce52SAndreas Gohr        return array(
25*dc6fce52SAndreas Gohr            'author' => 'Andreas Gohr',
26*dc6fce52SAndreas Gohr            'email'  => 'andi@splitbrain.org',
27*dc6fce52SAndreas Gohr            'date'   => '2005-09-04',
28*dc6fce52SAndreas Gohr            'name'   => 'Searchindex Manager',
29*dc6fce52SAndreas Gohr            'desc'   => 'Allows to rebuild the fulltext search index',
30*dc6fce52SAndreas Gohr            'url'    => 'http://wiki.splitbrain.org/plugin:searchindex',
31*dc6fce52SAndreas Gohr        );
32*dc6fce52SAndreas Gohr    }
33*dc6fce52SAndreas Gohr
34*dc6fce52SAndreas Gohr    /**
35*dc6fce52SAndreas Gohr     * return sort order for position in admin menu
36*dc6fce52SAndreas Gohr     */
37*dc6fce52SAndreas Gohr    function getMenuSort() {
38*dc6fce52SAndreas Gohr        return 40;
39*dc6fce52SAndreas Gohr    }
40*dc6fce52SAndreas Gohr
41*dc6fce52SAndreas Gohr    /**
42*dc6fce52SAndreas Gohr     * handle user request
43*dc6fce52SAndreas Gohr     */
44*dc6fce52SAndreas Gohr    function handle() {
45*dc6fce52SAndreas Gohr    }
46*dc6fce52SAndreas Gohr
47*dc6fce52SAndreas Gohr    /**
48*dc6fce52SAndreas Gohr     * output appropriate html
49*dc6fce52SAndreas Gohr     */
50*dc6fce52SAndreas Gohr    function html() {
51*dc6fce52SAndreas Gohr        print $this->plugin_locale_xhtml('intro');
52*dc6fce52SAndreas Gohr
53*dc6fce52SAndreas Gohr        print '<fieldset class="pl_si_out">';
54*dc6fce52SAndreas Gohr
55*dc6fce52SAndreas Gohr        print '<button class="button" id="pl_si_gobtn" onclick="plugin_searchindex_go()">';
56*dc6fce52SAndreas Gohr        print 'Rebuild Index'; #FIXME localize
57*dc6fce52SAndreas Gohr        print '</button>';
58*dc6fce52SAndreas Gohr        print '<span id="pl_si_out"></span>';
59*dc6fce52SAndreas Gohr        print '<img src="'.DOKU_BASE.'lib/images/loading.gif" id="pl_si_throbber" />';
60*dc6fce52SAndreas Gohr
61*dc6fce52SAndreas Gohr        print '</fieldset>';
62*dc6fce52SAndreas Gohr
63*dc6fce52SAndreas Gohr    }
64*dc6fce52SAndreas Gohr
65*dc6fce52SAndreas Gohr
66*dc6fce52SAndreas Gohr}
67*dc6fce52SAndreas Gohr//Setup VIM: ex: et ts=4 enc=utf-8 :
68