Changeset 4998
- Timestamp:
- 16/05/08 17:44:40 (4 months ago)
- Files:
-
- Trunk/association/serversides/cctiddly/Branches/Modules/includes/include.php (modified) (2 diffs)
- Trunk/association/serversides/cctiddly/Branches/Modules/includes/moduleLoader.php (modified) (5 diffs)
- Trunk/association/serversides/cctiddly/Branches/Modules/includes/modules.php (modified) (2 diffs)
- Trunk/association/serversides/cctiddly/Branches/Modules/index.php (modified) (3 diffs)
- Trunk/association/serversides/cctiddly/Branches/Modules/modules/sdk/index.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/association/serversides/cctiddly/Branches/Modules/includes/include.php
r4983 r4998 3 3 4 4 $dir = $cct_base."ccPlugins/"; 5 echo 'aaaaaaaaaaaaaaad';6 5 // Open a known directory, and proceed to read its contents 7 6 if (is_dir($dir)) { … … 23 22 } 24 23 } 25 echo 'loading plugins'26 24 27 echo "toshsdd"; 25 // Modules 28 26 29 foreach ($modulesLoader->plugins as plugin)30 echo 0;31 if(is_file("../Modules/sdk/".plugin)){32 echo 1;33 $ext = substr($plugin, strrpos($plugin, '.') + 1);34 if ($ext == "js")35 {36 $tiddler_name = str_replace('.js', '', $plugin);37 echo "<div title=\"".$tiddler_name."\" modifier=\"ccTiddly\" tags=\"systemConfig excludeLists excludeSearch ccTiddly\">\n<pre>";38 include_once("../Modules/sdk/".$file);39 echo "</pre>\n</div>\n";40 }else if ($ext == "tiddler")41 {42 include_once("../Modules/sdk/".$file);43 }44 }45 27 46 28 /////// START DEBUG TIDDLER Trunk/association/serversides/cctiddly/Branches/Modules/includes/moduleLoader.php
r4983 r4998 1 1 <?php 2 3 echo 'loaded';4 5 6 2 class ModulesLoader { 7 3 public $events; … … 10 6 public $msgHandlers; 11 7 12 13 8 public function __construct(){ 14 9 $this->events = array(); … … 17 12 $this->msgHandlers = array(); 18 13 } 19 20 21 14 // These functions populate arrays with module data 22 15 // !! ccT needs to make sure these arrays are processed 23 16 24 17 public function addPlugin($plugin){ 25 print_r($plugin);26 18 array_push($this->plugins,$plugin); 27 19 } 28 20 29 21 public function addEvent($event){ 30 print_r($event); 31 array_push($this->event,$event); 22 array_push($this->events,$event); 32 23 } 33 24 34 25 public function addTiddler($tiddler){ 35 print_r($tiddler);36 26 array_push($this->tiddlers,$tiddler); 37 27 } 38 28 39 29 public function addHandler($msgHandler){ 40 print_r($msgHandler);41 30 array_push($this->msgHandlers,$msgHandler); 42 31 } … … 59 48 { 60 49 include($modulePath); 61 echo "module exists";62 63 50 } 64 51 } … … 76 63 } 77 64 } 78 79 80 65 } 81 82 66 global $modulesLoader; 83 84 67 $modulesLoader = new ModulesLoader(); 85 86 68 $modulesLoader->readModules(); 87 88 69 //this needs to make sure plugins and events are loaded by ccT 89 70 $modulesLoader->runModules(); 90 71 91 92 93 72 ?> Trunk/association/serversides/cctiddly/Branches/Modules/includes/modules.php
r4983 r4998 24 24 } 25 25 26 27 26 28 27 // Specified relative to the module folder, these javascripts will be directly included at the end of the whole wiki // 29 28 public function addPlugin($script) { 30 29 array_push($this->plugins, $script); 31 30 } 31 32 public function addTiddler($tiddler) { 33 array_push($this->tiddlers, $tiddler); 34 } 32 35 33 36 public function addEvent($eventname, $fileInclude) { 34 global $moduleManager; 35 $moduleManager->registerEvent($eventname, $fileInclude); 36 if ( !isset($this->events[$eventname])) 37 $this->events[$eventname] = array(); 38 39 array_push($this->events[$eventname], $eventscript); 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); 40 45 } 41 46 … … 48 53 foreach ($this->phpEvents as $event) { 49 54 $modulesLoader->addEvent($event); 50 } 55 } 56 foreach ($this->phpEvents as $event) { 57 $modulesLoader->addTiddler($event); 58 } 51 59 } 52 60 Trunk/association/serversides/cctiddly/Branches/Modules/index.php
r4983 r4998 37 37 exit; 38 38 } 39 x40 39 //check if getting revision 41 40 if( isset($_GET['title']) ) … … 66 65 ?> 67 66 68 <?php69 // MODULES - beforeLoad70 //$ccModules['beforeLoad'] = array('a', 'b', 'c');71 //foreach($ccModules['beforeLoad'] as $key => $value)72 //{73 //echo $key;74 //echo $value;75 //}76 // MODULES - beforeLoad end77 ?>78 67 79 68 … … 601 590 <div id="storeArea"> 602 591 <?php 603 include_once($cct_base."modules/sdk/files/examples/cmds/getRecievedMessages.php"); 592 593 594 foreach ($modulesLoader->plugins as $plugin) 595 { 596 if(is_file("Modules/".$plugin)) 597 include_once("Modules/".$plugin); 598 } 599 600 echo 'asdasdasdasd'; 601 print_r($modulesLoader->events); 602 foreach ($modulesLoader->events[0] as $event) 603 { 604 if(is_file("Modules/".$event)) 605 include_once("Modules/".$event); 606 } 607 608 604 609 include_once($cct_base."includes/include.php"); 610 611 605 612 ?> 606 613 Trunk/association/serversides/cctiddly/Branches/Modules/modules/sdk/index.php
r4983 r4998 3 3 // This file defines the BT Web21c SDK ccTiddly Module 4 4 //echo 'SDK Module'; 5 $m = new Module('SDK Module','5000','simon.com'); 6 $m->addPlugin('inboundSMS.tiddler'); 5 $m = new Module('SDK Module','5000','simonmcmanus.com'); 6 $m->addPlugin('sdk/inboundSMS.tiddler'); // plugin 7 $m->addEvent("loadStoreArea", 'sdk/files/examples/cmds/getRecievedMessages.php'); // eventName, fileContainingCode 7 8 ?>