]> git.mjollnir.org Git - moodle.git/commitdiff
index: use $PAGE->edit_course_allowed() instead of editcourseallowed()
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:47:49 +0000 (07:47 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:47:49 +0000 (07:47 +0000)
$PAGE->edit_course_allowed() has been reworked and is faster/smarter
than editcourseallowed(). It can also be made more specific on a
per-page-type basis.

index.php

index 94a4306510070848bc311a2ee6817539b35494d7..2b4f9bce953817897f805067c0d722ac527b749a 100644 (file)
--- a/index.php
+++ b/index.php
             break;
             case 'right':
     // The right column
-    if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing || editcourseallowed(SITEID)) {
+    if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing || $PAGE->user_allowed_editing()) {
         echo '<td style="width: '.$preferred_width_right.'px;" id="right-column">';
         if (!empty($THEME->customcorners)) print_custom_corners_start();
-        if (editcourseallowed(SITEID)) {
+        if ($PAGE->user_allowed_editing()) {
             echo '<div style="text-align:center">'.update_course_icon($SITE->id).'</div>';
             echo '<br />';
         }