]> git.mjollnir.org Git - moodle.git/commitdiff
Tidy-ups
authormoodler <moodler>
Wed, 9 Aug 2006 05:37:53 +0000 (05:37 +0000)
committermoodler <moodler>
Wed, 9 Aug 2006 05:37:53 +0000 (05:37 +0000)
admin/roles/assign.html
admin/roles/assign.php
admin/roles/override.php
admin/roles/tabs.php

index 389dcf7eff96a527e105d639ab3af8dc1ad1060d..d4d1f3785b5522b2ce9165b70fead6d4f6d6a5d9 100755 (executable)
@@ -1,5 +1,5 @@
 
-<form name="studentform" id="studentform" method="post" action="assign.php">
+<form name="assignform" id="assignform" method="post" action="assign.php">
 <input type="hidden" name="previoussearch" value="<?php echo $previoussearch ?>" />
 <input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
 <input type="hidden" name="contextid" value="<?php echo $contextid ?>" />
@@ -7,19 +7,11 @@
   <table align="center" border="0" cellpadding="5" cellspacing="0">
     <tr>
       <td valign="top">
-          <?php
-              $a->count = count($contextusers);
-              $a->items = $strexistingusers;
-              print_string('counteditems', '', $a);
-          ?>
+          <?php print_string('existingusers', 'role', count($contextusers)); ?>
       </td>
       <td></td>
       <td valign="top">
-          <?php
-              $a->count = $usercount;
-              $a->items = $strpotentialusers;
-              print_string('counteditems', '', $a);
-          ?>
+          <?php print_string('potentialusers', 'role', count($usercount)); ?>
       </td>
     </tr>
     <tr>
index 5884d0d603670c8edd72def124fd9b3566cb4e4a..65b6020eed198b9d4cdd2393cb04d936b8464c90 100755 (executable)
      * end of permission checking  
         */
     
-/*
-    if ($course->metacourse) {
-        redirect("$CFG->wwwroot/course/importstudents.php?id=$course->id");
-    }
-*/
     require_login($course->id);
 
     if (!isteacheredit($course->id)) {
         error("You must be an editing teacher in this course, or an admin");
     }
 
-       $strassignusers = get_string('assignusers');
-       $strpotentialusers = get_string('potentialusers');
-       $strexistingusers = get_string('existingusers');
+       $strassignusers = get_string('assignusers', 'role');
+       $strpotentialusers = get_string('potentialusers', 'role');
+       $strexistingusers = get_string('existingusers', 'role');
+       $straction = get_string('assignroles', 'role');
+       $strcurrentrole = get_string('currentrole', 'role');
+       $strcurrentcontext = get_string('currentcontext', 'role');
        $strsearch = get_string('search');
        $strshowall = get_string('showall');
-/*
-       if ($course && $course->id != SITEID) { // course header
-           print_header("$course->shortname: $strassignusers",
-                        "$site->fullname",
-                        "<a href=\"view.php?id=$course->id\">$course->shortname</a> -> $strassignusers");
-       } else { // site header
-           print_header("$site->shortname: $strassignusers",
-                        "$site->fullname",
-                        "$strassignusers");
-       }
-       */
-       $straction = get_string('roleassignment');
+
        $context = get_record('context', 'id', $contextid);
        
        $currenttab = '';
     $existinguserarray = array();
 
        $SQL = "select u.* from {$CFG->prefix}role_assignments r, {$CFG->prefix}user u where contextid = $contextid and roleid = $roleid and u.id = r.userid"; // join now so that we can just use fullname() later
+
     if (!$contextusers = get_records_sql($SQL)) {
        $contextusers = array();  
     }
     
     // prints a form to swap roles
     print ('<form name="rolesform" action="assign.php" method="post">');
