4 Copyright 1999, 2000, 2001, 2002, 2004 $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
24 * This is a replacement for MagicPhpWikiURL forms.
25 * Just a few old actions are supported, which where previously
26 * encoded with the phpwiki: syntax.
28 * See WikiFormMore for the more generic version.
30 class WikiPlugin_WikiForm
37 function getVersion() {
38 return preg_replace("/[Revision: $]/", '',
42 function getDefaultArguments() {
43 return array('action' => 'upload', // 'upload', 'loadfile', or
46 'buttontext' => false,
52 function run($dbi, $argstr, &$request, $basepage) {
53 extract($this->getArgs($argstr, $request));
54 $form = HTML::form(array('action' => $request->getPostURL(),
56 'class' => 'wikiadmin',
57 'accept-charset' => $GLOBALS['charset']),
58 HiddenInputs(array('action' => $action,
59 'pagename' => $basepage)));
60 $input = array('type' => 'text',
66 $input['name'] = 'source';
68 $input['value'] = DEFAULT_DUMP_DIR;
70 $buttontext = _("Load File");
74 $input['name'] = 'source';
76 $buttontext = _("Login");
80 $input['name'] = 'directory';
82 $input['value'] = DEFAULT_DUMP_DIR;
84 $buttontext = _("Dump Pages");
88 $input['name'] = 'directory';
90 $input['value'] = HTML_DUMP_DIR;
92 $buttontext = _("Dump Pages as XHTML");
96 $form->setAttr('enctype', 'multipart/form-data');
97 $form->pushContent(HTML::input(array('name' => 'MAX_FILE_SIZE',
98 'value' => MAX_UPLOAD_SIZE,
99 'type' => 'hidden')));
100 $input['name'] = 'file';
101 $input['type'] = 'file';
103 $buttontext = _("Upload");
104 $class = false; // local OS function, so use native OS button
107 return HTML::p(fmt("WikiForm: %s: unknown action", $action));
111 $input = HTML::input($input);
112 $input->addTooltip($buttontext);
113 $button = Button('submit:', $buttontext, $class);
114 if ($request->getArg('start_debug'))
115 $form->pushContent(HTML::input(array('name' => 'start_debug',
116 'value' => $request->getArg('start_debug'),
117 'type' => 'hidden')));
118 $form->pushContent(HTML::span(array('class' => $class),
130 // c-hanging-comment-ender-p: nil
131 // indent-tabs-mode: nil