Changeset 538 for trunk/Modules/System/System.php
- Timestamp:
- May 18, 2013, 8:21:50 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/System/System.php
r534 r538 9 9 $this->ShortTitle = 'Moduly'; 10 10 $this->ParentClass = 'PagePortal'; 11 } 12 13 function ShowList() 14 { 15 $Output = ''; 16 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `SystemModule`'); 17 $DbRow = $DbResult->fetch_row(); 18 $PageList = GetPageList($DbRow[0]); 19 20 $Output .= $PageList['Output']; 21 $Output .= '<table class="WideTable" style="font-size: small;">'; 22 23 $TableColumns = array( 24 array('Name' => 'Name', 'Title' => 'Jméno'), 25 array('Name' => 'Creator', 'Title' => 'Tvůrce'), 26 array('Name' => 'Version', 'Title' => 'Verze'), 27 array('Name' => 'License', 'Title' => 'Licence'), 28 array('Name' => 'Installed', 'Title' => 'Instalováno'), 29 array('Name' => 'Description', 'Title' => 'Popis'), 30 array('Name' => 'Dependencies', 'Title' => 'Závislosti'), 31 array('Name' => '', 'Title' => 'Akce'), 32 ); 33 $Order = GetOrderTableHeader($TableColumns, 'Name', 0); 34 $Output .= $Order['Output']; 35 $Query = 'SELECT *, (SELECT GROUP_CONCAT(`T1`.`Name` SEPARATOR ", ") FROM `SystemModuleDependency` '. 36 'LEFT JOIN `SystemModule` AS `T1` ON `T1`.`Id` = `SystemModuleDependency`.`DependencyModule` '. 37 'WHERE `SystemModuleDependency`.`Module` = `SystemModule`.`Id`) AS `Dependencies` '. 38 'FROM `SystemModule` '.$Order['SQL'].$PageList['SQLLimit']; 39 40 $DbResult = $this->Database->query($Query); 41 while($Module = $DbResult->fetch_assoc()) 42 { 43 if($Module['Dependencies'] != '') $Dependencies = $Module['Dependencies']; 44 else $Dependencies = ' '; 45 if($Module['Installed'] == 1) $Installed = 'Ano'; 46 else $Installed = 'Ne'; 47 if($Module['Installed'] == 1) $Actions = '<a href="?A=Uninstall&Id='.$Module['Id'].'">Odinstalovat</a>'; 48 else $Actions = '<a href="?A=Install&Id='.$Module['Id'].'">Instalovat</a>'; 49 $Output .= '<tr><td>'.$Module['Name'].'</td>'. 50 '<td>'.$Module['Creator'].'</td>'. 51 '<td>'.$Module['Version'].'</td>'. 52 '<td>'.$Module['License'].'</td>'. 53 '<td>'.$Installed.'</td>'. 54 '<td>'.$Module['Description'].'</td>'. 55 '<td>'.$Dependencies.'</td>'. 56 '<td>'.$Actions.'</td></tr>'; 57 } 58 $Output .= '</table>'; 59 $Output .= $PageList['Output']; 60 $Output .= '<p><a href="?A=SaveToDb">Uložit do databáze</a></p>'; 61 return($Output); 11 62 } 12 63 … … 31 82 } else $Output .= 'Modul id '.$_GET['Id'].' nenalezen'; 32 83 33 } 84 } else 34 85 if($_GET['A'] == 'Uninstall') 35 86 { … … 40 91 $this->System->ModuleManager->Init(); 41 92 } else $Output .= 'Modul id '.$_GET['Id'].' nenalezen'; 42 } 43 } 44 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `SystemModule`'); 45 $DbRow = $DbResult->fetch_row(); 46 $PageList = GetPageList($DbRow[0]); 47 48 $Output .= $PageList['Output']; 49 $Output .= '<table class="WideTable" style="font-size: small;">'; 50 51 $TableColumns = array( 52 array('Name' => 'Name', 'Title' => 'Jméno'), 53 array('Name' => 'Creator', 'Title' => 'Tvůrce'), 54 array('Name' => 'Version', 'Title' => 'Verze'), 55 array('Name' => 'License', 'Title' => 'Licence'), 56 array('Name' => 'Installed', 'Title' => 'Instalováno'), 57 array('Name' => 'Description', 'Title' => 'Popis'), 58 array('Name' => 'Dependencies', 'Title' => 'Závislosti'), 59 array('Name' => '', 'Title' => 'Akce'), 60 ); 61 $Order = GetOrderTableHeader($TableColumns, 'Name', 0); 62 $Output .= $Order['Output']; 63 $Query = 'SELECT *, (SELECT GROUP_CONCAT(`T1`.`Name` SEPARATOR ", ") FROM `SystemModuleDependency` '. 64 'LEFT JOIN `SystemModule` AS `T1` ON `T1`.`Id` = `SystemModuleDependency`.`DependencyModule` '. 65 'WHERE `SystemModuleDependency`.`Module` = `SystemModule`.`Id`) AS `Dependencies` '. 66 'FROM `SystemModule` '.$Order['SQL'].$PageList['SQLLimit']; 67 68 $DbResult = $this->Database->query($Query); 69 while($Module = $DbResult->fetch_assoc()) 70 { 71 if($Module['Dependencies'] != '') $Dependencies = $Module['Dependencies']; 72 else $Module['Dependencies'] = ' '; 73 if($Module['Installed'] == 1) $Installed = 'Ano'; 74 else $Installed = 'Ne'; 75 if($Module['Installed'] == 1) $Actions = '<a href="?A=Uninstall Id='.$Module['Id'].'">Odinstalovat</a>'; 76 else $Actions = '<a href="?A=Install Id='.$Module['Id'].'">Instalovat</a>'; 77 $Output .= '<tr><td>'.$Module['Name'].'</td>'. 78 '<td>'.$Module['Creator'].'</td>'. 79 '<td>'.$Module['Version'].'</td>'. 80 '<td>'.$Module['License'].'</td>'. 81 '<td>'.$Installed.'</td>'. 82 '<td>'.$Module['Description'].'</td>'. 83 '<td>'.$Dependencies.'</td>'. 84 '<td>'.$Actions.'</td></tr>'; 85 } 86 $Output .= '</table>'; 87 $Output .= $PageList['Output']; 88 $Output .= '<p><a href="?A=SaveToDb">Uložit do databáze</a></p>'; 89 return($Output); 93 } else $Output .= 'Neplatná akce'; 94 } 95 $Output .= $this->ShowList(); 96 return($Output); 90 97 } 91 98 }
Note:
See TracChangeset
for help on using the changeset viewer.