Changeset 816 for trunk/Modules/Download


Ignore:
Timestamp:
Feb 22, 2015, 11:20:50 PM (10 years ago)
Author:
chronos
Message:
  • Modified: Tabs converted to spaces.
  • Modified: Remove spaces from end of lines.
  • Added: Code format script.
File:
1 edited

Legend:

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

    r800 r816  
    33class ModuleDownload extends AppModule
    44{
    5         function __construct($System)
    6         {
    7                 parent::__construct($System);
    8                 $this->Name = 'Download';
    9                 $this->Version = '1.0';
    10                 $this->Creator = 'Maron';
    11                 $this->License = 'GNU/GPL';
    12                 $this->Description = 'Show list of selected export and link to static files';
    13                 $this->Dependencies = array();
    14         }
     5  function __construct($System)
     6  {
     7    parent::__construct($System);
     8    $this->Name = 'Download';
     9    $this->Version = '1.0';
     10    $this->Creator = 'Maron';
     11    $this->License = 'GNU/GPL';
     12    $this->Description = 'Show list of selected export and link to static files';
     13    $this->Dependencies = array();
     14  }
    1515
    16         function Start()
    17         {
    18                 $this->System->RegisterPage('download', 'PageDownload');
    19                 $this->System->RegisterMenuItem(array(
     16  function Start()
     17  {
     18    $this->System->RegisterPage('download', 'PageDownload');
     19    $this->System->RegisterMenuItem(array(
    2020      'Title' => T('Download'),
    2121      'Hint' => T('List of czech to download'),
     
    2424      'Icon' => '',
    2525    ), 1);
    26         }
     26  }
    2727}
    2828
    2929class PageDownload extends Page
    3030{
    31         function ShowFiles()
    32         {
     31  function ShowFiles()
     32  {
    3333    $fileslink = $this->System->Link('/files');
    3434$Output = '<h3>'.T('Accessories for client').'</h3>'.
     
    7575  '<a href="'.$fileslink.'/ClientDBExtractor.exe">ClientDBExtractor.exe</a> - '.T('tool for exporting dbc files from game client').'<br />';
    7676  return($Output);
    77         }
     77  }
    7878
    79         function ShowDownload()
    80         {
     79  function ShowDownload()
     80  {
    8181    $Output = '<h3>'.T('Download czech').'</h3><br />';
    8282
     
    101101    $Output .= '<table class="BaseTable">'.
    102102      $Order['Output'];
    103         $DbRows = $this->Database->query('SELECT `ClientVersion`.`Version` AS `Version`, '.
     103    $DbRows = $this->Database->query('SELECT `ClientVersion`.`Version` AS `Version`, '.
    104104      '`Export`.`Id`, `Export`.`ClientVersion`, `Export`.`OutputType`, `Export`.`Title`, '.
    105105      '`Export`.`Description` FROM `Export` '.
     
    110110        $ExportId = $DbExport['Id'];
    111111
    112                           if ($DbExport['OutputType'] == 10)
    113                     $filename = $this->System->Config['Web']['TempFolder'].'Export/'.$ExportId.'/'.'Instalace_CzechWoW_'.$DbExport['Version'].'.exe';
    114                           if ($DbExport['OutputType'] == 7)
    115                     $filename = $this->System->Config['Web']['TempFolder'].'Export/'.$ExportId.'/'.'CzWoW_Addon-'.$DbExport['Version'].'.zip';
     112        if ($DbExport['OutputType'] == 10)
     113          $filename = $this->System->Config['Web']['TempFolder'].'Export/'.$ExportId.'/'.'Instalace_CzechWoW_'.$DbExport['Version'].'.exe';
     114        if ($DbExport['OutputType'] == 7)
     115          $filename = $this->System->Config['Web']['TempFolder'].'Export/'.$ExportId.'/'.'CzWoW_Addon-'.$DbExport['Version'].'.zip';
    116116
    117                           if ($DbExport['OutputType'] == 10)
     117        if ($DbExport['OutputType'] == 10)
    118118          $Output .= '<tr><td><a href="'.$this->System->Link('/'.$filename).
    119119            '">CzechWoW_'.$DbExport['Version'].'.exe</a><br /> <a href="'.
    120120            $this->System->Link('/export/?Action=View&amp;ExportId='.$ExportId).'">Export '.$ExportId.'</a></td>';
    121121        else
    122                           if ($DbExport['OutputType'] == 7)
     122        if ($DbExport['OutputType'] == 7)
    123123          $Output .= '<tr><td><a href="'.$this->System->Link('/'.$filename).
    124124            '">CzWoW_Addon-'.$DbExport['Version'].'.zip</a><br /> <a href="'.
     
    131131        $Output .= '<td>'.$DbExport['Title'].'</td>'; //.'<td>'.$DbExport['ClientVersion'].'</td>';
    132132
    133                           if ((($DbExport['OutputType'] == 10) or ($DbExport['OutputType'] == 7)) and (file_exists($filename)))
     133        if ((($DbExport['OutputType'] == 10) or ($DbExport['OutputType'] == 7)) and (file_exists($filename)))
    134134          $Output .= '<td>'.date('d.m.y H:i',filemtime($filename)).'</td>';
    135135        else
    136136          $Output .= '<td>&nbsp;</td>';
    137137
    138                                         $Output .=
    139                                         '<td>'.str_replace("\n", '<br />',$DbExport['Description']).'</td>'.
     138          $Output .=
     139          '<td>'.str_replace("\n", '<br />',$DbExport['Description']).'</td>'.
    140140          '</tr>';
    141141    }
     
    146146  }
    147147
    148         function Show()
    149         {
    150                 $this->Title = T('Download');
    151           $Output = '';
     148  function Show()
     149  {
     150    $this->Title = T('Download');
     151    $Output = '';
    152152    if (isset($_GET['Files'])) $Output .= $this->ShowFiles();
    153153    else $Output .= $this->ShowDownload();
Note: See TracChangeset for help on using the changeset viewer.