2 rcs_id('$Id: WikiForm.php,v 1.4 2002-02-20 00:16:11 carstenklapp Exp $');
4 * This is a replacement for MagicPhpWikiURL forms.
8 class WikiPlugin_WikiForm
15 function getDefaultArguments() {
16 return array('action' => 'upload', // 'upload', 'loadfile', or 'dumpserial'
18 'buttontext' => false);
22 function run($dbi, $argstr, $request) {
23 extract($this->getArgs($argstr, $request));
25 $form = HTML::form(array('action' => USE_PATH_INFO ? WikiURL($request->getPage()) : SCRIPT_NAME,
27 'class' => 'wikiadmin',
28 'accept-charset' => CHARSET),
29 HTML::input(array('type' => 'hidden',
31 'value' => $action)));
33 $input = array('type' => 'text',
39 $input['name'] = 'source';
41 $input['value'] = '/tmp/wikidump';
43 $buttontext = _("Load File");
47 $input['name'] = 'directory';
49 $input['value'] = '/tmp/wikidump';
51 $buttontext = _("Dump Pages");
55 $input['name'] = 'directory';
57 $input['value'] = '/tmp/wikidumphtml';
59 $buttontext = _("Dump Pages as XHTML");
63 $form->setAttr('enctype', 'multipart/form-data');
64 $form->pushContent(HTML::input(array('name' => 'MAX_FILE_SIZE',
65 'value' => MAX_UPLOAD_SIZE,
66 'type' => 'hidden')));
67 $input['name'] = 'file';
68 $input['type'] = 'file';
70 $buttontext = _("Upload");
71 $class = false; // local OS function, so use natve OS button
74 return HTML::p(fmt("WikiForm: %s: unknown action", $action));
78 $input = HTML::input($input);
79 $input->addTooltip($buttontext);
80 $button = Button('submit:', $buttontext, $class);
82 $form->pushContent(HTML::div(array('class' => $class),
94 // c-hanging-comment-ender-p: nil
95 // indent-tabs-mode: nil