Changeset 614 for trunk/Modules/Translation/Form.php
- Timestamp:
- Nov 28, 2013, 6:24:17 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Translation/Form.php
r613 r614 3 3 class PageTranslationForm extends Page 4 4 { 5 function ReplaceTranslated($orig,$tran,$Text,$ID,$Group) { 6 $tran_replace = str_replace(' ',' ',$tran); 7 $orig_replace = str_replace(' ',' ',$orig); 8 $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); 9 return ($Text); 10 } 11 function ReplaceNotTranslated($orig,$tran,$Text,$ID,$Group) { 12 $orig_replace = str_replace(' ',' ',$orig); 13 $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); 14 return ($Text); 15 } 16 5 17 function ColorNames($Text, $names) 6 18 { 7 // $buff[] = array($Line['ID'],GetIDbyName($Table),$Line[$Column],$Line['Tran']);19 $Text = ' '.$Text; 8 20 foreach($names as $Line) { 9 21 if ($Line[3] <> '') { 10 if (strpos($Text, '>'.$Line[2]) == 0) 11 $Text = str_replace($Line[2],'<span Title="Přelož jako: '.$Line[3].'" class="edit"><a class="edit" target="_NEW2" href="'.$this->System->Link('/form.php?group='.$Line[1].'&ID='.$Line[0]).'">'.$Line[2].'</a></span>',$Text); 12 if (strpos($Text, '>'.$Line[2]) == 0) 13 $Text = str_replace(strtolower($Line[2]),'<span Title="Překládej jako: '.$Line[3].'" class="edit"><a class="edit" target="_NEW2" href="'.$this->System->Link('/form.php?group='.$Line[1].'&ID='.$Line[0]).'">'.$Line[2].'</a></span>',$Text); 22 $Text = $this->ReplaceTranslated($Line[2],$Line[3],$Text,$Line[0],$Line[1]); 23 14 24 } else { 15 if (strpos($Text, '>'.$Line[2]) == 0) 16 $Text = str_replace($Line[2],'<span title="Kliknutím přeložíš" class="needtran"><a class="needtran" target="_NEW2" href="'.$this->System->Link('/form.php?group='.$Line[1].'&ID='.$Line[0]).'">'.$Line[2].'</a></span>',$Text); 17 if (strpos($Text, '>'.$Line[2]) == 0) 18 $Text = str_replace(strtolower($Line[2]),'<span title="Kliknutím přeložíš" class="needtran"><a class="needtran" target="_NEW2" href="'.$this->System->Link('/form.php?group='.$Line[1].'&ID='.$Line[0]).'">'.$Line[2].'</a></span>',$Text); 25 $Text = $this->ReplaceNotTranslated($Line[2],$Line[3],$Text,$Line[0],$Line[1]); 19 26 } 20 27 }
Note:
See TracChangeset
for help on using the changeset viewer.