Refactoring the code for creating forms

This commit is contained in:
2017-11-23 17:58:29 +04:00
parent 1c87dae035
commit 03d22ef096

View File

@ -22,16 +22,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
namespace local_webhooks;
defined("MOODLE_INTERNAL") || die(); defined("MOODLE_INTERNAL") || die();
require_once($CFG->libdir . "/formslib.php"); require_once($CFG->libdir . "/formslib.php");
use lang_string;
use moodleform;
use report_eventlist_list_generator;
/** /**
* Description editing form definition. * Description editing form definition.
* *
@ -46,19 +40,6 @@ class service_edit_form extends moodleform {
parent::__construct($baseurl); parent::__construct($baseurl);
} }
/**
* Preparing data before displaying.
*
* @param object $record
*/
public function set_data($record) {
if (!empty($record->events)) {
$record->events = unserialize(gzuncompress(base64_decode($record->events)));
}
return parent::set_data($record);
}
/** /**
* Defines the standard structure of the form. * Defines the standard structure of the form.
*/ */