Changeset 815 for trunk/Modules


Ignore:
Timestamp:
Feb 22, 2015, 11:05:49 PM (9 years ago)
Author:
chronos
Message:
  • Remove: Trailing spaces from end of lines from all files.
Location:
trunk/Modules
Files:
5 edited

Legend:

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

    r626 r815  
    1313    $this->Dependencies = array();
    1414  }
    15  
     15
    1616  function Start()
    1717  {
  • trunk/Modules/Import/generatecodeXML.php

    r565 r815  
    33//$xml_buffer = array();
    44
    5 function startElement($parser, $name, $attrs) 
     5function startElement($parser, $name, $attrs)
    66{
    77  global $depth, $xml_buffer;
    8  
    9   for ($i = 0; $i < $depth[$parser]; $i++) 
     8
     9  for ($i = 0; $i < $depth[$parser]; $i++)
    1010  {
    1111    echo "  ";
     
    1414//    print_r( $attrs);
    1515   // generování proměných
    16    
     16
    1717   $xml_buffer[count($xml_buffer)+1] = array($depth[$parser],$attrs);
    1818 //  print_r($xml_buffer);
     
    2020}
    2121
    22 function endElement($parser, $name) 
     22function endElement($parser, $name)
    2323{
    2424  global $depth;
    25  
     25
    2626  $depth[$parser]--;
    2727}
     
    3030
    3131$files = scandir($verze);
    32 foreach($files as $file) 
     32foreach($files as $file)
    3333{
    3434  $end = substr($file, strlen($file) - 3);
     
    3636  {
    3737    echo('<br />--'.$file.'<br /><br />');
    38     $file = $verze.'/'.$file; 
     38    $file = $verze.'/'.$file;
    3939    $xml_buffer = array(); //mazání
    40  
     40
    4141    $xml_parser = xml_parser_create();
    4242    xml_set_element_handler($xml_parser, 'startElement', 'endElement');
    43     if (!($fp = fopen($file, 'r'))) 
     43    if (!($fp = fopen($file, 'r')))
    4444    {
    4545      die('could not open XML input');
    4646    }
    4747
    48     while ($data = fread($fp, 4096)) 
     48    while ($data = fread($fp, 4096))
    4949    {
    50       if (!xml_parse($xml_parser, $data, feof($fp))) 
     50      if (!xml_parse($xml_parser, $data, feof($fp)))
    5151      {
    5252        die(sprintf("XML error: %s at line %d",
     
    5656    }
    5757    xml_parser_free($xml_parser);
    58  
    59     for ($i = 0; $i < count($xml_buffer); $i++) 
     58
     59    for ($i = 0; $i < count($xml_buffer); $i++)
    6060    {
    6161      $line = $xml_buffer[$i];
    62        if (isset($line[1]['TEXT'])) 
     62       if (isset($line[1]['TEXT']))
    6363      {
    6464        $name = $line[1]['NAME'];
    6565
    66         if ($name == '') 
     66        if ($name == '')
    6767        { //u FontString
    6868          $j = 1;
    69           while (substr($name,0,1) == '') 
     69          while (substr($name,0,1) == '')
    7070          {
    71             if (isset($xml_buffer[$i-$j][1]['NAME'])) 
     71            if (isset($xml_buffer[$i-$j][1]['NAME']))
    7272            {
    73               $name = $xml_buffer[$i-$j][1]['NAME'].$name; 
     73              $name = $xml_buffer[$i-$j][1]['NAME'].$name;
    7474            }
    75             $j++;         
     75            $j++;
    7676          }
    7777        }
    7878
    79         if (substr($name,0,1) == '$') 
     79        if (substr($name,0,1) == '$')
    8080        { //zjišťování potomků
    8181          $j = 1;
    82           while (substr($name,0,1) == '$') 
     82          while (substr($name,0,1) == '$')
    8383          {
    84             if (($xml_buffer[$i-$j][0] < $line[0]) and (isset($xml_buffer[$i-$j][1]['NAME']))) 
     84            if (($xml_buffer[$i-$j][0] < $line[0]) and (isset($xml_buffer[$i-$j][1]['NAME'])))
    8585            {
    8686              $name = substr($name,strlen('$parent'));
    87               $name = $xml_buffer[$i-$j][1]['NAME'].$name; 
     87              $name = $xml_buffer[$i-$j][1]['NAME'].$name;
    8888            }
    89             $j++;         
     89            $j++;
    9090          }
    9191        }
  • trunk/Modules/News/News.php

    r765 r815  
    66{
    77  var $RSSChannels;
    8  
     8
    99  function __construct($System)
    1010  {
     
    1717    $this->Dependencies = array();
    1818  }
    19  
     19
    2020  function Start()
    2121  {
    2222        $this->System->RegisterPage('news', 'PageNews');
    2323        $this->System->RegisterPage('rss', 'PageRSS');
    24         $this->RegisterRSS(array('Title' => T('News'), 'Channel' => 'news', 
     24        $this->RegisterRSS(array('Title' => T('News'), 'Channel' => 'news',
    2525          'Callback' => array('PageNews', 'ShowRSS'), 'Permission' => LICENCE_ANONYMOUS));
    2626  }
    27  
     27
    2828  function ShowBox()
    2929  {
     
    3737        return($Output);
    3838  }
    39  
     39
    4040  function RegisterRSS($Channel, $Pos = NULL, $Callback = NULL)
    4141  {
     
    4747    }
    4848  }
    49  
     49
    5050  function ShowRSSHeader()
    5151  {
    52     $Output = ''; 
     52    $Output = '';
    5353    foreach($this->RSSChannels as $Channel)
    5454                {
     
    5656                          $Output .= ' <link rel="alternate" title="'.$Channel['Title'].'" href="'.
    5757                        $this->System->Link('/rss/?channel='.$Channel['Channel']).'" type="application/rss+xml" />';
    58                 }               
     58                }
    5959    return($Output);
    6060  }
     
    7474                return($Output);
    7575        }
    76        
     76
    7777        function ShowList()
    7878        {
     
    8282               
    8383                $Output = '<h3>'.T('News').'</h3>'.$PageList['Output'];
    84                 if($this->System->User->Licence(LICENCE_ADMIN)) 
     84                if($this->System->User->Licence(LICENCE_ADMIN))
    8585                        $Output .= ' <a href="?a=add">'.T('Add').'</a>';
    8686                $Output .= '<div class="shoutbox">';
     
    9090                        $Output .= '<div><strong>'.$Line['Title'].' ('.HumanDate($Line['Time']).')</strong><br/> '.$Line['Text'].' ('.$Line['User'].')</div>';
    9191                $Output .= '</div>'.$PageList['Output'];
    92                 return($Output);               
     92                return($Output);
    9393        }
    94        
     94
    9595        function ShowAddForm()
    9696        {
     
    124124                return($Output);
    125125        }
    126        
     126
    127127        function ShowRSS()
    128128        {
     
    149149            'Items' => $Items,
    150150          ));
    151           return($Output);       
     151          return($Output);
    152152        }
    153153}
  • trunk/Modules/ShoutBox/ShoutBox.php

    r805 r815  
    1313    $this->Dependencies = array('News');
    1414  }
    15  
     15
    1616  function Start()
    1717  {
    1818        $this->System->RegisterPage('shoutbox', 'PageShoutBox');
    1919        $this->System->ModuleManager->Modules['News']->RegisterRSS(array(
    20           'Title' => T('Shoutbox'), 'Channel' => 'shoutbox', 'Callback' => array('PageShoutBox', 'ShowRSS'), 
    21           'Permission' => LICENCE_ANONYMOUS));           
     20          'Title' => T('Shoutbox'), 'Channel' => 'shoutbox', 'Callback' => array('PageShoutBox', 'ShowRSS'),
     21          'Permission' => LICENCE_ANONYMOUS));
    2222    if(array_key_exists('Search', $this->System->ModuleManager->Modules))
    2323      $this->System->ModuleManager->Modules['Search']->RegisterSearch('shoutbox',
    2424      T('Shoutbox'), array('UserName', 'Text'), '`ShoutBox`', $this->System->Link('/shoutbox/?search='));
    2525  }
    26  
     26
    2727  function ShowBox()
    2828  {
     
    3737        $Output .= '</table></div>';
    3838        return($Output);
    39   }   
     39  }
    4040}
    4141
     
    5353                return($Output);
    5454        }
    55        
     55
    5656        function ShowList()
    5757        {
     
    6464                        $SearchQuery = ' AND (`Text` LIKE "%'.$_SESSION['search'].'%")';
    6565                        $Output .= '<div><a href="?search=">'.sprintf(T('Disable filter "%s"'), $_SESSION['search']).'</a></div>';
    66                 } else $SearchQuery = '';                       
     66                } else $SearchQuery = '';
    6767
    6868        $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `ShoutBox` WHERE 1'.$SearchQuery);
     
    7171
    7272                $Output .= '<h3>'.T('Shoutbox').'</h3>'.$PageList['Output'];
    73                 if($this->System->User->Licence(LICENCE_USER)) 
     73                if($this->System->User->Licence(LICENCE_USER))
    7474                        $Output .= ' <a href="'.$this->System->Link('/shoutbox/?a=add').'">'.T('Add').'</a>';
    7575                $Output .= '<div class="shoutbox">';
     
    8080                return($Output);
    8181        }
    82        
     82
    8383        function ShowAddForm()
    8484        {
     
    9898                }       else $Output .= ShowMessage('Pro vkládaní zpráv musíte byt registrováni.', MESSAGE_CRITICAL);
    9999                $Output .= $this->ShowList();
    100           return($Output);     
     100          return($Output);
    101101        }
    102        
     102
    103103        function AddFinish()
    104104        {
     
    134134                $Output .= $this->ShowList();
    135135                return($Output);
    136         }       
    137        
     136        }
     137
    138138        function ShowRSS()
    139139        {
  • trunk/Modules/Translation/Translation.php

    r806 r815  
    2020    $this->Dependencies = array('News');
    2121  }
    22  
     22
    2323  function Start()
    2424  {
    2525        global $TranslationTree;
    26        
     26
    2727                $this->System->RegisterPage('comparison.php', 'PageTranslationComparison');
    2828        $this->System->RegisterPage('form.php', 'PageTranslationForm');
     
    3131    $this->System->RegisterPage('TranslationList.php', 'PageTranslationList');
    3232    $this->System->RegisterPage('LoadNames.php', 'PageLoadNames');
    33     $this->System->ModuleManager->Modules['News']->RegisterRSS(array('Title' => T('Last translations'), 
     33    $this->System->ModuleManager->Modules['News']->RegisterRSS(array('Title' => T('Last translations'),
    3434      'Channel' => 'translation', 'Callback' => array($this, 'ShowRSS'), 'Permission' => LICENCE_ANONYMOUS));
    3535    $this->System->RegisterMenuItem(array(
     
    3939        'Permission' => LICENCE_ANONYMOUS,
    4040        'Icon' => '',
    41     ), 1);   
     41    ), 1);
    4242    if(array_key_exists('Search', $this->System->ModuleManager->Modules))
    4343    {
     
    4545                  {
    4646                          $Table = $Group['TablePrefix'];
    47        
     47
    4848                                $Columns = array('ID', 'Entry');
    4949                          foreach($Group['Items'] as $Item)
    5050                          {
    5151                                if($Item['Column'] != '') $Columns[] = $Item['Column'];
    52                           } 
     52                          }
    5353
    5454        $this->System->ModuleManager->Modules['Search']->RegisterSearch('group'.$Group['Id'],
    5555        sprintf(T('Translation group "%s"'), $Group['Name']), $Columns, '`'.$Table.'`', $this->System->Link('/TranslationList.php?group='.
    56         $Group['Id'].'&amp;user=0&amp;state=0&amp;entry=&amp;text='));                 
     56        $Group['Id'].'&amp;user=0&amp;state=0&amp;entry=&amp;text='));
    5757                }
    58     }     
     58    }
    5959  }
    60  
     60
    6161  function ShowRSS()
    6262  {
Note: See TracChangeset for help on using the changeset viewer.