phpUserTrack
[ class tree: phpUserTrack ] [ index: phpUserTrack ] [ all elements ]

Source for file libplugins.php

Documentation is available at libplugins.php

  1. <?php
  2. /**
  3.  * Plugin class library
  4.  * @author Christopher Troup <mini@chatetheory.com>
  5.  * @package phpUserTrack
  6.  * @subpackage Plugins
  7.  */
  8. class plugins {
  9.     /**
  10.      * Registered hooks array
  11.      * @var array
  12.      */
  13.     var $hooks = array'ip.pre' => array()
  14.             'ip.post' => array(),
  15.             'data.pre' => array()
  16.             'data.post' => array(),
  17.             'graph.prerender' => array(),
  18.             'graph.postrender' => array());
  19.     
  20.     /**
  21.      * Register a new plugin and make availible to the proper hook
  22.      * @global array $conf
  23.      */
  24.     function plugins({
  25.         global $conf;
  26.         if (isset($conf['activePlugins'])) {
  27.             foreach ($conf['activePlugins'as $classname{
  28.                 include dirname(__FILE__'/../plugins/' $classname '.php';
  29.                 if (!class_exists($classname)) {
  30.                     /** @todo class doesent exist */
  31.                 }
  32.                 @$obj &new $classname;
  33.                 array_push($this->hooks[$obj->_type()]$obj);
  34.             }    
  35.         }
  36.     }
  37. }
  38.  
  39. ?>

Documentation generated on Tue, 06 Nov 2007 09:22:06 -0800 by phpDocumentor 1.4.0a2