source: trunk/Modules/Download/Download.php

Last change on this file was 893, checked in by chronos, 21 months ago
  • Fixed: Class types casting for better type checking.
  • Fixed: XML direct export.
  • Modified: User class instance moved from Core class to ModuleUser class.
File size: 8.4 KB
Line 
1<?php
2
3class ModuleDownload extends Module
4{
5 function __construct(System $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 }
15
16 function DoStart(): void
17 {
18 $this->System->RegisterPage(['download'], 'PageDownload');
19 Core::Cast($this->System)->RegisterMenuItem(array(
20 'Title' => T('Download'),
21 'Hint' => T('List of files for download'),
22 'Link' => $this->System->Link('/download/'),
23 'Permission' => LICENCE_ANONYMOUS,
24 'Icon' => '',
25 ), 1);
26 }
27}
28
29class PageDownload extends Page
30{
31 function ShowFiles()
32 {
33 $fileslink = $this->System->Link('/files');
34 $Output = '<h3>'.T('Accessories for client').'</h3>'.
35 '<strong><a href="'.$fileslink.'/WowLua/wowpatcher.exe">wowpatcher</a></strong> - '.T('Tool to command line, which search and edit file wow.exe for support editing files Glue Strings.lua and GlobalStrings.lua.').' '.
36 T('Designed for one-time creation of new modified version of wow.exe. Help can be called with the - help option. The ability to modify future versions not guaranteed.').' '.
37 '<br /><br/>'.
38 '<strong>WowLua</strong> - '.T('Specific modified version of WoW.exe for free servers with support for translation Lua files').'<br/>'.
39 'enGB a enUS: '.
40 ' <a href="'.$fileslink.'/WowLua/WowLua_3.3.5a.exe">3.3.5a</a>'.
41 ' <a href="'.$fileslink.'/WowLua/WowLua_3.3.3a.exe">3.3.3a</a>'.
42 ' <a href="'.$fileslink.'/WowLua/WowLua_3.3.2.exe">3.3.2</a>'.
43 ' <a href="'.$fileslink.'/WowLua/WowLua_3.3.0a.exe">3.3.0a</a>'.
44 ' <a href="'.$fileslink.'/WowLua/WowLua_2.4.3.exe">2.4.3</a>'.
45 ' <a href="'.$fileslink.'/WowLua/WowLua_1.12.1.exe">1.12.1</a>'.
46 '<br/><br/>'.
47 '<strong>WoWMe</strong> - '.T('Edited files wow.exe with support of translation dbc files').':<br/>'.
48 '<a href="'.$fileslink.'/WoWMe/WoWMe_4.3.4.zip">4.3.4</a> '.
49 '<a href="'.$fileslink.'/WoWMe/WoWMe_3.2.0.rar">3.2.0</a> '.
50 '<a href="'.$fileslink.'/WoWMe/WoWMe_3.1.3.rar">3.1.3</a> '.
51 '<a href="'.$fileslink.'/WoWMe/WoWMe_3.0.3.zip">3.0.3</a> '.
52 '<a href="'.$fileslink.'/WoWMe/WoWMe_2.4.3.zip">2.4.3</a> '.
53 '<br/><br/>'.
54 '<strong>CzechWoW</strong> - '.T('Czech for client with edited client files (old)').'<br/>';
55
56 $Output .= '<a href="'.$fileslink.'/CzechWoW/Instalace_CzechWoW_3.3.5a_2010-09-09.exe">Instalace CzechWoW 3.3.5a 2010-09-09.exe</a><br/>'.
57 '<a href="'.$fileslink.'/CzechWoW/Instalace_CzechWoW_3.3.3a_2010-04-23.exe">Instalace CzechWoW 3.3.3a 2010-04-23.exe</a><br/>'.
58 '<a href="'.$fileslink.'/CzechWoW/Instalace_CzechWoW_3.3.2_2010-04-12.exe">Instalace CzechWoW 3.3.2 2010-04-12.exe</a><br/>'.
59 '<br/>'.
60 '<strong>'.T('Other add-ons').':</strong><br/>'.
61 '<a href="'.$fileslink.'/ceske_fonty_do_wow.zip">'.T('Czech fonts for game').'</a> - '.T('original fonts from game with added czech symbols.').'<br />'.
62 '<a href="http://jenicko.savana.cz/wow/forum/viewtopic.php?id=218&amp;action=all">'.T('Czech shouts from W3').'</a> - '.T('sound files taken from Warcraft 3 and used in wow.').'<br />
63 <br />'.
64 '<h3>'.T('Add-ons for server').':</h3>'.
65
66 '<a href="http://mangos.cjb.net/forums/index.php?showforum=15">'.T('Czech to Minimanager').'</a><br />
67 <a href="http://mangos.cjb.net/forums/index.php?showtopic=359">'.T('Czech for AoWoW').'</a> <a href="'.$fileslink.'/AoWoW.zip">'.T('Czech for AoWoW').' (zip)</a> - '.T('Web viewer database for emulator mangos like wowhead.com').'<br />
68 <br />';
69
70 $Output .= '<h3>'.T('Tools for help').':</h3>'.
71 '<a href="http://zezula.net/download/mpqediten32.zip">Ladik\'s MPQ Editor</a> <a href="http://zezula.net/">'.T('Author page').'</a><br />'.
72 '<a href="'.$fileslink.'/mpq.exe">mpq.exe</a> '.T('command line program for adding files to MPQ archives, created by Maron').'<br />'.
73 '<a href="'.$fileslink.'/wowsig.exe">WoWsig.exe</a> addon signature generator by wad (2005)<br />'.
74 '<a href="'.$fileslink.'/DBCtoCSV.exe">DBCtoCSV</a> - '.T('tool for transform DBC files to CSV').'<br />'.
75 '<a href="'.$fileslink.'/ClientDBExtractor.exe">ClientDBExtractor.exe</a> - '.T('tool for exporting dbc files from game client').'<br />';
76 return $Output;
77 }
78
79 function ShowDownload()
80 {
81 $Output = '<h3>'.T('Download files').'</h3><br />';
82
83 $Output .= T('Additional files: modified wow.exe, fonts to game, translated interface aowow and more can be found on page').
84 ' <a href="'.$this->System->Link('/download/?Files').'">'.T('Files').'</a><br />';
85 $Output .= T('If none of these files is suitable for you, for example, to the Czech without the translated interface. You can generate your own section in section').' <a href="'.$this->System->Link('/export').'">'.T('Export').'</a><br /><br />';
86 $Output .= T('The following files are generated every day, if needed. That means if is added new translation to database. Therefore, if you translate a translation or correct the mistake, tomorrow you can download the new patched version. Or you can rebuild and download for a few minutes the repaired file.').'<br />';
87 $Output .= T('If you no longer want translation in game, you can uninstall it by file Uninstall.exe at the directory of game.').'<br />';
88 $Output .= '<br /><br />';
89
90 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Export` WHERE `Featured`=1');
91 $DbRow = $DbResult->fetch_row();
92 $PageList = GetPageList($DbRow[0]);
93
94 $Output .= $PageList['Output'];
95 $TableColumns = array(
96 array('Name' => 'Version', 'Title' => T('Download')),
97 array('Name' => 'Title', 'Title' => T('Name2'),),
98 array('Name' => 'TimeCreate', 'Title' => T('Creation date')),
99 array('Name' => 'Description', 'Title' => T('Description')),
100 );
101 $Order = GetOrderTableHeader($TableColumns, 'Id', 1);
102 $Output .= '<table class="BaseTable">'.
103 $Order['Output'];
104 $DbRows = $this->Database->query('SELECT `ClientVersion`.`Version` AS `Version`, '.
105 '`Export`.`Id`, `Export`.`ClientVersion`, `Export`.`OutputType`, `Export`.`Title`, '.
106 '`Export`.`Description` FROM `Export` '.
107 'JOIN `ClientVersion` as `ClientVersion` ON `ClientVersion`.`Id`=`Export`.`ClientVersion` '.
108 'WHERE `Featured`=1 '.$Order['SQL'].$PageList['SQLLimit']);
109 while ($DbExport = $DbRows->fetch_assoc())
110 {
111 $ExportId = $DbExport['Id'];
112
113 if ($DbExport['OutputType'] == 10)
114 $filename = Core::Cast($this->System)->Config['Web']['TempFolder'].'Export/'.$ExportId.'/'.'Instalace_CzechWoW_'.$DbExport['Version'].'.exe';
115 if ($DbExport['OutputType'] == 7)
116 $filename = Core::Cast($this->System)->Config['Web']['TempFolder'].'Export/'.$ExportId.'/'.'CzWoW_Addon-'.$DbExport['Version'].'.zip';
117
118 if ($DbExport['OutputType'] == 10)
119 $Output .= '<tr><td><a href="'.$this->System->Link('/'.$filename).
120 '">CzechWoW_'.$DbExport['Version'].'.exe</a><br /> <a href="'.
121 $this->System->Link('/export/?Action=View&amp;ExportId='.$ExportId).'">Export '.$ExportId.'</a></td>';
122 else
123 if ($DbExport['OutputType'] == 7)
124 $Output .= '<tr><td><a href="'.$this->System->Link('/'.$filename).
125 '">CzWoW_Addon-'.$DbExport['Version'].'.zip</a><br /> <a href="'.
126 $this->System->Link('/export/?Action=View&amp;ExportId='.$ExportId).'">Export '.$ExportId.'</a></td>';
127 else
128 $Output .= '<tr><td><a href="'.$this->System->Link('/export/?Action=View&amp;ExportId='.
129 $ExportId.'&amp;Tab=7').'">'.T('Make export').'</a><br /> <a href="'.
130 $this->System->Link('/export/?Action=View&amp;ExportId='.$ExportId).'">Export '.$ExportId.'</a></td>';
131
132 $Output .= '<td>'.$DbExport['Title'].'</td>'; //.'<td>'.$DbExport['ClientVersion'].'</td>';
133
134 if ((($DbExport['OutputType'] == 10) or ($DbExport['OutputType'] == 7)) and (file_exists($filename)))
135 $Output .= '<td>'.date('d.m.y H:i',filemtime($filename)).'</td>';
136 else
137 $Output .= '<td>&nbsp;</td>';
138
139 $Output .=
140 '<td>'.str_replace("\n", '<br />',$DbExport['Description']).'</td>'.
141 '</tr>';
142 }
143 $Output .= '</table>'.
144 $PageList['Output'];
145
146 return $Output;
147 }
148
149 function Show(): string
150 {
151 $this->Title = T('Download');
152 $Output = '';
153 if (isset($_GET['Files'])) $Output .= $this->ShowFiles();
154 else $Output .= $this->ShowDownload();
155
156 return $Output;
157 }
158}
Note: See TracBrowser for help on using the repository browser.