<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

/**
 * CSV import for CAPP compétences niveau/commentaire — same shape as
 * local_kid_eval_import_form/local_kid_stage_import_form.
 *
 * @package    local_kid
 */

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir . '/formslib.php');

class local_kid_capp_import_competences_form extends moodleform {

    protected function definition() {
        $mform = $this->_form;

        $mform->addElement('hidden', 'sessionid');
        $mform->setType('sessionid', PARAM_INT);

        $mform->addElement('filepicker', 'csvfile', get_string('capp_import_competences_file', 'local_kid'), null, [
            'accepted_types' => ['.csv'],
        ]);
        $mform->addRule('csvfile', get_string('required'), 'required', null, 'client');
        $mform->addElement('static', 'formathelp', '', get_string('capp_import_competences_format_help', 'local_kid'));

        $this->add_action_buttons(true, get_string('capp_import_submit', 'local_kid'));
    }
}
