Ignore:
Timestamp:
Apr 7, 2020, 10:15:48 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved code formatting.
File:
1 edited

Legend:

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

    r854 r880  
    3131    global $Message, $MessageType;
    3232
    33     if(array_key_exists('action', $_GET))
     33    if (array_key_exists('action', $_GET))
    3434    {
    35       if($_GET['action'] == 'login')
     35      if ($_GET['action'] == 'login')
    3636      {
    37         if(array_key_exists('LoginUser', $_POST) and array_key_exists('LoginPass', $_POST))
     37        if (array_key_exists('LoginUser', $_POST) and array_key_exists('LoginPass', $_POST))
    3838        {
    39           if(array_key_exists('StayLogged', $_POST)) $StayLogged = true;
     39          if (array_key_exists('StayLogged', $_POST)) $StayLogged = true;
    4040            else $StayLogged = false;
    4141          $this->System->User->Login($_POST['LoginUser'], $_POST['LoginPass'], $StayLogged);
    42           if($this->System->User->Role == LICENCE_ANONYMOUS)
     42          if ($this->System->User->Role == LICENCE_ANONYMOUS)
    4343          {
    4444            $Message = T('Incorrect name or password');
     
    5555        }
    5656      } else
    57         if($_GET['action'] == 'logout')
     57        if ($_GET['action'] == 'logout')
    5858        {
    59           if($this->System->User->Role != LICENCE_ANONYMOUS)
     59          if ($this->System->User->Role != LICENCE_ANONYMOUS)
    6060          {
    6161            $this->System->ModuleManager->Modules['Log']->WriteLog('Odhlášení', LOG_TYPE_USER);
     
    7878    $this->System->ModuleManager->Modules['FrontPage']->HandleLoginForm();
    7979    $Output = '';
    80     if(isset($Message)) $Output .= ShowMessage($Message, $MessageType);
     80    if (isset($Message)) $Output .= ShowMessage($Message, $MessageType);
    8181
    8282    $Output .= ''.
     
    9090      '<div class="box-left">'.$this->System->ModuleManager->Modules['Forum']->ShowBox().'</div>'.
    9191      '<div class="box-right">'.$this->System->ModuleManager->Modules['Translation']->ShowBox().'</div>';
    92      return($Output);
     92     return $Output;
    9393  }
    9494
     
    9696  {
    9797    // Cookies have to be used before any text is sent to output
    98     if(!array_key_exists('HideWelcome', $_COOKIE)) $_COOKIE['HideWelcome'] = 0;
    99     if(isset($_GET['Action']))
     98    if (!array_key_exists('HideWelcome', $_COOKIE)) $_COOKIE['HideWelcome'] = 0;
     99    if (isset($_GET['Action']))
    100100    {
    101       if($_GET['Action'] == 'HideWelcome')
     101      if ($_GET['Action'] == 'HideWelcome')
    102102      {
    103103        $_COOKIE['HideWelcome'] = 1;
    104104        setcookie('HideWelcome', $_COOKIE['HideWelcome'], time() + 3600 * 24 * 365);
    105105      }
    106       if($_GET['Action'] == 'UnHideWelcome')
     106      if ($_GET['Action'] == 'UnHideWelcome')
    107107      {
    108108        $_COOKIE['HideWelcome'] = 0;
     
    111111    }
    112112
    113     if(isset($_COOKIE['HideWelcome']) and ($_COOKIE['HideWelcome'] == 1))
     113    if (isset($_COOKIE['HideWelcome']) and ($_COOKIE['HideWelcome'] == 1))
    114114    {
    115115      $Action = '<a href="?Action=UnHideWelcome">'.T('Show welcome').'</a>';
     
    122122
    123123    // Echo text even if it is hidden because of caching by external searching engines
    124     return('<div style="'.$HideWelcome.'">'.
     124    return '<div style="'.$HideWelcome.'">'.
    125125      '<div id="bannertitle">'.$this->System->Config['Web']['Title'].'</div>'.
    126126      T('Open web system for translation texts from game World of Warcraft (WoW).<br/>'.
     
    133133      '<li>Thanks for sophisticated system of selectable exports you can download any part of translation, even just quests. And so exclude translation of items, creatures and others.</li>'.
    134134      '<li>Texts can be translated to multiple languages, e.g. Czech and Slovak.</li>'.
    135       '</ul>').'</div>'.$Action);
     135      '</ul>').'</div>'.$Action;
    136136  }
    137137}
Note: See TracChangeset for help on using the changeset viewer.