2023-05-26 15:21:13 +02:00
|
|
|
<?php
|
|
|
|
use filter_bibleversesnwt\bible;
|
|
|
|
|
|
|
|
class bibleversesnwt_filter_local_settings_form extends filter_local_settings_form {
|
2023-11-20 10:53:48 +01:00
|
|
|
|
2023-05-26 15:21:13 +02:00
|
|
|
protected function definition_inner($mform) {
|
|
|
|
$mform->addElement('select', 'biblelang', get_string('biblelang', 'filter_bibleversesnwt'), bible::languages());
|
|
|
|
$mform->setType('biblelang', PARAM_NOTAGS);
|
|
|
|
}
|
|
|
|
|
2023-11-20 10:53:48 +01:00
|
|
|
/**
|
|
|
|
* Override this method to save the settings to the database. The default
|
|
|
|
* implementation will probably be sufficient for most simple cases.
|
|
|
|
* @param object $data the form data that was submitted.
|
|
|
|
*/
|
|
|
|
public function save_changes($data) {
|
|
|
|
$data = (array) $data;
|
|
|
|
unset($data['filter']);
|
|
|
|
unset($data['contextid']);
|
|
|
|
unset($data['submitbutton']);
|
|
|
|
foreach ($data as $name => $value) {
|
|
|
|
if ($value !== '') {
|
|
|
|
filter_set_local_config($this->filter, $this->context->id, $name, $value);
|
|
|
|
} else {
|
|
|
|
filter_unset_local_config($this->filter, $this->context->id, $name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-05-26 15:21:13 +02:00
|
|
|
}
|