Update of /cvsroot/phpwiki/phpwiki/lib/plugin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3794
Modified Files:
WikiFormRich.php
Log Message:
add nobr, fix duplication if invalid arg is encountered
Index: WikiFormRich.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/WikiFormRich.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -2 -b -p -d -r1.5 -r1.6
--- WikiFormRich.php 24 Nov 2004 10:14:36 -0000 1.5
+++ WikiFormRich.php 24 Nov 2004 10:28:26 -0000 1.6
@@ -86,4 +86,5 @@ extends WikiPlugin
'buttontext' => false, // for the submit button. default:
action
'cancel' => false, // boolean if the action supports
cancel also
+ 'nobr' => false, // "no break": linebreaks or not
);
}
@@ -98,12 +99,12 @@ extends WikiPlugin
if (preg_match("/^\s*(".join("|",$allowed).")\[\]\s+(.+)\s*$/",
$arg_array[$i], $m)) {
$name = $m[1];
- $this->inputbox[][$name] = array(); $i =
count($this->inputbox) - 1;
+ $this->inputbox[][$name] = array(); $j =
count($this->inputbox) - 1;
foreach (preg_split("/[\s]+/", $m[2]) as $attr_pair) {
- list($attr,$value) = preg_split("/\s*=\s*/", $attr_pair);
+ list($attr, $value) = preg_split("/\s*=\s*/", $attr_pair);
if (preg_match('/^"(.*)"$/', $value, $m))
$value = $m[1];
elseif (defined($value))
$value = constant($value);
- $this->inputbox[$i][$name][$attr] = $value;
+ $this->inputbox[$j][$name][$attr] = $value;
}
//trigger_error("not yet finished");
@@ -134,5 +135,6 @@ extends WikiPlugin
$input['type'] = 'checkbox';
if (empty($input['name']))
- return $this->error("A required argument '%s' is
missing.","checkbox[][name]");
+ return $this->error(fmt("A required argument '%s' is
missing.",
+ "checkbox[][name]"));
if (empty($input['value'])) $input['value'] = 1;
if (empty($input['text']))
@@ -146,4 +148,7 @@ extends WikiPlugin
$input['checked'] = 'checked';
}
+ if ($nobr)
+ $form->pushContent(HTML::input($input), $text);
+ else
$form->pushContent(HTML::div(array('class' => $class),
HTML::input($input), $text));
break;
@@ -151,5 +156,6 @@ extends WikiPlugin
$input['type'] = 'text';
if (empty($input['name']))
- return $this->error("A required argument '%s' is
missing.","editbox[][name]");
+ return $this->error(fmt("A required argument '%s' is
missing.",
+ "editbox[][name]"));
if (empty($input['text'])) $input['text'] =
gettext($input['name']);
$text = $input['text'];
@@ -157,4 +163,7 @@ extends WikiPlugin
$input['value'] = $s;
unset($input['text']);
+ if ($nobr)
+ $form->pushContent(HTML::input($input), $text);
+ else
$form->pushContent(HTML::div(array('class' => $class),
HTML::input($input), $text));
break;
@@ -162,9 +171,13 @@ extends WikiPlugin
$input['type'] = 'radio';
if (empty($input['name']))
- return $this->error("A required argument '%s' is
missing.","radiobutton[][name]");
+ return $this->error(fmt("A required argument '%s' is
missing.",
+ "radiobutton[][name]"));
if (empty($input['text'])) $input['text'] =
gettext($input['name']);
$text = $input['text'];
unset($input['text']);
if ($input['checked']) $input['checked'] = 'checked';
+ if ($nobr)
+ $form->pushContent(HTML::input($input), $text);
+ else
$form->pushContent(HTML::div(array('class' => $class),
HTML::input($input), $text));
break;
@@ -198,4 +211,7 @@ extends WikiPlugin
// $Log$
+// Revision 1.6 2004/11/24 10:28:26 rurban
+// add nobr, fix duplication if invalid arg is encountered
+//
// Revision 1.5 2004/11/24 10:14:36 rurban
// fill-in request args as with plugin-form
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
|