mirror of
https://github.com/php/web-wiki.git
synced 2026-03-23 23:12:22 +01:00
Fix doodle autocloser
This commit is contained in:
committed by
Derick Rethans
parent
55cecbb6de
commit
575aed30b4
@@ -141,10 +141,6 @@ class syntax_plugin_doodle extends DokuWiki_Syntax_Plugin
|
||||
if (strcmp($name, "CLOSEON") == 0) {
|
||||
if (($timestamp = strtotime($value)) !== false) {
|
||||
$params['close_on_ts'] = $timestamp;
|
||||
|
||||
if (time() > $timestamp) {
|
||||
$params['closed'] = 1;
|
||||
}
|
||||
}
|
||||
} else
|
||||
if (strcmp($name, "CLOSED") == 0) {
|
||||
@@ -211,6 +207,14 @@ class syntax_plugin_doodle extends DokuWiki_Syntax_Plugin
|
||||
|
||||
//debout('data in render', $data);
|
||||
|
||||
// The auto-closer logic depends on the current time() and thus needs
|
||||
// to happen in render(), since the result of handle() is cached.
|
||||
if (isset($data['params']['close_on_ts'])) {
|
||||
if (time() > $data['params']['close_on_ts']) {
|
||||
$data['params']['closed'] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$this->params = $data['params'];
|
||||
$this->choices = $data['choices'];
|
||||
$this->doodle = array();
|
||||
|
||||
Reference in New Issue
Block a user