Changeset 9 for trunk/Packages
- Timestamp:
- Jun 1, 2023, 1:01:38 AM (18 months ago)
- Location:
- trunk/Packages/Common
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Modules/ModuleAdmin.php
r8 r9 8 8 { 9 9 parent::__construct($System); 10 $this->Name = ' ModuleManager';10 $this->Name = 'Admin'; 11 11 $this->Version = '1.0'; 12 12 $this->Creator = 'Chronos'; … … 49 49 ), 50 50 )); 51 $this->System->FormManager->RegisterFormType('TModule', array(51 Core::Cast($this->System)->FormManager->RegisterFormType('TModule', array( 52 52 'Type' => 'Reference', 53 53 'Table' => 'Module', … … 56 56 'Filter' => '1', 57 57 )); 58 $this->System->FormManager->RegisterFormType('TModelListModule', array(58 Core::Cast($this->System)->FormManager->RegisterFormType('TModelListModule', array( 59 59 'Type' => 'ManyToOne', 60 60 'Table' => 'Model', … … 63 63 'Filter' => '1', 64 64 )); 65 $this->System->FormManager->RegisterClass('Model', array(65 Core::Cast($this->System)->FormManager->RegisterClass('Model', array( 66 66 'Title' => 'Modely', 67 67 'Table' => 'Model', … … 76 76 ), 77 77 )); 78 $this->System->FormManager->RegisterFormType('TModel', array(78 Core::Cast($this->System)->FormManager->RegisterFormType('TModel', array( 79 79 'Type' => 'Reference', 80 80 'Table' => 'Model', … … 83 83 'Filter' => '1', 84 84 )); 85 $this->System->FormManager->RegisterFormType('TModelFieldListModel', array(85 Core::Cast($this->System)->FormManager->RegisterFormType('TModelFieldListModel', array( 86 86 'Type' => 'ManyToOne', 87 87 'Table' => 'ModelField', … … 90 90 'Filter' => '1', 91 91 )); 92 $this->System->FormManager->RegisterClass('ModelField', array(92 Core::Cast($this->System)->FormManager->RegisterClass('ModelField', array( 93 93 'Title' => 'Pole modelu', 94 94 'Table' => 'ModelField', … … 104 104 ), 105 105 )); 106 $this->System->FormManager->RegisterFormType('TModuleLink', array(106 Core::Cast($this->System)->FormManager->RegisterFormType('TModuleLink', array( 107 107 'Type' => 'Reference', 108 108 'Table' => 'ModuleLink', … … 111 111 'Filter' => '1', 112 112 )); 113 $this->System->FormManager->RegisterFormType('TModuleLinkListModule', array(113 Core::Cast($this->System)->FormManager->RegisterFormType('TModuleLinkListModule', array( 114 114 'Type' => 'ManyToOne', 115 115 'Table' => 'ModuleLink', … … 118 118 'Filter' => '1', 119 119 )); 120 $this->System->FormManager->RegisterClass('ModuleLink', array(120 Core::Cast($this->System)->FormManager->RegisterClass('ModuleLink', array( 121 121 'Title' => 'Vazby modulu', 122 122 'Table' => 'ModuleLink', … … 127 127 ), 128 128 )); 129 $this->System->FormManager->RegisterFormType('TModule', array(129 Core::Cast($this->System)->FormManager->RegisterFormType('TModule', array( 130 130 'Type' => 'Reference', 131 131 'Table' => 'Module', … … 250 250 'Type' => ModelColumnType::GetName($Field->Type), 'Nullable' => (int)$Field->Nullable)); 251 251 } 252 if ($ModelDesc->DefaultValues != null)253 { 254 $Values = call_user_func('self::'.$ModelDesc->DefaultValues );252 if ($ModelDesc->DefaultValuesMethod != null) 253 { 254 $Values = call_user_func('self::'.$ModelDesc->DefaultValuesMethod); 255 255 foreach ($Values as $Value) 256 256 { … … 303 303 { 304 304 //DebugLog('Loading modules...'); 305 $this->Modules = array();306 305 $Query = 'SELECT `Id`, `Name`,`Installed` FROM `Module`'; 307 306 $DbResult = $this->Database->query($Query); … … 492 491 $Output = ''; 493 492 494 $Pageing = new Paging( );493 $Pageing = new Paging($this->System); 495 494 $Pageing->TotalCount = count($this->System->ModuleManager->Modules); 496 $Table = new VisualTable( );495 $Table = new VisualTable($this->System); 497 496 $Table->SetColumns(array( 498 497 array('Name' => 'Name', 'Title' => T('Name')), -
trunk/Packages/Common/Paging.php
r8 r9 8 8 public string $SQLLimit; 9 9 public int $Page; 10 private System $System; 10 11 11 function __construct( )12 function __construct(System $System) 12 13 { 13 global $System; 14 15 $this->ItemPerPage = $System->Config['Web']['ItemsPerPage']; 16 $this->Around = $System->Config['Web']['VisiblePagingItems']; 14 $this->System = $System; 15 $this->ItemPerPage = Core::Cast($this->System)->Config['Web']['ItemsPerPage']; 16 $this->Around = Core::Cast($this->System)->Config['Web']['VisiblePagingItems']; 17 17 } 18 18 -
trunk/Packages/Common/System.php
r8 r9 39 39 { 40 40 if (array_key_exists($Name, $this->ModuleManager->Modules)) 41 { 41 42 return $this->ModuleManager->Modules[$Name]; 42 else return null; 43 } 44 else 45 { 46 echo('Module '.$Name.' not registered.'); 47 } 43 48 } 44 49 -
trunk/Packages/Common/Table.php
r8 r9 99 99 private array $OrderDirSQL; 100 100 101 function __construct( )101 function __construct(System $System) 102 102 { 103 global $System;104 105 103 $this->Columns = array(); 106 104 $this->Table = new TableMemory(); 107 105 $this->OrderDirSQL = array('ASC', 'DESC'); 108 $this->OrderArrowImage = array( $System->Link('/images/sort_asc.png'),106 $this->OrderArrowImage = array(Core::Cast($System)->Link('/images/sort_asc.png'), 109 107 $System->Link('/images/sort_desc.png')); 110 108 $this->DefaultOrder = 0;
Note:
See TracChangeset
for help on using the changeset viewer.