source: trunk/Modules/Server/Server.php

Last change on this file was 888, checked in by chronos, 17 months ago
  • Modified: Updated Common package to latest version.
  • Modified: Fixes related to PHP 8.x.
File size: 2.5 KB
Line 
1<?php
2
3class ModuleServer extends Module
4{
5 function __construct(System $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 DoStart(): void
17 {
18 $this->System->RegisterPage(['server'], 'PageServerList');
19 Core::Cast($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 $System)
32 {
33 parent::__construct($System);
34 $this->Table = 'Server';
35 $this->TableSQL = 'SELECT `Server`.`Id`, `Name`, `URL`, `Parts`, `XPRate`, `GameplayStyle`, `Description`, `CheckIP`, `CheckPort`, '.
36 '`ClientVersion`.`Version` AS `ClientVersion` FROM `Server` '.
37 'LEFT JOIN `ClientVersion` ON `ClientVersion`.`Id` = `Server`.`ClientVersion`';
38 $this->Definition = array(
39 'Name' => array('Type' => 'String', 'Title' => T('Name'), 'InList' => true),
40 'URL' => array('Type' => 'URL', 'Title' => T('URL'), 'InList' => true),
41 'Parts' => array('Type' => 'String', 'Title' => T('Translated'), 'InList' => true),
42 'XPRate' => array('Type' => 'String', 'Title' => T('XP rate'), 'InList' => true),
43 'GameplayStyle' => array('Type' => 'String', 'Title' => T('Style'), 'InList' => true),
44 'ClientVersion' => array('Type' => 'String', 'Title' => T('Client version'), 'InList' => true),
45 'Description' => array('Type' => 'Text', 'Title' => T('Description'), 'InList' => false),
46 'CheckIP' => array('Type' => 'Text', 'Title' => T('Online check IP'), 'InList' => false),
47 'CheckPort' => array('Type' => 'Text', 'Title' => T('Online check port'), 'InList' => false),
48 );
49 }
50
51 function ViewList()
52 {
53 $this->Title = T('Servers');
54 $Output = '<p>'.T('There are servers listed which are in fact offering translated game. '.
55 'There is resoluted if translation is offered either on client side, on server side or both. '.
56 'Term "Czech server" doesn\'t mean that server is operated by Czech people but that it is possible to play in Czech.').'.</p>';
57 $Output .= '<h3>'.T('Translated server list').'</h3>';
58 $Output .= parent::ViewList();
59 return $Output;
60 }
61}
Note: See TracBrowser for help on using the repository browser.