Source for file radio.php
Documentation is available at radio.php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
// $Id: radio.php,v 1.17 2004/02/28 22:10:16 avb Exp $
require_once('HTML/QuickForm/input.php');
* HTML class for a radio type element
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @param string Input field name attribute
* @param mixed Label(s) for a field
* @param string Text to display near the radio
* @param string Input field value
* @param mixed Either a typical HTML attribute string or an associative array
function HTML_QuickForm_radio($elementName=null , $elementLabel=null , $text=null , $value=null , $attributes=null )
$this->HTML_QuickForm_element ($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
* Sets whether radio button is checked
* @param bool $checked Whether the field is checked or not
$this->removeAttribute ('checked');
$this->updateAttributes (array ('checked'=> 'checked'));
* Returns whether radio button is checked
return $this->getAttribute ('checked');
* Returns the radio element in HTML
if (0 == strlen($this->_text)) {
} elseif ($this->_flagFrozen) {
$label = '<label for="' . $this->getAttribute ('id') . '">' . $this->_text . '</label>';
* Returns the value of field without HTML tags
$this->_getPersistantData ();
} //end func getFrozenHtml
* @param string $text Text to display near the radio button
// {{{ onQuickFormEvent()
* Called by HTML_QuickForm whenever form event is made on this element
* @param string $event Name of event
* @param mixed $arg event arguments
* @param object $caller calling object
// constant values override both default and submitted ones
// default values are overriden by submitted
$value = $this->_findValue ($caller->_constantValues );
$value = $this->_findValue ($caller->_submitValues );
$value = $this->_findValue ($caller->_defaultValues );
if ($value == $this->getValue ()) {
if ($arg == $this->getValue ()) {
parent ::onQuickFormEvent ($event, $arg, $caller);
} // end func onQuickFormLoad
* Returns the value attribute if the radio is checked, null if it is not
$value = $this->_findValue ($submitValues);
$value = $this->getChecked()? $this->getValue (): null;
} elseif ($value != $this->getValue ()) {
return $this->_prepareValue ($value, $assoc);
} //end class HTML_QuickForm_radio
Documentation generated on Mon, 11 Mar 2019 14:16:36 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|