Changeset 7 for branches/2/frontend.php


Ignore:
Timestamp:
May 9, 2008, 7:24:45 AM (16 years ago)
Author:
george
Message:

Opraveno: Přihlašování a odhlašování uživatelů.
Upraveno: Levý panel na stránce s menu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2/frontend.php

    r6 r7  
    3232  }
    3333
     34  function Login()
     35  {
     36   
     37    return($this->System->Modules['User']->Login($_POST['Username'], $_POST['Password']));
     38  }
     39
     40  function Logout()
     41  {
     42   
     43    return($this->System->Modules['User']->Logout());
     44  }
     45
    3446  function TranslationGroupEdit($TranslationGroupId)
    3547  {
    36     $Output = '<strong>Překlad textů:</strong><br /><table id="TranslationItem">';
     48    $Output = '<strong>Překlad textů:</strong><br /><table class="TranslationTable">';
    3749    foreach($this->System->Modules['Translation']->GetTextList($TranslationGroupId) as $GroupItem)
    3850    {
     
    6981  function Menu()
    7082  {
    71     $Output = '<strong>Menu:</strong><br /><a href="?Action=MangosImport">Import z MaNGOSu</a><br /><br />';
     83    $Output = '<strong>Menu:</strong><br />'.
     84    '<a href="?">Uvodní stránka</a><br />'.
     85    '<a href="?Action=TranslationGroupList">Seznam skupin</a><br />'.
     86    '<a href="?Action=MangosImport">Import z MaNGOSu</a><br />'.
     87    '<br />';
    7288    return($Output);
    7389  }
     90
     91  function User()
     92  {
     93    $Output = 'Uživatel: '.$this->System->Modules['User']->User['Name'].' ';
     94    if($this->System->Modules['User']->User['Id'] == 0) $Output .= '<a href="?Action=LoginDialog">Přihlásit</a>';
     95      else $Output .= '<a href="?Action=Logout">Odhlásit</a>';
     96   
     97    return($Output.'<br />');
     98  }
     99
    74100
    75101  function Output()
     
    79105    switch($_GET['Action'])
    80106    {
     107      case 'LoginDialog':
     108        $Output = $this->LoginDialog();
     109        break;
     110      case 'Login':
     111        $Output = $this->Login();
     112        break;
     113      case 'Logout':
     114        $Output = $this->Logout();
     115        break;
    81116      case 'TranslationGroupEdit':
    82117        $Output = $this->TranslationGroupEdit($_GET['GroupId']);
     
    85120        $Output = $this->TextGroupList($_GET['GroupId']);
    86121        break;
     122      case 'TranslationGroupList':
     123        $Output = $this->TranslationGroupList();
     124        break;
    87125      case 'MangosImport':
    88126        $Output = $this->System->Modules['MangosImport']->FullImport();
    89127        break;
    90128    }
    91     else $Output = $this->Menu().$this->LoginDialog().'<br />'.$this->TranslationGroupList().'</div>';
    92     return($this->Header().$Output.''.$this->Footer());
     129    else $Output = '';
     130    return($this->Header().'<table class="MainLayout"><tr><td id="LeftPanel">'.$this->User().$this->Menu().'</td><td>'.$Output.'</td></tr></table>'.$this->Footer());
    93131  } 
    94132}
Note: See TracChangeset for help on using the changeset viewer.