Lines Matching +defs:name +defs:value

18  * Every pseudo-tag must have the key '_elem' set to the name of the element.
125 * Adds a name/value pair as a hidden field.
126 * The value of the field (but not the name) will be passed to
129 * @param string $name Field name.
130 * @param string $value Field value. If null, remove a previously added field.
134 public function addHidden($name, $value)
136 if (is_null($value))
137 unset($this->_hidden[$name]);
138 else $this->_hidden[$name] = $value;
230 * Gets the position of the first element with a matching attribute value.
232 * @param string $name Attribute name.
233 * @param string $value Attribute value.
238 public function findElementByAttribute($name, $value)
241 if (is_array($elem) && isset($elem[$name]) && $elem[$name] == $value)
284 foreach ($this->_hidden as $name => $value)
285 $form .= form_hidden(array('name' => $name, 'value' => $value));
316 * This function adds a set of radio buttons to the form. If $_POST[$name]
319 * @param string $name The HTML field name
320 * @param array $entries An array of entries $value => $caption
325 public function addRadioSet($name, $entries)
328 $value = (array_key_exists($INPUT->post->str($name), $entries)) ?
329 $INPUT->str($name) : key($entries);
331 $data = ($value === $val) ? array('checked' => 'checked') : array();
332 $this->addElement(form_makeRadioField($name, $val, $cap, '', '', $data));
342 * @param string $tag Tag name.
360 * @param string $tag Tag name.
378 * @param string $tag Tag name.
393 * a name of 'wikitext' and id 'wiki__text'. The text will
413 * A title will automatically be generated using the value and
418 * @param string $value (optional) Displayed label. Uses $act if not provided.
424 function form_makeButton($type, $act, $value = '', $attrs = array())
426 if ($value == '') $value = $act;
428 'value' => $value);
430 $attrs['title'] = $value . ' [' . strtoupper($attrs['accesskey']) . ']';
442 * @param string $name Name attribute of the input.
443 * @param string $value (optional) Default value.
454 function form_makeField($type, $name, $value = '', $label = null, $id = '', $class = '', $attrs = array())
456 if (is_null($label)) $label = $name;
458 'type' => $type, 'id' => $id, 'name' => $name, 'value' => $value);
472 * @param string $name
473 * @param string $value
481 function form_makeFieldRight($type, $name, $value = '', $label = null, $id = '', $class = '', $attrs = array())
483 if (is_null($label)) $label = $name;
485 'type' => $type, 'id' => $id, 'name' => $name, 'value' => $value);
497 * @param string $name
498 * @param string $value
506 function form_makeTextField($name, $value = '', $label = null, $id = '', $class = '', $attrs = array())
508 if (is_null($label)) $label = $name;
510 'id' => $id, 'name' => $name, 'value' => $value, 'class' => 'edit');
518 * Password elements have no default value, for obvious reasons.
523 * @param string $name
531 function form_makePasswordField($name, $label = null, $id = '', $class = '', $attrs = array())
533 if (is_null($label)) $label = $name;
535 'id' => $id, 'name' => $name, 'class' => 'edit');
547 * @param string $name
555 function form_makeFileField($name, $label = null, $id = '', $class = '', $attrs = array())
557 if (is_null($label)) $label = $name;
559 'id' => $id, 'name' => $name, 'class' => 'edit');
567 * If $value is an array, a hidden field with the same name and the value
568 * $value[1] is constructed as well.
573 * @param string $name
574 * @param string $value
582 function form_makeCheckboxField($name, $value = '1', $label = null, $id = '', $class = '', $attrs = array())
584 if (is_null($label)) $label = $name;
585 if (is_null($value) || $value == '') $value = '0';
587 'id' => $id, 'name' => $name, 'value' => $value);
599 * @param string $name
600 * @param string $value
608 function form_makeRadioField($name, $value = '1', $label = null, $id = '', $class = '', $attrs = array())
610 if (is_null($label)) $label = $name;
611 if (is_null($value) || $value == '') $value = '0';
613 'id' => $id, 'name' => $name, 'value' => $value);
621 * The list of values can be strings, arrays of (value,text),
623 * An item is selected by supplying its value or integer index.
629 * @param string $name Name attribute of the input.
630 * @param string[]|array[] $values The list of values can be strings, arrays of (value,text),
632 * @param string|int $selected default selected value, string or index number
641 function form_makeMenuField($name, $values, $selected = '', $label = null, $id = '', $class = '', $attrs = array())
643 if (is_null($label)) $label = $name;
661 'id' => $id, 'name' => $name);
669 * The list of values can be strings, arrays of (value,text),
671 * Items are selected by supplying its value or an array of values.
675 * @param string $name Name attribute of the input.
676 * @param string[]|array[] $values The list of values can be strings, arrays of (value,text),
678 * @param array|string $selected value or array of values of the items that need to be selected
687 function form_makeListboxField($name, $values, $selected = '', $label = null, $id = '', $class = '', $attrs = array())
689 if (is_null($label)) $label = $name;
714 'id' => $id, 'name' => $name);
722 * Requires '_tag' key with name of the tag.
739 * Requires '_tag' key with name of the tag.
756 * Requires '_tag' key with name of the tag.
807 * Uses only 'name' and 'value' attributes.
817 return '<input type="hidden" name="' . $attrs['name'] . '" value="' . formText($attrs['value']) . '" />';
835 unset($attrs['name']);
837 return '<textarea name="wikitext" id="wiki__text" dir="auto" '
847 * If '_action' is set, the button name will be "do[_action]".
857 $p = (!empty($attrs['_action'])) ? 'name="do[' . $attrs['_action'] . ']" ' : '';
858 $value = $attrs['value'];
859 unset($attrs['value']);
860 return '<button ' . $p . buildAttributes($attrs, true) . '>' . $value . '</button>';
1004 * If value is an array, a hidden field with the same name and the value
1005 * $attrs['value'][1] is constructed as well.
1020 if (is_array($attrs['value'])) {
1021 echo '<input type="hidden" name="' . hsc($attrs['name']) . '"'
1022 . ' value="' . hsc($attrs['value'][1]) . '" />';
1023 $attrs['value'] = $attrs['value'][0];
1063 * _options : Array of (value,text,selected) for the menu.
1064 * Text can be omitted. Text and value are passed to formText()
1088 @list($value,$text,$select) = $attrs['_options'][$n];
1091 $p .= ' value="' . formText($value) . '"';
1092 else $text = $value;
1112 * _options : Array of (value,text,selected) for the list.
1113 * Text can be omitted. Text and value are passed to formText()
1132 @list($value, $text, $select, $disabled) = $opt;
1134 if (is_null($text)) $text = $value;
1135 $p .= ' value="' . formText($value) . '"';