mirror of
https://github.com/moodle/moodle.git
synced 2025-08-02 23:59:41 +02:00
role assign: MDL-17323 Show users from parent contexts ... Refine group labels.
This commit is contained in:
parent
a792ac1d7a
commit
490740d6cb
3 changed files with 30 additions and 8 deletions
|
@ -3303,6 +3303,24 @@ function capabilities_cleanup($component, $newcapdef=NULL) {
|
|||
* UI FUNCTIONS *
|
||||
****************/
|
||||
|
||||
/**
|
||||
* @param integer $contextlevel $context->context level. One of the CONTEXT_... constants.
|
||||
* @return string the name for this type of context.
|
||||
*/
|
||||
function get_contextlevel_name($contextlevel) {
|
||||
static $strcontextlevels = null;
|
||||
if (is_null($strcontextlevels)) {
|
||||
$strcontextlevels = array(
|
||||
CONTEXT_SYSTEM => get_string('coresystem'),
|
||||
CONTEXT_USER => get_string('user'),
|
||||
CONTEXT_COURSECAT => get_string('category'),
|
||||
CONTEXT_COURSE => get_string('course'),
|
||||
CONTEXT_MODULE => get_string('activitymodule'),
|
||||
CONTEXT_BLOCK => get_string('block')
|
||||
);
|
||||
}
|
||||
return $strcontextlevels[$contextlevel];
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints human readable context identifier.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue