]> git.mjollnir.org Git - moodle.git/commitdiff
Merged from 1.9
authormoodler <moodler>
Mon, 19 Nov 2007 07:13:02 +0000 (07:13 +0000)
committermoodler <moodler>
Mon, 19 Nov 2007 07:13:02 +0000 (07:13 +0000)
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

admin/roles/assign.php
admin/roles/override.php
admin/roles/tabs.php
course/modedit.php
lang/en_utf8/admin.php
lang/en_utf8/role.php
theme/standard/styles_layout.css

index 859b9c2cbf9a5a73282942ceecf1ed2d0758e514..01a3d73fc4708e6c78b4e422367e26b7a02d06c8 100755 (executable)
     } 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');
     }
 
index eba7516c8b522fe72690a3497ea6807bc817f6fd..1566552a2023599f6fef7064d9d375b00f2d0753 100755 (executable)
         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
index e11c5b6671d1dc5f8d99b84364d9870bc0902a76..5d753c2127fc03abf0d169849e4ef0a70a7d8082 100755 (executable)
@@ -159,48 +159,41 @@ if ($currenttab != 'update') {
 }
 
 
+$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.'&amp;return=true&amp;sesskey='.sesskey(), get_string('update'));
+                        $context->instanceid.'&amp;return=true&amp;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
@@ -209,7 +202,7 @@ if ($context->contextlevel != CONTEXT_SYSTEM) {    // Print tabs for anything ex
         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);
                 }
@@ -217,13 +210,11 @@ if ($context->contextlevel != CONTEXT_SYSTEM) {    // Print tabs for anything ex
         }
     }
 
-    if (!empty($secondrow)) {
-        $tabs = array($toprow, $secondrow);
-    } else {
-        $tabs = array($toprow);
-    }
+    $inactive = array($currenttab);
+
+    $tabs = array($toprow);
 
     print_tabs($tabs, $currenttab, $inactive, $activetwo);
-}
+
 
 ?>
index 3f9cee3fa8868e0f1592cbf349fe642368b99618..4bfd7d2d93f490ae63755f7a4456d65b5aaf8143 100644 (file)
         }
     } 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');
         }
index 2f0349bca100cac0ea2d388124661d616de31a34..2bd26f4e0e6e04a90fb94d4cf0a808eda0ceaf37 100644 (file)
@@ -45,12 +45,12 @@ $string['clamfailureonupload'] = 'On clam AV failure';
 $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.';
@@ -677,4 +677,4 @@ $string['uuupdatetype'] = 'Existing user details';
 $string['validateerror'] = 'This value was not valid:';
 $string['xmlstrictheaders'] = 'XML strict headers';
 
-?>
\ No newline at end of file
+?>
index 2c3ae634aeb6262226d04fb6b9f9ca2992403c91..3141c4458f01e6b4d0e38bf26012faba059b799f 100644 (file)
@@ -84,9 +84,12 @@ $string['legacy:teacher'] = 'LEGACY ROLE: Teacher (non-editing)';
 $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';
index 2211a2b57cd375696a8c71e5e00c1620667fc2fc..cde924f662904ad17b5dd3133fa5184e4f15ff5f 100644 (file)
@@ -2663,8 +2663,9 @@ body.notes .notesgroup {
 .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%;