Changeset 424 for branches/Modular/Install.php
- Timestamp:
- Oct 10, 2012, 9:29:20 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Modular/Install.php
r403 r424 2 2 3 3 include_once('Common/Global.php'); 4 /* @var $System System */ 5 $System = NULL; 4 6 GlobalInit(); 7 8 function ModuleTable() 9 { 10 global $System; 11 12 $Output = '<table border="1" style="border: 1px" class="WideTable">'. 13 '<tr><th>Name</th><th>Installed</th><th>Version</th><th>Dependency</th><th>Actions</th></tr>'; 14 foreach($System->Modules as $Module) 15 { 16 if($Module->Installed) $Actions = '<a href="?a=uninstall&m='.$Module->Name.'">Odinstalovat</td>'; 17 else $Actions = '<a href="?a=install&m='.$Module->Name.'">Instalovat</td>'; 18 if($Module->Installed) $Installed = 'Ano'; 19 else $Installed = 'Ne'; 20 $Deps = implode(', ', $Module->Dependencies); 21 if($Deps == '') $Deps = ' '; 22 $Output .= '<tr><td>'.$Module->Name.'</td><td>'.$Installed.'</td><td>'. 23 $Module->Version.'</td><td>'.$Deps.'</td><td>'.$Actions.'</td></tr>'; 24 } 25 $Output .= '</table>'; 26 return($Output); 27 } 5 28 6 29 function ShowDefault() … … 8 31 global $System; 9 32 10 if($System->IsInstalled()) 11 { 12 echo('System je již nainstalován.<br/>'); 13 echo('<a href="?a=uninstall">Odinstalovat systém</a>'); 33 if($System->Modules['System']->IsInstalled()) 34 { 35 $Output = ModuleTable(); 36 $Output .= '<a href="?a=uninstall">Odinstalovat systém</a>'; 37 $Output .= ' <a href="?a=reload">Aktualizovat seznam z disku</a>'; 14 38 } else 15 39 { 16 echo('System ještě není instalován.<br/>'); 17 echo('<a href="?a=install">Instalovat systém</a>'); 18 } 40 $Output = 'System ještě není instalován.<br/>'; 41 $Output .= '<a href="?a=install">Instalovat systém</a>'; 42 } 43 echo($Output); 19 44 } 20 45 46 if($System->Modules['System']->IsInstalled()) 47 $System->Modules['System']->LoadFromDatabase(); 48 49 if($Config['Web']['SystemAdministration'] == true) 50 { 21 51 if(array_key_exists('a', $_GET)) 22 52 { 23 53 if($_GET['a'] == 'install') 24 54 { 25 $System->Install(); 26 $System->Init(); 55 if(array_key_exists('m', $_GET)) 56 { 57 $Module = $System->Modules[$_GET['m']]; 58 $Module->Install(); 59 } else 60 { 61 $System->Modules['System']->Install(); 62 $System->ReloadFromDisk(); 63 $System->Modules['System']->SaveToDatabase(); 64 } 27 65 ShowDefault(); 28 66 } 29 67 else if($_GET['a'] == 'uninstall') 30 68 { 31 $System->Init(); 32 $System->Uninstall(); 69 if(array_key_exists('m', $_GET)) 70 { 71 $Module = $System->Modules[$_GET['m']]; 72 $Module->Uninstall(); 73 //$System->Modules['System']->SaveToDatabase(); 74 } else 75 { 76 $System->Modules['System']->Uninstall(); 77 } 78 ShowDefault(); 79 } else if($_GET['a'] == 'reload') 80 { 81 $System->ReloadFromDisk(); 82 $System->Modules['System']->SaveToDatabase(); 33 83 ShowDefault(); 34 84 } 35 85 else ShowDefault(); 36 86 } else ShowDefault(); 87 } else echo('Access denied'); 37 88 38 89 ?>
Note:
See TracChangeset
for help on using the changeset viewer.