[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/enrol/ -> enrol.class.php (source)

   1  <?php // $Id: enrol.class.php,v 1.27 2006/09/26 04:38:00 moodler Exp $
   2  
   3  /**
   4  * enrolment_factory is used to "manufacture" an instance of required enrolment plugin.
   5  */
   6  
   7  class enrolment_factory {
   8      function factory($enrol = '') {
   9          global $CFG;
  10          if (!$enrol) {
  11              $enrol = $CFG->enrol;
  12          }
  13          if (file_exists("$CFG->dirroot/enrol/$enrol/enrol.php")) {
  14              require_once("$CFG->dirroot/enrol/$enrol/enrol.php");
  15              $class = "enrolment_plugin_$enrol";
  16              return new $class;
  17          } else {
  18              trigger_error("$CFG->dirroot/enrol/$enrol/enrol.php does not exist");
  19              notify("Enrolment file $enrol/enrol.php does not exist");
  20          }
  21      }
  22  }
  23  
  24  ?>


Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7