Changeset 55 for trunk/Modules


Ignore:
Timestamp:
Apr 7, 2020, 12:55:39 AM (4 years ago)
Author:
chronos
Message:
  • Modified: Improved code formatting.
Location:
trunk/Modules
Files:
9 edited

Legend:

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

    r40 r55  
    3939    $this->Title = 'Tanec - Tance - '.$this->Title;
    4040    $Output = '';
    41     if(count($this->System->PathItems) > 1)
     41    if (count($this->System->PathItems) > 1)
    4242    {
    4343      $id = $this->System->PathItems[1] * 1;
     
    6060    $Output .= '<tr><th>Český název</th><th>Anglický název</th><th>Detail</th></tr>';
    6161    $DbResult = $this->Database->select('DanceFigure', '*', '(`Dance`='.$id.')');
    62     while($DanceFigure = $DbResult->fetch_assoc())
     62    while ($DanceFigure = $DbResult->fetch_assoc())
    6363    {
    6464      $Output .= '<tr>'.
     
    7474    $Output .= '<tr><th>Název</th><th>Skupina</th><th>Odkaz</th></tr>';
    7575    $DbResult = $this->Database->select('Resource', '*, (SELECT Name FROM ResourceGroup WHERE ResourceGroup.Id=Resource.Group) AS GroupName', '(`Dance`='.$id.')');
    76     while($DbRow = $DbResult->fetch_assoc())
     76    while ($DbRow = $DbResult->fetch_assoc())
    7777    {
    7878      $Output .= '<tr>'.
     
    8686      /*
    8787          $DbResult2 = $this->Database->select('ResourceGroup', '*');
    88     while($ResourceGroup = $DbResult2->fetch_assoc())
     88    while ($ResourceGroup = $DbResult2->fetch_assoc())
    8989    {
    9090      $Output .= '<th>'.$ResourceGroup['Name'].'</th>';
     
    9292
    9393      $DbResult2 = $this->Database->select('ResourceGroup', '*');
    94       while($ResourceGroup = $DbResult2->fetch_assoc())
     94      while ($ResourceGroup = $DbResult2->fetch_assoc())
    9595      {
    9696        $Output .= '<td>';
    97         while($Resource = $DbResult3->fetch_assoc())
     97        while ($Resource = $DbResult3->fetch_assoc())
    9898        {
    9999          $Output .= '<a href="'.$Resource['URL'].'">'.$Resource['Name'].'</a> ';
     
    122122    $Output .= '<tr><th>Název</th><th>Skupina</th><th>Detail</th></tr>';
    123123    $DbResult = $this->Database->select('Dance', '*, (SELECT Name FROM DanceGroup WHERE DanceGroup.Id=Dance.Group) AS GroupName', '1 ORDER BY `Name`');
    124     while($Dance = $DbResult->fetch_assoc())
     124    while ($Dance = $DbResult->fetch_assoc())
    125125    {
    126126      $Output .= '<tr>'.
     
    132132    $Output .= '</table>';
    133133
    134     return($Output);
     134    return $Output;
    135135  }
    136136}
     
    149149    $this->Title = 'Taneční figura - Tance - '.$this->Title;
    150150    $Output = '';
    151     if(count($this->System->PathItems) > 1)
     151    if (count($this->System->PathItems) > 1)
    152152    {
    153153      $id = $this->System->PathItems[1] * 1;
     
    169169    $Output .= '<tr><th>Skupina videí</th><th></th><th>Detail</th></tr>';
    170170    $DbResult = $this->Database->select('DanceFigure', '*', '(`Dance`='.$id.')');
    171     while($DanceFigure = $DbResult->fetch_assoc())
     171    while ($DanceFigure = $DbResult->fetch_assoc())
    172172    {
    173173      $Output .= '<tr>'.
     
    181181      /*
    182182          $DbResult2 = $this->Database->select('ResourceGroup', '*');
    183     while($ResourceGroup = $DbResult2->fetch_assoc())
     183    while ($ResourceGroup = $DbResult2->fetch_assoc())
    184184    {
    185185      $Output .= '<th>'.$ResourceGroup['Name'].'</th>';
     
    187187
    188188      $DbResult2 = $this->Database->select('ResourceGroup', '*');
    189       while($ResourceGroup = $DbResult2->fetch_assoc())
     189      while ($ResourceGroup = $DbResult2->fetch_assoc())
    190190      {
    191191        $Output .= '<td>';
    192         while($Resource = $DbResult3->fetch_assoc())
     192        while ($Resource = $DbResult3->fetch_assoc())
    193193        {
    194194          $Output .= '<a href="'.$Resource['URL'].'">'.$Resource['Name'].'</a> ';
     
    217217    $Output .= '<tr><th>Název</th><th>Skupina</th><th>Tanec</th><th>Detail</th></tr>';
    218218    $DbResult = $this->Database->select('DanceFigure', '*, (SELECT Dance.Name FROM Dance WHERE Dance.Id=DanceFigure.Dance) AS DanceName', '1 ORDER BY `NameCz`');
    219     while($DbRow = $DbResult->fetch_assoc())
     219    while ($DbRow = $DbResult->fetch_assoc())
    220220    {
    221221      $Output .= '<tr>'.
     
    228228    $Output .= '</table>';
    229229
    230     return($Output);
    231   }
    232 }
     230    return $Output;
     231  }
     232}
  • trunk/Modules/Event/Event.php

    r52 r55  
    117117      $Result = 1;
    118118    } else $Result = 0;
    119     return($Result);
     119    return $Result;
    120120  }
    121121}
  • trunk/Modules/Event/EventPage.php

    r52 r55  
    7979      '(SELECT EventSource.URL FROM EventSource WHERE EventSource.Id = Event.Source) AS SourceURL FROM Event) AS T WHERE (T.Hidden=0) AND '.
    8080      $Where.$Order['SQL'].$PageList['SQLLimit']);
    81     while($Event = $DbResult->fetch_assoc())
     81    while ($Event = $DbResult->fetch_assoc())
    8282    {
    8383      $Output .= '<tr>'.
     
    102102      $Output .= '<div><a href="'.$this->System->Link('/udalosti/rss/').'"><img src="'.$this->System->Link('/images/rss20.png').'" alt="rss20"/></a></div>';
    103103    }
    104     return($Output);
     104    return $Output;
    105105  }
    106106}
     
    138138    $this->Title = 'Událost - Události - '.$this->Title;
    139139    $Output = '';
    140     if(count($this->System->PathItems) > 2)
     140    if (count($this->System->PathItems) > 2)
    141141    {
    142142      $id = $this->System->PathItems[2] * 1;
     
    199199    $DbResult = $this->Database->select('Event', '*, (SELECT EventSource.Name FROM EventSource WHERE EventSource.Id = Event.Source) AS SourceName, '.
    200200      '(SELECT EventSource.URL FROM EventSource WHERE EventSource.Id = Event.Source) AS SourceURL', '`Hidden`=0 ORDER BY `TimeFrom` DESC LIMIT 30');
    201     while($Event = $DbResult->fetch_assoc())
     201    while ($Event = $DbResult->fetch_assoc())
    202202    {
    203203      $Title = $Event['Title'];
  • trunk/Modules/Event/Import/JoeClub.php

    r52 r55  
    4545  {
    4646    $Output = '';
    47     if ($Event->Link == '') return($Output);
     47    if ($Event->Link == '') return $Output;
    4848    $Content = file_get_contents($Event->Link);
    4949
     
    7272      $Time = substr($Time, 0, strpos($Time, '–'));
    7373
    74     if($Time == '') return(NULL);
     74    if ($Time == '') return NULL;
    7575    $Time = str_replace('@', '', $Time);
    7676
  • trunk/Modules/Meet/Meet.php

    r47 r55  
    3434function HumanDateTimeToTime($DateTime)
    3535{
    36   if($DateTime == '') return(NULL);
     36  if ($DateTime == '') return NULL;
    3737  $DateTime = str_replace('. ', '.', $DateTime);
    3838  $Parts = explode(' ', $DateTime);
     
    4444  } else $TimeParts = array(0, 0, 0);
    4545  $Result = mktime($TimeParts[0], $TimeParts[1], $TimeParts[2], $DateParts[1], $DateParts[0], $DateParts[2]);
    46   return($Result);
     46  return $Result;
    4747}
    4848
    4949function HumanDateToTime($Date)
    5050{
    51   if($Date == '') return(NULL);
    52   return(HumanDateTimeToTime($Date.' 0:0:0'));
     51  if ($Date == '') return NULL;
     52  return HumanDateTimeToTime($Date.' 0:0:0');
    5353}
    5454
     
    6060  $ret = html_entity_decode($str, ENT_COMPAT, 'UTF-8');
    6161  $p2 = 0;
    62   for(;;)
     62  for (;;)
    6363  {
    6464    $p = strpos($ret, $prefix, $p2);
     
    105105function is_alpha($Char)
    106106{
    107   return ((($Char >= 'a') and ($Char <= 'z')) or (($Char >= 'A') and ($Char <= 'Z')));
     107  return (($Char >= 'a') and ($Char <= 'z')) or (($Char >= 'A') and ($Char <= 'Z'));
    108108}
    109109
     
    116116{
    117117  $Result = '';
    118   for(;;)
     118  for (;;)
    119119  {
    120120    $Pos = strpos($Text, $Needle);
     
    142142{
    143143  $Result = '';
    144   for(;;)
     144  for (;;)
    145145  {
    146146    $Pos = strpos($Text, $Needle);
     
    432432      $Result = 1;
    433433    } else $Result = 0;
    434     return($Result);
    435   }
    436 }
     434    return $Result;
     435  }
     436}
  • trunk/Modules/Meet/MeetPage.php

    r49 r55  
    8484      '(SELECT MeetSource.URL FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceURL FROM MeetItem) AS T WHERE (T.Hidden=0) AND '.
    8585      $Where.$Order['SQL'].$PageList['SQLLimit']);
    86     while($MeetItem = $DbResult->fetch_assoc())
     86    while ($MeetItem = $DbResult->fetch_assoc())
    8787    {
    8888      $Output .= '<tr>'.
     
    109109      $Output .= '<div><a href="'.$this->System->Link('/seznamka/rss/').'"><img src="'.$this->System->Link('/images/rss20.png').'" alt="rss20"/></a></div>';
    110110    }
    111     return($Output);
     111    return $Output;
    112112  }
    113113}
     
    145145    $this->Title = 'Inzerát - Seznamka - '.$this->Title;
    146146    $Output = '';
    147     if(count($this->System->PathItems) > 2)
     147    if (count($this->System->PathItems) > 2)
    148148    {
    149149      $id = $this->System->PathItems[2] * 1;
     
    211211    $DbResult = $this->Database->select('MeetItem', '*, (SELECT MeetSource.Name FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceName, '.
    212212      '(SELECT MeetSource.URL FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceURL', '`Hidden`=0 ORDER BY `Time` DESC LIMIT 30');
    213     while($MeetItem = $DbResult->fetch_assoc())
     213    while ($MeetItem = $DbResult->fetch_assoc())
    214214    {
    215215      $Title = $MeetItem['Name'];
  • trunk/Modules/Movie/Movie.php

    r46 r55  
    6666    $Output .= '</tr>';
    6767    $DbResult = $this->Database->select('Movie', '*', $Where.$Order['SQL'].$PageList['SQLLimit']);
    68     while($Movie = $DbResult->fetch_assoc())
     68    while ($Movie = $DbResult->fetch_assoc())
    6969    {
    7070      $Output .= '<tr>'.
     
    8080    $Output .= $PageList['Output'];
    8181
    82     return($Output);
     82    return $Output;
    8383  }
    8484}
  • trunk/Modules/RSS/RSS.php

    r37 r55  
    2727    $this->RSSChannels[$Channel['Channel']] = $Channel;
    2828
    29     if(is_null($Pos)) $this->RSSChannelsPos[] = $Channel['Channel'];
     29    if (is_null($Pos)) $this->RSSChannelsPos[] = $Channel['Channel'];
    3030    else {
    3131      array_splice($this->RSSChannelsPos, $Pos, 0, $Channel['Channel']);
     
    4242  {
    4343    $Output = '';
    44     foreach($this->RSSChannels as $Channel)
     44    foreach ($this->RSSChannels as $Channel)
    4545    {
    46       //if($this->System->User->Licence($Channel['Permission']))
     46      //if ($this->System->User->Licence($Channel['Permission']))
    4747        $Output .= ' <link rel="alternate" title="'.$Channel['Title'].'" href="'.
    4848          $this->System->Link('/rss/?channel='.$Channel['Channel']).'" type="application/rss+xml" />';
    4949    }
    50     return($Output);
     50    return $Output;
    5151  }
    5252}
     
    5858    $this->ClearPage = true;
    5959
    60     if(array_key_exists('channel', $_GET)) $ChannelName = $_GET['channel'];
     60    if (array_key_exists('channel', $_GET)) $ChannelName = $_GET['channel'];
    6161      else $ChannelName = '';
    62     if(array_key_exists('token', $_GET)) $Token = $_GET['token'];
     62    if (array_key_exists('token', $_GET)) $Token = $_GET['token'];
    6363      else $Token = '';
    64     if(array_key_exists($ChannelName, $this->System->ModuleManager->Modules['RSS']->RSSChannels))
     64    if (array_key_exists($ChannelName, $this->System->ModuleManager->Modules['RSS']->RSSChannels))
    6565    {
    6666      $Channel = $this->System->ModuleManager->Modules['RSS']->RSSChannels[$ChannelName];
    67       if($this->System->User->CheckPermission($Channel['Permission']['Module'], $Channel['Permission']['Operation']) or
     67      if ($this->System->User->CheckPermission($Channel['Permission']['Module'], $Channel['Permission']['Operation']) or
    6868      $this->System->User->CheckToken($Channel['Permission']['Module'], $Channel['Permission']['Operation'], $Token))
    6969      {
    70         if(is_string($Channel['Callback'][0]))
     70        if (is_string($Channel['Callback'][0]))
    7171        {
    7272          $Class = new $Channel['Callback'][0]($this->System);
     
    7676      } else $Output = 'Nemáte oprávnění';
    7777    } else $Output = 'Kanál nenalezen';
    78     return($Output);
     78    return $Output;
    7979  }
    8080}
  • trunk/Modules/School/School.php

    r37 r55  
    3939    $Output .= '</tr>';
    4040    $DbResult = $this->Database->select('School', '*', '1 ORDER BY `Name`');
    41     while($School = $DbResult->fetch_assoc())
     41    while ($School = $DbResult->fetch_assoc())
    4242    {
    4343      $Output .= '<tr>'.
     
    4949    $Output .= '</table>';
    5050
    51     return($Output);
     51    return $Output;
    5252  }
    5353}
Note: See TracChangeset for help on using the changeset viewer.