2 rcs_id('$Id: InterWikiSearch.php,v 1.3 2003-02-23 20:10:48 dairiki Exp $');
4 Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
6 This file is part of PhpWiki.
8 PhpWiki is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 PhpWiki is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with PhpWiki; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 require_once('lib/PageType.php');
27 class WikiPlugin_InterWikiSearch
31 return _("InterWikiSearch");
34 function getDescription() {
35 return _("Perform searches on InterWiki sites listed in InterWikiMap.");
38 function getVersion() {
39 return preg_replace("/[Revision: $]/", '',
43 function getDefaultArguments() {
47 function run ($dbi, $argstr, $request) {
48 $args = $this->getArgs($argstr, $request);
51 return $this->disabled("Sorry, this plugin is currently out of order.");
53 return PageType($pagerevisionhandle,
54 $pagename = _('InterWikiMap'),
56 $overridePageType = 'searcableInterWikiMapPageType');
65 class searcableInterWikiMapPageType
66 extends interWikiMapPageType
68 function _arrayToTable ($array, &$request) {
69 $thead = HTML::thead();
70 $label[0] = _("Wiki Name");
71 $label[1] = _("Search");
72 $thead->pushContent(HTML::tr(HTML::td($label[0]),
73 HTML::td($label[1])));
75 $tbody = HTML::tbody();
76 $dbi = $request->getDbh();
78 foreach ($array as $moniker => $interurl) {
79 $monikertd = HTML::td(array('class' => 'interwiki-moniker'),
80 $dbi->isWikiPage($moniker)
84 $w = new WikiPluginLoader;
85 $p = $w->getPlugin('ExternalSearch');
86 $argstr = sprintf('url="%s"', addslashes($moniker));
87 $searchtd = HTML::td($p->run($dbi, $argstr, $request));
89 $tbody->pushContent(HTML::tr($monikertd, $searchtd));
92 $table = HTML::table();
93 $table->setAttr('class', 'interwiki-map');
94 $table->pushContent($thead);
95 $table->pushContent($tbody);
103 // $Log: not supported by cvs2svn $
104 // Revision 1.2 2003/02/22 20:49:56 dairiki
105 // Fixes for "Call-time pass by reference has been deprecated" errors.
107 // Revision 1.1 2003/01/31 22:56:21 carstenklapp
108 // New plugin which provides entry forms to search any site listed in the InterWikiMap.
111 // (c-file-style: "gnu")
116 // c-hanging-comment-ender-p: nil
117 // indent-tabs-mode: nil