├── conf
├── default.php
└── metadata.php
├── lang
├── en
│ └── settings.php
├── nl
│ └── settings.php
├── eo
│ └── settings.php
└── fr
│ └── settings.php
├── plugin.info.txt
├── README
└── action.php
/conf/default.php:
--------------------------------------------------------------------------------
1 | (phrases always match raw wiki)';
5 | $lang['snippet_in_text'] = 'Display search result snippets from rendered text';
6 |
--------------------------------------------------------------------------------
/plugin.info.txt:
--------------------------------------------------------------------------------
1 | base searchtext
2 | author Todd Augsburger, Michael Hamann
3 | email todd@rollerorgans.com
4 | date 2012-06-29
5 | name searchtext plugin
6 | desc Searches pages rendered as text instead of raw wiki. Displays search result snippets from text.
7 | url https://www.dokuwiki.org/plugin:searchtext
8 |
--------------------------------------------------------------------------------
/lang/nl/settings.php:
--------------------------------------------------------------------------------
1 |
7 | */
8 | $lang['search_in_text'] = 'Zoek in gerenderde tekst
(zinnen worden altijd in wiki opmaak gezocht)';
9 | $lang['snippet_in_text'] = 'Toon resultaat snippers uit gerenderde tekst';
10 |
--------------------------------------------------------------------------------
/lang/eo/settings.php:
--------------------------------------------------------------------------------
1 |
7 | */
8 | $lang['search_in_text'] = 'Serĉi en pretigita teksto
(esprimoj ĉiam kongruas al kruda viki-teksto)';
9 | $lang['snippet_in_text'] = 'Montri serĉrezulajn pecetojn da pretigita teksto ';
10 |
--------------------------------------------------------------------------------
/lang/fr/settings.php:
--------------------------------------------------------------------------------
1 |
7 | */
8 | $lang['search_in_text'] = 'Rechercher dans le texte mis en page
(les phrases correspondent toujours au texte brut)';
9 | $lang['snippet_in_text'] = 'Afficher le resultat de recherche en texte mis en page.';
10 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | searchtext Plugin for DokuWiki
2 |
3 | Searches pages rendered as text instead of raw wiki. Displays search result snippets from text.
4 |
5 | All documentation for this plugin can be found at
6 | https://www.dokuwiki.org/plugin:searchtext
7 |
8 | If you install this plugin manually, make sure it is installed in
9 | lib/plugins/searchtext/ - if the folder is called different it
10 | will not work!
11 |
12 | Please refer to http://www.dokuwiki.org/plugins for additional info
13 | on how to install plugins in DokuWiki.
14 |
15 | ----
16 | Copyright (C) Todd Augsburger, Michael Hamann
17 |
18 | This program is free software; you can redistribute it and/or modify
19 | it under the terms of the GNU General Public License as published by
20 | the Free Software Foundation; version 2 of the License
21 |
22 | This program is distributed in the hope that it will be useful,
23 | but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | GNU General Public License for more details.
26 |
27 | See the COPYING file in your DokuWiki folder for details
28 |
--------------------------------------------------------------------------------
/action.php:
--------------------------------------------------------------------------------
1 |
6 | */
7 |
8 | if(!defined('DOKU_INC')) die();
9 |
10 | class action_plugin_searchtext extends DokuWiki_Action_Plugin {
11 | function register(&$controller) {
12 | $controller->register_hook('INDEXER_PAGE_ADD', 'BEFORE', $this, '_getSearch');
13 | $controller->register_hook('FULLTEXT_SNIPPET_CREATE', 'BEFORE', $this, '_getSnippet');
14 | $controller->register_hook('INDEXER_VERSION_GET', 'BEFORE', $this, '_indexerVersion');
15 | }
16 |
17 | function _indexerVersion(&$event, $param) {
18 | $event->data['plugin_searchtext'] = '1-' . $this->getConf('search_in_text');
19 | }
20 |
21 | function _getSearch(&$event, $param) {
22 | if($this->getConf('search_in_text')) {
23 | global $ID;
24 |
25 | $prevID = $ID;
26 | $ID = $event->data['page'];
27 | $event->data['body'] .= p_cached_output(wikiFN($event->data['page']),'text');
28 | $ID = $prevID;
29 | $event->preventDefault();
30 | }
31 | }
32 |
33 | function _getSnippet(&$event, $param) {
34 | if($this->getConf('snippet_in_text')) {
35 | global $ID;
36 |
37 | $prevID = $ID;
38 | $ID = $event->data['id'];
39 | $event->data['text'] = p_cached_output(wikiFN($event->data['id']),'text');
40 | $ID = $prevID;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------