Ignore:
Timestamp:
Mar 6, 2023, 1:48:45 AM (14 months ago)
Author:
chronos
Message:
  • Fixed: Class types casting for better type checking.
  • Fixed: XML direct export.
  • Modified: User class instance moved from Core class to ModuleUser class.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Translation/LoadNames.php

    r888 r893  
    2020    return $Text;
    2121  }
     22
    2223  function ReplaceNotTranslated($orig,$tran,$Text,$ID,$Group)
    2324  {
     
    4445    $Text = str_replace('$r','<span Title="Znamená rasu hráče, překladu zachovej na stejné pozici." class="edit">$R</span>',$Text);
    4546    $Text = str_replace('$g','<span Title="Vybere oslovení podle pohlaví hráče, překladu zachovej na stejné pozici." class="edit">$G</span>',$Text);
    46     foreach ($names as $Line) {
    47      if (($_GET['ID'] <> $Line[0]) or ($Line[1] <> $_GET['GroupId']))
    48       if ($Line[3] <> '')  {
    49         $Text = $this->ReplaceTranslated($Line[2],$Line[3],$Text,$Line[0],$Line[1]);
    50 
    51       } else {
    52         $Text = $this->ReplaceNotTranslated($Line[2],$Line[3],$Text,$Line[0],$Line[1]);
     47    foreach ($names as $Line)
     48    {
     49      if (($_GET['ID'] <> $Line[0]) or ($Line[1] <> $_GET['GroupId']))
     50      {
     51        if ($Line[3] <> '') 
     52        {
     53          $Text = $this->ReplaceTranslated($Line[2],$Line[3],$Text,$Line[0],$Line[1]);     
     54        } else
     55        {
     56          $Text = $this->ReplaceNotTranslated($Line[2],$Line[3],$Text,$Line[0],$Line[1]);
     57        }
    5358      }
    5459    }
     
    5863  function LoadNames()
    5964  {
     65    $User = ModuleUser::Cast($this->System->GetModule('User'))->User;
    6066    $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();
    6167
     
    7278          $Text = $LineAJ[$Column];
    7379          $names = array();
    74           if ($this->System->User->Licence(LICENCE_USER))
     80          if ($User->Licence(LICENCE_USER))
    7581          if (($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11))
    7682          {
    7783            //<span class="edit">barvou.</span>
    7884            $names = GetTranslatNames($Text, 0, GetTranslatNamesArray());
    79           } else {
    80             if (($GroupId == 13)) {
     85          } else
     86          {
     87            if (($GroupId == 13))
     88            {
    8189              $names = GetTranslatNames($Text, 0, array('Dictionary' => 'Text',
    8290                'TextGlobalString' => 'Text', 'TextArea' => 'Name',
    8391                'TextItemSubClass' => 'Name', 'TextCharacterRace' => 'Name1',), false);
    84             } else {
     92            } else
     93            {
    8594              $names = GetTranslatNames($Text, 0, GetTranslatNamesArray());
    8695            }
    8796          }
    88                                    //$LineAJ[$Column]
     97          //$LineAJ[$Column]
    8998          return $this->ColorNames(htmlspecialchars($Text),$names);
    9099    }
Note: See TracChangeset for help on using the changeset viewer.