-    print ('<div align="center">Current Context: '.print_context_name($contextid).'<br/>');
-    print ('<input type="hidden" name="contextid" value="'.$contextid.'">Select a Role: ');
+    print ('<div align="center">'.$strcurrentcontext.': '.print_context_name($contextid).'<br/>');
+    print ('<input type="hidden" name="contextid" value="'.$contextid.'">'.$strcurrentrole.': ');
     choose_from_menu ($options, 'roleid', $roleid, 'choose', $script='rolesform.submit()');
        print ('</div></form>');
        
index f5f531b8d3b1263752c40e3d22d4bebf4d1d5f05..39ae39fa6a6e90e44bb54056448349e765111b41 100755 (executable)
@@ -1,5 +1,4 @@
- <? 
- /* interface page for writing role overrides */
+<?php
     
        require_once("../../config.php");
        
         redirect("$CFG->wwwroot/$CFG->admin/index.php");
     }
 
-       $stroverrides = get_string('roleoverries');
-/*
-       if ($course && $course->id != SITEID) { // course header
-           print_header("$course->shortname: $stroverrides",
-                        "$site->fullname",
-                        "<a href=\"view.php?id=$course->id\">$course->shortname</a> -> $stroverrides");
-       } else { // site header
-           print_header("$site->shortname: $stroverrides",
-                        "$site->fullname",
-                        "$stroverrides");
-       }
-*/
+       $strassignusers = get_string('assignusers', 'role');
+       $strpotentialusers = get_string('potentialusers', 'role');
+       $strexistingusers = get_string('existingusers', 'role');
+       $straction = get_string('assignroles', 'role');
+       $strcurrentrole = get_string('currentrole', 'role');
+       $strcurrentcontext = get_string('currentcontext', 'role');
+       $strsearch = get_string('search');
+       $strshowall = get_string('showall');
+
        $context = get_record('context', 'id', $contextid);
-       $straction = get_string('editoverride');
+
+       $straction = get_string('overrideroles', 'role');
        $currenttab = '';
+
        $tabsmode = 'override';
        include_once('tabs.php');
+
+
        /*************************
         * form processing here  *
         *************************/
@@ -88,9 +88,9 @@
        $options[$rolex->id] = $rolex->name;
     }
     
-       print ('<form name="rolesform" action="override.php" method="post">');
-    print ('<div align="center">Current Context: '.print_context_name($contextid).'<br/>');
-    print ('<input type="hidden" name="contextid" value="'.$contextid.'">Select a Role: ');
+    print ('<form name="rolesform" action="override.php" method="post">');
+    print ('<div align="center">'.$strcurrentcontext.': '.print_context_name($contextid).'<br/>');
+    print ('<input type="hidden" name="contextid" value="'.$contextid.'">'.$strcurrentrole.': ');
     choose_from_menu ($options, 'roleid', $roleid, 'choose', $script='rolesform.submit()');
        print ('</div></form>');
                
index 151d00edfe1f9ee7ee5ea36ae8450beabcbc6842..4e5834abd786875231057e970557d6315e440f4f 100755 (executable)
@@ -87,12 +87,13 @@ if ($currenttab != 'update') {
        if (isset($tabsmode)) {
                $inactive[] = 'roles';
 
-               $secondrow[] = new tabobject('assign', $CFG->wwwroot.'/admin/roles/assign.php?contextid='.$context->id, get_string('roleassignments')); 
+               $secondrow[] = new tabobject('assign', $CFG->wwwroot.'/admin/roles/assign.php?contextid='.$context->id, get_string('assignroles', 'role')); 
                 
         if ($context->level == CONTEXT_SYSTEM) {
-           $secondrow[] = new tabobject('override', '', get_string('roleoverrides'));          
+           $secondrow[] = new tabobject('override', '', get_string('overrideroles', 'role'));          
         } else {
-           $secondrow[] = new tabobject('override', $CFG->wwwroot.'/admin/roles/override.php?contextid='.$context->id, get_string('roleoverrides'));           
+           $secondrow[] = new tabobject('override', $CFG->wwwroot.'/admin/roles/override.php?contextid='.$context->id,
+                                          get_string('overrideroles', 'role'));                
         }
                
                if ($tabsmode == 'override') {