/[cvs]/nfo/php/libs/com.newsblob.phphtmllib/form/StandardFormContent.inc
ViewVC logotype

Diff of /nfo/php/libs/com.newsblob.phphtmllib/form/StandardFormContent.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by jonen, Sat Feb 22 21:07:43 2003 UTC revision 1.4 by jonen, Thu Aug 11 14:09:26 2005 UTC
# Line 10  Line 10 
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   */   */
# Line 68  class StandardFormContent extends FormCo Line 68  class StandardFormContent extends FormCo
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;
# Line 84  class StandardFormContent extends FormCo Line 84  class StandardFormContent extends FormCo
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      }      }
# Line 105  class StandardFormContent extends FormCo Line 103  class StandardFormContent extends FormCo
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 );
# Line 127  class StandardFormContent extends FormCo Line 133  class StandardFormContent extends FormCo
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          }          }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed