Changeset 614
- Timestamp:
- Nov 28, 2013, 6:24:17 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 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 } -
trunk/includes/Version.php
r613 r614 6 6 // and system will need database update. 7 7 8 $Revision = 61 3; // Subversion revision8 $Revision = 614; // Subversion revision 9 9 $DatabaseRevision = 610; // Database structure revision 10 10 $ReleaseTime = '2013-11-27'; -
trunk/includes/global.php
r603 r614 550 550 if ($mode == 2) $where .= ' AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> '.$Config['OriginalLanguage'].') AND (`Sub`.`Entry` = `O`.`Entry`))'; 551 551 $where .= ' AND ('; 552 if (array_search('the' , $ArrStr)) $where .= '(`O`.`'.$Column.'` LIKE "The %") OR '; 552 553 553 554 $SqlOK = false; … … 555 556 for($i = 0; $i < count($ArrStr); $i++) 556 557 { 557 // if (strpos($ArrStr[$i],"'s") > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-2); 558 // if (strpos($ArrStr[$i],',') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1); 559 // if (strpos($ArrStr[$i],'.') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1); 560 // if (strpos($ArrStr[$i],'!') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1); 561 // if (strpos($ArrStr[$i],'?') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1); 562 563 if (strlen($ArrStr[$i]) > 4) { 564 $where .= '(`O`.`'.$Column.'` LIKE "%'.addslashes($ArrStr[$i]).'%") OR '; 558 559 //find word only if is 3 characters and more, and if starts by upper char, and search only once 560 if ((strlen($ArrStr[$i]) > 3) and (ctype_upper(substr($ArrStr[$i],0,1))) and (array_search($ArrStr[$i], $ArrStr) == $i)) { 561 $where .= '(`O`.`'.$Column.'` LIKE "'.addslashes($ArrStr[$i]).'%") OR '; 565 562 $SqlOK = true; 566 563 }
Note:
See TracChangeset
for help on using the changeset viewer.