Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
lib.php File Reference

Classes

class  enrol_cohort_plugin
 Cohort enrolment plugin implementation. More...
 

Functions

 cohort_add_cohort ($cohort)
 Add new cohort.
 
 cohort_add_member ($cohortid, $userid)
 Add cohort member.
 
 cohort_can_view_cohort ($cohortorid, $currentcontext)
 Check if cohort exists and user is allowed to access it from the given context.
 
 cohort_delete_category ($category)
 Somehow deal with cohorts when deleting course category, we can not just delete them because they might be used in enrol plugins or referenced in external systems.
 
 cohort_delete_cohort ($cohort)
 Delete cohort.
 
 cohort_edit_controls (context $context, moodle_url $currenturl)
 Returns navigation controls (tabtree) to be displayed on cohort management pages.
 
 cohort_get_all_cohorts ($page=0, $perpage=25, $search='', $withcustomfields=false)
 Get all the cohorts defined anywhere in system.
 
 cohort_get_available_cohorts ($currentcontext, $withmembers=0, $offset=0, $limit=25, $search='', $withcustomfields=false)
 Returns the list of cohorts visible to the current user in the given course.
 
 cohort_get_cohort ($cohortorid, $currentcontext, $withcustomfields=false)
 Get a cohort by id.
 
 cohort_get_cohorts ($contextid, $page=0, $perpage=25, $search='', $withcustomfields=false)
 Get all the cohorts defined in given context.
 
 cohort_get_custom_fields_data (array $cohortids)
 Returns custom fields data for provided cohorts.
 
 cohort_get_list_of_themes ()
 Returns a list of valid themes which can be displayed in a selector.
 
 cohort_get_user_cohort_theme ($userid)
 Get the user cohort theme.
 
 cohort_get_user_cohorts ($userid, $withcustomfields=false)
 Get all the cohorts where the given user is member of.
 
 cohort_is_member ($cohortid, $userid)
 Is this user a cohort member?
 
 cohort_remove_member ($cohortid, $userid)
 Remove cohort member.
 
 cohort_update_cohort ($cohort)
 Update existing cohort.
 
 core_cohort_inplace_editable ($itemtype, $itemid, $newvalue)
 Implements callback inplace_editable() allowing to edit values in-place.
 
 enrol_cohort_allow_group_member_remove ($itemid, $groupid, $userid)
 Prevent removal of enrol roles.
 
 enrol_cohort_create_new_group ($courseid, $cohortid)
 Create a new group with the cohorts name.
 

Variables

const COHORT_ALL 0
 
const COHORT_COUNT_ENROLLED_MEMBERS 3
 
const COHORT_COUNT_MEMBERS 1
 
const COHORT_CREATE_GROUP -1
 COHORT_CREATEGROUP constant for automatically creating a group for a cohort.
 
const COHORT_NOGROUP 0
 COHORT_NOGROUP constant for using no group for a cohort.
 
const COHORT_WITH_ENROLLED_MEMBERS_ONLY 17
 
const COHORT_WITH_MEMBERS_ONLY 5
 
const COHORT_WITH_NOTENROLLED_MEMBERS_ONLY 23