source: trunk/Modules/Server/Server.php@ 663

Last change on this file since 663 was 639, checked in by chronos, 12 years ago
  • Added: Make server list more general to cover also non-translated servers.
  • Added: Partialy implemented generic view named PageEdit which serve as template to present item lists, add, delete and modify items.
File size: 2.0 KB
Line 
1<?php
2
3class ModuleServer extends AppModule
4{
5 function __construct($System)
6 {
7 parent::__construct($System);
8 $this->Name = 'Server';
9 $this->Version = '1.0';
10 $this->Creator = 'Chronos';
11 $this->License = 'GNU/GPL';
12 $this->Description = 'Show list of WoW servers which supports translated texts.';
13 $this->Dependencies = array();
14 }
15
16 function Start()
17 {
18 $this->System->RegisterPage('server', 'PageServerList');
19 $this->System->RegisterMenuItem(array(
20 'Title' => T('Servers'),
21 'Hint' => 'Seznam serverů, kde je nasazena čeština v praxi',
22 'Link' => $this->System->Link('/server/'),
23 'Permission' => LICENCE_ANONYMOUS,
24 'Icon' => '',
25 ), 5);
26 }
27}
28
29class PageServerList extends PageEdit
30{
31 function __construct($System)
32 {
33 parent::__construct($System);
34 $this->Table = 'Server';
35 $this->TableSQL = 'SELECT `Name`, `URL`, `Parts`, `XPRate`, `GameplayStyle`, '.
36 '`ClientVersion`.`Version` AS `Version` FROM `Server` '.
37 'LEFT JOIN `ClientVersion` ON `ClientVersion`.`Id` = `Server`.`ClientVersion`';
38 $this->Definition = array(
39 'Name' => array('Type' => 'String', 'Title' => T('Name')),
40 'URL' => array('Type' => 'URL', 'Title' => T('URL')),
41 'Parts' => array('Type' => 'String', 'Title' => T('Translated')),
42 'XPRate' => array('Type' => 'String', 'Title' => T('XP rate')),
43 'GameplayStyle' => array('Type' => 'String', 'Title' => T('Style')),
44 'ClientVersion' => array('Type' => 'String', 'Title' => T('Client version')),
45 );
46 }
47
48 function ViewList()
49 {
50 $this->Title = T('Servers');
51 $Output = '<p>'.T('There are servers listed which are in fact offering translated game. '.
52 'There is resoluted if translation is offered either on client side, on server side or both. '.
53 'Term "Czech server" doesn\'t mean that server is operated by Czech people but that it is possible to play in Czech.').'.</p>';
54 $Output .= '<h3>'.T('Translated server list').'</h3>';
55 $Output .= parent::ViewList();
56 return($Output);
57 }
58}
Note: See TracBrowser for help on using the repository browser.