- Timestamp:
- Jun 12, 2012, 6:41:12 PM (13 years ago)
- Location:
- branches/Modular
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Modular/.htaccess
r383 r404 11 11 RewriteCond %{REQUEST_FILENAME} !-f 12 12 RewriteCond %{REQUEST_FILENAME} !-d 13 RewriteRule ^(.*)$ centrala/index.php?$114 #RewriteRule ^(.*)$index.php?$113 #RewriteRule ^(.*)$ centrala/index.php?$1 14 RewriteRule ^(.*)$ dev/centrala/branches/Modular/index.php?$1 15 15 16 16 # Pretty urls -
branches/Modular/Common/Module.php
r403 r404 32 32 DebugLog('Installing module '.$this->Name.'...'); 33 33 $this->Installed = true; 34 35 // Install dependencies first 34 36 foreach($this->Dependencies as $Dependency) 35 37 $this->System->Modules[$Dependency]->Install(); 38 36 39 $this->LoadModels(); 37 40 foreach($this->Models as $Index => $Module) … … 45 48 { 46 49 DebugLog('Uninstalling module '.$this->Name.'...'); 50 $this->Installed = false; 51 52 // Remove dependent modules first 53 foreach($this->System->Modules as $Module) 54 foreach($Module->Dependencies as $Dependency) 55 if(($Dependency == $this->Name) and ($Module->Installed)) $this->System->Modules[$Module->Name]->UnInstall(); 56 47 57 $this->LoadModels(); 48 58 foreach(array_reverse($this->Models, true) as $Index => $Model) … … 51 61 } 52 62 $this->Database->query('UPDATE SystemModule SET Installed=0 WHERE Name="'.$this->Name.'"'); 53 $this->Installed = false;54 63 } 55 64 … … 115 124 $this->LoadModules(); 116 125 foreach($this->Modules as $Index => $Module) 126 { 127 //DebugLog('Init module '.$Module->Name); 117 128 $this->Modules[$Index]->Init(); 129 } 118 130 } 119 131 … … 171 183 $this->ReloadList(); 172 184 $this->LoadModules(false); 173 //$this->Modules['System']->Install();174 foreach($this->Modules as $Index => $Module)185 $this->Modules['System']->Install(); 186 /*foreach($this->Modules as $Index => $Module) 175 187 { 176 188 $this->Modules[$Index]->Install(); 177 } 189 }*/ 178 190 } 179 191 -
branches/Modular/Common/Page.php
r386 r404 55 55 <div id="Title">'.$Title.'</div> 56 56 <div class="Navigation"><span class="MenuItem"><strong>Navigace :: </strong> '.$Navigation.'</span><div class="MenuItem2">'; 57 if( $this->System->Config['Web']['UserSupport'] == 1)57 if(array_key_exists('User', $this->System->Modules)) 58 58 { 59 59 if($this->System->Modules['User']->Models['User']->User['Id'] == $this->System->Modules['User']->Models['User']->AnonymousUserId) -
branches/Modular/Common/TableHeader.php
r384 r404 92 92 { 93 93 $this->QueryItems->Data['OrderDir'] = 1 - $OrderDir; 94 $ArrowImage = '<img style="vertical-align: middle; border: 0px;" src="'.$this->System->RootFolder.'/ Style/'.$this->System->Style.'/Images/'.$this->OrderArrowImage[$OrderDir].'" alt="order arrow">';94 $ArrowImage = '<img style="vertical-align: middle; border: 0px;" src="'.$this->System->RootFolder.'/style/'.$this->System->Style.'/images/'.$this->OrderArrowImage[$OrderDir].'" alt="order arrow">'; 95 95 } else 96 96 { -
branches/Modular/Common/ViewList.php
r385 r404 131 131 } 132 132 133 function AddItemBoolean($Name, $Title) 134 { 135 $this->Columns[$Name] = array('Name' => $Name, 'Title' => $Title, 136 'Type' => ViewItemTypeBoolean, 'SQL' => $Name); 137 } 138 133 139 function AddItemDateTime($Name, $Title) 134 140 { -
branches/Modular/Modules/System/System.php
r403 r404 1 1 <?php 2 3 class PageModules extends Page 4 { 5 function __construct() 6 { 7 parent::__construct(); 8 $this->FullTitle = 'Správa modulů'; 9 $this->ShortTitle = 'Moduly'; 10 } 11 12 function Show() 13 { 14 $View = new ViewModules($this->System); 15 $View->LoadFromDatabase(); 16 return($View->Show()); 17 } 18 } 19 20 class ViewModules extends ViewList 21 { 22 function __construct($System) 23 { 24 parent::__construct($System); 25 $this->Name = 'SystemModule'; 26 $this->AddItemString('Name', 'Jméno'); 27 $this->AddItemString('Creator', 'Tvůrce'); 28 $this->AddItemString('Version', 'Verze'); 29 $this->AddItemString('License', 'Licence'); 30 $this->AddItemBoolean('Installed', 'Instalováno'); 31 $this->AddItemText('Description', 'Popis'); 32 } 33 } 2 34 3 35 class SystemView extends Model … … 34 66 } 35 67 68 class SystemModule extends Model 69 { 70 function __construct($Database, $System) 71 { 72 parent::__construct($Database, $System); 73 $this->Name = 'SystemModule'; 74 $this->AddPropertyString('Name'); 75 $this->AddPropertyString('Creator'); 76 $this->AddPropertyString('Version'); 77 $this->AddPropertyString('License'); 78 $this->AddPropertyBoolean('Installed'); 79 $this->AddPropertyText('Description'); 80 } 81 82 function Install() 83 { 84 // Do nothing, already installed by ModuleManager 85 } 86 87 function UnInstall() 88 { 89 // Do nothing, managed by ModuleManager 90 } 91 } 92 36 93 class ModuleSystem extends Module 37 94 { … … 44 101 $this->License = 'GNU/GPL'; 45 102 $this->Description = 'Base system module'; 46 $this->Dependencies = array('User'); 47 $this->SupportedModels = array('SystemView', 'SystemAction', 'SystemMenu'); 103 $this->Dependencies = array(); 104 $this->SupportedModels = array('SystemView', 'SystemAction', 'SystemMenu', 105 'SystemModule'); 48 106 } 49 107 … … 60 118 function Init() 61 119 { 120 $this->System->Pages['modules'] = 'PageModules'; 62 121 } 63 122 }
Note:
See TracChangeset
for help on using the changeset viewer.