Changeset 5000
- Timestamp:
- 16/05/08 18:07:29 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/association/serversides/cctiddly/Branches/Modules/includes/moduleLoader.php
r4998 r5000 19 19 } 20 20 21 public function addEvent($event){ 22 array_push($this->events,$event); 21 public function addEvent($eventname,$event){ 22 if ( !isset($this->events[$eventname])) 23 $this->events[$eventname] = array(); 24 array_push($this->events[$eventname], $event); 23 25 } 24 26 … … 31 33 } 32 34 33 //34 35 35 public function readModules(){ 36 36 $dir = "modules/"; … … 42 42 if( is_dir($dir.$file)) 43 43 { 44 //echo $dir.$file."/index.php"; 45 // check for index.php and remove the .. 46 $modulePath = $dir.$file."/index.php"; 47 if (is_file($modulePath) && $file!=='..') 48 { 49 include($modulePath); 50 } 44 // check for index.php and remove the .. 45 $modulePath = $dir.$file."/index.php"; 46 if (is_file($modulePath) && $file!=='..') 47 { 48 include($modulePath); 49 } 51 50 } 52 51 } … … 64 63 } 65 64 } 65 66 66 global $modulesLoader; 67 67 $modulesLoader = new ModulesLoader(); … … 69 69 //this needs to make sure plugins and events are loaded by ccT 70 70 $modulesLoader->runModules(); 71 72 71 ?> Trunk/association/serversides/cctiddly/Branches/Modules/includes/modules.php
r4998 r5000 35 35 36 36 public function addEvent($eventname, $fileInclude) { 37 // array_push($this->phpEvents, $fileInclude); 38 39 if ( !isset($this->phpEvents[$eventname])) 40 $this->phpEvents[$eventname] = array(); 41 // print_r('saq'); 42 // print_r($this->phpEvents[$eventname]); 43 array_push($this->phpEvents[$eventname], $fileInclude); 44 // print_r($this->phpEvents); 37 if ( !isset($this->phpEvents[$eventname])) 38 $this->phpEvents[$eventname] = array(); 39 array_push($this->phpEvents[$eventname], $fileInclude); 45 40 } 46 41 … … 51 46 $modulesLoader->addPlugin($plugin); 52 47 } 53 foreach ($this->phpEvents as $event) { 54 $modulesLoader->addEvent($event); 48 foreach ($this->phpEvents as $eventnames=>$eventArray) { 49 //print_r($eventnames); 50 foreach ($eventArray as $event) 51 $modulesLoader->addEvent($eventnames,$event); 55 52 } 56 foreach ($this-> phpEvents as $event) {53 foreach ($this->tiddlers as $event) { 57 54 $modulesLoader->addTiddler($event); 58 55 } Trunk/association/serversides/cctiddly/Branches/Modules/index.php
r4998 r5000 598 598 } 599 599 600 echo 'asdasdasdasd'; 601 print_r($modulesLoader->events); 602 foreach ($modulesLoader->events[0] as $event) 600 601 foreach ($modulesLoader->events['loadStoreArea'] as $event) 603 602 { 604 603 if(is_file("Modules/".$event))