|
|
|
|
@ -1,45 +1,46 @@ |
|
|
|
|
<?php |
|
|
|
|
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Base class for <input /> form elements |
|
|
|
|
* |
|
|
|
|
* PHP versions 4 and 5 |
|
|
|
|
* |
|
|
|
|
* LICENSE: This source file is subject to version 3.01 of the PHP license |
|
|
|
|
* that is available through the world-wide-web at the following URI: |
|
|
|
|
* http://www.php.net/license/3_01.txt If you did not receive a copy of |
|
|
|
|
* the PHP License and are unable to obtain it through the web, please |
|
|
|
|
* send a note to license@php.net so we can mail you a copy immediately. |
|
|
|
|
* |
|
|
|
|
* @category HTML |
|
|
|
|
* @package HTML_QuickForm |
|
|
|
|
* @author Adam Daniel <adaniel1@eesus.jnj.com> |
|
|
|
|
* @author Bertrand Mansion <bmansion@mamasam.com> |
|
|
|
|
* @copyright 2001-2009 The PHP Group |
|
|
|
|
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
|
|
|
|
* @version CVS: $Id: input.php,v 1.10 2009/04/04 21:34:03 avb Exp $ |
|
|
|
|
* @link http://pear.php.net/package/HTML_QuickForm |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Base class for form elements |
|
|
|
|
*/ |
|
|
|
|
require_once 'HTML/QuickForm/element.php'; |
|
|
|
|
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Base class for <input /> form elements |
|
|
|
|
* Base class for <input /> form elements |
|
|
|
|
* |
|
|
|
|
* @category HTML |
|
|
|
|
* @package HTML_QuickForm |
|
|
|
|
* @author Adam Daniel <adaniel1@eesus.jnj.com> |
|
|
|
|
* @author Bertrand Mansion <bmansion@mamasam.com> |
|
|
|
|
* @version Release: 3.2.11 |
|
|
|
|
* @since 1.0 |
|
|
|
|
* PHP versions 4 and 5 |
|
|
|
|
* |
|
|
|
|
* LICENSE: This source file is subject to version 3.01 of the PHP license |
|
|
|
|
* that is available through the world-wide-web at the following URI: |
|
|
|
|
* http://www.php.net/license/3_01.txt If you did not receive a copy of |
|
|
|
|
* the PHP License and are unable to obtain it through the web, please |
|
|
|
|
* send a note to license@php.net so we can mail you a copy immediately. |
|
|
|
|
* |
|
|
|
|
* @category HTML |
|
|
|
|
* @package HTML_QuickForm |
|
|
|
|
* @author Adam Daniel <adaniel1@eesus.jnj.com> |
|
|
|
|
* @author Bertrand Mansion <bmansion@mamasam.com> |
|
|
|
|
* @copyright 2001-2009 The PHP Group |
|
|
|
|
* @license http://www.php.net/license/3_01.txt PHP License 3.01 |
|
|
|
|
* @version CVS: $Id: input.php,v 1.10 2009/04/04 21:34:03 avb Exp $ |
|
|
|
|
* @link http://pear.php.net/package/HTML_QuickForm |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Base class for form elements |
|
|
|
|
*/ |
|
|
|
|
require_once 'HTML/QuickForm/element.php'; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Base class for <input /> form elements |
|
|
|
|
* |
|
|
|
|
* @category HTML |
|
|
|
|
* @package HTML_QuickForm |
|
|
|
|
* @author Adam Daniel <adaniel1@eesus.jnj.com> |
|
|
|
|
* @author Bertrand Mansion <bmansion@mamasam.com> |
|
|
|
|
* @version Release: 3.2.11 |
|
|
|
|
* @since 1.0 |
|
|
|
|
* @abstract |
|
|
|
|
*/ |
|
|
|
|
class HTML_QuickForm_input extends HTML_QuickForm_element |
|
|
|
|
{ |
|
|
|
|
public $icon; |
|
|
|
|
// {{{ constructor |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -52,13 +53,14 @@ class HTML_QuickForm_input extends HTML_QuickForm_element |
|
|
|
|
* @access public |
|
|
|
|
* @return void |
|
|
|
|
*/ |
|
|
|
|
function HTML_QuickForm_input($elementName=null, $elementLabel=null, $attributes=null) |
|
|
|
|
function HTML_QuickForm_input($elementName = null, $elementLabel = null, $attributes = null) |
|
|
|
|
{ |
|
|
|
|
$this->HTML_QuickForm_element($elementName, $elementLabel, $attributes); |
|
|
|
|
} //end constructor |
|
|
|
|
|
|
|
|
|
// }}} |
|
|
|
|
// {{{ setType() |
|
|
|
|
if (isset($attributes) && is_array($attributes) && !empty($attributes['icon'])) { |
|
|
|
|
$this->icon = $attributes['icon']; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Sets the element type |
|
|
|
|
@ -72,10 +74,7 @@ class HTML_QuickForm_input extends HTML_QuickForm_element |
|
|
|
|
{ |
|
|
|
|
$this->_type = $type; |
|
|
|
|
$this->updateAttributes(array('type'=>$type)); |
|
|
|
|
} // end func setType |
|
|
|
|
|
|
|
|
|
// }}} |
|
|
|
|
// {{{ setName() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Sets the input field name |
|
|
|
|
@ -151,7 +150,15 @@ class HTML_QuickForm_input extends HTML_QuickForm_element |
|
|
|
|
if ($this->_flagFrozen) { |
|
|
|
|
return $this->getFrozenHtml(); |
|
|
|
|
} else { |
|
|
|
|
return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' />'; |
|
|
|
|
$html = null; |
|
|
|
|
if (!empty($this->icon)) { |
|
|
|
|
$html .= '<div class="input-group"><span class="input-group-addon"><i class="'.$this->icon.'"></i></span>'; |
|
|
|
|
} |
|
|
|
|
$html .= $this->_getTabs().'<input' . $this->_getAttrString($this->_attributes).' />'; |
|
|
|
|
if (!empty($this->icon)) { |
|
|
|
|
$html .= '</div>'; |
|
|
|
|
} |
|
|
|
|
return $html; |
|
|
|
|
} |
|
|
|
|
} //end func toHtml |
|
|
|
|
|
|
|
|
|
@ -163,7 +170,7 @@ class HTML_QuickForm_input extends HTML_QuickForm_element |
|
|
|
|
* |
|
|
|
|
* @param string $event Name of event |
|
|
|
|
* @param mixed $arg event arguments |
|
|
|
|
* @param object &$caller calling object |
|
|
|
|
* @param object &$caller calling object |
|
|
|
|
* @since 1.0 |
|
|
|
|
* @access public |
|
|
|
|
* @return void |
|
|
|
|
|