moodle_page: MDL-12212 reimplement user_is_editing, deprecate isediting
[moodle.git] / blocks / social_activities / block_social_activities.php
index 65d5c2c..06f29df 100644 (file)
@@ -11,7 +11,7 @@ class block_social_activities extends block_list {
     }
 
     function get_content() {
-        global $USER, $CFG, $COURSE, $DB;
+        global $USER, $CFG, $COURSE, $DB, $PAGE;
 
         if ($this->content !== NULL) {
             return $this->content;
@@ -35,7 +35,7 @@ class block_social_activities extends block_list {
         require_once($CFG->dirroot.'/course/lib.php');
 
         $context = get_context_instance(CONTEXT_COURSE, $course->id);
-        $isediting = isediting($this->instance->pageid) && has_capability('moodle/course:manageactivities', $context);
+        $isediting = $PAGE->user_is_editing() && has_capability('moodle/course:manageactivities', $context);
         $modinfo = get_fast_modinfo($course);
 
 /// extra fast view mode