mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01:00
Changed a magic number to DAYSECS and some instance_config_save() calls to
the recommended instance_config_commit().
This commit is contained in:
parent
3522e27dbc
commit
6d908bc6c8
@ -38,7 +38,7 @@ class block_glossary_random extends block_base {
|
||||
if (!$numberofentries = count_records('glossary_entries','glossaryid',$this->config->glossary,
|
||||
'approved',1)) {
|
||||
$this->config->cache = get_string('noentriesyet','block_glossary_random');
|
||||
parent::instance_config_save($this->config);
|
||||
$this->instance_config_commit();
|
||||
}
|
||||
|
||||
switch ($this->config->type) {
|
||||
@ -78,15 +78,15 @@ class block_glossary_random extends block_base {
|
||||
$text = "<b>$entry->concept</b><br />";
|
||||
$text .= format_text($entry->definition, $entry->format);
|
||||
|
||||
$this->config->nexttime = usergetmidnight(time())+60*60*24*$this->config->refresh;
|
||||
$this->config->nexttime = usergetmidnight(time()) + DAYSECS * $this->config->refresh;
|
||||
$this->config->previous = $i;
|
||||
|
||||
} else {
|
||||
$text = get_string('noentriesyet','block_glossary_random');
|
||||
}
|
||||
// store the text
|
||||
$this->config->cache= $text;
|
||||
parent::instance_config_save($this->config);
|
||||
$this->config->cache = $text;
|
||||
$this->instance_config_commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user