]> git.mjollnir.org Git - moodle.git/commitdiff
Adding roles to front page course list "add" button
authormoodler <moodler>
Sun, 13 Aug 2006 13:17:38 +0000 (13:17 +0000)
committermoodler <moodler>
Sun, 13 Aug 2006 13:17:38 +0000 (13:17 +0000)
course/lib.php

index cba819d437ee11a371ac94307a7b2a61e248df4f..675e5f929f23e9e7b79143e190d675c976c6fb87 100644 (file)
@@ -1500,7 +1500,8 @@ function print_courses($category, $width="100%", $hidesitecourse = false) {
         }
     } else {
         print_heading(get_string("nocoursesyet"));
-        if (iscreator()) {  // Make it obvious for newbies on new sites how to add a course
+               $context = get_context_instance(CONTEXT_SYSTEM, SITEID);
+        if (has_capability('moodle/course:create', $context->id)) {
             $options = array();
             $options['category'] = $category->id;
             echo '<div class="addcoursebutton" align="center">';
@@ -2156,4 +2157,4 @@ function move_courses ($courseids, $categoryid) {
     return true;
 }
 
-?>
\ No newline at end of file
+?>