1 | <?php
|
---|
2 |
|
---|
3 | class HomePageController extends Controller
|
---|
4 | {
|
---|
5 | function Show()
|
---|
6 | {
|
---|
7 | $Page = new PageView($this->System);
|
---|
8 | $View = new HomePageView($this->System);
|
---|
9 | return($Page->GetOutput($View->Welcome()));
|
---|
10 | }
|
---|
11 |
|
---|
12 | function Info()
|
---|
13 | {
|
---|
14 | $Page = new PageView($this->System);
|
---|
15 | $View = new HomePageView($this->System);
|
---|
16 | return($Page->GetOutput($View->Info()));
|
---|
17 | }
|
---|
18 |
|
---|
19 | function State()
|
---|
20 | {
|
---|
21 | $Page = new PageView($this->System);
|
---|
22 | $View = new HomePageView($this->System);
|
---|
23 | return($Page->GetOutput($View->State()));
|
---|
24 | }
|
---|
25 |
|
---|
26 | /*
|
---|
27 | class Index extends Page
|
---|
28 | {
|
---|
29 | var $FullTitle = 'Seznam serverů';
|
---|
30 | var $ShortTitle = 'Seznam serverů';
|
---|
31 |
|
---|
32 | function Show()
|
---|
33 | {
|
---|
34 | global $Config;
|
---|
35 |
|
---|
36 | $Output = '';
|
---|
37 | if(array_key_exists('Action', $_GET))
|
---|
38 | {
|
---|
39 | if($_GET['Action'] == 'EmulatorShow')
|
---|
40 | {
|
---|
41 | $EmulatorView = new EmulatorView($this->Database, $this->System);
|
---|
42 | $Output .= $EmulatorView->Item();
|
---|
43 | } else
|
---|
44 | if($_GET['Action'] == 'EmulatorList')
|
---|
45 | {
|
---|
46 | $EmulatorView = new EmulatorView($this->Database, $this->System);
|
---|
47 | $Output .= $EmulatorView->ItemList();
|
---|
48 | } else
|
---|
49 | if($_GET['Action'] == 'EmulatorCompile')
|
---|
50 | {
|
---|
51 | $EmulatorView = new EmulatorView($this->Database, $this->System);
|
---|
52 | $Output .= $EmulatorView->Compile();
|
---|
53 | } else
|
---|
54 | if($_GET['Action'] == 'EmulatorDownload')
|
---|
55 | {
|
---|
56 | $EmulatorView = new EmulatorView($this->Database, $this->System);
|
---|
57 | $Output .= $EmulatorView->Download();
|
---|
58 | } else
|
---|
59 | if($_GET['Action'] == 'EmulatorAdd')
|
---|
60 | {
|
---|
61 | $EmulatorView = new EmulatorView($this->Database, $this->System);
|
---|
62 | $Output .= $EmulatorView->Add();
|
---|
63 | } else
|
---|
64 | if($_GET['Action'] == 'EmulatorAdd2')
|
---|
65 | {
|
---|
66 | $EmulatorView = new EmulatorView($this->Database, $this->System);
|
---|
67 | $Output .= $EmulatorView->AddFinish();
|
---|
68 | } else
|
---|
69 | if($_GET['Action'] == 'ClientList')
|
---|
70 | {
|
---|
71 | $ClientView = new ClientView($this->Database, $this->System);
|
---|
72 | $Output .= $ClientView->ItemList();
|
---|
73 | } else
|
---|
74 | if($_GET['Action'] == 'BackupList')
|
---|
75 | {
|
---|
76 | $BackupView = new BackupView($this->Database, $this->System);
|
---|
77 | $Output .= $BackupView->ItemList();
|
---|
78 | } else
|
---|
79 | if($_GET['Action'] == 'DebugView')
|
---|
80 | {
|
---|
81 | $DebugView = new DebugView($this->Database, $this->System);
|
---|
82 | $Output .= $DebugView->Item();
|
---|
83 | } else
|
---|
84 | if($_GET['Action'] == 'DebugList')
|
---|
85 | {
|
---|
86 | $DebugView = new DebugView($this->Database, $this->System);
|
---|
87 | $Output .= $DebugView->ItemList();
|
---|
88 | } else
|
---|
89 | if($_GET['Action'] == 'UpdateList')
|
---|
90 | {
|
---|
91 | $UpdateView = new UpdateView($this->Database, $this->System);
|
---|
92 | $Output .= $UpdateView->ItemList();
|
---|
93 | } else
|
---|
94 | if($_GET['Action'] == 'BackupAdd')
|
---|
95 | {
|
---|
96 | $BackupView = new BackupView($this->Database, $this->System);
|
---|
97 | $Output .= $BackupView->Add();
|
---|
98 | } else
|
---|
99 | if($_GET['Action'] == 'BackupRestore')
|
---|
100 | {
|
---|
101 | $BackupView = new BackupView($this->Database, $this->System);
|
---|
102 | $Output .= $BackupView->Restore();
|
---|
103 | } else
|
---|
104 | if($_GET['Action'] == 'BackupDownload')
|
---|
105 | {
|
---|
106 | $BackupView = new BackupView($this->Database, $this->System);
|
---|
107 | $Output .= $BackupView->Download();
|
---|
108 | } else
|
---|
109 | if($_GET['Action'] == 'TaskList')
|
---|
110 | {
|
---|
111 | $TaskView = new TaskView($this->Database, $this->System);
|
---|
112 | $Output .= $TaskView->ItemList();
|
---|
113 | } else
|
---|
114 | if($_GET['Action'] == 'TaskShowErrorLog')
|
---|
115 | {
|
---|
116 | $TaskView = new TaskView($this->Database, $this->System);
|
---|
117 | $Output .= $TaskView->ErrorLog();
|
---|
118 | } else
|
---|
119 | if($_GET['Action'] == 'TaskShowStandardLog')
|
---|
120 | {
|
---|
121 | $TaskView = new TaskView($this->Database, $this->System);
|
---|
122 | $Output .= $TaskView->StandardLog();
|
---|
123 | } else
|
---|
124 | if($_GET['Action'] == 'Update')
|
---|
125 | {
|
---|
126 | $UpdateView = new UpdateView($this->Database, $this->System);
|
---|
127 | $Output .= $UpdateView->Update();
|
---|
128 | } else
|
---|
129 | if($_GET['Action'] == 'NewsAdd')
|
---|
130 | {
|
---|
131 | $NewsView = new NewsView($this->Database, $this->System);
|
---|
132 | $Output .= $NewsView->Add();
|
---|
133 | } else
|
---|
134 | if($_GET['Action'] == 'NewsAdd2')
|
---|
135 | {
|
---|
136 | $NewsView = new NewsView($this->Database, $this->System);
|
---|
137 | $Output .= $NewsView->AddFinish();
|
---|
138 | } else
|
---|
139 | if($_GET['Action'] == 'EmulatorShow')
|
---|
140 | {
|
---|
141 | $EmulatorView = new EmulatorView($this->Database, $this->System);
|
---|
142 | $Output .= $EmulatorView->Item();
|
---|
143 | } else
|
---|
144 | if($_GET['Action'] == 'State')
|
---|
145 | {
|
---|
146 | $BaseView = new BaseView($this->Database, $this->System);
|
---|
147 | $Output .= $BaseView->State();
|
---|
148 | } else
|
---|
149 | if($_GET['Action'] == 'RealmList')
|
---|
150 | {
|
---|
151 | $RealmView = new RealmView($this->Database, $this->System);
|
---|
152 | $Output .= $RealmView->ItemList();
|
---|
153 | } else
|
---|
154 | if($_GET['Action'] == 'RealmShow')
|
---|
155 | {
|
---|
156 | $RealmView = new RealmView($this->Database, $this->System);
|
---|
157 | $Output .= $RealmView->Item();
|
---|
158 | } else
|
---|
159 | if($_GET['Action'] == 'RealmAdd')
|
---|
160 | {
|
---|
161 | $RealmView = new RealmView($this->Database, $this->System);
|
---|
162 | $Output .= $RealmView->Add();
|
---|
163 | } else
|
---|
164 | if($_GET['Action'] == 'RealmCreate')
|
---|
165 | {
|
---|
166 | $RealmView = new RealmView($this->Database, $this->System);
|
---|
167 | $Output .= $RealmView->Create();
|
---|
168 | } else
|
---|
169 | if($_GET['Action'] == 'RealmInitDatabase')
|
---|
170 | {
|
---|
171 | $RealmView = new RealmView($this->Database, $this->System);
|
---|
172 | $Output .= $RealmView->InitDatabase();
|
---|
173 | } else
|
---|
174 | if($_GET['Action'] == 'RealmEdit')
|
---|
175 | {
|
---|
176 | $RealmView = new RealmView($this->Database, $this->System);
|
---|
177 | $Output .= $RealmView->Edit();
|
---|
178 | } else
|
---|
179 | if($_GET['Action'] == 'RealmSave')
|
---|
180 | {
|
---|
181 | $RealmView = new RealmView($this->Database, $this->System);
|
---|
182 | $Output .= $RealmView->Save();
|
---|
183 | } else
|
---|
184 | if($_GET['Action'] == 'RealmEditDetailed')
|
---|
185 | {
|
---|
186 | $RealmView = new RealmView($this->Database, $this->System);
|
---|
187 | $Output .= $RealmView->EditDetailed();
|
---|
188 | } else
|
---|
189 | if($_GET['Action'] == 'RealmSaveDetailed')
|
---|
190 | {
|
---|
191 | $RealmView = new RealmView($this->Database, $this->System);
|
---|
192 | $Output .= $RealmView->SaveDetailed();
|
---|
193 | } else
|
---|
194 | if($_GET['Action'] == 'RealmStart')
|
---|
195 | {
|
---|
196 | $RealmView = new RealmView($this->Database, $this->System);
|
---|
197 | $Output .= $RealmView->Start();
|
---|
198 | } else
|
---|
199 | if($_GET['Action'] == 'RealmStop')
|
---|
200 | {
|
---|
201 | $RealmView = new RealmView($this->Database, $this->System);
|
---|
202 | $Output .= $RealmView->Stop();
|
---|
203 | } else
|
---|
204 | if($_GET['Action'] == 'UpdateRealmCharacters')
|
---|
205 | {
|
---|
206 | $Server = new Server($this->Database, $_GET['Id']);
|
---|
207 | $Output .= $Server->UpdateRealmlistAccountCount();
|
---|
208 | } else
|
---|
209 | if($_GET['Action'] == 'Test')
|
---|
210 | {
|
---|
211 | //$Emulator = new Emulator($this->Database, 2);
|
---|
212 | // $Emulator->Compile();
|
---|
213 | //$Server = new Server($this->Database, 1);
|
---|
214 | //$Output .= $Server->ImportDatabase();
|
---|
215 | //$Config = new MangosConfigurationFile($this->Database);
|
---|
216 | //$Config->Load('../emu/mangos/7681/etc/mangosd.conf');
|
---|
217 | //$Config->Save('../server/1/etc/mangosd.conf');
|
---|
218 | } else
|
---|
219 | {
|
---|
220 | $BaseView = new BaseView($this->Database, $this->System);
|
---|
221 | $Output .= $BaseView->Welcome();
|
---|
222 | }
|
---|
223 | } else
|
---|
224 | {
|
---|
225 | $BaseView = new BaseView($this->Database, $this->System);
|
---|
226 | $Output .= $BaseView->Welcome();
|
---|
227 | }
|
---|
228 |
|
---|
229 | $BaseView = new BaseView($this->Database, $this->System);
|
---|
230 | $Content = $Output;
|
---|
231 | $Output = '<table class="BasicTable"><tr>';
|
---|
232 | if($this->System->Modules['User']->User['Id'] != $this->System->Modules['User']->AnonymousUserId)
|
---|
233 | $Output .= '<td class="UserMenu">'.$BaseView->UserMenu().'</td>';
|
---|
234 | $Output .= '<td class="Content">'.$Content.'</td>';
|
---|
235 | if(!array_key_exists('Action', $_GET))
|
---|
236 | {
|
---|
237 | $NewsView = new NewsView($this->Database, $this->System);
|
---|
238 | $Output .= $NewsView->View();
|
---|
239 | }
|
---|
240 | $Output .= '</tr></table>';
|
---|
241 | return($Output);
|
---|
242 | }
|
---|
243 | }
|
---|
244 |
|
---|
245 | $System->AddModule(new Index($Database, $System));
|
---|
246 | $System->Modules['Index']->GetOutput();
|
---|
247 | */
|
---|
248 |
|
---|
249 | }
|
---|
250 |
|
---|
251 | ?>
|
---|