#780 Auto refresh for the shortcuts

SVN:trunk[2926]
This commit is contained in:
Romain Quetiez
2013-10-17 14:47:05 +00:00
parent afa3c40c3e
commit bbb31e2b7f
4 changed files with 61 additions and 4 deletions

View File

@@ -204,6 +204,11 @@ class DisplayBlock
$bAutoReload = false;
if (isset($aExtraParams['auto_reload']))
{
if ($aExtraParams['auto_reload'] === true)
{
// Note: does not work in the switch (case true) because a positive number evaluates to true!!!
$aExtraParams['auto_reload'] = 'standard';
}
switch($aExtraParams['auto_reload'])
{
case 'fast':
@@ -213,16 +218,15 @@ class DisplayBlock
case 'standard':
case 'true':
case true:
$bAutoReload = true;
$iReloadInterval = MetaModel::GetConfig()->GetStandardReloadInterval()*1000;
break;
default:
if (is_numeric($aExtraParams['auto_reload']))
if (is_numeric($aExtraParams['auto_reload']) && ($aExtraParams['auto_reload'] > 0))
{
$bAutoReload = true;
$iReloadInterval = $aExtraParams['auto_reload']*1000;
$iReloadInterval = max(5, $aExtraParams['auto_reload'])*1000;
}
else
{