public function display(core_backup_renderer $renderer) {

        $format = backup_general_helper::detect_backup_format($this->filepath);

        if ($format === backup::FORMAT_MOODLE) {
            // Standard Moodle 2 format, let use get the type of the backup.
            $details = backup_general_helper::get_backup_information($this->filepath);
            if ($details->type === backup::TYPE_1COURSE) {
                $wholecourse = true;
            } else {
                $wholecourse = false;
            }

        } else {
            // Non-standard format to be converted. We assume it contains the
            // whole course for now. However, in the future there might be a callback
            // to the installed converters.
            $wholecourse = true;
        }

        $nextstageurl = new moodle_url('/backup/restore.php', array(
            'contextid' => $this->contextid,
            'filepath'  => $this->filepath,
            'stage'     => restore_ui::STAGE_SETTINGS));
        $context = context::instance_by_id($this->contextid);

        if ($context->contextlevel == CONTEXT_COURSE and has_capability('moodle/restore:restorecourse', $context)) {
            $currentcourse = $context->instanceid;
        } else {
            $currentcourse = false;
        }

        return $renderer->course_selector($nextstageurl, $wholecourse, $this->categorysearch, $this->coursesearch, $currentcourse);
    }
public function display(core_backup_renderer $renderer) {

        $format = backup_general_helper::detect_backup_format($this->filepath);

        if ($format === backup::FORMAT_MOODLE) {
            // Standard Moodle 2 format, let use get the type of the backup.
            $details = backup_general_helper::get_backup_information($this->filepath);
            if ($details->type === backup::TYPE_1COURSE) {
                $wholecourse = true;
            } else {
                $wholecourse = false;
            }

        } else {
            // Non-standard format to be converted. We assume it contains the
            // whole course for now. However, in the future there might be a callback
            // to the installed converters.
            $wholecourse = true;
        }

        $nextstageurl = new moodle_url('/backup/restore.php', array(
            'contextid' => $this->contextid,
            'filepath'  => $this->filepath,
            'stage'     => restore_ui::STAGE_SETTINGS));
        $context = context::instance_by_id($this->contextid);

        if ($context->contextlevel == CONTEXT_COURSE and has_capability('moodle/restore:restorecourse', $context)) {
            $currentcourse = $context->instanceid;
        } else {
            $currentcourse = false;
        }

        return $renderer->course_selector($nextstageurl, $wholecourse, $this->categorysearch, $this->coursesearch, $currentcourse);
    }
public function display ( core_backup_renderer $ renderer ) { $ format = backup_general_helper :: detect_backup_format ( $ this -> filepath ) ; if ( $ format === backup :: FORMAT_MOODLE ) { // Standard Moodle 2 format, let use get the type of the backup. $ details = backup_general_helper :: get_backup_information ( $ this -> filepath ) ; if ( $ details -> type === backup :: TYPE_1COURSE ) { $ wholecourse = true ; } else { $ wholecourse = false ; } } else { // Non-standard format to be converted. We assume it contains the // whole course for now. However, in the future there might be a callback // to the installed converters. $ wholecourse = true ; } $ nextstageurl = new moodle_url ( '/backup/restore.php' , array ( 'contextid' => $ this -> contextid , 'filepath' => $ this -> filepath , 'stage' => restore_ui :: STAGE_SETTINGS ) ) ; $ context = context :: instance_by_id ( $ this -> contextid ) ; if ( $ context -> contextlevel == CONTEXT_COURSE and has_capability ( 'moodle/restore:restorecourse' , $ context ) ) { $ currentcourse = $ context -> instanceid ; } else { $ currentcourse = false ; } return $ renderer -> course_selector ( $ nextstageurl , $ wholecourse , $ this -> categorysearch , $ this -> coursesearch , $ currentcourse ) ; }
Renders the destination stage screen

@param core_backup_renderer $renderer renderer instance to use
@return string HTML code
Renders the destination stage screen