示例#1
0
 function content_block()
 {
     //  Build the FormProcessor, and add the
     //  form content object that the FormProcessor
     //  will use.
     //
     $container = container();
     //  This allows passing arguments eithers as a GET or a POST
     $scriptargs = array_merge($_GET, $_POST);
     //  The swimmeetid is the argument which must be
     //  dealt with differently for GET and POST operations
     if (array_key_exists("swimmeetid", $scriptargs)) {
         $swimmeetid = $scriptargs["swimmeetid"];
     } else {
         if (array_key_exists("_swimmeetid", $scriptargs)) {
             $swimmeetid = $scriptargs["_swimmeetid"];
         } else {
             if (array_key_exists(FT_DB_PREFIX . "radio", $scriptargs)) {
                 $swimmeetid = $scriptargs[FT_DB_PREFIX . "radio"][0];
             } else {
                 $swimmeetid = null;
             }
         }
     }
     //  Create the form
     $form = new SwimMeetUpdateForm("Update Swim Meet", null, 600);
     $form->setSwimMeetId($swimmeetid);
     //  Create the form processor
     $fp = new FormProcessor($form);
     //  Don't display the form again if processing was successful.
     $fp->set_render_form_after_success(false);
     //  Update the Form Processor to the container.
     //  If the Form Processor was succesful, display
     //  some statistics about the uploaded file.
     if ($fp->is_action_successful()) {
         //  Add the InfoTableCSS so the tables look right
         $this->add_head_css(new DefaultGUIDataListCSS());
         $swimmeets = new SwimMeetsDataList("Swim Meets", '100%', "swimmeetid");
         $div = html_div();
         $div->set_id("swimmeetsgdl");
         $div->add($swimmeets);
         $container->add($div);
         //  Update the Form Processor to the container.
         $container->add(html_br(2), $fp);
     } else {
         $container->add($fp);
     }
     return $container;
 }
 /**
  * This method is called only the first time the form
  * page is hit.  This enables u to query a DB and 
  * pre populate the FormElement objects with data.
  *
  */
 function form_init_data($action = FT_ACTION_DELETE)
 {
     parent::form_init_data($action);
 }