TiddlyWiki.org

Changeset 4998

Show
Ignore:
Timestamp:
16/05/08 17:44:40 (4 months ago)
Author:
simonmcmanus
Message:

cct - web21c modules

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Trunk/association/serversides/cctiddly/Branches/Modules/includes/include.php

    r4983 r4998  
    33 
    44$dir = $cct_base."ccPlugins/"; 
    5 echo 'aaaaaaaaaaaaaaad'; 
    65// Open a known directory, and proceed to read its contents 
    76if (is_dir($dir)) { 
     
    2322    } 
    2423} 
    25 echo 'loading plugins' 
    2624 
    27 echo "toshsdd"; 
     25// Modules  
    2826 
    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         } 
    4527 
    4628///////  START DEBUG TIDDLER  
  • Trunk/association/serversides/cctiddly/Branches/Modules/includes/moduleLoader.php

    r4983 r4998  
    11<?php 
    2  
    3 echo 'loaded'; 
    4  
    5  
    62class ModulesLoader { 
    73        public $events; 
     
    106        public $msgHandlers; 
    117         
    12  
    138        public function __construct(){ 
    149                $this->events = array(); 
     
    1712                $this->msgHandlers = array(); 
    1813        }        
    19          
    20          
    2114        //  These functions populate arrays with module data 
    2215        // !! ccT needs to make sure these arrays are processed 
    2316         
    2417        public function addPlugin($plugin){ 
    25                 print_r($plugin); 
    2618                array_push($this->plugins,$plugin); 
    2719        } 
    2820         
    2921        public function addEvent($event){ 
    30                 print_r($event); 
    31                 array_push($this->event,$event); 
     22                array_push($this->events,$event); 
    3223        } 
    3324         
    3425        public function addTiddler($tiddler){ 
    35                 print_r($tiddler); 
    3626                array_push($this->tiddlers,$tiddler); 
    3727        } 
    3828         
    3929        public function addHandler($msgHandler){ 
    40                 print_r($msgHandler); 
    4130                array_push($this->msgHandlers,$msgHandler); 
    4231        } 
     
    5948                                                        { 
    6049                                                                include($modulePath); 
    61                                                                 echo "module exists"; 
    62  
    6350                                                        } 
    6451                                        } 
     
    7663                }                
    7764        } 
    78          
    79          
    8065} 
    81  
    8266global $modulesLoader; 
    83  
    8467$modulesLoader = new ModulesLoader(); 
    85  
    8668$modulesLoader->readModules(); 
    87  
    8869//this needs to make sure plugins and events are loaded by ccT 
    8970$modulesLoader->runModules(); 
    9071 
    91  
    92  
    9372?> 
  • Trunk/association/serversides/cctiddly/Branches/Modules/includes/modules.php

    r4983 r4998  
    2424      } 
    2525       
    26    
    27  
     26  
    2827 // Specified relative to the module folder, these javascripts will be directly included at the end of the whole wiki //  
    2928      public function addPlugin($script) { 
    3029                  array_push($this->plugins, $script); 
    3130      } 
     31 
     32      public function addTiddler($tiddler) { 
     33                  array_push($this->tiddlers, $tiddler); 
     34      } 
    3235       
    3336      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);   
    4045      } 
    4146       
     
    4853          foreach ($this->phpEvents as $event) { 
    4954              $modulesLoader->addEvent($event); 
    50           } 
     55         } 
     56           foreach ($this->phpEvents as $event) { 
     57              $modulesLoader->addTiddler($event); 
     58       } 
    5159      } 
    5260       
  • Trunk/association/serversides/cctiddly/Branches/Modules/index.php

    r4983 r4998  
    3737        exit; 
    3838} 
    39 x 
    4039//check if getting revision 
    4140if( isset($_GET['title']) ) 
     
    6665?> 
    6766 
    68 <?php 
    69 // MODULES - beforeLoad 
    70 //$ccModules['beforeLoad'] = array('a', 'b', 'c'); 
    71 //foreach($ccModules['beforeLoad'] as $key => $value) 
    72 //{ 
    73 //echo $key; 
    74 //echo $value; 
    75 //} 
    76 // MODULES - beforeLoad end  
    77 ?> 
    7867 
    7968 
     
    601590<div id="storeArea"> 
    602591<?php 
    603 include_once($cct_base."modules/sdk/files/examples/cmds/getRecievedMessages.php"); 
     592 
     593 
     594foreach ($modulesLoader->plugins as $plugin) 
     595
     596        if(is_file("Modules/".$plugin)) 
     597                include_once("Modules/".$plugin);        
     598
     599 
     600echo 'asdasdasdasd'; 
     601print_r($modulesLoader->events); 
     602foreach ($modulesLoader->events[0] as $event) 
     603
     604        if(is_file("Modules/".$event)) 
     605                include_once("Modules/".$event);         
     606
     607         
     608 
    604609include_once($cct_base."includes/include.php"); 
     610 
     611 
    605612?> 
    606613 
  • Trunk/association/serversides/cctiddly/Branches/Modules/modules/sdk/index.php

    r4983 r4998  
    33// This file defines the BT Web21c SDK ccTiddly Module 
    44//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 
    78?>