Changeset 513

Show
Ignore:
Timestamp:
08/21/06 15:13:54 (2 years ago)
Author:
ben
Message:

Plugin initialisation. If a plugin in /mod/foo has a function foo_init(), this will now be initialised when includes.php is loaded.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/includes.php

    r506 r513  
    4848 
    4949    /*************************************************************************** 
    50     *    INSERT PLUGINS HERE 
    51     *    Eventually this should be replaced with plugin autodiscovery 
     50    *    PLUGIN INITIALISATION 
    5251    ****************************************************************************/ 
    5352         
    5453    // XMLRPC 
    5554    //    @include($CFG->dirroot . "units/rpc/main.php"); 
     55     
     56        if ($allmods = get_list_of_plugins('mod') ) { 
     57            foreach ($allmods as $mod) { 
     58                $mod_init = $mod . '_init'; 
     59                if (function_exists($mod_init)) { 
     60                    $mod_init(); 
     61                   } 
     62           } 
     63        } 
    5664     
    5765    /***************************************************************************