00001 <?php 00010 class TableLayout extends BaseLayout 00011 { 00017 public function drawBeginning() 00018 { 00019 echo "\n\n<table class=\"BaseForm\">\n"; 00020 } 00021 00025 public function drawEnd() 00026 { 00027 echo "</table>\n\n"; 00028 00029 $this->drawHiddenFields(); 00030 } 00031 00036 public function drawField($field) 00037 { 00038 if($field instanceof HiddenField) 00039 { 00040 $this->hiddenFields[] = $field; 00041 return; 00042 } 00043 00044 echo "\t<tr>\n"; 00045 00046 if ($field instanceOf StaticField) 00047 echo "\t\t<td colspan=\"2\">"; 00048 else if($field->title !== null && !($field instanceOf ButtonField)) 00049 echo "\t\t<th>" . $field->getTitle() . "</th>\n\t\t<td>"; 00050 else 00051 echo "\t\t<td> </td>\n\t\t<td>"; 00052 00053 if($js = $field->getJs()) 00054 echo "\n\t\t\t<script type='text/javascript'>$js</script>"; 00055 00056 $field->drawInput(); 00057 00058 echo "</td>\n\t</tr>\n"; 00059 try 00060 { 00061 if($field->hasError()) 00062 echo "\n\t<tr><td> </td><td><span class='FormError'>$field->errorMessage</span></td></tr>\n"; 00063 } 00064 catch (NotValidatedException $e){}; 00065 } 00066 } 00067 ?>