Changeset 293
- Timestamp:
- Dec 27, 2009, 9:35:07 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/export.php
r292 r293 31 31 while($Language = $DbResult->fetch_assoc()) 32 32 $this->WhereLang .= ' OR (Language = '.$Language['Language'].')'; 33 if($this->WhereLang == '') $ WhereLang = 1;33 if($this->WhereLang == '') $this->WhereLang = 1; 34 34 else $this->WhereLang = '('.substr($this->WhereLang, 4).')'; 35 35 … … 65 65 $this->User = $DbResult->fetch_assoc(); 66 66 } else $this->User = array('user' => 'Neznámý'); 67 67 68 68 69 $DbResult = $this->Database->query('SELECT * FROM `wow_client_version` WHERE `Id`='.$this->Export['ClientVersion']); -
trunk/export/index.php
r291 r293 35 35 array('Name' => 'UserName', 'Title' => 'Překladatel'), 36 36 array('Name' => 'Title', 'Title' => 'Popis'), 37 array('Name' => 'UsedCount', 'Title' => 'P očet stažení'),37 array('Name' => 'UsedCount', 'Title' => 'Prohlédnutí výstupu'), 38 38 array('Name' => 'UserCount', 'Title' => 'Překladatelů'), 39 39 array('Name' => 'GroupCount', 'Title' => 'Překladových skupin'), … … 48 48 { 49 49 $Action = '<a href="?Action=View&ExportId='.$Export['Id'].'">Zobrazit</a>'; 50 if($Export['User'] == $_SESSION['UserID']) $Action .= ' <a href="?Action=Delete&ExportId='.$Export['Id'].'" ><div onclick="return confirmAction(\'Opravdu smazat položku?\');">Smazat</div></a>';50 if($Export['User'] == $_SESSION['UserID']) $Action .= ' <a href="?Action=Delete&ExportId='.$Export['Id'].'" onclick="return confirmAction(\'Opravdu smazat položku?\');">Smazat</a>'; 51 51 echo('<tr><td>'.$Export['TimeCreate'].'</td><td>'.$Export['UserName'].'</td><td>'.$Export['Title'].'</td><td>'.$Export['UsedCount'].'</td><td>'.$Export['UserCount'].'</td><td>'.$Export['GroupCount'].'</td><td>'.$Action.'</td></tr>'); 52 52 } … … 94 94 if(array_key_exists('ExportId', $_GET)) 95 95 { 96 $Database->SQLCommand('DELETE FROM Export WHERE Id='.$_GET['ExportId']); 97 echo('Export smazán.<br/><br/>'); 98 $_GET['Filter'] = 'my'; 99 ExportList(); 96 $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId'].' AND User='.$_SESSION['UserID']); 97 if(mysql_num_rows($DbResult) > 0) 98 { 99 $Database->SQLCommand('DELETE FROM Export WHERE Id='.$_GET['ExportId']); 100 echo('Export smazán.<br/><br/>'); 101 $_GET['Filter'] = 'my'; 102 ExportList(); 103 } else echo('Export '.$_GET['ExportId'].' nelze smazat.<br/>'); 100 104 } else echo('Nebylo zadáno Id'); 101 105 } else echo('Nemáte oprávnění'); … … 515 519 $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']); 516 520 $Export = mysql_fetch_assoc($DbResult); 517 ExportOutput($Export['Id'], $Export['OutputType']); 521 $DbResult = $Database->SQLCommand('SELECT * FROM ExportOutputType WHERE Id='.$Export['OutputType']); 522 if(mysql_num_rows($DbResult) > 0) 523 { 524 $DbResult = $Database->SQLCommand('SELECT * FROM ExportVersion WHERE ExportType='.$Export[ 'OutputType'].' AND ClientVersion='.$Export['ClientVersion']); 525 if(mysql_num_rows($DbResult) > 0) 526 { 527 $Database->SQLCommand('UPDATE Export SET UsedCount = UsedCount + 1 WHERE Id='.$Export['Id']); 528 ExportOutput($Export['Id'], $Export['OutputType']); 529 } else echo('Nebyla vybrána požadovaná verze klienta'); 530 } else echo('Nebyl vybrán formát výstupu.'); 518 531 } 519 532 -
trunk/style/global.js
r228 r293 35 35 } 36 36 37 onload = function()37 function confirmAction(theMessage) 38 38 { 39 if (document.getElementsByClassName == undefined) 39 // TODO: Confirmation is not required in the configuration file 40 // or browser is Opera (crappy js implementation) 41 if (typeof(window.opera) != 'undefined') 40 42 { 41 document.getElementsByClassName = function(className) 42 { 43 var hasClassName = new RegExp("(?:^|\\s)" + className + "(?:$|\\s)"); 44 var allElements = document.getElementsByTagName("*"); 45 var results = []; 46 47 var element; 48 for (var i = 0; (element = allElements[i]) != null; i++) 49 { 50 var elementClass = element.className; 51 if (elementClass && elementClass.indexOf(className) != -1 && hasClassName.test(elementClass)) 52 results.push(element); 53 } 54 55 return results; 56 } 57 43 return true; 58 44 } 59 45 60 arr = document.getElementsByClassName('textedit'); 61 for(i = 0; i < arr.length; i++) 62 { 63 ResizeTextArea(arr[i]); 64 } 46 var is_confirmed = confirm(theMessage); 47 48 return is_confirmed; 65 49 } 66 67 function CheckAll()68 {69 ch = document.getElementById('CheckAll');70 arr = document.getElementsByClassName('CheckBox');71 for(i = 0; i < arr.length; i++)72 {73 arr[i].checked = ch.checked;74 }75 }76 77 function UpdateVersion(versions,versionselected)78 {79 //elSel.clear;80 var elSel = document.getElementById('Version');81 for (i = elSel.length - 1; i>=0; i--) {82 elSel.remove(i);83 }84 85 var elSel = document.getElementById('Version');86 for(i = 0; i < versions.length; i++)87 {88 var elOptNew = document.createElement('option');89 elOptNew.text = versions[i];90 elOptNew.value = versions[i];91 if (versions[i] == versionselected)92 elOptNew.selected = true;93 try {94 elSel.add(elOptNew, null); // standards compliant; doesn't work in IE95 }96 catch(ex) {97 elSel.add(elOptNew); // IE only98 }99 }100 }
Note:
See TracChangeset
for help on using the changeset viewer.