]> git.mjollnir.org Git - moodle.git/commitdiff
merged fix for MDL-7426, removed link to teacher.php
authortoyomoyo <toyomoyo>
Tue, 21 Nov 2006 04:45:32 +0000 (04:45 +0000)
committertoyomoyo <toyomoyo>
Tue, 21 Nov 2006 04:45:32 +0000 (04:45 +0000)
course/search.php

index 652f2370b3746cc6674d9b1e64e69fd546555cef..4f2b5ae54af0b7af92d7e09550e1ea555eaca6e6 100644 (file)
                 } else {
                     $pixpath = "$CFG->themedir/$CFG->theme/pix";
                 }
+                
                 echo "<a title=\"".get_string("settings")."\" href=\"$CFG->wwwroot/course/edit.php?id=$course->id\"><img".
                     " src=\"$pixpath/t/edit.gif\" height=\"11\" width=\"11\" border=\"0\"></a> ";
-                echo "<a title=\"".get_string("assignteachers")."\" href=\"$CFG->wwwroot/course/teacher.php?id=$course->id\"><img".
-                    " src=\"$pixpath/t/user.gif\" height=\"11\" width=\"11\" border=\"0\"></a> ";
+           
+                   $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
+                   if (has_capability('moodle/role:assign', $coursecontext)) {
+                    echo'<a title="'.get_string('assignroles', 'role').'" href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$coursecontext->id.'">';
+                       echo '<img src="'.$CFG->pixpath.'/i/roles.gif" height="11" width="11" alt="'.get_string('assignroles', 'role').'" /></a>';
+                   }                
+                      
                 echo "<a title=\"".get_string("delete")."\" href=\"delete.php?id=$course->id\"><img".
                     " src=\"$pixpath/t/delete.gif\" height=\"11\" width=\"11\" border=\"0\"></a> ";
                 if (!empty($course->visible)) {