Ignore:
Timestamp:
Jan 21, 2016, 2:49:19 PM (9 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.