Ignore:
Timestamp:
Apr 6, 2020, 11:17:40 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Improved code format.
File:
1 edited

Legend:

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

    r860 r873  
    6060    $DbResult = $this->Database->query('SELECT `Id` FROM `Action` '.
    6161      'WHERE (`Action`.`Group`='.$ActionGroup['Id'].') AND (`Action`.`Enable` = 1)');
    62     while($Action = $DbResult->fetch_assoc())
     62    while ($Action = $DbResult->fetch_assoc())
    6363    {
    6464      $Output .= $this->System->ShowAction($Action['Id']).'<br/>';
    6565    }
    66     return($this->Panel($ActionGroup['Name'], $Output));
     66    return ($this->Panel($ActionGroup['Name'], $Output));
    6767  }
    6868
     
    9898    //$Output .= 'Server běží: '.$this->GetServerUptime().' &nbsp;  &nbsp; ';
    9999
    100     if($this->System->User->CheckPermission('Finance', 'DisplaySubjectState'))
     100    if ($this->System->User->CheckPermission('Finance', 'DisplaySubjectState'))
    101101    {
    102102      $DbResult = $this->Database->select('MemberPayment', 'Cash', 'Member=(SELECT Customer FROM UserCustomerRel WHERE Id='.$this->System->User->User['Id'].')');
    103       if($DbResult->num_rows > 0)
     103      if ($DbResult->num_rows > 0)
    104104      {
    105105        $DbRow = $DbResult->fetch_assoc();
     
    109109
    110110    $Output = '<div class="Navigation"><span class="MenuItem">'.$Output.'</span><div class="MenuItem2">&nbsp;'.$Output2.'</div></div>';
    111     return($Output);
     111    return ($Output);
    112112  }
    113113
     
    115115  {
    116116    $Output = '<a href="'.$this->System->Link('/user/?Action=UserOptions').'">Profil</a><br />';
    117     if($this->System->User->CheckPermission('Finance', 'MemberOptions'))
     117    if ($this->System->User->CheckPermission('Finance', 'MemberOptions'))
    118118      $Output .= '<a href="'.$this->System->Link('/?Action=MemberOptions').'">Fakturační adresa</a><br />';
    119     if($this->System->User->CheckPermission('Finance', 'DisplaySubjectState'))
     119    if ($this->System->User->CheckPermission('Finance', 'DisplaySubjectState'))
    120120      $Output .= '<a href="'.$this->System->Link('/finance/platby/').'">Finance</a><br />';
    121     if($this->System->User->CheckPermission('Network', 'RegistredHostList'))
     121    if ($this->System->User->CheckPermission('Network', 'RegistredHostList'))
    122122      $Output .= '<a href="'.$this->System->Link('/network/user-hosts/').'">Počítače</a><br />';
    123     if($this->System->User->CheckPermission('News', 'Insert'))
     123    if ($this->System->User->CheckPermission('News', 'Insert'))
    124124      $Output .= '<a href="'.$this->System->Link('/aktuality/?action=add').'">Vložení aktuality</a><br />';
    125     if($this->System->User->CheckPermission('EatingPlace', 'Edit'))
     125    if ($this->System->User->CheckPermission('EatingPlace', 'Edit'))
    126126      $Output .= '<a href="'.$this->System->Link('/jidelna/menuedit.php').'">Úprava jídelníčků</a><br />';
    127     if($this->System->User->CheckPermission('Finance', 'Manage'))
     127    if ($this->System->User->CheckPermission('Finance', 'Manage'))
    128128      $Output .= '<a href="'.$this->System->Link('/finance/sprava/').'">Správa financí</a><br />';
    129     if($this->System->User->CheckPermission('IS', 'Manage'))
     129    if ($this->System->User->CheckPermission('IS', 'Manage'))
    130130      $Output .= '<a href="'.$this->System->Link('/is/').'">Správa dat</a><br />';
    131     return($Output);
     131    return ($Output);
    132132  }
    133133
     
    135135  {
    136136    $Output = $this->System->ModuleManager->Modules['WebCam']->ShowImage();
    137     return($Output);
     137    return ($Output);
    138138  }
    139139
     
    141141  {
    142142    $Output = '<a href="https://stat.zdechov.net/meteo/?Measure=28" title="Klikněte pro detailní informace a předpověď"><img src="https://www.zdechov.net/meteo/koliba.png" border="0" alt="Počasí - Meteostanice Zděchov" width="150" height="150" /></a>';
    143     return($Output);
     143    return ($Output);
    144144  }
    145145
     
    150150      'LEFT JOIN `NetworkDeviceType` ON `NetworkDeviceType`.`Id` = `NetworkDevice`.`Type` '.
    151151      'WHERE (`NetworkDeviceType`.`ShowOnline` = 1) AND (`NetworkDevice`.`Online` = 1) ORDER BY `NetworkDevice`.`Name`');
    152     while($Device = $DbResult->fetch_array())
     152    while ($Device = $DbResult->fetch_array())
    153153    {
    154154      $Output .= $Device['Name'].'<br />';
    155155    }
    156156    $Output .= '</span>';
    157     return($Output);
     157    return ($Output);
    158158  }
    159159
     
    162162    $Output .= '<div class="PanelTitle">Dlužníci:</div><span style="font-size: smaller;">';
    163163    $DbResult = $Database->select('Subject', 'Name', 'Money < 0 ORDER BY Money');
    164     while($Row = $DbResult->fetch_array())
     164    while ($Row = $DbResult->fetch_array())
    165165    {
    166166      $Output .= $Row['Name'].'<br />';
    167167    }
    168168    $Output .= '</span>';
    169     return($Output);
     169    return ($Output);
    170170  }
    171171
    172172  function Panel($Title, $Content, $Menu = array())
    173173  {
    174     if(count($Menu) > 0)
    175       foreach($Menu as $Item)
     174    if (count($Menu) > 0)
     175      foreach ($Menu as $Item)
    176176        $Title .= '<div class="Action">'.$Item.'</div>';
    177     return('<div class="Panel"><div class="Title">'.$Title.'</div><div class="Content">'.$Content.'</div></div>');
     177    return ('<div class="Panel"><div class="Title">'.$Title.'</div><div class="Content">'.$Content.'</div></div>');
    178178  }
    179179
     
    181181  {
    182182    $Output = '';
    183     if(array_key_exists('Action', $_GET))
     183    if (array_key_exists('Action', $_GET))
    184184    {
    185185      $Action = $_GET['Action'];
    186       if($Action == 'CustomizeNewsSave')
     186      if ($Action == 'CustomizeNewsSave')
    187187      {
    188188        $Output .= $this->System->ModuleManager->Modules['News']->CustomizeSave();
    189189      } else
    190       if($Action == 'MemberOptions')
     190      if ($Action == 'MemberOptions')
    191191      {
    192192        $DbResult = $this->Database->query('SELECT `Customer` FROM `UserCustomerRel` '.
    193193          'WHERE `User`='.$this->System->User->User['Id']);
    194         while($CustomerUserRel = $DbResult->fetch_assoc())
     194        while ($CustomerUserRel = $DbResult->fetch_assoc())
    195195        {
    196196          $DbResult2 = $this->Database->query('SELECT `Member`.`Id`, '.
     
    202202          $Form->SetClass('MemberOptions');
    203203          $DbRow = $DbResult2->fetch_array();
    204           foreach($Form->Definition['Items'] as $Index => $Item)
     204          foreach ($Form->Definition['Items'] as $Index => $Item)
    205205          {
    206206            $Form->Values[$Index] = $DbRow[$Index];
     
    210210        }
    211211      } else
    212       if($Action == 'MemberOptionsSave')
     212      if ($Action == 'MemberOptionsSave')
    213213      {
    214214        $Form = new Form($this->System->FormManager);
    215215        $Form->SetClass('MemberOptions');
    216216        $Form->LoadValuesFromForm();
    217         if($Form->Values['FamilyMemberCount'] < 0)
     217        if ($Form->Values['FamilyMemberCount'] < 0)
    218218          $Form->Values['FamilyMemberCount'] = 0;
    219219
     
    235235          'ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->User->User['Member']);
    236236        $DbRow = $DbResult->fetch_array();
    237         foreach($Form->Definition['Items'] as $Index => $Item)
     237        foreach ($Form->Definition['Items'] as $Index => $Item)
    238238        {
    239239          $Form->Values[$Index] = $DbRow[$Index];
     
    243243      }
    244244    } else $Output = $this->ShowMain();
    245     return($Output);
     245    return ($Output);
    246246  }
    247247
     
    250250    $Output = '';
    251251    $DbResult = $this->Database->query('SELECT * FROM `ActionGroup`');
    252     while($DbRow = $DbResult->fetch_assoc())
     252    while ($DbRow = $DbResult->fetch_assoc())
    253253      $ActionGroups[$DbRow['Id']] = $DbRow;
    254254
    255255    // Show pannels
    256     //if(IsInternetAddr()) echo('Internet'); else echo('LAN');
     256    //if (IsInternetAddr()) echo('Internet'); else echo('LAN');
    257257    //$Output .= $this->InfoBar();
    258258    $Output .= '<table id="MainTable"><tr>';
    259259    $DbResult = $this->Database->select('PanelColumn', '*');
    260     while($PanelColumn =  $DbResult->fetch_assoc())
    261     {
    262       if($PanelColumn != '') $Width = ' width="'.$PanelColumn['Width'].'"';
     260    while ($PanelColumn =  $DbResult->fetch_assoc())
     261    {
     262      if ($PanelColumn != '') $Width = ' width="'.$PanelColumn['Width'].'"';
    263263        else $Width = '';
    264264      $Output .= '<td valign="top"'.$Width.'>';
    265265      $DbResult2 = $this->Database->query('SELECT * FROM `Panel` WHERE `PanelColumn`='.$PanelColumn['Id'].' ORDER BY `Order`');
    266       while($Panel = $DbResult2->fetch_assoc())
    267       {
    268         if($Panel['Module'] == 'ActionGroup') $Output .= $this->ShowActions($ActionGroups[$Panel['Parameters']]);
    269         else if($Panel['Module'] == 'OnlineHostList') $Output .= $this->Panel('Online počítače', $this->OnlineHostList());
    270         else if($Panel['Module'] == 'UserOptions')
     266      while ($Panel = $DbResult2->fetch_assoc())
     267      {
     268        if ($Panel['Module'] == 'ActionGroup') $Output .= $this->ShowActions($ActionGroups[$Panel['Parameters']]);
     269        else if ($Panel['Module'] == 'OnlineHostList') $Output .= $this->Panel('Online počítače', $this->OnlineHostList());
     270        else if ($Panel['Module'] == 'UserOptions')
    271271        {
    272           //if($this->System->User->User['Id'] != null) $Output .= $this->Panel('Přihlášený uživatel', $this->UserPanel());
     272          //if ($this->System->User->User['Id'] != null) $Output .= $this->Panel('Přihlášený uživatel', $this->UserPanel());
    273273        } else
    274         if($Panel['Module'] == 'Webcam') $Output .= $this->Panel('Kamery', $this->WebcamPanel());
    275         if($Panel['Module'] == 'Meteo') $Output .= $this->Panel('Meteostanice', $this->MeteoPanel());
    276         else if($Panel['Module'] == 'NewsGroupList')
     274        if ($Panel['Module'] == 'Webcam') $Output .= $this->Panel('Kamery', $this->WebcamPanel());
     275        if ($Panel['Module'] == 'Meteo') $Output .= $this->Panel('Meteostanice', $this->MeteoPanel());
     276        else if ($Panel['Module'] == 'NewsGroupList')
    277277          $Output .= $this->Panel('Aktuality', $this->System->ModuleManager->Modules['News']->Show(), array('<a href="?Action=CustomizeNews">Upravit</a>'));
    278278      }
     
    280280    }
    281281    $Output .= '</tr></table>';
    282     return($Output);
     282    return ($Output);
    283283  }
    284284}
Note: See TracChangeset for help on using the changeset viewer.