Hi,
I'm trying to catch some values stored in block configuration so I can store it in the database as separate and make available out of block configuration.
I added form element in
protected function specific_definition($mform) {
....
$defaults = array('yes'=>'yes', 'no'=>'no');
$mform->addElement('select', 'config_studentmobileaccess', get_string('studentsmobileaccess', 'block_morph'), $defaults);
$mform->setDefault('config_studentmobileaccess', 'default');
I tried to overload function set_data like this
function set_data($defaults) {
parent::set_data($defaults);
$val1=$defaults->config_studentmobileaccess
$val2=json_encode($this->block->config)
Both values val1 and val2 shows reads old values from the form. Could somebody explain how to get new values inserted into the form?
Thanks,
Zoran