public function config_write($name, $value) { if ($value === '') { // We do not want empty values in config table, // delete it instead. $value = null; } return parent::config_write($name, $value); }
/** * Set the cron field for the gdata block record * to the number of sections set in this setting. * * @return boolean **/ function config_write($name, $value) { global $DB; if (empty($value)) { $cron = 0; } else { $cron = $value * MINSECS; } if ($DB->set_field('block', 'cron', $cron, array('name' => 'gdata'))) { return parent::config_write($name, $value); } return false; }