<?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.

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

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

class local_kid_cohort_link_form extends moodleform {

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

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

        $cohorts = $this->_customdata['cohorts'];
        $mform->addElement('select', 'cohortid', get_string('promotion_col_cohort', 'local_kid'), $cohorts);
        $mform->addRule('cohortid', get_string('required'), 'required', null, 'client');

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