source: trunk/Modules/ClientVersion/ClientVersion.php@ 637

Last change on this file since 637 was 637, checked in by chronos, 12 years ago
  • Modified: More translated texts.
File size: 2.2 KB
Line 
1<?php
2
3class ModuleClientVersion extends AppModule
4{
5 function __construct($System)
6 {
7 parent::__construct($System);
8 $this->Name = 'ClientVersion';
9 $this->Version = '1.0';
10 $this->Creator = 'Chronos';
11 $this->License = 'GNU/GPL';
12 $this->Description = 'Manage and show list of known versions of WoW client.';
13 $this->Dependencies = array('');
14 }
15
16 function Start()
17 {
18 $this->System->RegisterPage('client-version', 'PageClientVersion');
19 $this->System->RegisterMenuItem(array(
20 'Title' => T('Game version'),
21 'Hint' => 'Seznam verzí herního klienta',
22 'Link' => $this->System->Link('/client-version/'),
23 'Permission' => LICENCE_ANONYMOUS,
24 'Icon' => '',
25 ), 10);
26 }
27}
28
29class PageClientVersion extends Page
30{
31 function Show()
32 {
33 $this->Title = T('Game version');
34 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `ClientVersion`');
35 $DbRow = $DbResult->fetch_row();
36 $PageList = GetPageList($DbRow[0]);
37
38 $Output = '<h3>'.T('Game version').'</h3>'.
39 $PageList['Output'];
40
41 $TableColumns = array(
42 array('Name' => 'Version', 'Title' => T('Version')),
43 array('Name' => 'BuildNumber', 'Title' => T('Build')),
44 array('Name' => 'ReleaseDate', 'Title' => T('Release date')),
45 array('Name' => 'Title', 'Title' => T('Title')),
46 array('Name' => 'Imported', 'Title' => T('Imported')),
47 );
48 $Order = GetOrderTableHeader($TableColumns, 'BuildNumber', 1);
49 $Output .= '<table class="BaseTable">'.
50 $Order['Output'];
51
52 $YesNo = array('Ne', 'Ano');
53
54 $DbResult = $this->System->Database->query('SELECT * FROM ClientVersion '.$Order['SQL'].$PageList['SQLLimit']);
55 while($Version = $DbResult->fetch_assoc())
56 {
57 $Output .= '<tr><td><a href="http://www.wowwiki.com/Patch_'.$Version['Version'].'">'.
58 $Version['Version'].'</a></td><td>'.$Version['BuildNumber'].'</td><td>'.
59 HumanDate($Version['ReleaseDate']).'</td><td>'.$Version['Title'].'</td>'.
60 '<td>'.$YesNo[$Version['Imported']].'</td></tr>';
61 }
62 $Output .= '</table>'.
63 $PageList['Output'];
64 return($Output);
65 }
66}
67
Note: See TracBrowser for help on using the repository browser.