[ Index ]

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

title

Body

[close]

/enrol/ -> README.txt (source)

   1  ENROLMENT MODULES
   2  -----------------
   3  
   4  (Yes, that's the correct English spelling  ;-) )
   5  
   6  enrol.class.php contains a simple 'factory' method that
   7  will instantiate your class when called. For an example
   8  of a complete class, take a look at the 'manual' class.
   9  
  10  Each plugin is in a subfolder here.
  11  
  12  Except for the configuration methods, most methods 
  13  defined in the API are optional -- callers will use
  14  method_exists() to determine whether your plugin offers
  15  the functionality they are after.
  16  
  17  
  18  Mandatory methods
  19  =================
  20  
  21    config_form()
  22    process_config()
  23  
  24  
  25  Login-time methods
  26  ==================
  27  
  28    Before Moodle 1.7
  29    -----------------
  30  
  31        get_student_courses()
  32        get_teacher_courses()
  33    
  34    You probably will want to offer at least get_student_courses().
  35    
  36    These methods are triggered when a user logs in successfully,
  37    and they are expected to populate $USER->student and 
  38    $USER->teacher arrays and maintain (add/delete) entries from
  39    user_students and user_teachers.
  40    
  41    These methods are relevant for most plugins, and are the main
  42    interest for plugins that work with a read-only backend such
  43    as LDAP or a database.
  44    
  45    Note that with the multi-enrol infrastructure two things have 
  46    changed. We now have an 'enrol' field in those tables, and 
  47    each plugin must maintain only its own enrolment records. 
  48    Conversely, the $USER->student and ->teacher arrays have the
  49    enrolment type as value, like
  50    
  51       $USER->student = array ( $courseid => $plugintype );
  52    
  53  
  54    Moodle 1.7 and later
  55    --------------------
  56  
  57        setup_enrolments()
  58  
  59    With the advent of roles, there could well not be students and 
  60    teachers any more, so enrolment plugins have to be more flexible
  61    about how they map outside data to the internal roles.
  62    
  63    This one method should do everything, calling functions from 
  64    lib/accesslib.php as necessary to set up relationships.
  65    
  66    
  67  Interactive enrolment methods
  68  =============================
  69  
  70    print_entry()
  71    check_entry()
  72    check_group_entry()
  73    get_access_icons()
  74  
  75  These methods are for enrolment plugins that allow for user
  76  driven enrolment. These methods are relevant for plugins 
  77  that implement payment gateways (credit card, paypal),
  78  as well as "magic password" schemes. 
  79  
  80  Only one interactive enrolment method can be active for
  81  a given course. The site default can be set from
  82  Admin->Enrolment, and then individual courses can be
  83  set to specific interactive enrolment methods.
  84  
  85  
  86  Cron
  87  ====
  88  
  89  If your class offers a cron() method, it will be invoked by
  90  the standard Moodle cron every 5 minutes. Note that if the
  91  tasks are not lightweight you must control how frequently they
  92  execute, perhaps offering a config option.
  93  
  94  For really heavy cron processing, an alternative is to have
  95  a separate script to be called separately. Currently the LDAP
  96  and DB plugins have external scripts. 
  97  
  98  
  99  Guilty Parties
 100  --------------
 101  
 102  Martin Dougiamas and Shane Elliott, Moodle.com
 103  Martin Langhoff and Patrick Li, Catalyst IT
 104  


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