adding some strings
[moodle-linuxchix.git] / lib / pear / HTML / QuickForm / link.php
blob947f76c32bd10bbf5502cff8536d1939618cf3dd
1 <?php
2 /* vim: set expandtab tabstop=4 shiftwidth=4: */
3 // +----------------------------------------------------------------------+
4 // | PHP version 4.0 |
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';
23 /**
24 * HTML class for a link type field
26 * @author Adam Daniel <adaniel1@eesus.jnj.com>
27 * @author Bertrand Mansion <bmansion@mamasam.com>
28 * @version 1.0
29 * @since PHP4.04pl1
30 * @access public
32 class HTML_QuickForm_link extends HTML_QuickForm_static
34 // {{{ properties
36 /**
37 * Link display text
38 * @var string
39 * @since 1.0
40 * @access private
42 var $_text = "";
44 // }}}
45 // {{{ constructor
47 /**
48 * Class constructor
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
55 * @since 1.0
56 * @access public
57 * @return void
58 * @throws
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);
66 $this->_text = $text;
67 } //end constructor
69 // }}}
70 // {{{ setName()
72 /**
73 * Sets the input field name
75 * @param string $name Input field name attribute
76 * @since 1.0
77 * @access public
78 * @return void
79 * @throws
81 function setName($name)
83 $this->updateAttributes(array('name'=>$name));
84 } //end func setName
86 // }}}
87 // {{{ getName()
89 /**
90 * Returns the element name
92 * @since 1.0
93 * @access public
94 * @return string
95 * @throws
97 function getName()
99 return $this->getAttribute('name');
100 } //end func getName
102 // }}}
103 // {{{ setValue()
106 * Sets value for textarea element
108 * @param string $value Value for password element
109 * @since 1.0
110 * @access public
111 * @return void
112 * @throws
114 function setValue($value)
116 return;
117 } //end func setValue
119 // }}}
120 // {{{ getValue()
123 * Returns the value of the form element
125 * @since 1.0
126 * @access public
127 * @return void
128 * @throws
130 function getValue()
132 return;
133 } // end func getValue
136 // }}}
137 // {{{ setHref()
140 * Sets the links href
142 * @param string $href
143 * @since 1.0
144 * @access public
145 * @return void
146 * @throws
148 function setHref($href)
150 $this->updateAttributes(array('href'=>$href));
151 } // end func setHref
153 // }}}
154 // {{{ toHtml()
157 * Returns the textarea element in HTML
159 * @since 1.0
160 * @access public
161 * @return string
162 * @throws
164 function toHtml()
166 $tabs = $this->_getTabs();
167 $html = "$tabs<a".$this->_getAttrString($this->_attributes).">";
168 $html .= $this->_text;
169 $html .= "</a>";
170 return $html;
171 } //end func toHtml
173 // }}}
174 // {{{ getFrozenHtml()
177 * Returns the value of field without HTML tags (in this case, value is changed to a mask)
179 * @since 1.0
180 * @access public
181 * @return string
182 * @throws
184 function getFrozenHtml()
186 return;
187 } //end func getFrozenHtml
189 // }}}
191 } //end class HTML_QuickForm_textarea