mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-24210, make site/course/private repositories more clear
This commit is contained in:
parent
4461a18e73
commit
47fffd8d60
@ -103,8 +103,9 @@ $string['iconview'] = 'View as icons';
|
||||
$string['instance'] = 'instance';
|
||||
$string['instancedeleted'] = 'Instance deleted';
|
||||
$string['instances'] = 'Repository instances';
|
||||
$string['instancesforadmin'] = 'common instance(s)';
|
||||
$string['instancesforothers'] = 'private instance(s)';
|
||||
$string['instancesforsite'] = '{$a} Site-wide common instance(s)';
|
||||
$string['instancesforcourses'] = '{$a} Course-wide common instance(s)';
|
||||
$string['instancesforusers'] = '{$a} User private instance(s)';
|
||||
$string['invalidjson'] = 'Invalid JSON string';
|
||||
$string['invalidplugin'] = 'Invalid repository {$a} plug-in';
|
||||
$string['invalidfiletype'] = '{$a} filetype cannot be accepted.';
|
||||
|
@ -6303,16 +6303,43 @@ class admin_setting_managerepository extends admin_setting {
|
||||
$params['onlyvisible'] = false;
|
||||
$params['type'] = $typename;
|
||||
$admininstancenumber = count(repository::static_function($typename, 'get_instances', $params));
|
||||
$admininstancenumbertext = " <br/> ". $admininstancenumber . " " . get_string('instancesforadmin', 'repository');
|
||||
// site instances
|
||||
$admininstancenumbertext = get_string('instancesforsite', 'repository', $admininstancenumber);
|
||||
$params['context'] = array();
|
||||
$instancenumber = count(repository::static_function($typename, 'get_instances', $params)) - $admininstancenumber;
|
||||
$instancenumbertext = "<br/>" . $instancenumber . " " . get_string('instancesforothers', 'repository');
|
||||
$instances = repository::static_function($typename, 'get_instances', $params);
|
||||
$courseinstances = array();
|
||||
$userinstances = array();
|
||||
|
||||
foreach ($instances as $instance) {
|
||||
if ($instance->context->contextlevel == CONTEXT_COURSE) {
|
||||
$courseinstances[] = $instance;
|
||||
} else if ($instance->context->contextlevel == CONTEXT_USER) {
|
||||
$userinstances[] = $instance;
|
||||
}
|
||||
}
|
||||
// course instances
|
||||
$instancenumber = count($courseinstances);
|
||||
$courseinstancenumbertext = get_string('instancesforcourses', 'repository', $instancenumber);
|
||||
|
||||
// user private instances
|
||||
$instancenumber = count($userinstances);
|
||||
$userinstancenumbertext = get_string('instancesforusers', 'repository', $instancenumber);
|
||||
} else {
|
||||
$admininstancenumbertext = "";
|
||||
$instancenumbertext = "";
|
||||
$courseinstancenumbertext = "";
|
||||
$userinstancenumbertext = "";
|
||||
}
|
||||
|
||||
$settings .= '<a href="' . $this->baseurl . '&action=edit&repos=' . $typename . '">' . $settingsstr .'</a>' . $admininstancenumbertext . $instancenumbertext . "\n";
|
||||
$settings .= '<a href="' . $this->baseurl . '&action=edit&repos=' . $typename . '">' . $settingsstr .'</a>';
|
||||
|
||||
$settings .= $OUTPUT->container_start('mdl-left');
|
||||
$settings .= '<br/>';
|
||||
$settings .= $admininstancenumbertext;
|
||||
$settings .= '<br/>';
|
||||
$settings .= $courseinstancenumbertext;
|
||||
$settings .= '<br/>';
|
||||
$settings .= $userinstancenumbertext;
|
||||
$settings .= $OUTPUT->container_end();
|
||||
}
|
||||
// Get the current visibility
|
||||
if ($i->get_visible()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user