Changeset 860 for trunk/Modules


Ignore:
Timestamp:
Jan 21, 2016, 2:49:19 PM (8 years ago)
Author:
chronos
Message:
  • Modified: Now application modules are started according configuration file.
  • Added: Each module which want to show something in main page bars needs to register its callback.
Location:
trunk/Modules
Files:
5 edited

Legend:

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

    r838 r860  
    2323  function DoStart()
    2424  {
     25    if(isset($this->System->Config['Web']['ShowPHPError']))
     26      $this->ErrorHandler->ShowError = $this->System->Config['Web']['ShowPHPError'];
     27      else $this->ErrorHandler->ShowError = true;
    2528    $this->ErrorHandler->Start();
    2629  }
  • trunk/Modules/Referrer/Referrer.php

    r838 r860  
    2020  function DoStart()
    2121  {
     22    $this->Excludes[] = $this->System->Config['Web']['Host'];
    2223    $this->Log();
    2324    $this->System->RegisterPage('referrer', 'PageReferrer');
  • trunk/Modules/Translation/Translation.php

    r859 r860  
    2424  function DoStart()
    2525  {
    26     $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();
    27 
    2826    $this->System->RegisterPage('comparison.php', 'PageTranslationComparison');
    2927    $this->System->RegisterPage('form.php', 'PageTranslationForm');
     
    5149    if(array_key_exists('Search', $this->System->ModuleManager->Modules))
    5250    {
     51      $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();
    5352      foreach($TranslationTree as $Group)
    5453      {
  • trunk/Modules/User/Profile.php

    r852 r860  
    163163        T('Number of translated:').' <a href="'.$this->System->Link('/TranslationList.php?user='.$UserLine['ID'].'&amp;state=2&amp;group=0').'" title="Zobrazit Všechny jeho přeložené texty"><strong>'.$UserLine['TranslatedCount'].'</strong></a><br />'.
    164164        T('Level:').' <strong>'.$XP['Level'].'</strong> '.T('experience:').' '.ProgressBar(150, round($XP['XP'] / $XP['MaxXP'] * 100, 2), $XP['XP'].' / '.$XP['MaxXP']).'<br/>';
    165       if($UserLine['TeamName'] != '')
     165      if($this->System->ModuleManager->ModuleRunning('Team') and ($UserLine['TeamName'] != ''))
    166166        $Output .= T('Member of team:').' <a href="'.$this->System->Link('/team/?action=team&amp;id='.$UserLine['Team']).'"><strong>'.htmlspecialchars($UserLine['TeamName']).'</strong></a><br />';
    167167
  • trunk/Modules/User/User.php

    r843 r860  
    3737      $this->System->ModuleManager->Modules['Search']->RegisterSearch('user',
    3838      T('Translators'), array('Name'), '`User`', $this->System->Link('/users/?search='));
     39    $this->System->RegisterPageBarItem('Top', 'User', array($this, 'TopBarCallback'));
    3940  }
    4041
     
    5152      $Name = '<a href="'.$this->System->Link('/user/?user='.$DbUser['ID']).'">'.$DbUser['Name'].'</a>';
    5253      $Output .= $Name.'<br />';
     54    }
     55    return($Output);
     56  }
     57
     58  function TopBarCallback()
     59  {
     60    $Output = '';
     61    if($this->System->User->Licence(LICENCE_USER))
     62    {
     63      //$DbResult =$this->Database->query('SELECT `Id`, `Name` FROM `Team` WHERE `Id`='.$this->System->User->Team);
     64      //$Team = $DbResult->fetch_assoc();
     65      //$Output .= ''<span class="MenuItem">Moje překlady: <a href="">Dokončené</a> <a href="">Rozpracované</a> <a href="">Exporty</a> Tým: <a href="">'.$Team['name'].'</a></span>';
     66      $Output .= $this->System->User->Name.' <a href="'.$this->System->Link('/?action=logout').'">'.T('Logout').'</a>'.
     67          ' <a href="'.$this->System->Link('/user/?user='.$this->System->User->Id).'">'.T('My page').'</a>'.
     68          ' <a href="'.$this->System->Link('/options/').'">'.T('Options').'</a>'.
     69          ' <a title="Vámi přeložené texty" href="'.$this->System->Link('/TranslationList.php?user='.
     70          $this->System->User->Id.'&amp;group=0&amp;state=2&amp;text=&amp;entry=').'">'.T('Translated').'</a>'.
     71          ' <a title="Vaše rozpracované text" href="'.$this->System->Link('/TranslationList.php?user='.
     72          $this->System->User->Id.'&amp;group=0&amp;state=3&amp;text=&amp;entry=').'">'.T('Unfinished').'</a>'.
     73          ' <a title="Nikým nepřeložené texty" href="'.
     74          $this->System->Link('/TranslationList.php?user=0&amp;group=0&amp;state=1&amp;text=&amp;entry=').'">'.T('Untranslated').'</a>';
     75    } else
     76    {
     77      $Output .= '<a href="'.$this->System->Link('/login/').'">'.T('Login').'</a>&nbsp;'.
     78        '<a href="'.$this->System->Link('/registration/').'">'.T('Registration').'</a>';
    5379    }
    5480    return($Output);
Note: See TracChangeset for help on using the changeset viewer.