Ignore:
Timestamp:
Apr 14, 2015, 10:20:16 PM (10 years ago)
Author:
chronos
Message:
  • Removed: Spaces on end of line.
  • Modified: Tabs converted to spaces.
File:
1 edited

Legend:

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

    r586 r738  
    1010  var $EventType = array('Žádný', 'Otevřeno', 'Zavřeno');
    1111  var $ParentClass = 'PagePortal';
    12  
     12
    1313  function ToHumanTime($Time)
    1414  {
    1515    $Hours = floor($Time / 60);
    1616    $Minutes = $Time - $Hours * 60;
    17     if($Minutes < 10) $Minutes = '0'.$Minutes;   
     17    if($Minutes < 10) $Minutes = '0'.$Minutes;
    1818    $Hours = $Hours % 24;
    1919    return($Hours.':'.$Minutes);
    20   } 
     20  }
    2121
    2222  function ToHumanTime2($Time)
     
    3333    return($Output);
    3434  }
    35  
     35
    3636  function EditSubject($Id)
    3737  {
     
    7272    return($Output);
    7373  }
    74  
     74
    7575  function SaveSubject($Id)
    7676  {
    7777    global $Config;
    78    
     78
    7979    $Output = '';
    8080    if($this->System->User->CheckPermission('OpeningHours', 'Edit'))
     
    9797        $Day['Close2'] = $_POST['day'.$Index.'_close2_m'] + $_POST['day'.$Index.'_close2_h'] * 60;
    9898        $this->Database->insert('SubjectOpenTimeDay', $Day);
    99       }   
    100       $Output .= 'Uloženo'; 
    101      
     99      }
     100      $Output .= 'Uloženo';
     101
    102102      $File = new File($this->Database);
    103103
     
    112112    } else $Output = 'Nemáte oprávnění';
    113113    return($Output);
    114   } 
    115  
     114  }
     115
    116116  function ShowAll()
    117117  {
     
    121121    {
    122122      $Output .= '<strong>'.$Subject['Name'].':</strong><br />';
    123    
     123
    124124      // Load time event list
    125125      $Events = array();
     
    139139      }
    140140      //print_r($Events);
    141      
     141
    142142      // Calculate time to next event
    143143      if(count($Events) > 0)
    144144      {
    145145        $CurrentTime = ((date('w') + 6) % 7) * 24 * 60 + date('G') * 60 + date('i');
    146      
     146
    147147        $I = 0;
    148         while(($I < count($Events)) and ($Events[$I]['Time'] < $CurrentTime)) 
     148        while(($I < count($Events)) and ($Events[$I]['Time'] < $CurrentTime))
    149149          $I++;
    150150        if($I < count($Events))
     
    152152          $NextTime = $Events[$I]['Time'];
    153153          $NextEventType = $Events[$I]['Type'];
    154         } else 
     154        } else
    155155        {
    156156          $NextTime = $Events[0]['Time'] + 7 * 24 * 60;
    157157          $NextEventType = $Events[0]['Type'];
    158158        }
    159      
     159
    160160        $TimeDelta = $NextTime - $CurrentTime;
    161161        //$Output .= $CurrentTime.' '.$NextTime;
     
    163163          else $Output .= 'Otevírá za '.$this->ToHumanTime2($TimeDelta);
    164164      }
    165      
    166       // Show time inteval table 
     165
     166      // Show time inteval table
    167167      $Output .= '<table class="WideTable"><tr><th>Den</th><th>Čas</th></tr>';
    168168      foreach($this->DaysOfWeek as $DayIndex => $DayOfWeek)
     
    187187      $Output .= '</table>Aktualizováno: '.$Subject['UpdateTime'].'<br />';
    188188      if($Subject['Notice'] != '') $Output .= 'Poznámka: '.$Subject['Notice'].'<br />';
    189      
     189
    190190      if($Subject['Photo'] != 0) $Output .= '<a href="file?id='.$Subject['Photo'].'">Fotka</a> ';
    191      
     191
    192192      if($this->System->User->CheckPermission('SubjectOpenTime', 'Edit'))
    193193        $Output .= '<a href="edit?Subject='.$Subject['Id'].'">Editovat</a><br />';
     
    197197    return($Output);
    198198  }
    199  
     199
    200200  function Show()
    201201  {
    202202    if(count($this->System->PathItems) > 1)
    203     { 
     203    {
    204204      if($this->System->PathItems[1] == 'edit') $Output = $this->EditSubject($_GET['Subject']);
    205       else if($this->System->PathItems[1] == 'save') 
     205      else if($this->System->PathItems[1] == 'save')
    206206      {
    207207        $Output = $this->SaveSubject($_GET['Subject']);
    208208        $Output .= $this->ShowAll();
    209       } else $Output = PAGE_NOT_FOUND;       
    210     } else $Output = $this->ShowAll();   
     209      } else $Output = PAGE_NOT_FOUND;
     210    } else $Output = $this->ShowAll();
    211211    return($Output);
    212212  }
     
    225225    $this->Dependencies = array();
    226226  }
    227  
     227
    228228  function DoStart()
    229229  {
    230230    $this->System->Pages['otviraci-doby'] = 'PageSubjectOpenTime';
    231231  }
    232  
     232
    233233  function DoInstall()
    234234  {
Note: See TracChangeset for help on using the changeset viewer.