Changeset 887 for trunk/Common/VCL
- Timestamp:
- Nov 20, 2020, 12:08:12 AM (4 years ago)
- Location:
- trunk/Common/VCL
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/VCL/Database.php
r874 r887 19 19 } 20 20 21 function Show() 21 function Show(): string 22 22 { 23 23 // Get total item count in database -
trunk/Common/VCL/General.php
r874 r887 1 1 <?php 2 2 3 4 //print_r($_SESSION); 5 6 function ReadSessionVar($Name, $Persistent = true) 3 function ReadSessionVar(string $Name, bool $Persistent = true): string 7 4 { 8 5 //echo($Name.','); … … 20 17 class Element 21 18 { 22 var$Id;23 var$Enabled;24 var$Visible;19 public string $Id; 20 public bool $Enabled; 21 public bool $Visible; 25 22 26 23 function __construct() … … 30 27 } 31 28 32 function Show() 29 function Show(): string 33 30 { 34 31 $Output = ''; … … 37 34 } 38 35 39 function Prepare() 36 function Prepare(): void 40 37 { 41 38 } … … 44 41 class Layout extends Element 45 42 { 46 var$Items;47 48 function Show() 43 public array $Items; 44 45 function Show(): string 49 46 { 50 47 if ($this->Visible) … … 57 54 } 58 55 59 function Prepare() 56 function Prepare(): void 60 57 { 61 58 foreach ($this->Items as $Item) … … 66 63 class Button extends Element 67 64 { 68 var$Caption;69 70 function Show() 65 public string $Caption; 66 67 function Show(): string 71 68 { 72 69 if ($this->Visible) … … 79 76 class Edit extends Element 80 77 { 81 var$Text;82 83 function Show() 78 public string $Text; 79 80 function Show(): string 84 81 { 85 82 return parent::Show().'<input type="text" name="'.$this->Id.'" value="'.$this->Text.'"/>'; 86 83 } 87 84 88 function Prepare() 85 function Prepare(): void 89 86 { 90 87 $this->Text = ReadSessionVar($this->Id.'_Text'); … … 94 91 class PageSelect extends Element 95 92 { 96 var$Count;97 var$Position;98 var$PageSize;93 public int $Count; 94 public int $Position; 95 public int $PageSize; 99 96 100 97 function __construct() … … 106 103 } 107 104 108 function Show() 105 function Show(): string 109 106 { 110 107 if (array_key_exists($this->Id.'_Page', $_GET)) … … 122 119 } 123 120 124 function Prepare() 121 function Prepare(): void 125 122 { 126 123 $this->Position = ReadSessionVar($this->Id.'_Page'); … … 130 127 class ListViewColumn extends Element 131 128 { 132 var$Name;133 134 function Show() 129 public string $Name; 130 131 function Show(): string 135 132 { 136 133 return $this->Name; … … 140 137 class ListView extends Element 141 138 { 142 var$Columns;143 var$Rows;144 var$OnColumnClick;145 var$OnColumnDraw;139 public array $Columns; 140 public array $Rows; 141 public $OnColumnClick; 142 public $OnColumnDraw; 146 143 147 144 function __construct() … … 152 149 } 153 150 154 function Show() 151 function Show(): string 155 152 { 156 153 $Output = '<table class="WideTable" style="font-size: small;><tr>'; … … 176 173 class PageListView extends ListView 177 174 { 178 var$PageSelect;179 var$SortOrder;180 var$SortColumn;181 var$OrderArrowImage;175 public PageSelect $PageSelect; 176 public int $SortOrder; 177 public string $SortColumn; 178 public array $OrderArrowImage; 182 179 183 180 function __construct() … … 190 187 } 191 188 192 function ColumnClick( $Column)189 function ColumnClick(ListViewColumn $Column): string 193 190 { 194 191 return '?'.$this->Id.'_SortColumn='.$Column->Id.'&'.$this->Id.'_SortOrder='.(1 - $this->SortOrder); 195 192 } 196 193 197 function ColumnDraw( $Column)194 function ColumnDraw(ListViewColumn $Column): string 198 195 { 199 196 global $System; … … 211 208 } 212 209 213 function Show() 210 function Show(): string 214 211 { 215 212 $this->PageSelect->Count = count($this->Rows); … … 222 219 } 223 220 224 function Prepare() 221 function Prepare(): void 225 222 { 226 223 $this->PageSelect->Id = $this->Id.'PageSelect'; … … 233 230 class TableLayout extends Element 234 231 { 235 var$Rows;236 var$Span;237 238 function Show() 239 { 240 $Output .= '<table>';232 public array $Rows; 233 public string $Span; 234 235 function Show(): string 236 { 237 $Output = '<table>'; 241 238 foreach ($this->Rows as $RowNum => $Row) 242 239 { … … 254 251 } 255 252 256 function Prepare() 253 function Prepare(): void 257 254 { 258 255 foreach ($this->Rows as $RowNum => $Row) … … 268 265 class Label extends Element 269 266 { 270 var$Caption;271 var$OnExecute;272 273 function Show() 267 public string $Caption; 268 public $OnExecute; 269 270 function Show(): string 274 271 { 275 272 $Output = $this->Caption; … … 282 279 } 283 280 284 function Prepare() 281 function Prepare(): void 285 282 { 286 283 $Object = ReadSessionVar('O', false); … … 293 290 class Page2 294 291 { 295 var$Items;296 297 function Show() 292 public array $Items; 293 294 function Show(): string 298 295 { 299 296 $Output = '<!DOCTYPE html><html><head></head><body>'; … … 304 301 } 305 302 306 function Prepare() 303 function Prepare(): void 307 304 { 308 305 foreach ($this->Items as $Item)
Note:
See TracChangeset
for help on using the changeset viewer.