Changeset 577 for trunk/Modules/Export/Page.php
- Timestamp:
- Sep 11, 2013, 10:37:54 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/Page.php
r572 r577 16 16 function ExportList() 17 17 { 18 global $User;19 20 18 $Output = '<a href="?Action=ViewList">Všechny</a>'; 21 if($ User->Licence(LICENCE_USER))19 if($this->System->User->Licence(LICENCE_USER)) 22 20 { 23 21 $Output .= ' <a href="?Action=ViewList&Filter=Others">Ostatních</a>'. … … 25 23 } 26 24 27 if($ User->Licence(LICENCE_USER))25 if($this->System->User->Licence(LICENCE_USER)) 28 26 $Output .= '<br/><div style="text-align: center;"><a href="?Action=Create">Vytvořit nový export</a></div><br/>'; 29 27 … … 31 29 if(array_key_exists('Filter', $_GET)) 32 30 { 33 if($_GET['Filter'] == 'My') $Filter = ' WHERE `Export`.`User` = '.$ User->Id;34 if($_GET['Filter'] == 'Others') $Filter = ' WHERE `Export`.`User` != '.$ User->Id;31 if($_GET['Filter'] == 'My') $Filter = ' WHERE `Export`.`User` = '.$this->System->User->Id; 32 if($_GET['Filter'] == 'Others') $Filter = ' WHERE `Export`.`User` != '.$this->System->User->Id; 35 33 } 36 34 … … 62 60 $Action = '<a href="?Action=View&ExportId='.$Export['Id'].'&Tab=0">Zobrazit</a> '. 63 61 '<a href="?Action=View&ExportId='.$Export['Id'].'&Tab=7">Exportovat</a>'; 64 if($Export['User'] == $ User->Id) $Action .= ' <a href="?Action=Delete&ExportId='.$Export['Id'].'" onclick="return confirmAction(\'Opravdu smazat položku?\');">Smazat</a>';65 if($ User->Id != null) $Action .= ' <a href="?Action=Clone&ExportId='.$Export['Id'].'" onclick="return confirmAction(\'Opravdu klonovat položku?\');">Klonovat</a>';62 if($Export['User'] == $this->System->User->Id) $Action .= ' <a href="?Action=Delete&ExportId='.$Export['Id'].'" onclick="return confirmAction(\'Opravdu smazat položku?\');">Smazat</a>'; 63 if($this->System->User->Id != null) $Action .= ' <a href="?Action=Clone&ExportId='.$Export['Id'].'" onclick="return confirmAction(\'Opravdu klonovat položku?\');">Klonovat</a>'; 66 64 $Output .= '<tr><td>'.HumanDate($Export['TimeCreate']).'</td>'. 67 65 '<td><a href="'.$this->System->Link('/user.php?user='.$Export['User']).'">'.$Export['UserName'].'</a></td>'. … … 80 78 function ExportCreate() 81 79 { 82 global $User; 83 84 if($User->Licence(LICENCE_USER)) 85 { 86 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Export` WHERE `User`='.$User->Id); 80 if($this->System->User->Licence(LICENCE_USER)) 81 { 82 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Export` WHERE `User`='.$this->System->User->Id); 87 83 $DbRow = $DbResult->fetch_row(); 88 84 if($DbRow[0] < $this->System->Config['MaxExportPerUser']) … … 101 97 function ExportCreateFinish() 102 98 { 103 global $User; 104 105 if($User->Licence(LICENCE_USER)) 99 if($this->System->User->Licence(LICENCE_USER)) 106 100 { 107 101 if(array_key_exists('Title', $_POST) and array_key_exists('Description', $_POST)) 108 102 { 109 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Export` WHERE `User`='.$ User->Id);103 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Export` WHERE `User`='.$this->System->User->Id); 110 104 $DbRow = $DbResult->fetch_row(); 111 105 if($DbRow[0] < $this->System->Config['MaxExportPerUser']) 112 106 { 113 $this->System->Database->query('INSERT INTO `Export` (`Title`, `User`, `TimeCreate`, `WithDiacritic`, `Description`) VALUES ("'.$_POST['Title'].'", '.$ User->Id.', NOW(), 1, "'.$_POST['Description'].'")');107 $this->System->Database->query('INSERT INTO `Export` (`Title`, `User`, `TimeCreate`, `WithDiacritic`, `Description`) VALUES ("'.$_POST['Title'].'", '.$this->System->User->Id.', NOW(), 1, "'.$_POST['Description'].'")'); 114 108 $ExportId = $this->System->Database->insert_id; 115 109 $Output = ShowMessage('Nový export vytvořen.<br/>Přímý odkaz na tento export: <a href="?Action=View&ExportId='.$ExportId.'">zde</a>'); … … 125 119 function ExportDelete() 126 120 { 127 global $User; 128 129 if($User->Licence(LICENCE_USER)) 130 { 131 $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE (`Id`='.($_GET['ExportId'] * 1).') AND (`User`='.$User->Id.')'); 121 if($this->System->User->Licence(LICENCE_USER)) 122 { 123 $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE (`Id`='.($_GET['ExportId'] * 1).') AND (`User`='.$this->System->User->Id.')'); 132 124 if($DbResult->num_rows > 0) 133 125 { … … 149 141 function ExportViewTranslators() 150 142 { 151 global $TranslationTree , $User;143 global $TranslationTree; 152 144 153 145 $Output = ''; … … 155 147 $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 156 148 $Export = $DbResult->fetch_assoc(); 157 if($ User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;149 if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true; 158 150 else $Editable = false; 159 151 … … 251 243 function ExportViewGeneral() 252 244 { 253 global $User;254 255 245 $DisabledInput = array(false => ' disabled="disabled"', true => ''); 256 246 $DisabledTextArea = array(false => ' readonly="yes"', true => ''); … … 258 248 $DbRows = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 259 249 $Export = $DbRows->fetch_assoc(); 260 if($ User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;250 if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true; 261 251 else $Editable = false; 262 252 … … 291 281 function ExportViewLanguages() 292 282 { 293 global $TranslationTree , $User;283 global $TranslationTree; 294 284 295 285 $Output = ''; … … 297 287 $DbRows = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 298 288 $Export = $DbRows->fetch_assoc(); 299 if($ User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;289 if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true; 300 290 else $Editable = false; 301 291 … … 382 372 function ExportViewGroups() 383 373 { 384 global $TranslationTree , $User;374 global $TranslationTree; 385 375 386 376 $Output = ''; … … 388 378 $DbRows = $this->System->Database->query('SELECT * FROM Export WHERE Id='.$_GET['ExportId']); 389 379 $Export = $DbRows->fetch_assoc(); 390 if($ User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;380 if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true; 391 381 else $Editable = false; 392 382 … … 469 459 function ExportViewOutputFormat() 470 460 { 471 global $User;472 473 461 $Output = ''; 474 462 $DisabledInput = array(false => ' disabled="disabled"', true => ''); … … 479 467 { 480 468 $Export = $DbRows->fetch_assoc(); 481 if($ User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;469 if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true; 482 470 else $Editable = false; 483 471 … … 516 504 function ExportViewVersion() 517 505 { 518 global $User;519 520 506 $Output = ''; 521 507 $DisabledInput = array(false => ' disabled="disabled"', true => ''); 522 508 $DbRows = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 523 509 $Export = $DbRows->fetch_assoc(); 524 if($ User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;510 if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true; 525 511 else $Editable = false; 526 512
Note:
See TracChangeset
for help on using the changeset viewer.