Changeset 72
- Timestamp:
- Aug 23, 2009, 6:37:45 PM (15 years ago)
- Location:
- trunk/www/Application
- Files:
-
- 5 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/Application/Controller/HomePage.php
r71 r72 37 37 if(array_key_exists('Action', $_GET)) 38 38 { 39 if($_GET['Action'] == 'EmulatorShow')40 {41 $EmulatorView = new EmulatorView($this->Database, $this->System);42 $Output .= $EmulatorView->Item();43 } else44 if($_GET['Action'] == 'EmulatorList')45 {46 $EmulatorView = new EmulatorView($this->Database, $this->System);47 $Output .= $EmulatorView->ItemList();48 } else49 if($_GET['Action'] == 'EmulatorCompile')50 {51 $EmulatorView = new EmulatorView($this->Database, $this->System);52 $Output .= $EmulatorView->Compile();53 } else54 if($_GET['Action'] == 'EmulatorDownload')55 {56 $EmulatorView = new EmulatorView($this->Database, $this->System);57 $Output .= $EmulatorView->Download();58 } else59 if($_GET['Action'] == 'EmulatorAdd')60 {61 $EmulatorView = new EmulatorView($this->Database, $this->System);62 $Output .= $EmulatorView->Add();63 } else64 if($_GET['Action'] == 'EmulatorAdd2')65 {66 $EmulatorView = new EmulatorView($this->Database, $this->System);67 $Output .= $EmulatorView->AddFinish();68 } else69 if($_GET['Action'] == 'ClientList')70 {71 $ClientView = new ClientView($this->Database, $this->System);72 $Output .= $ClientView->ItemList();73 } else74 39 if($_GET['Action'] == 'BackupList') 75 40 { 76 41 $BackupView = new BackupView($this->Database, $this->System); 77 42 $Output .= $BackupView->ItemList(); 78 } else79 if($_GET['Action'] == 'DebugView')80 {81 $DebugView = new DebugView($this->Database, $this->System);82 $Output .= $DebugView->Item();83 } else84 if($_GET['Action'] == 'DebugList')85 {86 $DebugView = new DebugView($this->Database, $this->System);87 $Output .= $DebugView->ItemList();88 43 } else 89 44 if($_GET['Action'] == 'UpdateList') … … 107 62 $Output .= $BackupView->Download(); 108 63 } else 109 if($_GET['Action'] == 'TaskList')110 {111 $TaskView = new TaskView($this->Database, $this->System);112 $Output .= $TaskView->ItemList();113 } else114 if($_GET['Action'] == 'TaskShowErrorLog')115 {116 $TaskView = new TaskView($this->Database, $this->System);117 $Output .= $TaskView->ErrorLog();118 } else119 if($_GET['Action'] == 'TaskShowStandardLog')120 {121 $TaskView = new TaskView($this->Database, $this->System);122 $Output .= $TaskView->StandardLog();123 } else124 64 if($_GET['Action'] == 'Update') 125 65 { … … 127 67 $Output .= $UpdateView->Update(); 128 68 } else 129 if($_GET['Action'] == 'NewsAdd')130 {131 $NewsView = new NewsView($this->Database, $this->System);132 $Output .= $NewsView->Add();133 } else134 if($_GET['Action'] == 'NewsAdd2')135 {136 $NewsView = new NewsView($this->Database, $this->System);137 $Output .= $NewsView->AddFinish();138 } else139 if($_GET['Action'] == 'EmulatorShow')140 {141 $EmulatorView = new EmulatorView($this->Database, $this->System);142 $Output .= $EmulatorView->Item();143 } else144 if($_GET['Action'] == 'State')145 {146 $BaseView = new BaseView($this->Database, $this->System);147 $Output .= $BaseView->State();148 } else149 if($_GET['Action'] == 'RealmList')150 {151 $RealmView = new RealmView($this->Database, $this->System);152 $Output .= $RealmView->ItemList();153 } else154 if($_GET['Action'] == 'RealmShow')155 {156 $RealmView = new RealmView($this->Database, $this->System);157 $Output .= $RealmView->Item();158 } else159 if($_GET['Action'] == 'RealmAdd')160 {161 $RealmView = new RealmView($this->Database, $this->System);162 $Output .= $RealmView->Add();163 } else164 if($_GET['Action'] == 'RealmCreate')165 {166 $RealmView = new RealmView($this->Database, $this->System);167 $Output .= $RealmView->Create();168 } else169 if($_GET['Action'] == 'RealmInitDatabase')170 {171 $RealmView = new RealmView($this->Database, $this->System);172 $Output .= $RealmView->InitDatabase();173 } else174 if($_GET['Action'] == 'RealmEdit')175 {176 $RealmView = new RealmView($this->Database, $this->System);177 $Output .= $RealmView->Edit();178 } else179 if($_GET['Action'] == 'RealmSave')180 {181 $RealmView = new RealmView($this->Database, $this->System);182 $Output .= $RealmView->Save();183 } else184 if($_GET['Action'] == 'RealmEditDetailed')185 {186 $RealmView = new RealmView($this->Database, $this->System);187 $Output .= $RealmView->EditDetailed();188 } else189 if($_GET['Action'] == 'RealmSaveDetailed')190 {191 $RealmView = new RealmView($this->Database, $this->System);192 $Output .= $RealmView->SaveDetailed();193 } else194 if($_GET['Action'] == 'RealmStart')195 {196 $RealmView = new RealmView($this->Database, $this->System);197 $Output .= $RealmView->Start();198 } else199 if($_GET['Action'] == 'RealmStop')200 {201 $RealmView = new RealmView($this->Database, $this->System);202 $Output .= $RealmView->Stop();203 } else204 if($_GET['Action'] == 'UpdateRealmCharacters')205 {206 $Server = new Server($this->Database, $_GET['Id']);207 $Output .= $Server->UpdateRealmlistAccountCount();208 } else209 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 } else219 {220 $BaseView = new BaseView($this->Database, $this->System);221 $Output .= $BaseView->Welcome();222 }223 } else224 {225 $BaseView = new BaseView($this->Database, $this->System);226 $Output .= $BaseView->Welcome();227 }228 69 229 70 $BaseView = new BaseView($this->Database, $this->System); -
trunk/www/Application/Controller/Include.php
r71 r72 5 5 include('Application/Controller/Server.php'); 6 6 include('Application/Controller/User.php'); 7 include('Application/Controller/Client.php'); 8 include('Application/Controller/Emulator.php'); 9 include('Application/Controller/Task.php'); 10 include('Application/Controller/News.php'); 11 include('Application/Controller/Debug.php'); 7 12 8 13 ?> -
trunk/www/Application/Controller/Realm.php
r69 r72 3 3 class RealmController extends Controller 4 4 { 5 5 function ItemList() 6 { 7 $Page = new PageView($this->System); 8 $View = new RealmView($this->System); 9 return($Page->GetOutput($View->ItemList())); 10 } 11 12 function Show() 13 { 14 $Page = new PageView($this->System); 15 $View = new RealmView($this->System); 16 return($Page->GetOutput($View->Item())); 17 } 18 19 function Add() 20 { 21 $Page = new PageView($this->System); 22 $View = new RealmView($this->System); 23 return($Page->GetOutput($View->Add())); 24 } 25 26 function Create() 27 { 28 $Page = new PageView($this->System); 29 $View = new RealmView($this->System); 30 return($Page->GetOutput($View->Create())); 31 } 32 33 function InitDatabase() 34 { 35 $Page = new PageView($this->System); 36 $View = new RealmView($this->System); 37 return($Page->GetOutput($View->InitDatabase())); 38 } 39 40 function Edit() 41 { 42 $Page = new PageView($this->System); 43 $View = new RealmView($this->System); 44 return($Page->GetOutput($View->Edit())); 45 } 46 47 function Save() 48 { 49 $Page = new PageView($this->System); 50 $View = new RealmView($this->System); 51 return($Page->GetOutput($View->Save())); 52 } 53 54 function EditDetailed() 55 { 56 $Page = new PageView($this->System); 57 $View = new RealmView($this->System); 58 return($Page->GetOutput($View->EditDetailed())); 59 } 60 61 function SaveDetailed() 62 { 63 $Page = new PageView($this->System); 64 $View = new RealmView($this->System); 65 return($Page->GetOutput($View->SaveDetailed())); 66 } 67 68 function Start() 69 { 70 $Page = new PageView($this->System); 71 $View = new RealmView($this->System); 72 return($Page->GetOutput($View->Start())); 73 } 74 75 function Stop() 76 { 77 $Page = new PageView($this->System); 78 $View = new RealmView($this->System); 79 return($Page->GetOutput($View->Stop())); 80 } 81 82 function UpdateCharacters() 83 { 84 $Page = new PageView($this->System); 85 $View = new RealmView($this->System); 86 return($Page->GetOutput($View->UpdateRealmlistAccountCount())); 87 } 6 88 } 7 89 -
trunk/www/Application/View/Debug.php
r69 r72 28 28 function ShowListOnRow($Row) 29 29 { 30 $Row['Time'] = '<a href="? Action=DebugView&Id='.$Row['Id'].'&Show=Backtrace">'.str_replace(' ', ' ', $Row['Time']).'</a>';30 $Row['Time'] = '<a href="?Module=Debug&Action=View&Id='.$Row['Id'].'&Show=Backtrace">'.str_replace(' ', ' ', $Row['Time']).'</a>'; 31 31 $Row['Uptime'] = TimeToHumanTime($Row['Uptime']); 32 32 return($Row); … … 69 69 70 70 $MangosDebug = new MangosDebug($this->Database, $this->System); 71 $Form = new Form($this-> ItemFormClass);71 $Form = new Form($this->System, $this->ItemFormClass); 72 72 if($Form->LoadValuesFromDatabase($_GET['Id'])) 73 73 { … … 75 75 $Output .= $Form->ShowTable(); 76 76 77 $Output .= '<a href="? Action=DebugView&Id='.$_GET['Id'].'&Show=Backtrace">Backtrace</a>'.78 ' <a href="? Action=DebugView&Id='.$_GET['Id'].'&Show=Log">Mangos log</a>'.79 ' <a href="? Action=DebugView&Id='.$_GET['Id'].'&Show=Error">Console error log</a>'.80 ' <a href="? Action=DebugView&Id='.$_GET['Id'].'&Show=DbErrors">Database error log</a>'.81 ' <a href="? Action=DebugView&Id='.$_GET['Id'].'&Show=Configuration">Mangos configuration</a>'.77 $Output .= '<a href="?Module=Debug&Action=View&Id='.$_GET['Id'].'&Show=Backtrace">Backtrace</a>'. 78 ' <a href="?Module=Debug&Action=View&Id='.$_GET['Id'].'&Show=Log">Mangos log</a>'. 79 ' <a href="?Module=Debug&Action=View&Id='.$_GET['Id'].'&Show=Error">Console error log</a>'. 80 ' <a href="?Module=Debug&Action=View&Id='.$_GET['Id'].'&Show=DbErrors">Database error log</a>'. 81 ' <a href="?Module=Debug&Action=View&Id='.$_GET['Id'].'&Show=Configuration">Mangos configuration</a>'. 82 82 '<hr>'; 83 83 if(array_key_exists('Show', $_GET)) -
trunk/www/Application/View/Emulator.php
r69 r72 43 43 foreach($Table->Values as $Index => $Item) 44 44 { 45 $Table->Values[$Index]['Actions'] = '<a href="? Action=EmulatorShow&Id='.$Item['Id'].'">Podrobnosti</a>';45 $Table->Values[$Index]['Actions'] = '<a href="?Module=Emulator&Action=Show&Id='.$Item['Id'].'">Podrobnosti</a>'; 46 46 unset($Table->Values[$Index]['Id']); 47 47 } … … 49 49 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR) 50 50 { 51 $Output .= '<br /><div style="text-align: center;"><a href="? Action=EmulatorAdd">Přidat emulátor</a></dev>';51 $Output .= '<br /><div style="text-align: center;"><a href="?Module=Emulator&Action=Add">Přidat emulátor</a></dev>'; 52 52 } 53 53 return($Output); … … 59 59 //$Server = new Server($this->Database, $Id); 60 60 $Output = '<h4>Podrobnosti emulátoru</h4>'; 61 $Form = new Form($this-> ItemFormClass);61 $Form = new Form($this->System, $this->ItemFormClass); 62 62 $Form->LoadValuesFromDatabase($Id); 63 63 $Output .= $Form->ShowTable(); … … 66 66 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR) 67 67 { 68 if($Emulator->Emulator['Lock'] == 0) $Output .= ' <a href="? Action=EmulatorDownload&Id='.$Id.'">Stáhnout</a>';69 if($Emulator->Emulator['Lock'] == 0) $Output .= ' <a href="? Action=EmulatorCompile&Id='.$Id.'">Přeložit</a>';68 if($Emulator->Emulator['Lock'] == 0) $Output .= ' <a href="?Module=Emulator&Action=Download&Id='.$Id.'">Stáhnout</a>'; 69 if($Emulator->Emulator['Lock'] == 0) $Output .= ' <a href="?Module=Emulator&Action=Compile&Id='.$Id.'">Přeložit</a>'; 70 70 } 71 71 $Output .= '</div>'; … … 77 77 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR) 78 78 { 79 $Form = new Form($this-> ItemFormClass);79 $Form = new Form($this->System, $this->ItemFormClass); 80 80 $Form->LoadValuesFromForm(); 81 $Form->OnSubmit = '? Action=EmulatorAdd2';81 $Form->OnSubmit = '?Module=Emulator&Action=AddFinish'; 82 82 $Output = $Form->ShowEditForm(); 83 83 } else $Output = USER_BAD_ROLE; … … 89 89 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR) 90 90 { 91 $Form = new Form($this-> ItemFormClass);91 $Form = new Form($this->System, $this->ItemFormClass); 92 92 $Form->LoadValuesFromForm(); 93 93 $Form->SaveValuesToDatabase(0); -
trunk/www/Application/View/News.php
r69 r72 16 16 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR) 17 17 { 18 $Form = new Form($this-> ItemFormClass);18 $Form = new Form($this->System, $this->ItemFormClass); 19 19 $Form->LoadValuesFromForm(); 20 20 $Form->Values['Time'] = 'NOW()'; … … 30 30 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR) 31 31 { 32 $Form = new Form($this-> ItemFormClass);33 $Form->OnSubmit = '? Action=NewsAdd2';32 $Form = new Form($this->System, $this->ItemFormClass); 33 $Form->OnSubmit = '?Module=News&Action=AddFinish'; 34 34 $Output = $Form->ShowEditForm(); 35 35 } else $Output = USER_BAD_ROLE; -
trunk/www/Application/View/Realm.php
r69 r72 118 118 foreach($Table->Values as $Index => $Item) 119 119 { 120 $Table->Values[$Index]['Actions'] = '<a href="? Action=RealmShow&Id='.$Item['Id'].'">Podrobnosti</a>';120 $Table->Values[$Index]['Actions'] = '<a href="?Module=Realm&Action=Show&Id='.$Item['Id'].'">Podrobnosti</a>'; 121 121 unset($Table->Values[$Index]['Id']); 122 122 } … … 130 130 //$DbRow = $DbResult->fetch_row(); 131 131 if(($RealmCount < $Config['MaxRealmPerServerCount'])) 132 $Output .= '<br /><div style="text-align: center;"><a href="? Action=RealmAdd">Vytvořit nový svět</a></dev>';132 $Output .= '<br /><div style="text-align: center;"><a href="?Module=Realm&Action=Add">Vytvořit nový svět</a></dev>'; 133 133 } 134 134 return($Output); … … 144 144 //{ 145 145 $Output = '<h4>Podrobnosti světa</h4>'; 146 $Form = new Form($this-> ItemFormClass);146 $Form = new Form($this->System, $this->ItemFormClass); 147 147 $Form->LoadValuesFromDatabase($Id); 148 148 $Form->Definition['Items']['Uptime'] = array('Type' => 'String', 'Caption' => 'Doba běhu', 'Default' => ''); … … 159 159 if(array_key_exists('Id', $Realm->Data['Database']) and ($Realm->Data['Lock'] == 0)) 160 160 { 161 if($RealmStatus['WorlddPortState'] == true) $Output .= ' <a href="? Action=RealmStop&Id='.$Realm->Id.'">Zastavit</a> <a href="?Action=RealmRestart&Id='.$Realm->Id.'">Restartovat</a>';162 else $Output .= ' <a href="? Action=RealmStart&Id='.$Realm->Id.'">Spustit</a>';161 if($RealmStatus['WorlddPortState'] == true) $Output .= ' <a href="?Module=Realm&Action=Stop&Id='.$Realm->Id.'">Zastavit</a> <a href="?Module=Realm&Action=Restart&Id='.$Realm->Id.'">Restartovat</a>'; 162 else $Output .= ' <a href="?Module=Realm&Action=Start&Id='.$Realm->Id.'">Spustit</a>'; 163 163 } 164 164 if($Realm->Data['Lock'] == 0) 165 165 { 166 $Output .= ' <a href="? Action=RealmEdit&Id='.$Realm->Id.'">Upravit základní nastavení</a>';167 $Output .= ' <a href="? Action=RealmEditDetailed&Id='.$Realm->Id.'">Upravit podrobné nastavení</a>';168 $Output .= ' <a href="? Action=RealmInitDatabase&Id='.$Realm->Id.'">Vynulovat databázi</a>';166 $Output .= ' <a href="?Module=Realm&Action=Edit&Id='.$Realm->Id.'">Upravit základní nastavení</a>'; 167 $Output .= ' <a href="?Module=Realm&Action=EditDetailed&Id='.$Realm->Id.'">Upravit podrobné nastavení</a>'; 168 $Output .= ' <a href="?Module=Realm&Action=InitDatabase&Id='.$Realm->Id.'">Vynulovat databázi</a>'; 169 169 } 170 $Output .= ' <a href="? Action=DebugList&Id='.$Realm->Id.'">Ladící informace</a>';170 $Output .= ' <a href="?Module=Debug&Action=ItemList&Id='.$Realm->Id.'">Ladící informace</a>'; 171 171 //$Output .= ' <a href="?Action=ServerDatabaseImport&Id='.$Server->Id.'">Načtení čisté databáze</a>'; 172 172 } … … 193 193 else 194 194 { 195 $Form = new Form($this-> CreateFormClass);195 $Form = new Form($this->System, $this->CreateFormClass); 196 196 $Form->LoadValuesFromForm(); 197 $Form->OnSubmit = '? Action=RealmCreate&Id='.$ServerId;197 $Form->OnSubmit = '?Module=Realm&Action=Create&Id='.$ServerId; 198 198 $Output .= 'Tento formulář vám umožní si vytvořit nový svět. Pečlivě vyplňte požadované údaje.'; 199 199 $Output .= $Form->ShowEditForm(); … … 223 223 if($NewPortWorldd < $Config['BaseNetworkPortWorldd']) $NewPortWorldd = $Config['BaseNetworkPortWorldd']; 224 224 225 $Form = new Form($this-> CreateFormClass, array());225 $Form = new Form($this->System, $this->CreateFormClass, array()); 226 226 $Form->LoadValuesFromForm(); 227 227 $this->Database->insert('Realm', array('Name' => $Form->Values['Name'], 'Description' => $Form->Values['Description'], 'Server' => $ServerId, 'Motd' => $Form->Values['Motd'], 'Homepage' => $Form->Values['Homepage'], 'Type' => $Form->Values['Type'], 'Database' => $Form->Values['Database'], 'NetworkPortWorldd' => $NewPortWorldd, 'Lock' => 1, 'TimeCreate' => 'NOW()')); … … 247 247 if(($this->System->Modules['User']->User['Id'] == $Realm->GetUser()) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 248 248 { 249 $Form = new Form($this-> EditFormClass, array());249 $Form = new Form($this->System, $this->EditFormClass, array()); 250 250 $Form->LoadValuesFromForm(); 251 251 $RealmId = $_POST['RealmId']; … … 253 253 $Output .= $this->System->SystemMessage('Upravit svět', 'Nastavení světa uloženo.'); 254 254 $Form->SaveValuesToDatabase($_POST['RealmId']); 255 $Form->OnSubmit = '? Action=RealmSave';255 $Form->OnSubmit = '?Module=Realm&Action=Save'; 256 256 257 257 $Realm = new Realm($this->Database, $_POST['RealmId']); … … 269 269 if(($this->System->Modules['User']->User['Id'] == $Realm->GetUser()) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 270 270 { 271 $Form = new Form($this-> EditFormClass);271 $Form = new Form($this->System, $this->EditFormClass); 272 272 $Form->LoadValuesFromDatabase($_GET['Id']); 273 273 $Form->Values['RealmId'] = $_GET['Id']; 274 $Form->OnSubmit = '? Action=RealmSave';274 $Form->OnSubmit = '?Module=Realm&Action=Save'; 275 275 $Output .= $Form->ShowEditForm(); 276 276 } else $Output = $this->System->SystemMessage('Nastavení světa', 'Nemáte oprávnění'); … … 284 284 if(($this->System->Modules['User']->User['Id'] == $Realm->GetUser()) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 285 285 { 286 $Form = new Form($this->S ettingDetailedFormClass);286 $Form = new Form($this->System, $this->SettingDetailedFormClass); 287 287 $EmulatorConfig = new MangosConfigurationFile($this->Database); 288 288 $EmulatorConfig->Load('../realm/'.$Realm->Id.'/etc/mangosd.conf'); … … 291 291 $Form->Values[str_replace('.', '_', $Index)] = $Item; 292 292 $Form->Values['RealmId'] = $_GET['Id']; 293 $Form->OnSubmit = '? Action=RealmSaveDetailed';293 $Form->OnSubmit = '?Module=Realm&Action=SaveDetailed'; 294 294 $Output .= $Form->ShowEditForm(); 295 295 } else $this->System->SystemMessage('Nastavení světa', 'Nemáte oprávnění'); … … 303 303 if(($this->System->Modules['User']->User['Id'] == $Realm->GetUser()) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 304 304 { 305 $Form = new Form($this->S ettingDetailedFormClass, array());305 $Form = new Form($this->System, $this->SettingDetailedFormClass, array()); 306 306 $Form->LoadValuesFromForm(); 307 307 $EmulatorConfig = new MangosConfigurationFile($this->Database); … … 318 318 $Output .= $this->System->SystemMessage('Upravit svět', 'Nastavení světa uloženo.'); 319 319 //$Form->SaveValuesToDatabase($_POST['ServerId']); 320 $Form->OnSubmit = '? Action=RealmSaveDetailed';320 $Form->OnSubmit = '?Module=Realm&Action=SaveDetailed'; 321 321 322 322 $Realm = new Realm($this->Database, $_POST['RealmId']); -
trunk/www/Application/View/Task.php
r69 r72 37 37 foreach($Table->Values as $Index => $Item) 38 38 { 39 $Table->Values[$Index]['Actions'] = '<a href="? Action=TaskShowErrorLog&Id='.$Item['Id'].'">Výpis chyb</a> <a href="?Action=TaskShowStandardLog&Id='.$Item['Id'].'">Výpis výstupu</a> ';39 $Table->Values[$Index]['Actions'] = '<a href="?Module=Task&Action=ErrorLog&Id='.$Item['Id'].'">Výpis chyb</a> <a href="?Module=Task&Action=StandardLog&Id='.$Item['Id'].'">Výpis výstupu</a> '; 40 40 unset($Table->Values[$Index]['Id']); 41 41 }
Note:
See TracChangeset
for help on using the changeset viewer.