public function restore_progress_viewer ($userid, $context) {
        $tablehead = array(get_string('course'), get_string('time'), get_string('status', 'backup'));

        $table = new html_table();
        $table->attributes['class'] = 'backup-files-table generaltable';
        $table->head = $tablehead;
        $tabledata = array();

        // Get all in progress async restores for this user.
        $restores = \async_helper::get_async_restores($userid);

        // For each backup get, new item name, time restore created and progress.
        foreach ($restores as $restore) {

            $restorename = \async_helper::get_restore_name($context);
            $timecreated = $restore->timecreated;
            $status = $this->get_status_display($restore->status, $restore->backupid);

            $tablerow = array($restorename, userdate($timecreated), $status);
            $tabledata[] = $tablerow;
        }

        $table->data = $tabledata;
        $html = html_writer::table($table);

        return $html;
    }
public function restore_progress_viewer ($userid, $context) {
        $tablehead = array(get_string('course'), get_string('time'), get_string('status', 'backup'));

        $table = new html_table();
        $table->attributes['class'] = 'backup-files-table generaltable';
        $table->head = $tablehead;
        $tabledata = array();

        // Get all in progress async restores for this user.
        $restores = \async_helper::get_async_restores($userid);

        // For each backup get, new item name, time restore created and progress.
        foreach ($restores as $restore) {

            $restorename = \async_helper::get_restore_name($context);
            $timecreated = $restore->timecreated;
            $status = $this->get_status_display($restore->status, $restore->backupid);

            $tablerow = array($restorename, userdate($timecreated), $status);
            $tabledata[] = $tablerow;
        }

        $table->data = $tabledata;
        $html = html_writer::table($table);

        return $html;
    }
public function restore_progress_viewer ( $ userid , $ context ) { $ tablehead = array ( get_string ( 'course' ) , get_string ( 'time' ) , get_string ( 'status' , 'backup' ) ) ; $ table = new html_table ( ) ; $ table -> attributes [ 'class' ] = 'backup-files-table generaltable' ; $ table -> head = $ tablehead ; $ tabledata = array ( ) ; // Get all in progress async restores for this user. $ restores = \ async_helper :: get_async_restores ( $ userid ) ; // For each backup get, new item name, time restore created and progress. foreach ( $ restores as $ restore ) { $ restorename = \ async_helper :: get_restore_name ( $ context ) ; $ timecreated = $ restore -> timecreated ; $ status = $ this -> get_status_display ( $ restore -> status , $ restore -> backupid ) ; $ tablerow = array ( $ restorename , userdate ( $ timecreated ) , $ status ) ; $ tabledata [ ] = $ tablerow ; } $ table -> data = $ tabledata ; $ html = html_writer :: table ( $ table ) ; return $ html ; }
Get markup to render table for all of a users async
in progress restores.

@param int $userid The Moodle user id.
@param \context $context The Moodle context for these restores.
@return string $html The table HTML.
Get markup to render table for all of a users async in progress restores .