summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2017-11-17 19:14:52 +0300
committerValentin Popov <info@valentineus.link>2017-11-18 03:56:33 +0300
commit7b56375c057d6d7cdbe0948837cbc9d53c7880e9 (patch)
tree6b6cab88217868b51d0ef85dbff6f6e9b57baebd
parentb61e5a08be11a3691fcef6cc163fd869ab8c2b0b (diff)
downloadlocal_webhooks-7b56375c057d6d7cdbe0948837cbc9d53c7880e9.tar.xz
local_webhooks-7b56375c057d6d7cdbe0948837cbc9d53c7880e9.zip
Form class loading a backup
-rw-r--r--classes/editform.php34
1 files changed, 33 insertions, 1 deletions
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 <http://www.gnu.org/licenses/>.
/**
- * Defines the form of editing the service.
+ * Defines forms.
*
* @package local_webhooks
* @copyright 2017 "Valentin Popov" <info@valentineus.link>
@@ -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" <info@valentineus.link>
+ * @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