. /** * Defines forms. * * @package local_webhooks * @copyright 2017 "Valentin Popov" * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); require_once($CFG->libdir . '/formslib.php'); /** * Description of the form of restoration. * * @copyright 2017 "Valentin Popov" * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class service_backup_form extends moodleform { /** * Defines the standard structure of the form. * * @throws \coding_exception */ protected function definition() { $mform =& $this->_form; /* Form heading */ $mform->addElement('header', 'editserviceheader', new lang_string('restore', 'local_webhooks')); /* Download the file */ $mform->addElement('filepicker', 'backupfile', new lang_string('file', 'local_webhooks')); $mform->addRule('backupfile', null, 'required'); /* Control Panel */ $this->add_action_buttons(true, new lang_string('restore', 'local_webhooks')); } }