2 rcs_id('$Id: WikiForm.php,v 1.13 2004-06-21 16:22:32 rurban 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
24 * This is a replacement for MagicPhpWikiURL forms.
28 class WikiPlugin_WikiForm
35 function getVersion() {
36 return preg_replace("/[Revision: $]/", '',
37 "\$Revision: 1.13 $");
40 function getDefaultArguments() {
41 return array('action' => 'upload', // 'upload', 'loadfile', or
44 'buttontext' => false,
49 function run($dbi, $argstr, &$request, $basepage) {
50 extract($this->getArgs($argstr, $request));
51 $form = HTML::form(array('action' => $request->getPostURL(),
53 'class' => 'wikiadmin',
54 'accept-charset' => $GLOBALS['charset']),
55 HiddenInputs(array('action' => $action,
56 'pagename' => $basepage)));
57 $input = array('type' => 'text',
63 $input['name'] = 'source';
65 $input['value'] = DEFAULT_DUMP_DIR;
67 $buttontext = _("Load File");
71 $input['name'] = 'source';
73 $buttontext = _("Login");
77 $input['name'] = 'directory';
79 $input['value'] = DUMP_DIR;
81 $buttontext = _("Dump Pages");
85 $input['name'] = 'directory';
87 $input['value'] = HTML_DUMP_DIR;
89 $buttontext = _("Dump Pages as XHTML");
93 $form->setAttr('enctype', 'multipart/form-data');
94 $form->pushContent(HTML::input(array('name' => 'MAX_FILE_SIZE',
95 'value' => MAX_UPLOAD_SIZE,
96 'type' => 'hidden')));
97 $input['name'] = 'file';
98 $input['type'] = 'file';
100 $buttontext = _("Upload");
101 $class = false; // local OS function, so use native OS button
104 return HTML::p(fmt("WikiForm: %s: unknown action", $action));
108 $input = HTML::input($input);
109 $input->addTooltip($buttontext);
110 $button = Button('submit:', $buttontext, $class);
111 if ($request->getArg('start_debug'))
112 $form->pushContent(HTML::input(array('name' => 'start_debug',
113 'value' => $request->getArg('start_debug'),
114 'type' => 'hidden')));
115 $form->pushContent(HTML::span(array('class' => $class),
122 // $Log: not supported by cvs2svn $
123 // Revision 1.12 2004/04/18 01:11:52 rurban
124 // more numeric pagename fixes.
125 // fixed action=upload with merge conflict warnings.
126 // charset changed from constant to global (dynamic utf-8 switching)
128 // Revision 1.11 2004/02/24 15:20:07 rurban
129 // fixed minor warnings: unchecked args, POST => Get urls for sortby e.g.
131 // Revision 1.10 2004/02/22 23:20:33 rurban
132 // fixed DumpHtmlToDir,
133 // enhanced sortby handling in PageList
134 // new button_heading th style (enabled),
135 // added sortby and limit support to the db backends and plugins
136 // for paging support (<<prev, next>> links on long lists)
138 // Revision 1.9 2003/02/26 01:56:52 dairiki
139 // Tuning/fixing of POST action URLs and hidden inputs.
141 // Revision 1.8 2003/01/18 22:14:30 carstenklapp
143 // Reformatting & tabs to spaces;
144 // Added copyleft, getVersion, getDescription, rcs_id.
152 // c-hanging-comment-ender-p: nil
153 // indent-tabs-mode: nil