1 |
<?php |
2 |
/** |
3 |
* This file contains the base FormElement class. |
4 |
* |
5 |
* $Id: misc.inc,v 1.4 2003/11/20 00:46:16 hemna Exp $ |
6 |
* |
7 |
* @author Walter A. Boring IV <waboring@buildabetterweb.com> |
8 |
* @author Suren Markossian <suren@bcsweb.com> |
9 |
* @package phpHtmlLib |
10 |
* @subpackage FormProcessing |
11 |
* |
12 |
* @copyright LGPL - See LICENCE |
13 |
* |
14 |
*/ |
15 |
|
16 |
/** |
17 |
* This is the Hidden FormElement which builds a |
18 |
* input field of type="hidden". It has no validation method. |
19 |
* |
20 |
* |
21 |
* @author Walter A. Boring IV <waboring@buildabetterweb.com> |
22 |
* @author Suren Markossian <suren@bcsweb.com> |
23 |
* @package phpHtmlLib |
24 |
* @subpackage FormProcessing |
25 |
* |
26 |
* @copyright LGPL - See LICENCE |
27 |
*/ |
28 |
class FEHidden extends FormElement { |
29 |
|
30 |
function FEHidden($label, $value=NULL) { |
31 |
$this->FormElement($label); |
32 |
if ($value != NULL) { |
33 |
$this->set_value( $value ); |
34 |
} |
35 |
} |
36 |
|
37 |
function get_element() { |
38 |
return form_hidden($this->get_element_name(), |
39 |
$this->get_value() ); |
40 |
} |
41 |
|
42 |
/** |
43 |
* This method returns the hidden version of this |
44 |
* element for a confirmation page. |
45 |
* |
46 |
* NOTE: This is called by the FormProcessor only. |
47 |
* It shouldn't be called manually. |
48 |
* |
49 |
* @return INPUTtag of type hidden |
50 |
*/ |
51 |
function get_confirm_element() { |
52 |
return $this->get_element(); |
53 |
} |
54 |
} |
55 |
|
56 |
/** |
57 |
* This is a way of providing an Error to the FormProcessor. |
58 |
* It can be used at any time during FormContent to create |
59 |
* a specialized error field and message. |
60 |
* |
61 |
* |
62 |
* @author Walter A. Boring IV <waboring@buildabetterweb.com> |
63 |
* @author Suren Markossian <suren@bcsweb.com> |
64 |
* @package phpHtmlLib |
65 |
* @subpackage FormProcessing |
66 |
* |
67 |
* @copyright LGPL - See LICENCE |
68 |
*/ |
69 |
class FEError extends FormElement { |
70 |
|
71 |
/** |
72 |
* The constructor |
73 |
* |
74 |
* @param string the error label |
75 |
* @param string the error message |
76 |
*/ |
77 |
function FEError( $label, $message ) { |
78 |
$this->set_label_text($label); |
79 |
$this->set_error_message($message); |
80 |
} |
81 |
|
82 |
} |
83 |
?> |