} else if ($context->contextlevel==CONTEXT_COURSE and $context->instanceid == SITEID) {
admin_externalpage_setup('frontpageroles');
admin_externalpage_print_header();
- $currenttab = '';
- $tabsmode = 'assign';
+ $currenttab = 'assign';
include_once('tabs.php');
} else {
- $currenttab = '';
- $tabsmode = 'assign';
+ $currenttab = 'assign';
include_once('tabs.php');
}
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('frontpageroles');
admin_externalpage_print_header();
- $currenttab = '';
- $tabsmode = 'override';
+ $currenttab = 'override';
include_once('tabs.php');
} else {
- $currenttab = '';
- $tabsmode = 'override';
+ $currenttab = 'override';
include_once('tabs.php');
}
}
- print_heading_with_help(get_string('overriderolesin', 'role', print_context_name($context)), 'overrides');
+ print_heading_with_help(get_string('overridepermissionsin', 'role', print_context_name($context)), 'overrides');
if ($roleid) {
/// prints a form to swap roles
}
+$toprow = array();
+$inactive = array();
+$activetwo = array();
+
+
if ($context->contextlevel != CONTEXT_SYSTEM) { // Print tabs for anything except SYSTEM context
- if ($context->contextlevel == CONTEXT_MODULE) { // only show update button if module?
+ if ($context->contextlevel == CONTEXT_MODULE) { // Only show update button if module
$toprow[] = new tabobject('update', $CFG->wwwroot.'/course/mod.php?update='.
- $context->instanceid.'&return=true&sesskey='.sesskey(), get_string('update'));
+ $context->instanceid.'&return=true&sesskey='.sesskey(), get_string('settings'));
}
- $toprow[] = new tabobject('roles', $CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.
- $context->id, get_string('roles'));
-
- if (!empty($tabsmode)) {
-
- if (!empty($assignableroles)) {
- $secondrow[] = new tabobject('assign',
- $CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id,
- get_string('assignroles', 'role'),
- get_string('showallroles', 'role'),
- true);
- }
-
- if (!empty($overridableroles)) {
- $secondrow[] = new tabobject('override',
- $CFG->wwwroot.'/'.$CFG->admin.'/roles/override.php?contextid='.$context->id,
- get_string('overrideroles', 'role'),
- get_string('showallroles', 'role'),
- true);
- }
-
- $inactive[] = 'roles';
- $activetwo = array('roles');
- $currenttab = $tabsmode;
+ if (!empty($assignableroles)) {
+ $toprow[] = new tabobject('assign',
+ $CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id,
+ get_string('localroles', 'role'),
+ get_string('showallroles', 'role'),
+ true);
+ }
- } else {
- $inactive[] = '';
- $activetwo = array();
+ if (!empty($overridableroles)) {
+ $toprow[] = new tabobject('override',
+ $CFG->wwwroot.'/'.$CFG->admin.'/roles/override.php?contextid='.$context->id,
+ get_string('overridepermissions', 'role'),
+ get_string('showallroles', 'role'),
+ true);
}
+}
+
/// Here other core tabs should go (always calling tabs.php files)
-/// All the logic to decide what to show must be self-cointained in the tabs file
-/// ej.:
+/// All the logic to decide what to show must be self-contained in the tabs file
+/// eg:
/// include_once($CFG->dirroot . '/grades/tabs.php');
/// Finally, we support adding some 'on-the-fly' tabs here
if ($extratabs = explode(',', $CFG->extratabs)) {
asort($extratabs);
foreach($extratabs as $extratab) {
- /// Each extra tab mus be one $CFG->dirroot relative file
+ /// Each extra tab must be one $CFG->dirroot relative file
if (file_exists($CFG->dirroot . '/' . $extratab)) {
include_once($CFG->dirroot . '/' . $extratab);
}
}
}
- if (!empty($secondrow)) {
- $tabs = array($toprow, $secondrow);
- } else {
- $tabs = array($toprow);
- }
+ $inactive = array($currenttab);
+
+ $tabs = array($toprow);
print_tabs($tabs, $currenttab, $inactive, $activetwo);
-}
+
?>
}
} 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");
}
$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");
} 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");
}
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');
}
$string['cleanup'] = 'Cleanup';
$string['componentinstalled'] = 'Component Installed';
$string['confeditorhidebuttons'] = 'Select the buttons that should be hidden in the HTML editor.';
-$string['configallowassign'] = 'Allow the roles on the left side to assign the roles in each column';
+$string['configallowassign'] = 'You can allow people who have the roles on the left side to assign some of the column roles to other people';
$string['configallowcategorythemes'] = 'If you enable this, then themes can be set at the category level. This will affect all child categories and courses unless they have specifically set their own theme. WARNING: Enabling category themes may affect performance.';
$string['configallowcoursethemes'] = 'If you enable this, then courses will be allowed to set their own themes. Course themes override all other theme choices (site, user, or session themes)';
$string['configallowemailaddresses'] = 'If you want to restrict all new email addresses to particular domains, then list them here separated by spaces. All other domains will be rejected. eg <strong>ourcollege.edu.au .gov.au</strong>';
$string['configallowobjectembed'] = 'As a default security measure, normal users are not allowed to embed multimedia (like Flash) within texts using explicit EMBED and OBJECT tags in their HTML (although it can still be done safely using the mediaplugins filter). If you wish to allow these tags then enable this option.';
-$string['configallowoverride'] = 'Allow the roles on the left side to override the roles in each column';
+$string['configallowoverride'] = 'You can allow people with the roles on the left side to override some of the column roles';
$string['configallowunenroll'] = 'If this is set \'Yes\', then students are allowed to unenroll themselves from courses whenever they like. Otherwise they are not allowed, and this process will be solely controlled by the teachers and administrators.';
$string['configallowuserblockhiding'] = 'Do you want to allow users to hide/show side blocks throughout this site? This feature uses Javascript and cookies to remember the state of each collapsible block, and only affects the user\'s own view.';
$string['configallowusermailcharset'] = 'Enabling this, every user in the site will be able to specify his own charset for email.';
$string['validateerror'] = 'This value was not valid:';
$string['xmlstrictheaders'] = 'XML strict headers';
-?>
\ No newline at end of file
+?>
$string['legacy:user'] = 'LEGACY ROLE: Authenticated user';
$string['legacytype'] = 'Legacy role type';
$string['listallroles'] = 'List all roles';
+$string['localroles'] = 'Locally assigned roles';
$string['manageroles'] = 'Manage roles';
$string['metaassignerror'] = 'Can not assign this role to user \"$a\" because Manage metacourse capability is needed.';
$string['metaunassignerror'] = 'Role of user \"$a\" was automatically reassigned, please unassign the role in child courses instead.';
+$string['overridepermissions'] = 'Override permissions';
+$string['overridepermissionsin'] = 'Override permissions in $a';
$string['morethan'] = 'More than $a';
$string['my:manageblocks'] = 'Manage myMoodle page blocks';
$string['nocapabilitiesincontext'] = 'No capabilities available in this context';
.tabrow0 {
text-align: center;
width:100%;
- padding:0 0 1.75em 0;
margin:0;
+ margin-top: 10px;
+ padding:0 0 1.75em 0;
list-style:none;
line-height:1.8em;
font-size: 84%;