function format_socialwall_user_deleted($event)
{
    $eventdata = $event->get_data();
    $userid = $eventdata['objectid'];
    \format_socialwall\local\posts::cleanup_userdeleted($userid);
}
     }
     redirect($redirecturl);
     break;
 case 'deletepost':
     $pid = required_param('pid', PARAM_INT);
     $formatsociallwallposts = \format_socialwall\local\posts::instance($course->id);
     // Suitable capability checks are made in delete_post!
     $formatsociallwallposts->delete_post($pid);
     redirect($redirecturl);
     break;
 case 'likepost':
     \format_socialwall\local\action_handler::like_post($course);
     redirect($redirecturl);
     break;
 case 'makesticky':
     $posts = \format_socialwall\local\posts::instance($course->id);
     // Suitable capability checks are made in delete_post!
     $posts->makesticky();
     redirect($redirecturl);
     break;
 case 'lockpost':
     \format_socialwall\local\action_handler::lock_post($course);
     redirect($redirecturl);
     break;
 case 'postcomment':
     \format_socialwall\local\action_handler::post_comment($course);
     redirect($redirecturl);
     break;
 case 'deletecomment':
     \format_socialwall\local\action_handler::delete_comment();
     redirect($redirecturl);
 /**
  * Print out the course page
  * 
  * @param object $course
  * @param completion_info $completioninfo
  */
 public function print_page($course, $completioninfo)
 {
     $this->commentsformshow = optional_param('commentsformshow', 0, PARAM_ALPHANUMEXT);
     $posts = \format_socialwall\local\posts::instance($course->id);
     $postdata = $posts->get_timeline_posts($course);
     $postform = $posts->get_post_form($postdata);
     $course = course_get_format($course)->get_course();
     // Title with completion help icon.
     echo $completioninfo->display_help_icon();
     echo $this->output->heading($this->page_title(), 2, 'accesshide');
     // Copy activity clipboard..
     echo $this->course_activity_clipboard($course, 0);
     // Now the list of sections..
     echo $this->start_section_list();
     $modinfo = get_fast_modinfo($course);
     $sectioninfo = $modinfo->get_section_info_all();
     // ...Section 0.
     $this->print_first_section($course, $sectioninfo);
     // ...Section 2.
     $postid = $postdata->filteroptions->postid;
     $this->print_postform_section($course, $sectioninfo, $postform, $postid);
     // ...Section 1.
     $this->print_timeline_section($course, $postdata, $completioninfo);
     echo $this->end_section_list();
     $args = array('courseid' => $course->id, 'poststotal' => $postdata->poststotal, 'postsloaded' => $postdata->postsloaded, 'userallowedediting' => $this->page->user_allowed_editing());
     $this->page->requires->strings_for_js(array('counttotalpost', 'like', 'likenomore', 'countlikes', 'countcomments', 'textrequired', 'confirmdeletecomment'), 'format_socialwall');
     $this->page->requires->yui_module('moodle-format_socialwall-postform', 'M.format_socialwall.postforminit', array($args), null, true);
 }