Changeset 816 for trunk/includes/global.php
- Timestamp:
- Feb 22, 2015, 11:20:50 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/global.php
r806 r816 42 42 $System = new System(); 43 43 $System->DoNotShowPage = true; 44 44 $System->Run(); 45 45 $User = $System->User; // Back compatibility, will be removed 46 46 } … … 48 48 class TempPage extends Page 49 49 { 50 51 52 53 54 50 function Show() 51 { 52 global $TempPageContent; 53 return($TempPageContent); 54 } 55 55 } 56 56 57 57 function ShowPageClass($Page) 58 58 { 59 59 global $TempPageContent, $System; 60 60 61 61 $System->Pages['temporary-page'] = get_class($Page); 62 62 $_SERVER['REDIRECT_QUERY_STRING'] = 'temporary-page'; 63 63 $System->PathItems = ProcessURL(); 64 64 $System->ShowPage(); 65 65 } 66 66 67 67 function ShowPage($Content) 68 68 { 69 69 global $TempPageContent, $System; 70 70 71 71 $TempPage = new TempPage($System); 72 72 $System->Pages['temporary-page'] = 'TempPage'; 73 74 73 $_SERVER['REDIRECT_QUERY_STRING'] = 'temporary-page'; 74 $TempPageContent = $Content; 75 75 $System->PathItems = ProcessURL(); 76 76 $System->ShowPage(); 77 77 } 78 78 … … 260 260 if(array_key_exists('OrderCol', $_GET)) $_SESSION['OrderCol'] = $_GET['OrderCol']; 261 261 if(array_key_exists('OrderDir', $_GET) and (array_key_exists($_GET['OrderDir'], $OrderArrowImage))) 262 262 $_SESSION['OrderDir'] = $_GET['OrderDir']; 263 263 if(!array_key_exists('OrderCol', $_SESSION)) $_SESSION['OrderCol'] = $DefaultColumn; 264 264 if(!array_key_exists('OrderDir', $_SESSION)) $_SESSION['OrderDir'] = $DefaultOrder; … … 557 557 } 558 558 559 function GetTranslatNamesArray() 559 function GetTranslatNamesArray() 560 560 { 561 561 $TablesColumn = array … … 733 733 734 734 $IconName = array( 735 735 MESSAGE_INFORMATION => 'information', 736 736 MESSAGE_WARNING => 'warning', 737 737 MESSAGE_CRITICAL => 'critical' 738 738 ); 739 739 $BackgroundColor = array( 740 740 MESSAGE_INFORMATION => '#e0e0ff', 741 741 MESSAGE_WARNING => '#ffffe0', 742 742 MESSAGE_CRITICAL => '#ffe0e0' 743 743 ); 744 744 745 745 return('<div class="message" style="background-color: '.$BackgroundColor[$Type]. 746 747 748 746 ';"><table><tr><td class="icon"><img src="'. 747 $System->Link('/images/message/'.$IconName[$Type].'.png').'" alt="'. 748 $IconName[$Type].'"><td>'.$Text.'</td></tr></table></div>'); 749 749 } 750 750 751 751 function ProcessURL() 752 752 { 753 754 755 756 757 758 759 760 761 753 if(array_key_exists('REDIRECT_QUERY_STRING', $_SERVER)) 754 $PathString = $_SERVER['REDIRECT_QUERY_STRING']; 755 else $PathString = ''; 756 if(substr($PathString, -1, 1) == '/') $PathString = substr($PathString, 0, -1); 757 $PathItems = explode('/', $PathString); 758 if(strpos(GetRequestURI(), '?') !== false) 759 $_SERVER['QUERY_STRING'] = substr(GetRequestURI(), strpos(GetRequestURI(), '?') + 1); 760 else $_SERVER['QUERY_STRING'] = ''; 761 parse_str($_SERVER['QUERY_STRING'], $_GET); 762 762 // SQL injection hack protection 763 763 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($_GET[$Index]); 764 764 return($PathItems); 765 765 } 766 766 767 767 function WriteLanguages($Selected) 768 768 { 769 770 771 772 773 774 775 776 777 778 779 780 781 769 global $System; 770 771 $Output = '<select name="Language">'; 772 $DbResult = $System->Database->select('Language', '`Id`, `Name`', '`Enabled` = 1'); 773 while($Language = $DbResult->fetch_assoc()) 774 { 775 $Output .= '<option value="'.$Language['Id'].'"'; 776 if($Selected == $Language['Id']) 777 $Output .= ' selected="selected"'; 778 $Output .= '>'.$Language['Name'].'</option>'; 779 } 780 $Output .= '</select>'; 781 return($Output); 782 782 } 783 783
Note:
See TracChangeset
for help on using the changeset viewer.