Ignore:
Timestamp:
Jan 21, 2016, 3:20:48 PM (8 years ago)
Author:
chronos
Message:
  • Removed: Execute flag from PHP files in repo.
  • Modified: BaseView class separated to file View.php.
  • Added: Left and Right bar items are now registered from their modules using callbacks.
File:
1 edited

Legend:

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

    r860 r861  
    6666      }
    6767    }
     68    $this->System->RegisterPageBarItem('Right', 'TranslatedMenu', array($this, 'ShowTranslatedMenu'));
    6869  }
    6970
     
    160161    }
    161162  }
     163
     164  function ShowTranslatedMenu()
     165  {
     166    $TranslationTree = $this->GetTranslationTree();
     167
     168    $Output = '<strong>'.T('Translate groups').':</strong><br /><div id="TranslationMenu">';
     169    $DbResult = $this->System->Database->select('Group', '`Id`, `Name`', '1 ORDER BY `Name`');
     170    while($Group = $DbResult->fetch_assoc())
     171    {
     172      $Groups[T($Group['Name'])] = $Group;
     173    }
     174    ksort($Groups);
     175    foreach($Groups as $Group)
     176    {
     177      $Output .= '<div id="menuitem-group'.$Group['Id'].'" onmouseover="show(\'group'.$Group['Id'].'\')" onmouseout="hide(\'group'.$Group['Id'].'\')">'.
     178        '<a href="'.$this->System->Link('/TranslationList.php?group='.$Group['Id'].
     179          '&amp;action=filter').'">'.str_replace(' ','&nbsp;', T($Group['Name'])).'</a></div>'.
     180          '<div id="group'.$Group['Id'].'" class="hidden-menu-item" onmouseover="show(\'group'.$Group['Id'].'\')" onmouseout="hide(\'group'.$Group['Id'].'\')">';
     181      $Output .= '&nbsp;<a title="Zde můžete začít překládat" href="'.
     182        $this->System->Link('/TranslationList.php?group='.$Group['Id'].'&amp;state=1&amp;user=0&amp;entry=&amp;text=').'">'.T('Untranslated').'</a><br />'.
     183        '&nbsp;<a title="Přeložené texty, můžete zde hlasovat, nebo opravovat překlady" href="'.
     184        $this->System->Link('/TranslationList.php?group='.$Group['Id'].'&amp;state=2&amp;user=0&amp;entry=&amp;text=').'">'.T('Translated').'</a><br />';
     185      if(isset($this->System->User) and $this->System->User->Licence(LICENCE_USER))
     186      {
     187        $Output .= '&nbsp;<a title="'.T('Unfinished translations').'" href="'.$this->System->Link('/TranslationList.php?group='.$Group['Id'].'&amp;state=3').'">'.T('Unfinished').'</a><br />'.
     188          '&nbsp;<a title="Všechny překlady, které jste přeložil" href="'.
     189          $this->System->Link('/TranslationList.php?group='.$Group['Id'].'&amp;state=1&amp;user='.
     190          $this->System->User->Id).'&amp;entry=&amp;text=">'.T('Own').'</a><br />';
     191      }
     192      $Output .= '&nbsp;<a title="'.T('Compose special filter').'" href="'.
     193        $this->System->Link('/TranslationList.php?group='.$Group['Id'].'&amp;action=filter').
     194        '">'.T('Filter').'</a><br />';
     195        $Output .= '</div>';
     196    }
     197    $Output .= '</div>';
     198    return($Output);
     199  }
    162200}
Note: See TracChangeset for help on using the changeset viewer.