Changeset 498 for trunk/Common
- Timestamp:
- Mar 3, 2013, 6:02:17 PM (12 years ago)
- Location:
- trunk/Common
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/File.php
r438 r498 53 53 global $Config; 54 54 55 $DbResult = $this->Database->select('File', '*', 'Id='.addslashes($ _GET['Id']));55 $DbResult = $this->Database->select('File', '*', 'Id='.addslashes($Id)); 56 56 if($DbResult->num_rows > 0) 57 57 { 58 58 $DbRow = $DbResult->fetch_assoc(); 59 Header('Content-Type: '.$this->DetectMimeType($ DbRow['Name']));59 Header('Content-Type: '.$this->DetectMimeType($this->System->FilesDir.'/'.$DbRow['Name'])); 60 60 Header('Content-Disposition: attachment; filename="'.$DbRow['Name'].'"'); 61 echo(file_get_contents($ Config['Web']['UploadFileFolder'].'/'.$DbRow['Id'].'_'.$DbRow['Name']));61 echo(file_get_contents($this->System->FilesDir.'/'.$DbRow['Name'])); 62 62 } else echo('Soubor nenalezen!'); 63 63 } -
trunk/Common/Global.php
r496 r498 118 118 var $ModuleManager; 119 119 var $PathItems; 120 var $FilesDir; 120 121 121 122 function __construct() … … 126 127 $this->Pages = array(); 127 128 $this->ModuleManager = new AppModuleManager(); 129 $this->FilesDir = ''; 128 130 } 129 131 … … 298 300 $System = new System(); 299 301 $System->Config = $Config; 302 $System->FilesDir = dirname(__FILE__).'/../'.$Config['Web']['UploadFileFolder'].'/'; 300 303 $System->Database = &$Database; 301 304 $System->AddModule(new Log()); -
trunk/Common/Types/Enumeration.php
r445 r498 18 18 $Type = $this->System->Type->GetTypeDefinition($Item['Type']); 19 19 $Output = '<select name="'.$Item['Name'].'">'; 20 if(array_key_exists('Null', $Item) and $Item['Null']) 21 { 22 if($Item['Value'] == NULL) $Selected = ' selected="1"'; else $Selected = ''; 23 $Output .= '<option value=""'.$Selected.'></option>'; 24 } 20 25 foreach($Type['Parameters']['States'] as $Index => $StateName) 21 26 { … … 29 34 function OnLoad($Item) 30 35 { 36 if($_POST[$Item['Name']] == '') return(NULL); 31 37 return($_POST[$Item['Name']]); 38 } 39 40 function OnLoadDb($Item) 41 { 42 if($Item['Value'] == '') return(NULL); 43 else return($Item['Value']); 32 44 } 33 45 } -
trunk/Common/Version.php
r497 r498 1 1 <?php 2 2 3 $Revision = 49 7; // Subversion revision4 $DatabaseRevision = 49 7;3 $Revision = 498; // Subversion revision 4 $DatabaseRevision = 498; 5 5 $ReleaseTime = '2013-03-03'; 6 6
Note:
See TracChangeset
for help on using the changeset viewer.