summaryrefslogtreecommitdiff
path: root/inc/Form/Form.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2015-05-08 19:12:21 +0200
committerAndreas Gohr <andi@splitbrain.org>2015-05-08 19:12:21 +0200
commitde19515f04567db78bd41d5bff68a88bfb8c2a22 (patch)
treee478b1cdf6a186c162f6b62b8dce5addd2f7c17d /inc/Form/Form.php
parent6d0ceaf93ca31dfb83fd4325ef2eecd9cef733c0 (diff)
downloadrpg-de19515f04567db78bd41d5bff68a88bfb8c2a22.tar.gz
rpg-de19515f04567db78bd41d5bff68a88bfb8c2a22.tar.bz2
started with the compatibility layer
Diffstat (limited to 'inc/Form/Form.php')
-rw-r--r--inc/Form/Form.php27
1 files changed, 22 insertions, 5 deletions
diff --git a/inc/Form/Form.php b/inc/Form/Form.php
index dc502e021..19cc05065 100644
--- a/inc/Form/Form.php
+++ b/inc/Form/Form.php
@@ -92,7 +92,7 @@ class Form extends Element {
* @param int $pos
* @return InputElement
*/
- public function addTextInput($name, $label, $pos = -1) {
+ public function addTextInput($name, $label = '', $pos = -1) {
return $this->addElement(new InputElement('text', $name, $label), $pos);
}
@@ -104,7 +104,7 @@ class Form extends Element {
* @param int $pos
* @return InputElement
*/
- public function addPasswordInput($name, $label, $pos = -1) {
+ public function addPasswordInput($name, $label = '', $pos = -1) {
return $this->addElement(new InputElement('password', $name, $label), $pos);
}
@@ -116,7 +116,7 @@ class Form extends Element {
* @param int $pos
* @return CheckableElement
*/
- public function addRadioButton($name, $label, $pos = -1) {
+ public function addRadioButton($name, $label = '', $pos = -1) {
return $this->addElement(new CheckableElement('radio', $name, $label), $pos);
}
@@ -128,7 +128,7 @@ class Form extends Element {
* @param int $pos
* @return CheckableElement
*/
- public function addCheckbox($name, $label, $pos = -1) {
+ public function addCheckbox($name, $label = '', $pos = -1) {
return $this->addElement(new CheckableElement('checkbox', $name, $label), $pos);
}
@@ -140,16 +140,33 @@ class Form extends Element {
* @param int $pos
* @return TextareaElement
*/
- public function addTextarea($name, $label, $pos = -1) {
+ public function addTextarea($name, $label = '', $pos = -1) {
return $this->addElement(new TextareaElement($name, $label), $pos);
}
/**
+ * Add fixed HTML to the form
+ *
+ * @param $html
+ * @param int $pos
+ * @return Element
+ */
+ public function addHTML($html, $pos = -1) {
+ return $this->addElement(new HTMLElement($html), $pos);
+ }
+
+ protected function balanceFieldsets() {
+ //todo implement!
+ }
+
+ /**
* The HTML representation of the whole form
*
* @return string
*/
public function toHTML() {
+ $this->balanceFieldsets();
+
$html = '<form ' . buildAttributes($this->attrs()) . '>' . DOKU_LF;
foreach($this->hidden as $name => $value) {