logo       


CVS: phpwiki/lib/plugin WikiFormRich.php,1.5,1.6: msg#00151

Subject: CVS: phpwiki/lib/plugin WikiFormRich.php,1.5,1.6
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/


Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe