Changeset 633 for trunk/Modules/Translation/Form.php
- Timestamp:
- Dec 9, 2013, 9:08:12 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Translation/Form.php
r630 r633 3 3 class PageTranslationForm extends Page 4 4 { 5 var $GroupId; 6 var $ID; 5 7 function ReplaceTranslated($orig,$tran,$Text,$ID,$Group) { 6 $tran_replace = str_replace(' ',' ', $tran);7 $orig_replace = str_replace(' ',' ', $orig);8 9 if (strlen($orig) < strlen($Text)-1) {8 $tran_replace = str_replace(' ',' ',htmlspecialchars($tran)); 9 $orig_replace = str_replace(' ',' ',htmlspecialchars($orig)); 10 11 // if (strlen($orig) < strlen($Text)-1) { 10 12 if ($Group <> '') { 11 13 $Text = str_replace(' '.$orig,' <span Title="Přelož jako: '.$tran_replace.'" class="edit"><a class="edit" target="_NEW2" href="'.$this->System->Link('/form.php?group='.$Group.'&ID='.$ID).'">'.$orig_replace.'</a></span>',$Text); … … 13 15 $Text = str_replace(' '.$orig,' <span Title="Přelož jako: '.$tran_replace.'" class="edit"><a class="edit" target="_NEW2" href="'.$this->System->Link('/dictionary/?search='.$tran).'">'.$orig_replace.'</a></span>',$Text); 14 16 } 15 }17 // } 16 18 return ($Text); 17 19 } 18 20 function ReplaceNotTranslated($orig,$tran,$Text,$ID,$Group) { 19 $orig_replace = str_replace(' ',' ',$orig); 21 // echo $orig.'-'.$Text.'<br>'; 22 $orig_replace = str_replace(' ',' ',htmlspecialchars($orig)); 20 23 21 // echo $orig.'-'.$Text.'<br>'; 22 if (strlen($orig) < strlen($Text)-1) 23 $Text = str_replace($orig,' <span title="Kliknutím přeložíš" class="needtran"><a class="needtran" target="_NEW2" href="'.$this->System->Link('/form.php?group='.$Group.'&ID='.$ID).'">'.$orig_replace.'</a></span>',$Text); 24 $Text = str_replace(' '.$orig,' <span title="Kliknutím přeložíš" class="needtran"><a class="needtran" target="_NEW2" href="'.$this->System->Link('/form.php?group='.$Group.'&ID='.$ID).'">'.$orig_replace.'</a></span>',$Text); 24 25 return ($Text); 25 26 } … … 28 29 { 29 30 $Text = ' '.$Text; 31 $Text = str_replace('$B$B','$B$B ',$Text); 30 32 31 33 $Text = str_replace('$B','<span Title="Znamená odřádkování, překladu zachovej na stejné pozici." class="edit">$B</span>',$Text); … … 38 40 $Text = str_replace('$g','<span Title="Vybere oslovení podle pohlaví hráče, překladu zachovej na stejné pozici." class="edit">$G</span>',$Text); 39 41 foreach($names as $Line) { 40 if ($Line[3] <> '') { 42 if (($this->ID <> $Line[0]) or ($Line[1] <> $this->GroupId)) 43 if ($Line[3] <> '') { 41 44 $Text = $this->ReplaceTranslated($Line[2],$Line[3],$Text,$Line[0],$Line[1]); 42 45 … … 65 68 66 69 $GroupId = LoadGroupIdParameter(); 70 $this->GroupId = $GroupId; 67 71 $Table = $TranslationTree[$GroupId]['TablePrefix']; 68 72 if(array_key_exists('action', $_GET)) $Action = $_GET['action']; … … 72 76 { 73 77 $TextID = $_GET['ID'] * 1; 78 $this->ID = $TextID; 74 79 75 80 $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE `ID` = '.$TextID); … … 84 89 $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE '. 85 90 '(`Language` != '.$this->System->Config['OriginalLanguage'].') AND '. 86 '(`Entry` = '.$Line['Entry'].') LIMIT 1');91 '(`Entry` = '.$Line['Entry'].') ORDER BY `ModifyTime` DESC LIMIT 1'); 87 92 $LineSearch = $DbResult->fetch_assoc(); 88 93 foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
Note:
See TracChangeset
for help on using the changeset viewer.