Changeset 731 for trunk/Modules
- Timestamp:
- Jan 17, 2015, 9:24:47 PM (10 years ago)
- Location:
- trunk/Modules
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/IS/IS.php
r721 r731 756 756 { 757 757 parent::__construct($System); 758 $this->Name = 'Information system'; 758 $this->Name = 'IS'; 759 $this->Title = 'Information system'; 759 760 $this->Version = '1.0'; 760 761 $this->Creator = 'Chronos'; -
trunk/Modules/Network/Network.php
r715 r731 15 15 function Show() 16 16 { 17 // http://en.wikipedia.org/wiki/List_of_WLAN_channels 18 //$ChannelList = array(2412 => 1, 2417 => 2, 2422 => 3, 2427 => 4, 2432 => 5, 2437 => 6, 2442 => 7, 2447 => 8, 2452 => 9, 2457 => 10, 2462 => 11, 2467 => 12, 2472 => 13, 5200 => 40, 5205 => 41, 5210 => 42, 5215 => 43, 5220 => 44, 5225 => 45, 5230 => 46, 5235 => 47, 5240 => 48, 5245 => 49, 5250 => 50, 5255 => 51, 5260 => 52, 5265 => 53, 5270 => 54, 5275 => 55, 5280 => 56, 5285 => 57, 5290 => 58, 5295 => 59, 5300 => 60, 5500 => 100, 5520 => 104, 5540 => 108, 5560 => 112, 5580 => 116, 5600 => 120, 5620 => 124, 5640 => 128, 5660 => 132, 5700 => 140, 5720 => 144); 19 $Output = '<div align="center">'. 20 '<a href="?section=obsazeni_wifi_kanalu&range=a">Pásmo 2,4 GHz (a)</a> '. 21 '<a href="?section=obsazeni_wifi_kanalu&range=bc">Pásmo 5 GHz dolní (b, c)</a> '. 22 '<a href="?section=obsazeni_wifi_kanalu&range=d">Pásmo 5 GHz horní (d)</a> '. 23 '<a href="http://www.ctu.cz/1/download/Opatreni%20obecne%20povahy/VO_R_12_08_2005_34.pdf">VO_R_12_08_2005_34</a><br/>'. 24 '<strong>Seznam známých AP a obsazení kmitočtových pásem:</strong></div>'. 25 '<table class="WideTable">'. 26 '<tr><th/><br/>SSID<br/><br/></th>'; 27 $ChannelList = array(); 28 if(!array_key_exists('range', $_GET)) $_GET['range'] = 'a'; 29 if($_GET['range'] == 'a') 30 { 31 $Where = '(Frequency < 5000)'; 32 for($Freq = 2402; $Freq <= 2482; $Freq = $Freq + 5) $ChannelList[] = $Freq; 33 } 34 if($_GET['range'] == 'bc') 35 { 36 $Where = '(Frequency >= 5000) AND (Frequency <= 5350)'; 37 for($Freq = 5150; $Freq <= 5350; $Freq = $Freq + 5) $ChannelList[] = $Freq; 38 } 39 if($_GET['range'] == 'd') 40 { 41 $Where = '(Frequency >= 5470)'; 42 for($Freq = 5470; $Freq <= 5725; $Freq = $Freq + 5) $ChannelList[] = $Freq; 43 } 44 17 // http://en.wikipedia.org/wiki/List_of_WLAN_channels 18 //$ChannelList = array(2412 => 1, 2417 => 2, 2422 => 3, 2427 => 4, 2432 => 5, 2437 => 6, 2442 => 7, 2447 => 8, 2452 => 9, 2457 => 10, 2462 => 11, 2467 => 12, 2472 => 13, 5200 => 40, 5205 => 41, 5210 => 42, 5215 => 43, 5220 => 44, 5225 => 45, 5230 => 46, 5235 => 47, 5240 => 48, 5245 => 49, 5250 => 50, 5255 => 51, 5260 => 52, 5265 => 53, 5270 => 54, 5275 => 55, 5280 => 56, 5285 => 57, 5290 => 58, 5295 => 59, 5300 => 60, 5500 => 100, 5520 => 104, 5540 => 108, 5560 => 112, 5580 => 116, 5600 => 120, 5620 => 124, 5640 => 128, 5660 => 132, 5700 => 140, 5720 => 144); 19 $Output = '<div align="center">'. 20 '<a href="?section=obsazeni_wifi_kanalu&range=a">Pásmo 2,4 GHz (a)</a> '. 21 '<a href="?section=obsazeni_wifi_kanalu&range=bc">Pásmo 5 GHz dolní (b, c)</a> '. 22 '<a href="?section=obsazeni_wifi_kanalu&range=d">Pásmo 5 GHz horní (d)</a> '. 23 '<a href="http://www.ctu.cz/1/download/Opatreni%20obecne%20povahy/VO_R_12_08_2005_34.pdf">VO_R_12_08_2005_34</a><br/>'. 24 '<strong>Seznam známých AP a obsazení kmitočtových pásem:</strong></div>'. 25 '<table class="WideTable">'. 26 '<tr><th/><br/>SSID<br/><br/></th>'; 27 $ChannelList = array(); 28 if(!array_key_exists('range', $_GET)) $_GET['range'] = 'a'; 29 if($_GET['range'] == 'a') 30 { 31 $Where = '(Frequency < 5000)'; 32 for($Freq = 2402; $Freq <= 2482; $Freq = $Freq + 5) $ChannelList[] = $Freq; 33 } 34 if($_GET['range'] == 'bc') 35 { 36 $Where = '(Frequency >= 5000) AND (Frequency <= 5350)'; 37 for($Freq = 5150; $Freq <= 5350; $Freq = $Freq + 5) $ChannelList[] = $Freq; 38 } 39 if($_GET['range'] == 'd') 40 { 41 $Where = '(Frequency >= 5470)'; 42 for($Freq = 5470; $Freq <= 5725; $Freq = $Freq + 5) $ChannelList[] = $Freq; 43 } 44 45 foreach($ChannelList as $Frequency) 46 { 47 $Output .= '<th><div class="RotatedHeader">'.$Frequency.'<div></th>'; 48 } 49 $Output .= '</tr>'; 50 $DbResult = $this->Database->query('SELECT `Frequency` FROM `NetworkInterfaceWireless` WHERE '.$Where.' AND (`Mode`=0) GROUP BY `Frequency`'); 51 while($DbRow = $DbResult->fetch_assoc()) 52 { 53 $DbResult2 = $this->Database->query('SELECT * FROM `NetworkInterfaceWireless` WHERE (`Frequency`='.$DbRow['Frequency'].') AND '.$Where); 54 while($DbRow2 = $DbResult2->fetch_assoc()) 55 { 56 $LowFrequency = $DbRow['Frequency'] - $DbRow2['ChannelWidth'] / 2 - $DbRow2['ChannelWidthLower']; 57 $HighFrequency = $DbRow['Frequency'] + $DbRow2['ChannelWidth'] / 2 + $DbRow2['ChannelWidthUpper']; 58 $Output .= '<tr><td>'.$DbRow2['SSID'].'</td>'; 45 59 foreach($ChannelList as $Frequency) 46 60 { 47 $Output .= '<th><div class="RotatedHeader">'.$Frequency.'<div></th>'; 61 if(($DbRow2['Frequency'] == $Frequency)) $Color = '#000000'; 62 else if(($LowFrequency <= ($Frequency - 2.5)) and ($HighFrequency >= ($Frequency + 2.5))) $Color = '#808080'; 63 else if(($LowFrequency == $Frequency) or ($HighFrequency == $Frequency)) $Color = '#c0c0c0'; 64 else $Color = '#ffffff'; 65 $Output .= '<td style="background-color: '.$Color.';"> </td>'; 48 66 } 49 $Output .= '</tr>'; 50 $DbResult = $this->Database->query('SELECT `Frequency` FROM `NetworkInterfaceWireless` WHERE '.$Where.' AND (`Mode`=0) GROUP BY `Frequency`'); 51 while($DbRow = $DbResult->fetch_assoc()) 52 { 53 $DbResult2 = $this->Database->query('SELECT * FROM `NetworkInterfaceWireless` WHERE (`Frequency`='.$DbRow['Frequency'].') AND '.$Where); 54 while($DbRow2 = $DbResult2->fetch_assoc()) 55 { 56 $LowFrequency = $DbRow['Frequency'] - $DbRow2['ChannelWidth'] / 2 - $DbRow2['ChannelWidthLower']; 57 $HighFrequency = $DbRow['Frequency'] + $DbRow2['ChannelWidth'] / 2 + $DbRow2['ChannelWidthUpper']; 58 $Output .= '<tr><td>'.$DbRow2['SSID'].'</td>'; 59 foreach($ChannelList as $Frequency) 60 { 61 if(($DbRow2['Frequency'] == $Frequency)) $Color = '#000000'; 62 else if(($LowFrequency <= ($Frequency - 2.5)) and ($HighFrequency >= ($Frequency + 2.5))) $Color = '#808080'; 63 else if(($LowFrequency == $Frequency) or ($HighFrequency == $Frequency)) $Color = '#c0c0c0'; 64 65 else $Color = '#ffffff'; 66 $Output .= '<td style="background-color: '.$Color.';"> </td>'; 67 } 68 69 $Output .= '</tr>'; 70 } 71 } 72 $Output .= '</table>'; 67 68 $Output .= '</tr>'; 69 } 70 } 71 $Output .= '</table>'; 73 72 return($Output); 74 73 } … … 250 249 ), 251 250 )); 252 $this->System->FormManager->RegisterClass('NetworkDeviceConfig', array(251 $this->System->FormManager->RegisterClass('NetworkDeviceConfig', array( 253 252 'Title' => 'Nastavení zařízení', 254 253 'Table' => 'NetworkDeviceConfig', … … 261 260 'ConfigCompact' => array('Type' => 'Text', 'Caption' => 'Rozdílové nastavení', 'Default' => ''), 262 261 ), 262 )); 263 $this->System->FormManager->RegisterClass('NetworkDomain', array( 264 'Title' => 'Síťová doména', 265 'Table' => 'NetworkDomain', 266 'DefaultSortColumn' => 'Name', 267 'DefaultSortOrder' => 1, 268 'Items' => array( 269 'Name' => array('Type' => 'String', 'Caption' => 'Jméno', 'Default' => ''), 270 'Description' => array('Type' => 'String', 'Caption' => 'Popis', 'Default' => ''), 271 'Parent' => array('Type' => 'TNetworkDomain', 'Caption' => 'Nadřazená doména', 'Default' => '', 'Null' => true), 272 'Serial' => array('Type' => 'Integer', 'Caption' => 'Sériové číslo', 'Default' => '1'), 273 'Minimum' => array('Type' => 'Integer', 'Caption' => 'Minimum', 'Default' => '10800'), 274 'Retry' => array('Type' => 'Integer', 'Caption' => 'Opakování', 'Default' => '7200'), 275 'Expire' => array('Type' => 'Integer', 'Caption' => 'Čas vypršení', 'Default' => '2419200'), 276 'Refresh' => array('Type' => 'Integer', 'Caption' => 'Obnovení', 'Default' => '28800'), 277 'TTL' => array('Type' => 'Integer', 'Caption' => 'TTL', 'Default' => '86400', 'Suffix' => 'sekund'), 278 ), 279 )); 280 $this->System->FormManager->RegisterFormType('TNetworkDomain', array( 281 'Type' => 'Reference', 282 'Table' => 'NetworkDomain', 283 'Id' => 'Id', 284 'Name' => 'Name', 285 'Filter' => '1', 263 286 )); 264 287 $this->System->FormManager->RegisterClass('DeviceAPIType', array( … … 358 381 'Name' => 'Name', 359 382 'Filter' => '1', 360 )); 383 )); 361 384 $this->System->FormManager->RegisterFormType('TDeviceList', array( 362 385 'Type' => 'ManyToOne', -
trunk/Modules/System/System.php
r712 r731 14 14 { 15 15 $Output = ''; 16 $DbResult = $this->Database->query('SELECT COUNT(*) FROM ` SystemModule`');16 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `Module`'); 17 17 $DbRow = $DbResult->fetch_row(); 18 18 $PageList = GetPageList($DbRow[0]); … … 22 22 23 23 $TableColumns = array( 24 25 26 27 28 29 30 31 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 32 ); 33 33 $Order = GetOrderTableHeader($TableColumns, 'Name', 0); 34 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'];35 $Query = 'SELECT *, (SELECT GROUP_CONCAT(`T1`.`Name` SEPARATOR ", ") FROM `ModuleLink` '. 36 'LEFT JOIN `Module` AS `T1` ON `T1`.`Id` = `ModuleLink`.`LinkedModule` '. 37 'WHERE `ModuleLink`.`Module` = `Module`.`Id`) AS `Dependencies` '. 38 'FROM `Module` '.$Order['SQL'].$PageList['SQLLimit']; 39 39 40 40 $DbResult = $this->Database->query($Query); … … 69 69 if($_GET['A'] == 'SaveToDb') 70 70 { 71 $ this->System->ModuleManager->Modules['System']->SaveToDatabase();71 $Output .= $this->System->ModuleManager->Modules['System']->SaveToDatabase(); 72 72 $Output .= $this->SystemMessage('Načtení modulů', 'Seznam modulů v databázi zaktualizován'); 73 73 } else … … 225 225 'Name' => array('Type' => 'String', 'Caption' => 'Systémové jméno', 'Default' => ''), 226 226 'Title' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 227 'Description' => array('Type' => 'Text', 'Caption' => 'Popis', 'Default' => ''), 228 'Version' => array('Type' => 'String', 'Caption' => 'Verze', 'Default' => ''), 229 'License' => array('Type' => 'String', 'Caption' => 'Licence', 'Default' => ''), 230 'Creator' => array('Type' => 'String', 'Caption' => 'Tvůrce', 'Default' => ''), 231 'HomePage' => array('Type' => 'Hyperlink', 'Caption' => 'Domovské stránky', 'Default' => ''), 232 'Installed' => array('Type' => 'Boolean', 'Caption' => 'Instalováno', 'Default' => '', 'ReadOnly' => true), 233 'Models' => array('Type' => 'TModelListModule', 'Caption' => 'Modely', 'Default' => ''), 234 'Links' => array('Type' => 'TModuleLinkListModule', 'Caption' => 'Vazby', 'Default' => ''), 235 ), 236 'Actions' => array( 237 array('Caption' => 'Aktualizovat z disku', 'URL' => '/module/?A=SaveToDb'), 238 ), 239 )); 240 $this->System->FormManager->RegisterFormType('TModule', array( 241 'Type' => 'Reference', 242 'Table' => 'Module', 243 'Id' => 'Id', 244 'Name' => 'Title', 245 'Filter' => '1', 246 )); 247 $this->System->FormManager->RegisterFormType('TModelListModule', array( 248 'Type' => 'ManyToOne', 249 'Table' => 'Model', 250 'Id' => 'Id', 251 'Ref' => 'Module', 252 'Filter' => '1', 253 )); 254 $this->System->FormManager->RegisterClass('Model', array( 255 'Title' => 'Modely', 256 'Table' => 'Model', 257 'Items' => array( 258 'Name' => array('Type' => 'String', 'Caption' => 'Systémové jméno', 'Default' => ''), 259 'Title' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 260 'Module' => array('Type' => 'TModule', 'Caption' => 'Module', 'Default' => ''), 261 'Query' => array('Type' => 'String', 'Caption' => 'SQL dotaz', 'Default' => ''), 262 'DefaultSortColumn' => array('Type' => 'String', 'Caption' => 'Výchozí sloupce řazení', 'Default' => ''), 263 'DefaultSortOrder' => array('Type' => 'Text', 'Caption' => 'Výchozí směr řazení', 'Default' => ''), 264 'Fields' => array('Type' => 'TModelFieldListModel', 'Caption' => 'Pole', 'Default' => ''), 265 ), 266 )); 267 $this->System->FormManager->RegisterFormType('TModel', array( 268 'Type' => 'Reference', 269 'Table' => 'Model', 270 'Id' => 'Id', 271 'Name' => 'Title', 272 'Filter' => '1', 273 )); 274 $this->System->FormManager->RegisterFormType('TModelFieldListModel', array( 275 'Type' => 'ManyToOne', 276 'Table' => 'ModelField', 277 'Id' => 'Id', 278 'Ref' => 'Model', 279 'Filter' => '1', 280 )); 281 $this->System->FormManager->RegisterClass('ModelField', array( 282 'Title' => 'Pole modelu', 283 'Table' => 'ModelField', 284 'Items' => array( 285 'Name' => array('Type' => 'String', 'Caption' => 'Systémové jméno', 'Default' => ''), 286 'Title' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 287 'Model' => array('Type' => 'TModel', 'Caption' => 'Model', 'Default' => ''), 288 'Query' => array('Type' => 'String', 'Caption' => 'SQL dotaz', 'Default' => ''), 289 'Type' => array('Type' => 'String', 'Caption' => 'Typ', 'Default' => ''), 290 'DefaultValue' => array('Type' => 'String', 'Caption' => 'Výchozí hodnota', 'Default' => ''), 291 'IsNull' => array('Type' => 'Boolean', 'Caption' => 'Také nulová hodnota', 'Default' => ''), 292 'Suffix' => array('Type' => 'String', 'Caption' => 'Text za', 'Default' => ''), 293 ), 294 )); 295 $this->System->FormManager->RegisterFormType('TModuleLink', array( 296 'Type' => 'Reference', 297 'Table' => 'ModuleLink', 298 'Id' => 'Id', 299 'Name' => 'Module', 300 'Filter' => '1', 301 )); 302 $this->System->FormManager->RegisterFormType('TModuleLinkListModule', array( 303 'Type' => 'ManyToOne', 304 'Table' => 'ModuleLink', 305 'Id' => 'Id', 306 'Ref' => 'Module', 307 'Filter' => '1', 308 )); 309 $this->System->FormManager->RegisterClass('ModuleLink', array( 310 'Title' => 'Vazby modulu', 311 'Table' => 'ModuleLink', 312 'Items' => array( 313 'Module' => array('Type' => 'TModule', 'Caption' => 'Modul', 'Default' => ''), 314 'LinkedModule' => array('Type' => 'TModule', 'Caption' => 'Vázaný modul', 'Default' => ''), 315 'Type' => array('Type' => 'String', 'Caption' => 'Typ vazby', 'Default' => ''), 227 316 ), 228 317 )); … … 232 321 'DefaultSortColumn' => 'Name', 233 322 'Items' => array( 234 'Name' => array('Type' => 'String', 'Caption' => 'Jméno', 'Default' => ''), 323 'Name' => array('Type' => 'String', 'Caption' => 'Jméno', 'Default' => ''), 235 324 ), 236 325 )); … … 337 426 if($Module->IsInstalled()) $Installed = 1; 338 427 else $Installed = 0; 339 $this->Database->query('UPDATE ` SystemModule` SET `Installed`=1 WHERE `Name`="'.$Module->Name.'"');428 $this->Database->query('UPDATE `Module` SET `Installed`=1 WHERE `Name`="'.$Module->Name.'"'); 340 429 } 341 430 } … … 345 434 //DebugLog('Loading modules...'); 346 435 $this->Modules = array(); 347 $Query = 'SELECT `Id`, `Name`,`Installed` FROM ` SystemModule`';436 $Query = 'SELECT `Id`, `Name`,`Installed` FROM `Module`'; 348 437 $DbResult = $this->Database->query($Query); 349 438 while($Module = $DbResult->fetch_array()) … … 361 450 function SaveToDatabase() 362 451 { 452 $Output = ''; 363 453 $Modules = array(); 364 $DbResult = $this->Database->query('SELECT * FROM ` SystemModule`');454 $DbResult = $this->Database->query('SELECT * FROM `Module`'); 365 455 while($DbRow = $DbResult->fetch_assoc()) 366 456 { … … 375 465 if(!array_key_exists($Module->Name, $Modules)) 376 466 { 377 $this->Database->insert('SystemModule', array('Name' => $Module->Name, 378 'Version' => $Module->Version, 'Creator' => $Module->Creator, 467 $this->Database->insert('Module', array('Name' => $Module->Name, 468 'Version' => $Module->Version, 'Creator' => $Module->Creator, 469 'HomePage' => $Module->HomePage, 'Title' => $Module->Title, 379 470 'Description' => $Module->Description, 'License' => $Module->License, 380 471 'Installed' => $Module->Installed)); 381 472 $this->System->ModuleManager->Modules[$Module->Name]->Id = $this->Database->insert_id; 382 473 } 383 else $this->Database->update('SystemModule', 'Name = "'.$Module->Name.'"', array( 384 'Version' => $Module->Version, 'Creator' => $Module->Creator, 474 else $this->Database->update('Module', 'Name = "'.$Module->Name.'"', array( 475 'Version' => $Module->Version, 'Creator' => $Module->Creator, 476 'HomePage' => $Module->HomePage, 'Title' => $Module->Title, 385 477 'Description' => $Module->Description, 'License' => $Module->License, 386 478 'Installed' => $Module->Installed)); … … 391 483 if(!$this->System->ModuleManager->ModulePresent($Module['Name'])) 392 484 { 393 DebugLog('Removing module '.$Module['Name'].' from list'); 394 $this->Database->query('DELETE FROM `SystemModule` WHERE `Id` = '.$Module['Id']); 485 $Output .= 'Removing module '.$Module['Name'].' from list</br/>'; 486 $this->Database->query('DELETE FROM `ModuleLink` WHERE `Module` = '.$Module['Id']); 487 $this->Database->query('DELETE FROM `ModuleLink` WHERE `LinkedModule` = '.$Module['Id']); 488 $DbResult = $this->Database->query('SELECT Id FROM `PermissionOperation` WHERE `Module` = '.$Module['Id']); 489 while($DbRow = $DbResult->fetch_assoc()) 490 { 491 $this->Database->query('DELETE FROM `PermissionGroupAssignment` WHERE `AssignedOperation` = '.$DbRow['Id']); 492 $this->Database->query('DELETE FROM `PermissionUserAssignment` WHERE `AssignedOperation` = '.$DbRow['Id']); 493 } 494 $this->Database->query('DELETE FROM `PermissionOperation` WHERE `Module` = '.$Module['Id']); 495 $this->Database->query('DELETE FROM `Model` WHERE `Module` = '.$Module['Id']); 496 $DbResult = $this->Database->query('SELECT Id FROM `Model` WHERE `Module` = '.$Module['Id']); 497 while($DbRow = $DbResult->fetch_assoc()) 498 $this->Database->query('DELETE FROM `ModelField` WHERE `Model` = '.$DbRow['Id']); 499 $this->Database->query('DELETE FROM `Module` WHERE `Id` = '.$Module['Id']); 395 500 } 396 501 397 502 // Reload dependencies 398 503 $DbDependency = array(); 399 $DbResult = $this->Database->query('SELECT * FROM ` SystemModuleDependency`');504 $DbResult = $this->Database->query('SELECT * FROM `ModuleLink`'); 400 505 while($DbRow = $DbResult->fetch_assoc()) 401 $DbDependency[$DbRow['Module']][] = $DbRow[' DependencyModule'];506 $DbDependency[$DbRow['Module']][] = $DbRow['LinkedModule']; 402 507 403 508 foreach($this->System->ModuleManager->Modules as $Module) … … 412 517 $DependencyId = $this->System->ModuleManager->Modules[$Dependency]->Id; 413 518 else throw new Exception('Dependent module '.$Dependency.' not found'); 414 $this->Database->insert(' SystemModuleDependency', array('Module' => $Module->Id,415 ' DependencyModule' => $DependencyId));519 $this->Database->insert('ModuleLink', array('Module' => $Module->Id, 520 'LinkedModule' => $DependencyId, 'Type' => 'DependOn')); 416 521 } 417 522 } … … 423 528 $DepModName = $this->System->ModuleManager->SearchModuleById($Dep); 424 529 if(!in_array($DepModName, $Module->Dependencies)) 425 $this->Database->query('DELETE FROM ` SystemModuleDependency` WHERE `Module` = '.426 $Module->Id.' AND DependencyModule='.$Dep);530 $this->Database->query('DELETE FROM `ModuleLink` WHERE `Module` = '. 531 $Module->Id.' AND LinkedModule='.$Dep); 427 532 } 428 533 } 534 return($Output); 429 535 } 430 536 } -
trunk/Modules/VPS/VPS.php
r631 r731 7 7 parent::__construct($System); 8 8 $this->Name = 'VPS'; 9 $this->Title = 'VPS'; 9 10 $this->Version = '1.0'; 10 11 $this->Creator = 'Chronos'; … … 12 13 $this->Description = 'VPS(Virtual Private Server) hosting management'; 13 14 $this->Dependencies = array('User'); 15 $this->Modules = array(); 14 16 } 15 17
Note:
See TracChangeset
for help on using the changeset viewer.