mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
Merged from 1.9
Improvements to the tabs for assigning and overriding roles. MDL-12120 Tabs are now all on the top row Tabs have clearer titles Other help texts improved
This commit is contained in:
parent
b8faa9a7d1
commit
21090e447a
7 changed files with 54 additions and 56 deletions
|
@ -172,6 +172,7 @@
|
|||
}
|
||||
} else if ($fromform = $mform->get_data()) {
|
||||
if (empty($fromform->coursemodule)) { //add
|
||||
$cm = null;
|
||||
if (! $course = get_record("course", "id", $fromform->course)) {
|
||||
error("This course doesn't exist");
|
||||
}
|
||||
|
@ -212,16 +213,16 @@
|
|||
$fromform->groupmembersonly = 0;
|
||||
}
|
||||
|
||||
if (!isset($fromform->groupmode)) {
|
||||
$fromform->groupmode = 0;
|
||||
}
|
||||
|
||||
if (!isset($fromform->name)) { //label
|
||||
$fromform->name = $fromform->modulename;
|
||||
}
|
||||
|
||||
if (!empty($fromform->update)) {
|
||||
|
||||
if (!empty($course->groupmodeforce) or !isset($fromform->groupmode)) {
|
||||
$fromform->groupmode = $cm->groupmode; // keep original
|
||||
}
|
||||
|
||||
$returnfromfunc = $updateinstancefunction($fromform);
|
||||
if (!$returnfromfunc) {
|
||||
error("Could not update the $fromform->modulename", "view.php?id=$course->id");
|
||||
|
@ -249,6 +250,10 @@
|
|||
|
||||
} else if (!empty($fromform->add)){
|
||||
|
||||
if (!empty($course->groupmodeforce) or !isset($fromform->groupmode)) {
|
||||
$fromform->groupmode = 0; // do not set groupmode
|
||||
}
|
||||
|
||||
if (!course_allowed_module($course,$fromform->modulename)) {
|
||||
error("This module ($fromform->modulename) has been disabled for this particular course");
|
||||
}
|
||||
|
@ -425,6 +430,8 @@
|
|||
|
||||
if (!empty($cm->id)) {
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
$overridableroles = get_overridable_roles($context);
|
||||
$assignableroles = get_assignable_roles($context);
|
||||
$currenttab = 'update';
|
||||
include_once($CFG->dirroot.'/'.$CFG->admin.'/roles/tabs.php');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue