Changeset 28 for trunk/www/table.php
- Timestamp:
- Jun 13, 2009, 9:01:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/table.php
r24 r28 19 19 } 20 20 21 function CheckOrder() 22 { 23 if(!array_key_exists('Order', $_GET)) 24 { 25 if(array_key_exists('DefaultOrderDirection', $this->Definition)) $_GET['Order'] = $this->Definition['DefaultOrderDirection']; 26 else $_GET['Order'] = 0; 27 }; 28 if(!array_key_exists('Column', $_GET)) 29 { 30 if(array_key_exists('DefaultOrderColumn', $this->Definition)) $_GET['Column'] = $this->Definition['DefaultOrderColumn']; 31 else 32 { 33 $Keys = array_keys($this->Definition['Items']); 34 $_GET['Column'] = $Keys[0]; 35 } 36 } 37 } 38 21 39 function Show() 22 40 { 23 41 global $Config; 24 42 43 $this->CheckOrder(); 25 44 $Header = array(); 26 if(!array_key_exists('Order', $_GET)) $_GET['Order'] = 0;27 if(!array_key_exists('Column', $_GET)) $_GET['Column'] = 0;28 45 $QueryStringArray = GetQueryStringArray(); 29 46 $QueryStringArray['Order'] = $_GET['Order']; 30 47 foreach($this->Definition['Items'] as $Index => $Item) 31 48 { 32 $QueryStringArray['Column'] = $Index; 33 if($_GET['Column'] == $Index) $QueryStringArray['Order'] = 1 - $_GET['Order']; 34 else $QueryStringArray['Order'] = $_GET['Order']; 35 $Header[] = '<a href="?'.SetQueryStringArray($QueryStringArray).'">'.$Item['Caption'].'</a>'; 49 if($Item['Type'] != 'Hidden') 50 { 51 $QueryStringArray['Column'] = $Index; 52 if($_GET['Column'] == $Index) $QueryStringArray['Order'] = 1 - $_GET['Order']; 53 else $QueryStringArray['Order'] = $_GET['Order']; 54 $Header[] = '<a href="?'.SetQueryStringArray($QueryStringArray).'">'.$Item['Caption'].'</a>'; 55 } 36 56 } 37 57 $Table = array( … … 48 68 global $Config; 49 69 70 $this->CheckOrder(); 50 71 $OrderType = array('ASC', 'DESC'); 51 if(!array_key_exists('Order', $_GET)) $_GET['Order'] = 0;52 else if($_GET['Order'] == 'Asc') $_GET['Order'] = 1;53 if(!array_key_exists('Column', $_GET))54 {55 $Keys = array_keys($this->Definition['Items']);56 $_GET['Column'] = $Keys[0];57 }58 72 $this->Header = array(); 59 73 foreach($this->Definition['Items'] as $Index => $Item) … … 84 98 $DbRow[$Index] = ExecuteTypeEvent($Item['Type'], 'OnView', 85 99 array('Name' => $Index, 'Value' => $DbRow[$Index], 'Type' => $Item['Type'])); 86 $Row[ ] = $DbRow[$Index];100 $Row[$Index] = $DbRow[$Index]; 87 101 } 88 102 $this->Values[] = $Row;
Note:
See TracChangeset
for help on using the changeset viewer.