Merge pull request #4698 from Icinga/bugfix/set-modal-title-from-response-header-on-autosubmit
Set modal title from response header on auto/formsubmit
This commit is contained in:
commit
a621229240
|
@ -496,6 +496,7 @@ class ActionController extends Zend_Controller_Action
|
|||
$resp->setReloadCss(true);
|
||||
}
|
||||
|
||||
if ($resp->getHeader('X-Icinga-Title') === null) {
|
||||
if ($this->view->title) {
|
||||
if (preg_match('~[\r\n]~', $this->view->title)) {
|
||||
// TODO: Innocent exception and error log for hack attempts
|
||||
|
@ -509,6 +510,7 @@ class ActionController extends Zend_Controller_Action
|
|||
} else {
|
||||
$resp->setHeader('X-Icinga-Title', rawurlencode($this->view->defaultTitle), true);
|
||||
}
|
||||
}
|
||||
|
||||
$layout = $this->_helper->layout();
|
||||
if ($this->rerenderLayout) {
|
||||
|
|
|
@ -109,6 +109,11 @@
|
|||
req.addToHistory = false;
|
||||
req.$redirectTarget = $modal.data('redirectTarget');
|
||||
req.done(function (data, textStatus, req) {
|
||||
var title = req.getResponseHeader('X-Icinga-Title');
|
||||
if (!! title) {
|
||||
_this.setTitle($modal, decodeURIComponent(title).replace(/\s::\s.*/, ''));
|
||||
}
|
||||
|
||||
if (req.getResponseHeader('X-Icinga-Redirect')) {
|
||||
_this.hide($modal);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue