Changeset 202 for trunk/forms.php
- Timestamp:
- Apr 30, 2009, 11:30:37 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/forms.php
r187 r202 9 9 var $Values = array(); 10 10 var $OnSubmit = ''; 11 11 12 12 function Form($ClassName) 13 13 { … … 19 19 function ShowEditForm() 20 20 { 21 $Output = '<form action="'.$this->OnSubmit.'" method="post"><center>'.$this->ShowEditBlock().'<input type="submit" value="Uložit"></center></form>'; 21 if(!array_key_exists('SubmitText', $this->Definition)) $this->Definition['SubmitText'] = 'Uložit'; 22 $Output = '<form class="Form" action="'.$this->OnSubmit.'" method="post">'.$this->ShowEditBlock().'<div><input type="submit" value="'.$this->Definition['SubmitText'].'" /></div></form>'; 22 23 return($Output); 23 24 } … … 39 40 case 'Boolean': 40 41 if($this->Values[$Index] == 0) $Checked = ''; else $Checked = ' CHECKED'; 41 $Edit = '<input type="checkbox" name="'.$Context.$Index.'"'.$Checked.' >';42 $Edit = '<input type="checkbox" name="'.$Context.$Index.'"'.$Checked.' />'; 42 43 break; 43 44 case 'String': 44 $Edit = '<input type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" >';45 break; 46 case 'Password': 47 $Edit = '<input type="password" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" >';45 $Edit = '<input type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" />'; 46 break; 47 case 'Password': 48 $Edit = '<input type="password" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" />'; 48 49 break; 49 50 case 'Integer': 50 $Edit = '<input type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" >';51 $Edit = '<input type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" />'; 51 52 break; 52 53 case 'Float': 53 $Edit = '<input type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" >';54 $Edit = '<input type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" />'; 54 55 break; 55 56 case 'Time': 56 57 if($this->Values[$Index] == 'Now') $this->Values[$Index] = date('j.n.Y'); 57 $Edit = '<input type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" >';58 $Edit = '<input type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" />'; 58 59 break; 59 60 case 'Array': … … 69 70 "scr.parentNode.insertBefore(newcontent, scr); }". 70 71 '</script>'; 71 $Edit .= '<form><input type="button" onclick="AddItem();" value="Přidat položku" ></form>';72 $Edit .= '<form><input type="button" onclick="AddItem();" value="Přidat položku" /></form>'; 72 73 break; 73 74 default: … … 101 102 array_push($Table['Rows'], array($Item['Caption'].':', $Edit)); 102 103 } 103 $Output = '<fieldset style="width: 500px;"><legend>'.$this->Definition['Title'].'</legend>'.Table($Table).104 $Output = '<fieldset><legend>'.$this->Definition['Title'].'</legend>'.Table($Table). 104 105 '</fieldset>'; 105 106 return($Output); … … 166 167 foreach($this->Definition['Items'] as $Index => $Item) 167 168 { 169 if(array_key_exists($Context.$Index, $_POST)) 168 170 switch($Item['Type']) 169 171 { … … 227 229 { 228 230 $Result = '<table class="BasicTable">'; 229 $Result .= '<tr>';230 231 if(array_key_exists('Header', $Table)) 231 232 { 233 $Result .= '<tr>'; 232 234 foreach($Table['Header'] as $Item) 233 235 $Result .= '<th>'.$Item.'</th>';
Note:
See TracChangeset
for help on using the changeset viewer.