role assign: MDL-17323 Show users from parent contexts ... Refine group labels.

This commit is contained in:
tjhunt 2008-11-21 06:19:52 +00:00
parent a792ac1d7a
commit 490740d6cb
3 changed files with 30 additions and 8 deletions

View file

@ -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.