includes/plugins.php
changeset 313 854eecfada20
parent 311 a007145a0ff6
child 322 5f1cd51bf1be
equal deleted inserted replaced
310:199b9708f4a2 313:854eecfada20
    17   var $load_list;
    17   var $load_list;
    18   var $loaded_plugins;
    18   var $loaded_plugins;
    19   var $system_plugins = Array('SpecialUserFuncs.php','SpecialUserPrefs.php','SpecialPageFuncs.php','SpecialAdmin.php','SpecialCSS.php','SpecialUpdownload.php','SpecialSearch.php','PrivateMessages.php','SpecialGroups.php');
    19   var $system_plugins = Array('SpecialUserFuncs.php','SpecialUserPrefs.php','SpecialPageFuncs.php','SpecialAdmin.php','SpecialCSS.php','SpecialUpdownload.php','SpecialSearch.php','PrivateMessages.php','SpecialGroups.php');
    20   function loadAll() 
    20   function loadAll() 
    21   {
    21   {
    22     dc_here('plugins: building file list');
       
    23     
       
    24     $dir = ENANO_ROOT.'/plugins/';
    22     $dir = ENANO_ROOT.'/plugins/';
    25     
    23     
    26     $this->load_list = Array();
    24     $this->load_list = Array();
    27     
    25     
    28     $plugins = Array();
    26     $plugins = Array();
    65     }
    63     }
    66     $this->loaded_plugins = $plugins;
    64     $this->loaded_plugins = $plugins;
    67     //die('<pre>'.htmlspecialchars(print_r($plugins, true)).'</pre>');
    65     //die('<pre>'.htmlspecialchars(print_r($plugins, true)).'</pre>');
    68   }
    66   }
    69   function setHook($name, $opts = Array()) {
    67   function setHook($name, $opts = Array()) {
    70     dc_dump($name, 'plugins: hook added: ');
       
    71     /*
    68     /*
    72     $r = Array();
    69     $r = Array();
    73     if(isset($this->hook_list[$name])) {
    70     if(isset($this->hook_list[$name])) {
    74       for($i=0;$i<sizeof($this->hook_list[$name]);$i++) {
    71       for($i=0;$i<sizeof($this->hook_list[$name]);$i++) {
    75         $ret = eval($this->hook_list[$name][$i]);
    72         $ret = eval($this->hook_list[$name][$i]);
    87     {
    84     {
    88       return Array();
    85       return Array();
    89     }
    86     }
    90   }
    87   }
    91   function attachHook($name, $code) {
    88   function attachHook($name, $code) {
    92     dc_dump($code, 'plugins: hook attached: '.$name.'<br />code:');
       
    93     if(!isset($this->hook_list[$name]))
    89     if(!isset($this->hook_list[$name]))
    94     {
    90     {
    95       $this->hook_list[$name] = Array();
    91       $this->hook_list[$name] = Array();
    96     }
    92     }
    97     $this->hook_list[$name][] = $code;
    93     $this->hook_list[$name][] = $code;