Lines Matching +full:- +full:- +full:name
17 * @var array name value pairs for hidden values
39 if (!$this->attr('action')) {
43 $this->attr('action', $self);
47 if (!$this->attr('method')) {
48 $this->attr('method', 'post');
51 // we like UTF-8
52 if (!$this->attr('accept-charset')) {
53 $this->attr('accept-charset', 'utf-8');
58 $this->setHiddenField('sectok', getSecurityToken());
62 $this->addClass('doku_form');
68 * @param string $name
72 public function setHiddenField($name, $value) argument
74 $this->hidden[$name] = $value;
87 return count($this->elements);
93 …* Warning: This function may return Boolean FALSE, but may also return a non-Boolean value which e…
103 return array_search($element, $this->elements, true);
108 * A position out-of-bounds will return either the
116 if ($pos < 0) $pos = count($this->elements) + $pos;
118 if ($pos >= count($this->elements)) $pos = count($this->elements) - 1;
119 return $this->elements[$pos];
131 $len = $this->elementCount();
133 if ($this->elements[$pos]->getType() == $type) {
143 * @param string $name Name of the attribute
148 public function findPositionByAttribute($name, $value, $offset = 0) argument
150 $len = $this->elementCount();
152 if ($this->elements[$pos]->attr($name) == $value) {
167 * @param int $pos 0-based position in the form, -1 for at the end
170 public function addElement(Element $element, $pos = -1)
176 $this->elements[] = $element;
178 array_splice($this->elements, $pos, 0, [$element]);
187 * @param int $pos 0-based position of the element to replace
194 array_splice($this->elements, $pos, 1, [$element]);
200 * @param int $pos 0-based position of the element to remove
204 array_splice($this->elements, $pos, 1);
214 * @param string $name
219 public function addTextInput($name, $label = '', $pos = -1) argument
221 return $this->addElement(new InputElement('text', $name, $label), $pos);
227 * @param string $name
232 public function addPasswordInput($name, $label = '', $pos = -1) argument
234 return $this->addElement(new InputElement('password', $name, $label), $pos);
240 * @param string $name
245 public function addRadioButton($name, $label = '', $pos = -1) argument
247 return $this->addElement(new CheckableElement('radio', $name, $label), $pos);
253 * @param string $name
258 public function addCheckbox($name, $label = '', $pos = -1) argument
260 return $this->addElement(new CheckableElement('checkbox', $name, $label), $pos);
266 * @param string $name
272 public function addDropdown($name, $options, $label = '', $pos = -1) argument
274 return $this->addElement(new DropdownElement($name, $options, $label), $pos);
280 * @param string $name
285 public function addTextarea($name, $label = '', $pos = -1) argument
287 return $this->addElement(new TextareaElement($name, $label), $pos);
293 * @param string $name
298 public function addButton($name, $content, $pos = -1) argument
300 return $this->addElement(new ButtonElement($name, hsc($content)), $pos);
306 * @param string $name
311 public function addButtonHTML($name, $html, $pos = -1) argument
313 return $this->addElement(new ButtonElement($name, $html), $pos);
324 public function addLabel($label, $for = '', $pos = -1)
326 return $this->addLabelHTML(hsc($label), $for, $pos);
337 public function addLabelHTML($content, $for = '', $pos = -1)
343 $for = $for->id();
347 $element->attr('for', $for);
350 return $this->addElement($element, $pos);
360 public function addHTML($html, $pos = -1)
362 return $this->addElement(new HTMLElement($html), $pos);
372 public function addTag($tag, $pos = -1)
374 return $this->addElement(new TagElement($tag), $pos);
386 public function addTagOpen($tag, $pos = -1)
388 return $this->addElement(new TagOpenElement($tag), $pos);
400 public function addTagClose($tag, $pos = -1)
402 return $this->addElement(new TagCloseElement($tag), $pos);
412 public function addFieldsetOpen($legend = '', $pos = -1)
414 return $this->addElement(new FieldsetOpenElement($legend), $pos);
423 public function addFieldsetClose($pos = -1)
425 return $this->addElement(new FieldsetCloseElement(), $pos);
437 $len = count($this->elements);
440 $type = $this->elements[$pos]->getType();
444 $this->addFieldsetClose($pos);
454 $this->addFieldsetOpen('', $lastclose);
465 $this->addFieldsetClose();
472 * @param string $eventName (optional) name of the event: FORM_{$name}_OUTPUT
477 $this->balanceFieldsets();
485 $html = '<form ' . buildAttributes($this->attrs()) . '>';
487 foreach ($this->hidden as $name => $value) {
488 … $html .= '<input type="hidden" name="' . $name . '" value="' . formText($value) . '" />';
491 foreach ($this->elements as $element) {
492 $html .= $element->toHTML();