10 |
* |
* |
11 |
* $Id$ |
* $Id$ |
12 |
* |
* |
13 |
* @author Walter A. Boring IV <waboring@buildabetterweb.com> |
* @author Walter A. Boring IV <waboring@newsblob.com> |
14 |
* @package phpHtmlLib |
* @package phpHtmlLib |
15 |
* @subpackage FormProcessing |
* @subpackage FormProcessing |
16 |
*/ |
*/ |
68 |
function form() { |
function form() { |
69 |
$title = $this->_form_title._HTML_SPACE; |
$title = $this->_form_title._HTML_SPACE; |
70 |
$title .="( ".$this->_required_field_marker." ".$this->_required_field_text." )"; |
$title .="( ".$this->_required_field_marker." ".$this->_required_field_text." )"; |
71 |
$this->_infotable = new InfoTable($title, $this->_form_width); |
$this->_infotable = new InfoTable($title, $this->_width); |
72 |
$this->_infotable->set_cellpadding(0); |
$this->_infotable->set_cellpadding(0); |
73 |
|
|
74 |
//ok call the Child class to add the |
//ok call the Child class to add the |
75 |
//form fields inside of form blocks |
//form fields inside of form blocks |
76 |
$this->form_content($data, $err); |
$this->form_content(); |
77 |
|
|
78 |
$this->_infotable->add_row( $this->form_content_buttons() ); |
$this->_infotable->add_row( $this->form_content_buttons() ); |
79 |
return $this->_infotable; |
return $this->_infotable; |
84 |
* Child class MUST override this |
* Child class MUST override this |
85 |
* to provide the form fields |
* to provide the form fields |
86 |
* |
* |
87 |
* @param InfoTable object that is the wrapper |
* @return object |
|
* @param the form data array |
|
|
* @param the form errors (if any) |
|
88 |
*/ |
*/ |
89 |
function form_content( &$data, &$err ) { |
function form_content() { |
90 |
user_error("StandardFormContent::form_content() - CHILD MUST OVERRIDE "); |
user_error("StandardFormContent::form_content() - CHILD MUST OVERRIDE "); |
91 |
return NULL; |
return NULL; |
92 |
} |
} |
103 |
* have to do is show the data, and a confirm |
* have to do is show the data, and a confirm |
104 |
* submit button. |
* submit button. |
105 |
* |
* |
106 |
|
* @param string - the title for the table |
107 |
|
* @param boolean - show the action buttons? |
108 |
* @return mixed - either raw html, or some |
* @return mixed - either raw html, or some |
109 |
* container HTMLTag object. |
* container HTMLTag object. |
110 |
*/ |
*/ |
111 |
function form_confirm( ) { |
function form_confirm( $title = "Form Confirmation", $show_buttons=TRUE ) { |
112 |
$title = "Form Confirmation"._HTML_SPACE; |
$title = $title._HTML_SPACE; |
113 |
$title .="( ".$this->_required_field_marker." ".$this->_required_field_text." )"; |
|
114 |
|
//only show this if we aren't readonly |
115 |
|
//if we are in read only mode...required doesn't make sense |
116 |
|
if (!$this->is_readonly()) { |
117 |
|
$title .="( ".$this->_required_field_marker." ".$this->_required_field_text." )"; |
118 |
|
} |
119 |
|
|
120 |
$table = new InfoTable($title, $this->_width); |
$table = new InfoTable($title, $this->_width); |
121 |
|
|
122 |
$this->build_confirm_table( $table ); |
$this->build_confirm_table( $table ); |
133 |
$td->add(_HTML_SPACE, $this->add_cancel()); |
$td->add(_HTML_SPACE, $this->add_cancel()); |
134 |
} |
} |
135 |
|
|
136 |
$table->add_row( $td ); |
if ($show_buttons) { |
137 |
|
$table->add_row( $td ); |
138 |
|
} |
139 |
|
|
140 |
return $table; |
return $table; |
141 |
} |
} |