. /** * Class site_unregistration_form * * @package core * @copyright 2017 Marina Glancy * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace core\hub; defined('MOODLE_INTERNAL') || die(); global $CFG; require_once($CFG->libdir . '/formslib.php'); /** * This form display a unregistration form. * * @author Jerome Mouneyrac * @package core * @copyright 2017 Marina Glancy * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class site_unregistration_form extends \moodleform { /** * Form definition */ public function definition() { global $CFG; $mform = & $this->_form; $mform->addElement('header', 'site', get_string('unregister', 'hub')); $unregisterlabel = get_string('unregister', 'hub'); $mform->addElement('advcheckbox', 'unpublishalladvertisedcourses', '', ' ' . get_string('unpublishalladvertisedcourses', 'hub')); $mform->setType('unpublishalladvertisedcourses', PARAM_INT); $mform->addElement('advcheckbox', 'unpublishalluploadedcourses', '', ' ' . get_string('unpublishalluploadedcourses', 'hub')); $mform->setType('unpublishalluploadedcourses', PARAM_INT); $mform->addElement('hidden', 'unregistration', 1); $mform->setType('unregistration', PARAM_INT); $mform->addElement('static', 'explanation', '', get_string('unregisterexplained', 'hub', $CFG->wwwroot)); $this->add_action_buttons(true, $unregisterlabel); } }