From 7b56375c057d6d7cdbe0948837cbc9d53c7880e9 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Fri, 17 Nov 2017 20:14:52 +0400 Subject: Form class loading a backup --- classes/editform.php | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/classes/editform.php b/classes/editform.php index f3b877b..46a8f23 100644 --- a/classes/editform.php +++ b/classes/editform.php @@ -15,7 +15,7 @@ // along with Moodle. If not, see . /** - * Defines the form of editing the service. + * Defines forms. * * @package local_webhooks * @copyright 2017 "Valentin Popov" @@ -119,4 +119,36 @@ class service_edit_form extends moodleform { /* Control Panel */ $this->add_action_buttons(true); } +} + +/** + * 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 { + /** + * @param string $baseurl + */ + public function __construct($baseurl) { + parent::__construct($baseurl); + } + + /** + * Defines the standard structure of the form. + */ + protected function definition() { + $mform =& $this->_form; + + /* Form heading */ + $mform->addElement("header", "editserviceheader", new lang_string("restore", "moodle")); + + /* Download the file */ + $mform->addElement("filepicker", "backupfile", new lang_string("file", "moodle")); + $mform->addRule("backupfile", null, "required"); + + /* Control Panel */ + $this->add_action_buttons(true, new lang_string("restore", "moodle")); + } } \ No newline at end of file -- cgit v1.2.3