Ignore:
Timestamp:
Jan 21, 2016, 10:20:04 AM (9 years ago)
Author:
chronos
Message:
  • Modified: Function GetTranslationTree moved from global to Translation module where it belongs.
Location:
trunk/Modules/Translation
Files:
7 edited

Legend:

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

    r847 r859  
    4040  function Show()
    4141  {
    42     global $TranslationTree;
     42    $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();
    4343
    4444    $Output = '';
  • trunk/Modules/Translation/Form.php

    r848 r859  
    1919  function ShowForm()
    2020  {
    21     global $TranslationTree;
     21    $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();
    2222
    2323    $Output = '';
     
    261261  function Delete()
    262262  {
    263     global $TranslationTree;
     263    $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();
    264264
    265265    if($this->System->User->Licence(LICENCE_MODERATOR))
  • trunk/Modules/Translation/LoadNames.php

    r843 r859  
    5858  function LoadNames()
    5959  {
    60     global $TranslationTree;
     60    $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();
    6161
    6262    $Output = '';
     
    7979          } else {
    8080            if(($GroupId == 13)) {
    81               $names = GetTranslatNames($Text, 0, array('Dictionary' => 'Text', 'TextGlobalString' => 'Text', 'TextArea' => 'Name', 'TextItemSubClass' => 'Name', 'TextCharacterRace' => 'Name1',),false);
     81              $names = GetTranslatNames($Text, 0, array('Dictionary' => 'Text',
     82                'TextGlobalString' => 'Text', 'TextArea' => 'Name',
     83                'TextItemSubClass' => 'Name', 'TextCharacterRace' => 'Name1',), false);
    8284            } else {
    8385              $names = GetTranslatNames($Text, 0, GetTranslatNamesArray());
  • trunk/Modules/Translation/Save.php

    r848 r859  
    176176  function Show()
    177177  {
    178     global $TranslationTree, $Message, $MessageType;
     178    global $Message, $MessageType;
    179179
    180180    $Output = '';
     181    $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();
    181182
    182183    unset($Message);
  • trunk/Modules/Translation/Translation.php

    r854 r859  
    2424  function DoStart()
    2525  {
    26     global $TranslationTree;
     26    $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();
    2727
    2828    $this->System->RegisterPage('comparison.php', 'PageTranslationComparison');
     
    135135    return($Output);
    136136  }
     137
     138  function GetTranslationTree()
     139  {
     140    if(isset($this->TranslationTree)) return($this->TranslationTree);
     141    else {
     142      $Result = array();
     143      $Groups = array();
     144      $DbResult = $this->System->Database->query('SELECT *, UNIX_TIMESTAMP(`LastImport`) AS `LastImportTime` FROM `Group`');
     145      while($DbRow = $DbResult->fetch_assoc())
     146        $Groups[T($DbRow['Name'])] = $DbRow;
     147      ksort($Groups);
     148      foreach($Groups as $Group)
     149      {
     150        $Group['Items'] = array();
     151        $Group['Game'] = T($Group['Name']);
     152        $Result[$Group['Id']] = $Group;
     153      }
     154      $DbResult = $this->System->Database->query('SELECT * FROM `GroupItem` ORDER BY `Group`, `Sequence`');
     155      while($DbRow = $DbResult->fetch_assoc())
     156      {
     157        $Result[$DbRow['Group']]['Items'][] = $DbRow;
     158      }
     159      $this->TranslationTree = $Result;
     160      return($Result);
     161    }
     162  }
    137163}
  • trunk/Modules/Translation/TranslationList.php

    r855 r859  
    1818  function ShowFilter($GroupId = 0)
    1919  {
    20     global $TranslationTree;
     20    $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();
    2121
    2222    $Filter = array('SQL' => '');
     
    251251  function ShowTranslationList($Filter)
    252252  {
    253     global $TranslationTree;
     253    $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();
    254254
    255255    $Output = $Filter['Output'];
     
    310310  function ShowGroupList($Filter)
    311311  {
    312     global $TranslationTree;
     312    $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();
    313313
    314314    $Output = $Filter['Output'];
     
    333333  function ShowMenu()
    334334  {
    335     global $TranslationTree;
     335    $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();
    336336
    337337    $GroupId = GetParameter('group', 0, true);
  • trunk/Modules/Translation/UserLevel.php

    r833 r859  
    2121function GetXPFromTranslation($UserId)
    2222{
    23   global $System, $TranslationTree, $xp_from_word, $from_diakrit, $Config;
     23  global $System, $xp_from_word, $from_diakrit, $Config;
     24
     25  $TranslationTree = $System->ModuleManager->Modules['Translation']->GetTranslationTree();
    2426
    2527  $xp = 0;
     
    7274function UserLevelUpdate($UserId)
    7375{
    74   global $System, $TranslationTree, $Config;
     76  global $System, $Config;
    7577
     78  $TranslationTree = $System->ModuleManager->Modules['Translation']->GetTranslationTree();
    7679  // Main code for users
    7780  $DbResult = $System->Database->query('SELECT `ID`, `Name` FROM `User` WHERE `Id` = '.$UserId);
Note: See TracChangeset for help on using the changeset viewer.