/**
  *
  * @global moodle_database $DB
  * @param core_backup_renderer $renderer
  * @return string
  */
 public function display($renderer)
 {
     global $DB, $USER, $PAGE;
     $format = backup_general_helper::detect_backup_format($this->filepath);
     if ($format !== 'moodle2') {
         return $renderer->invalid_format($format);
     }
     $this->details = backup_general_helper::get_backup_information($this->filepath);
     $url = new moodle_url('/backup/restore.php', array('contextid' => $this->contextid, 'filepath' => $this->filepath, 'stage' => restore_ui::STAGE_SETTINGS));
     $context = get_context_instance_by_id($this->contextid);
     $currentcourse = $context->contextlevel == CONTEXT_COURSE && has_capability('moodle/restore:restorecourse', $context) ? $context->instanceid : false;
     $html = $renderer->course_selector($url, $this->details, $this->categorysearch, $this->coursesearch, $currentcourse);
     return $html;
 }