MDL-29538 core_condition: initial commit to add support for making things conditional on user profile fields

This commit is contained in:
Mark Nelson 2011-09-26 21:20:17 +08:00
parent 6be7840ce6
commit 76af15bb4c
11 changed files with 399 additions and 10 deletions

View file

@ -596,6 +596,12 @@ class cm_info extends stdClass {
*/
public $conditionsgrade;
/**
* Availability conditions for this course-module based on user fields
* @var array
*/
public $conditionsfield;
/**
* Plural name of module type, e.g. 'Forums' - from lang file
* @deprecated Do not use this value (you can obtain it by calling get_string instead); it
@ -996,6 +1002,8 @@ class cm_info extends stdClass {
? $mod->conditionscompletion : array();
$this->conditionsgrade = isset($mod->conditionsgrade)
? $mod->conditionsgrade : array();
$this->conditionsfield = isset($mod->conditionsfield)
? $mod->conditionsfield : array();
// Get module plural name.
// TODO This was a very old performance hack and should now be removed as the information