public function subscriber_overview($users, $forum , $course) {
        $output = '';
        $modinfo = get_fast_modinfo($course);
        if (!$users || !is_array($users) || count($users)===0) {
            $output .= $this->output->heading(get_string("nosubscribers", "forum"));
        } else if (!isset($modinfo->instances['forum'][$forum->id])) {
            $output .= $this->output->heading(get_string("invalidmodule", "error"));
        } else {
            $cm = $modinfo->instances['forum'][$forum->id];
            $canviewemail = in_array('email', get_extra_user_fields(context_module::instance($cm->id)));
            $strparams = new stdclass();
            $strparams->name = format_string($forum->name);
            $strparams->count = count($users);
            $output .= $this->output->heading(get_string("subscriberstowithcount", "forum", $strparams));
            $table = new html_table();
            $table->cellpadding = 5;
            $table->cellspacing = 5;
            $table->tablealign = 'center';
            $table->data = array();
            foreach ($users as $user) {
                $info = array($this->output->user_picture($user, array('courseid'=>$course->id)), fullname($user));
                if ($canviewemail) {
                    array_push($info, $user->email);
                }
                $table->data[] = $info;
            }
            $output .= html_writer::table($table);
        }
        return $output;
    }
public function subscriber_overview($users, $forum , $course) {
        $output = '';
        $modinfo = get_fast_modinfo($course);
        if (!$users || !is_array($users) || count($users)===0) {
            $output .= $this->output->heading(get_string("nosubscribers", "forum"));
        } else if (!isset($modinfo->instances['forum'][$forum->id])) {
            $output .= $this->output->heading(get_string("invalidmodule", "error"));
        } else {
            $cm = $modinfo->instances['forum'][$forum->id];
            $canviewemail = in_array('email', get_extra_user_fields(context_module::instance($cm->id)));
            $strparams = new stdclass();
            $strparams->name = format_string($forum->name);
            $strparams->count = count($users);
            $output .= $this->output->heading(get_string("subscriberstowithcount", "forum", $strparams));
            $table = new html_table();
            $table->cellpadding = 5;
            $table->cellspacing = 5;
            $table->tablealign = 'center';
            $table->data = array();
            foreach ($users as $user) {
                $info = array($this->output->user_picture($user, array('courseid'=>$course->id)), fullname($user));
                if ($canviewemail) {
                    array_push($info, $user->email);
                }
                $table->data[] = $info;
            }
            $output .= html_writer::table($table);
        }
        return $output;
    }
public function subscriber_overview ( $ users , $ forum , $ course ) { $ output = '' ; $ modinfo = get_fast_modinfo ( $ course ) ; if ( ! $ users || ! is_array ( $ users ) || count ( $ users ) === 0 ) { $ output .= $ this -> output -> heading ( get_string ( "nosubscribers" , "forum" ) ) ; } else if ( ! isset ( $ modinfo -> instances [ 'forum' ] [ $ forum -> id ] ) ) { $ output .= $ this -> output -> heading ( get_string ( "invalidmodule" , "error" ) ) ; } else { $ cm = $ modinfo -> instances [ 'forum' ] [ $ forum -> id ] ; $ canviewemail = in_array ( 'email' , get_extra_user_fields ( context_module :: instance ( $ cm -> id ) ) ) ; $ strparams = new stdclass ( ) ; $ strparams -> name = format_string ( $ forum -> name ) ; $ strparams -> count = count ( $ users ) ; $ output .= $ this -> output -> heading ( get_string ( "subscriberstowithcount" , "forum" , $ strparams ) ) ; $ table = new html_table ( ) ; $ table -> cellpadding = 5 ; $ table -> cellspacing = 5 ; $ table -> tablealign = 'center' ; $ table -> data = array ( ) ; foreach ( $ users as $ user ) { $ info = array ( $ this -> output -> user_picture ( $ user , array ( 'courseid' => $ course -> id ) ) , fullname ( $ user ) ) ; if ( $ canviewemail ) { array_push ( $ info , $ user -> email ) ; } $ table -> data [ ] = $ info ; } $ output .= html_writer :: table ( $ table ) ; } return $ output ; }
This function generates HTML to display a subscriber overview, primarily used on
the subscribers page if editing was turned off

@param array $users
@param object $forum
@param object $course
@return string
This function generates HTML to display a subscriber overview primarily used on the subscribers page if editing was turned off