2 /* vim: set expandtab tabstop=4 shiftwidth=4: */
3 // +----------------------------------------------------------------------+
5 // +----------------------------------------------------------------------+
6 // | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
7 // +----------------------------------------------------------------------+
8 // | This source file is subject to version 2.0 of the PHP license, |
9 // | that is bundled with this package in the file LICENSE, and is |
10 // | available at through the world-wide-web at |
11 // | http://www.php.net/license/2_02.txt. |
12 // | If you did not receive a copy of the PHP license and are unable to |
13 // | obtain it through the world-wide-web, please send a note to |
14 // | license@php.net so we can mail you a copy immediately. |
15 // +----------------------------------------------------------------------+
16 // | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
17 // | Bertrand Mansion <bmansion@mamasam.com> |
18 // +----------------------------------------------------------------------+
21 require_once 'HTML/QuickForm/static.php';
24 * HTML class for a link type field
26 * @author Adam Daniel <adaniel1@eesus.jnj.com>
27 * @author Bertrand Mansion <bmansion@mamasam.com>
32 class HTML_QuickForm_link
extends HTML_QuickForm_static
50 * @param string $elementLabel (optional)Link label
51 * @param string $href (optional)Link href
52 * @param string $text (optional)Link display text
53 * @param mixed $attributes (optional)Either a typical HTML attribute string
54 * or an associative array
60 function HTML_QuickForm_link($elementName=null, $elementLabel=null, $href=null, $text=null, $attributes=null)
62 HTML_QuickForm_element
::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
63 $this->_persistantFreeze
= false;
64 $this->_type
= 'link';
65 $this->setHref($href);
73 * Sets the input field name
75 * @param string $name Input field name attribute
81 function setName($name)
83 $this->updateAttributes(array('name'=>$name));
90 * Returns the element name
99 return $this->getAttribute('name');
106 * Sets value for textarea element
108 * @param string $value Value for password element
114 function setValue($value)
117 } //end func setValue
123 * Returns the value of the form element
133 } // end func getValue
140 * Sets the links href
142 * @param string $href
148 function setHref($href)
150 $this->updateAttributes(array('href'=>$href));
151 } // end func setHref
157 * Returns the textarea element in HTML
166 $tabs = $this->_getTabs();
167 $html = "$tabs<a".$this->_getAttrString($this->_attributes
).">";
168 $html .= $this->_text
;
174 // {{{ getFrozenHtml()
177 * Returns the value of field without HTML tags (in this case, value is changed to a mask)
184 function getFrozenHtml()
187 } //end func getFrozenHtml
191 } //end class HTML_QuickForm_textarea