ActionController: Set autorefresh interval on view as late as possible

This allows to initialize property `$autorefreshInterval` and have it
take an effect on non-XHR requests.
This commit is contained in:
Johannes Meyer 2020-12-07 16:00:27 +01:00
parent 765557af69
commit f1dd69d877

View File

@ -356,14 +356,14 @@ class ActionController extends Zend_Controller_Action
} }
$this->autorefreshInterval = $interval; $this->autorefreshInterval = $interval;
$this->_helper->layout()->autorefreshInterval = $interval;
return $this; return $this;
} }
public function disableAutoRefresh() public function disableAutoRefresh()
{ {
$this->autorefreshInterval = null; $this->autorefreshInterval = null;
$this->_helper->layout()->autorefreshInterval = null;
return $this; return $this;
} }
@ -480,6 +480,10 @@ class ActionController extends Zend_Controller_Action
} }
} }
if ($this->autorefreshInterval !== null) {
$layout->autorefreshInterval = $this->autorefreshInterval;
}
if ($req->getParam('error_handler') === null && $req->getParam('format') === 'pdf') { if ($req->getParam('error_handler') === null && $req->getParam('format') === 'pdf') {
$this->sendAsPdf(); $this->sendAsPdf();
$this->shutdownSession(); $this->shutdownSession();