'') { $Text = str_replace(' '.$orig,' '.$orig_replace.'',$Text); } else { $Text = str_replace(' '.$orig,' '.$orig_replace.'',$Text); } // } return $Text; } function ReplaceNotTranslated($orig, $tran, $Text, $ID, $Group) { $orig_replace = str_replace(' ',' ',htmlspecialchars($orig)); $Text = str_replace(' '.$orig,' '.$orig_replace.'',$Text); return $Text; } function ColorNames($Text, $names) { $Text = ' '.$Text; $Text = str_replace('$B$B','$B$B ',$Text); $Text = str_replace('$B','$B',$Text); $Text = str_replace('$N','$N',$Text); $Text = str_replace('$R','$R',$Text); $Text = str_replace('$C','$C',$Text); $Text = str_replace('$G','$G',$Text); $Text = str_replace('$b','$B',$Text); $Text = str_replace('$n','$N',$Text); $Text = str_replace('$c','$c',$Text); $Text = str_replace('$r','$R',$Text); $Text = str_replace('$g','$G',$Text); foreach ($names as $Line) { if (($_GET['ID'] <> $Line[0]) or ($Line[1] <> $_GET['GroupId'])) { if ($Line[3] <> '') { $Text = $this->ReplaceTranslated($Line[2],$Line[3],$Text,$Line[0],$Line[1]); } else { $Text = $this->ReplaceNotTranslated($Line[2],$Line[3],$Text,$Line[0],$Line[1]); } } } return $Text; } function LoadNames() { $User = ModuleUser::Cast($this->System->GetModule('User'))->User; $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree(); $Output = ''; if (array_key_exists('GroupId', $_GET)) $GroupId = $_GET['GroupId']; else return ShowMessage(T('GroupId not specified'), MESSAGE_CRITICAL); if (!array_key_exists('ID', $_GET)) return ShowMessage(T('ID not specified'), MESSAGE_CRITICAL); if (!array_key_exists('Column', $_GET)) return ShowMessage(T('Column not specified'), MESSAGE_CRITICAL); $Table = $TranslationTree[$GroupId]['TablePrefix']; $DbResult = $this->System->Database->query('SELECT * FROM `'.$Table.'` WHERE `ID` = '.$_GET['ID'].' LIMIT 1'); $LineAJ = $DbResult->fetch_assoc(); $Column = $_GET['Column']; //$Text = $LineAJ[$TranslationTree[$GroupId]['Items'][$_GET['Item']]]; $Text = $LineAJ[$Column]; $names = array(); if ($User->Licence(LICENCE_USER)) if (($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11)) { //barvou. $names = GetTranslatNames($Text, 0, GetTranslatNamesArray()); } else { if (($GroupId == 13)) { $names = GetTranslatNames($Text, 0, array('Dictionary' => 'Text', 'TextGlobalString' => 'Text', 'TextArea' => 'Name', 'TextItemSubClass' => 'Name', 'TextCharacterRace' => 'Name1',), false); } else { $names = GetTranslatNames($Text, 0, GetTranslatNamesArray()); } } //$LineAJ[$Column] return $this->ColorNames(htmlspecialchars($Text), $names); } function Show(): string { $this->RawPage = true; return str_replace("\n", '
', $this->LoadNames()); } }