Changeset 873 for trunk/Common/VCL/General.php
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/VCL/General.php
r693 r873 8 8 //echo($Name.','); 9 9 $Result = ''; 10 if ($Persistent)11 if (array_key_exists($Name, $_SESSION)) $Result = $_SESSION[$Name];12 if (array_key_exists($Name, $_GET))10 if ($Persistent) 11 if (array_key_exists($Name, $_SESSION)) $Result = $_SESSION[$Name]; 12 if (array_key_exists($Name, $_GET)) 13 13 { 14 14 $Result = $_GET[$Name]; 15 if ($Persistent) $_SESSION[$Name] = $Result;16 } 17 return ($Result);15 if ($Persistent) $_SESSION[$Name] = $Result; 16 } 17 return ($Result); 18 18 } 19 19 … … 34 34 $Output = ''; 35 35 //$Output .= '#'.$this->Id; 36 return ($Output);36 return ($Output); 37 37 } 38 38 … … 48 48 function Show() 49 49 { 50 if ($this->Visible)50 if ($this->Visible) 51 51 { 52 52 $Output = parent::Show(); 53 foreach ($this->Items as $Item)53 foreach ($this->Items as $Item) 54 54 $Output .= $Item->Show(); 55 return ($Output);56 } 57 } 58 59 function Prepare() 60 { 61 foreach ($this->Items as $Item)55 return ($Output); 56 } 57 } 58 59 function Prepare() 60 { 61 foreach ($this->Items as $Item) 62 62 $Item->Prepare(); 63 63 } … … 70 70 function Show() 71 71 { 72 if ($this->Visible)73 { 74 return (parent::Show().'<button>'.$this->Caption.'</button>');72 if ($this->Visible) 73 { 74 return (parent::Show().'<button>'.$this->Caption.'</button>'); 75 75 } 76 76 } … … 83 83 function Show() 84 84 { 85 return (parent::Show().'<input type="text" name="'.$this->Id.'" value="'.$this->Text.'"/>');85 return (parent::Show().'<input type="text" name="'.$this->Id.'" value="'.$this->Text.'"/>'); 86 86 } 87 87 … … 108 108 function Show() 109 109 { 110 if (array_key_exists($this->Id.'_Page', $_GET))110 if (array_key_exists($this->Id.'_Page', $_GET)) 111 111 $this->Position = $_GET[$this->Id.'_Page']; 112 if ($this->Position >= $this->Count) $this->Position = $this->Count / $this->PageSize - 1;112 if ($this->Position >= $this->Count) $this->Position = $this->Count / $this->PageSize - 1; 113 113 $Output = ''; 114 for ($I = 0; $I < $this->Count / $this->PageSize; $I++)114 for ($I = 0; $I < $this->Count / $this->PageSize; $I++) 115 115 { 116 116 $Text = '<a href="?'.$this->Id.'_Page='.$I.'">'.$I.'</a> '; 117 if ($I == $this->Position) $Text = '<strong>'.$Text.'</strong>';117 if ($I == $this->Position) $Text = '<strong>'.$Text.'</strong>'; 118 118 $Output .= $Text; 119 119 } 120 120 $Output .= '<br/>'; 121 return ($Output);121 return ($Output); 122 122 } 123 123 … … 134 134 function Show() 135 135 { 136 return ($this->Name);136 return ($this->Name); 137 137 } 138 138 } … … 155 155 { 156 156 $Output = '<table class="WideTable" style="font-size: small;><tr>'; 157 foreach ($this->Columns as $Column)158 { 159 if ($this->OnColumnDraw != '') $Text = call_user_func($this->OnColumnDraw, $Column);157 foreach ($this->Columns as $Column) 158 { 159 if ($this->OnColumnDraw != '') $Text = call_user_func($this->OnColumnDraw, $Column); 160 160 else $Text = $Column->Show(); 161 161 $Output .= '<th>'.$Text.'</th>'; 162 162 } 163 163 $Output .= '</tr>'; 164 foreach ($this->Rows as $Row)164 foreach ($this->Rows as $Row) 165 165 { 166 166 $Output .= '<tr>'; 167 foreach ($Row as $Value)167 foreach ($Row as $Value) 168 168 $Output .= '<td>'.$Value.'</td>'; 169 169 $Output .= '</tr>'; 170 170 } 171 171 $Output .= '</table>'; 172 return ($Output);172 return ($Output); 173 173 } 174 174 } … … 192 192 function ColumnClick($Column) 193 193 { 194 return ('?'.$this->Id.'_SortColumn='.$Column->Id.'&'.$this->Id.'_SortOrder='.(1 - $this->SortOrder));194 return ('?'.$this->Id.'_SortColumn='.$Column->Id.'&'.$this->Id.'_SortOrder='.(1 - $this->SortOrder)); 195 195 } 196 196 … … 201 201 $Output = $Column->Show(); 202 202 203 if ($Column->Name == $this->SortColumn)203 if ($Column->Name == $this->SortColumn) 204 204 { 205 205 $Output .= '<img style="vertical-align: middle; border: 0px;" src="'. 206 206 $System->Link('/images/'.$this->OrderArrowImage[$this->SortOrder]).'" alt="order arrow">'; 207 207 } 208 if ($this->OnColumnClick != '')208 if ($this->OnColumnClick != '') 209 209 $Output = '<a href="'.call_user_func($this->OnColumnClick, $Column).'">'.$Output.'</a>'; 210 return ($Output);210 return ($Output); 211 211 } 212 212 … … 219 219 $Output .= parent::Show(); 220 220 $Output .= $this->PageSelect->Show(); 221 return ($Output);221 return ($Output); 222 222 } 223 223 … … 239 239 { 240 240 $Output .= '<table>'; 241 foreach ($this->Rows as $RowNum => $Row)241 foreach ($this->Rows as $RowNum => $Row) 242 242 { 243 243 $Output .= '<tr>'; 244 foreach ($Row as $ColNum => $Value)244 foreach ($Row as $ColNum => $Value) 245 245 { 246 if ($this->Span[$RowNum][$ColNum] != 1) $Span = ' colspan="'.$this->Span[$RowNum][$ColNum].'"';246 if ($this->Span[$RowNum][$ColNum] != 1) $Span = ' colspan="'.$this->Span[$RowNum][$ColNum].'"'; 247 247 else $Span = ''; 248 248 $Output .= '<td'.$Span.'>'.$Value->Show().'</td>'; … … 251 251 } 252 252 $Output .= '</table>'; 253 return ($Output);254 } 255 256 function Prepare() 257 { 258 foreach ($this->Rows as $RowNum => $Row)259 { 260 foreach ($Row as $ColNum => $Value)253 return ($Output); 254 } 255 256 function Prepare() 257 { 258 foreach ($this->Rows as $RowNum => $Row) 259 { 260 foreach ($Row as $ColNum => $Value) 261 261 { 262 262 $Value->Prepare(); … … 274 274 { 275 275 $Output = $this->Caption; 276 if (method_exists($this->OnExecute[0], $this->OnExecute[1]))276 if (method_exists($this->OnExecute[0], $this->OnExecute[1])) 277 277 { 278 278 $Link = 'O='.$this->Id.'&M=Execute'; 279 279 $Output = '<a href="?'.$Link.'">'.$Output.'</a>'; 280 280 }; 281 return ($Output);281 return ($Output); 282 282 } 283 283 … … 286 286 $Object = ReadSessionVar('O', false); 287 287 $Method = ReadSessionVar('M', false); 288 if (($Object == $this->Id) and ($Method == 'Execute'))288 if (($Object == $this->Id) and ($Method == 'Execute')) 289 289 call_user_func($this->OnExecute, $this); 290 290 } … … 298 298 { 299 299 $Output = '<!DOCTYPE html><html><head></head><body>'; 300 foreach ($this->Items as $Item)300 foreach ($this->Items as $Item) 301 301 $Output .= $Item->Show(); 302 302 $Output .= '</body></html>'; 303 return ($Output);304 } 305 306 function Prepare() 307 { 308 foreach ($this->Items as $Item)303 return ($Output); 304 } 305 306 function Prepare() 307 { 308 foreach ($this->Items as $Item) 309 309 $Item->Prepare(); 310 310 }
Note:
See TracChangeset
for help on using the changeset viewer.