diff options
author | Alexander Shubin <aleksandrs.subins@zabbix.com> | 2020-07-14 17:55:24 +0300 |
---|---|---|
committer | Alexander Shubin <aleksandrs.subins@zabbix.com> | 2020-07-14 17:55:33 +0300 |
commit | 2676c3fd547c6edf47b5edc15fffaff7c35d0c21 (patch) | |
tree | b8d4dea3d4e7e2dd561089a4a4a965082b79291d /ui/app/controllers | |
parent | 65270afbe022cbdd38733bfbcce40f62dff7c77d (diff) |
..F....... [ZBXNEXT-5965] fixed messages helper
Diffstat (limited to 'ui/app/controllers')
50 files changed, 134 insertions, 134 deletions
diff --git a/ui/app/controllers/CControllerAuthenticationUpdate.php b/ui/app/controllers/CControllerAuthenticationUpdate.php index 58da4065bec..38b24555381 100644 --- a/ui/app/controllers/CControllerAuthenticationUpdate.php +++ b/ui/app/controllers/CControllerAuthenticationUpdate.php @@ -100,7 +100,7 @@ class CControllerAuthenticationUpdate extends CController { || $data['ldap_configured'] == ZBX_AUTH_LDAP_ENABLED); if (!$is_valid) { - CMessages::addError(_s('Incorrect value for field "%1$s": %2$s.', 'authentication_type', + CMessageHelper::setErrorTitle(_s('Incorrect value for field "%1$s": %2$s.', 'authentication_type', _('LDAP is not configured') )); } @@ -131,14 +131,14 @@ class CControllerAuthenticationUpdate extends CController { foreach ($ldap_fields as $field) { if (trim($config[$field]) === '') { - CMessages::addError(_s('Incorrect value for field "%1$s": %2$s.', $field, _('cannot be empty'))); + CMessageHelper::setErrorTitle(_s('Incorrect value for field "%1$s": %2$s.', $field, _('cannot be empty'))); $is_valid = false; break; } } if ($is_valid && ($config['ldap_port'] < ZBX_MIN_PORT_NUMBER || $config['ldap_port'] > ZBX_MAX_PORT_NUMBER)) { - CMessages::addError(_s( + CMessageHelper::setErrorTitle(_s( 'Incorrect value "%1$s" for "%2$s" field: must be between %3$s and %4$s.', $this->getInput('ldap_port'), 'ldap_port', ZBX_MIN_PORT_NUMBER, ZBX_MAX_PORT_NUMBER )); @@ -146,7 +146,7 @@ class CControllerAuthenticationUpdate extends CController { } if ($ldap_status['result'] != CFrontendSetup::CHECK_OK) { - CMessages::addError($ldap_status['error']); + CMessageHelper::setErrorTitle($ldap_status['error']); $is_valid = false; } elseif ($is_valid) { @@ -167,7 +167,7 @@ class CControllerAuthenticationUpdate extends CController { ]); if (!$login) { - CMessages::addError($ldap_validator->getError()); + CMessageHelper::setErrorTitle($ldap_validator->getError()); $is_valid = false; } } @@ -187,7 +187,7 @@ class CControllerAuthenticationUpdate extends CController { foreach ($saml_fields as $field) { if (trim($config[$field]) === '') { - CMessages::addError(_s('Incorrect value for field "%1$s": %2$s.', $field, _('cannot be empty'))); + CMessageHelper::setErrorTitle(_s('Incorrect value for field "%1$s": %2$s.', $field, _('cannot be empty'))); return false; } @@ -222,7 +222,7 @@ class CControllerAuthenticationUpdate extends CController { // Only ZBX_AUTH_LDAP have 'Test' option. if ($this->hasInput('ldap_test')) { - CMessages::addSuccess(_('LDAP login successful')); + CMessageHelper::setSuccessTitle(_('LDAP login successful')); $this->response->setFormData($this->getInputAll()); $this->setResponse($this->response); return; @@ -297,12 +297,12 @@ class CControllerAuthenticationUpdate extends CController { $this->invalidateSessions(); } - CMessages::addSuccess(_('Authentication settings updated')); + CMessageHelper::setSuccessTitle(_('Authentication settings updated')); add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_ZABBIX_CONFIG, _('Authentication method changed')); } else { $this->response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update authentication')); + CMessageHelper::setErrorTitle(_('Cannot update authentication')); } } diff --git a/ui/app/controllers/CControllerAutoregUpdate.php b/ui/app/controllers/CControllerAutoregUpdate.php index 5017cc0d945..26dcfd5360b 100644 --- a/ui/app/controllers/CControllerAutoregUpdate.php +++ b/ui/app/controllers/CControllerAutoregUpdate.php @@ -38,7 +38,7 @@ class CControllerAutoregUpdate extends CController { ->getUrl() ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update configuration')); + CMessageHelper::setErrorTitle(_('Cannot update configuration')); $this->setResponse($response); break; case self::VALIDATION_FATAL_ERROR: @@ -66,11 +66,11 @@ class CControllerAutoregUpdate extends CController { ); if ($result) { - CMessages::addSuccess(_('Configuration updated')); + CMessageHelper::setSuccessTitle(_('Configuration updated')); } else { $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update configuration')); + CMessageHelper::setErrorTitle(_('Cannot update configuration')); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerDashboardDelete.php b/ui/app/controllers/CControllerDashboardDelete.php index ed735f6f0a5..814ca314cd9 100644 --- a/ui/app/controllers/CControllerDashboardDelete.php +++ b/ui/app/controllers/CControllerDashboardDelete.php @@ -56,10 +56,10 @@ class CControllerDashboardDelete extends CController { if ($result) { $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_n('Dashboard deleted', 'Dashboards deleted', $deleted)); + CMessageHelper::setSuccessTitle(_n('Dashboard deleted', 'Dashboards deleted', $deleted)); } else { - CMessages::addError(_n('Cannot delete dashboard', 'Cannot delete dashboards', $deleted)); + CMessageHelper::setErrorTitle(_n('Cannot delete dashboard', 'Cannot delete dashboards', $deleted)); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerExportXml.php b/ui/app/controllers/CControllerExportXml.php index 090b19efe73..4c216c455f8 100644 --- a/ui/app/controllers/CControllerExportXml.php +++ b/ui/app/controllers/CControllerExportXml.php @@ -106,7 +106,7 @@ class CControllerExportXml extends CController { $response = new CControllerResponseRedirect( $this->getInput('backurl', 'zabbix.php?action=dashboard.view')); - CMessages::addError(_('No permissions to referred object or it does not exist!')); + CMessageHelper::setErrorTitle(_('No permissions to referred object or it does not exist!')); } else { $response = new CControllerResponseData([ diff --git a/ui/app/controllers/CControllerGuiUpdate.php b/ui/app/controllers/CControllerGuiUpdate.php index 5f7f32b55c9..6660c6791a3 100644 --- a/ui/app/controllers/CControllerGuiUpdate.php +++ b/ui/app/controllers/CControllerGuiUpdate.php @@ -40,7 +40,7 @@ class CControllerGuiUpdate extends CController { ->getUrl() ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update configuration')); + CMessageHelper::setErrorTitle(_('Cannot update configuration')); $this->setResponse($response); break; @@ -73,11 +73,11 @@ class CControllerGuiUpdate extends CController { ); if ($result) { - CMessages::addSuccess(_('Configuration updated')); + CMessageHelper::setSuccessTitle(_('Configuration updated')); } else { $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update configuration')); + CMessageHelper::setErrorTitle(_('Cannot update configuration')); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerHousekeepingUpdate.php b/ui/app/controllers/CControllerHousekeepingUpdate.php index ff88188c7ec..c0feb3d18bb 100644 --- a/ui/app/controllers/CControllerHousekeepingUpdate.php +++ b/ui/app/controllers/CControllerHousekeepingUpdate.php @@ -54,7 +54,7 @@ class CControllerHousekeepingUpdate extends CController { ->getUrl() ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update configuration')); + CMessageHelper::setErrorTitle(_('Cannot update configuration')); $this->setResponse($response); break; case self::VALIDATION_FATAL_ERROR: @@ -119,11 +119,11 @@ class CControllerHousekeepingUpdate extends CController { ); if ($result) { - CMessages::addSuccess(_('Configuration updated')); + CMessageHelper::setSuccessTitle(_('Configuration updated')); } else { $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update configuration')); + CMessageHelper::setErrorTitle(_('Cannot update configuration')); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerIconMapCreate.php b/ui/app/controllers/CControllerIconMapCreate.php index 516d01fabec..c1edba2e0b5 100644 --- a/ui/app/controllers/CControllerIconMapCreate.php +++ b/ui/app/controllers/CControllerIconMapCreate.php @@ -46,14 +46,14 @@ class CControllerIconMapCreate extends CController { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'iconmap.list') ); - CMessages::addSuccess(_('Icon map created')); + CMessageHelper::setSuccessTitle(_('Icon map created')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'iconmap.edit') ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot create icon map')); + CMessageHelper::setErrorTitle(_('Cannot create icon map')); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerIconMapDelete.php b/ui/app/controllers/CControllerIconMapDelete.php index e9202cd81c2..e8f3c587b78 100644 --- a/ui/app/controllers/CControllerIconMapDelete.php +++ b/ui/app/controllers/CControllerIconMapDelete.php @@ -58,14 +58,14 @@ class CControllerIconMapDelete extends CController { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'iconmap.list') ); - CMessages::addSuccess(_('Icon map deleted')); + CMessageHelper::setSuccessTitle(_('Icon map deleted')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'iconmap.edit') ->setArgument('iconmapid', $this->getInput('iconmapid')) ); - CMessages::addError(_('Cannot delete icon map')); + CMessageHelper::setErrorTitle(_('Cannot delete icon map')); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerIconMapUpdate.php b/ui/app/controllers/CControllerIconMapUpdate.php index d780092fa02..4226f5af238 100644 --- a/ui/app/controllers/CControllerIconMapUpdate.php +++ b/ui/app/controllers/CControllerIconMapUpdate.php @@ -62,7 +62,7 @@ class CControllerIconMapUpdate extends CController { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'iconmap.list') ); - CMessages::addSuccess(_('Icon map updated')); + CMessageHelper::setSuccessTitle(_('Icon map updated')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) @@ -74,7 +74,7 @@ class CControllerIconMapUpdate extends CController { $form_data['iconmap']['mappings'] = []; } $response->setFormData($form_data); - CMessages::addError(_('Cannot update icon map')); + CMessageHelper::setErrorTitle(_('Cannot update icon map')); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerImageCreate.php b/ui/app/controllers/CControllerImageCreate.php index 9b15a9f4e62..a4126af5592 100644 --- a/ui/app/controllers/CControllerImageCreate.php +++ b/ui/app/controllers/CControllerImageCreate.php @@ -38,7 +38,7 @@ class CControllerImageCreate extends CController { $response = new CControllerResponseRedirect($url); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot add image')); + CMessageHelper::setErrorTitle(_('Cannot add image')); $this->setResponse($response); break; @@ -104,7 +104,7 @@ class CControllerImageCreate extends CController { $response = new CControllerResponseRedirect($url); error($error); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot add image')); + CMessageHelper::setErrorTitle(_('Cannot add image')); return $this->setResponse($response); } @@ -122,7 +122,7 @@ class CControllerImageCreate extends CController { ->setArgument('action', 'image.list') ->setArgument('imagetype', $this->getInput('imagetype')) ); - CMessages::addSuccess(_('Image added')); + CMessageHelper::setSuccessTitle(_('Image added')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) @@ -130,7 +130,7 @@ class CControllerImageCreate extends CController { ->setArgument('imagetype', $this->getInput('imagetype')) ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot add image')); + CMessageHelper::setErrorTitle(_('Cannot add image')); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerImageDelete.php b/ui/app/controllers/CControllerImageDelete.php index 93dfc023356..0d7cc4a2428 100644 --- a/ui/app/controllers/CControllerImageDelete.php +++ b/ui/app/controllers/CControllerImageDelete.php @@ -64,14 +64,14 @@ class CControllerImageDelete extends CController { ->setArgument('action', 'image.list') ->setArgument('imagetype', $this->getInput('imagetype')) ); - CMessages::addSuccess(_('Image deleted')); + CMessageHelper::setSuccessTitle(_('Image deleted')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'image.edit') ->setArgument('imageid', $this->getInput('imageid')) ); - CMessages::addError(_('Cannot delete image')); + CMessageHelper::setErrorTitle(_('Cannot delete image')); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerImageUpdate.php b/ui/app/controllers/CControllerImageUpdate.php index 59b60719cb4..5dd59dc3a64 100644 --- a/ui/app/controllers/CControllerImageUpdate.php +++ b/ui/app/controllers/CControllerImageUpdate.php @@ -40,7 +40,7 @@ class CControllerImageUpdate extends CController { $response = new CControllerResponseRedirect($url); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update image')); + CMessageHelper::setErrorTitle(_('Cannot update image')); $this->setResponse($response); break; @@ -107,7 +107,7 @@ class CControllerImageUpdate extends CController { ); error($error); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update image')); + CMessageHelper::setErrorTitle(_('Cannot update image')); return $this->setResponse($response); } @@ -134,7 +134,7 @@ class CControllerImageUpdate extends CController { ->setArgument('action', 'image.list') ->setArgument('imagetype', $this->getInput('imagetype')) ); - CMessages::addSuccess(_('Image updated')); + CMessageHelper::setSuccessTitle(_('Image updated')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) @@ -143,7 +143,7 @@ class CControllerImageUpdate extends CController { ->setArgument('imageid', $this->getInput('imageid')) ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update image')); + CMessageHelper::setErrorTitle(_('Cannot update image')); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerMacrosUpdate.php b/ui/app/controllers/CControllerMacrosUpdate.php index c3f6a28bf13..32b473a7107 100644 --- a/ui/app/controllers/CControllerMacrosUpdate.php +++ b/ui/app/controllers/CControllerMacrosUpdate.php @@ -107,10 +107,10 @@ class CControllerMacrosUpdate extends CController { $response = new CControllerResponseRedirect((new CUrl('zabbix.php'))->setArgument('action', 'macros.edit')); if ($result) { - CMessages::addSuccess(_('Macros updated')); + CMessageHelper::setSuccessTitle(_('Macros updated')); } else { - CMessages::addError(_('Cannot update macros')); + CMessageHelper::setErrorTitle(_('Cannot update macros')); $form_data = $this->getInputAll(); $form_data['macros'] = array_values($form_data['macros']); $response->setFormData($form_data); diff --git a/ui/app/controllers/CControllerMediatypeCreate.php b/ui/app/controllers/CControllerMediatypeCreate.php index 9d4c8cd9e9f..f97527be55a 100644 --- a/ui/app/controllers/CControllerMediatypeCreate.php +++ b/ui/app/controllers/CControllerMediatypeCreate.php @@ -73,7 +73,7 @@ class CControllerMediatypeCreate extends CController { case self::VALIDATION_ERROR: $response = new CControllerResponseRedirect('zabbix.php?action=mediatype.edit'); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot add media type')); + CMessageHelper::setErrorTitle(_('Cannot add media type')); $this->setResponse($response); break; @@ -155,14 +155,14 @@ class CControllerMediatypeCreate extends CController { ->setArgument('page', CPagerHelper::loadPage('mediatype.list', null)) ); $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_('Media type added')); + CMessageHelper::setSuccessTitle(_('Media type added')); } else { $response = new CControllerResponseRedirect( (new CUrl('zabbix.php'))->setArgument('action', 'mediatype.edit') ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot add media type')); + CMessageHelper::setErrorTitle(_('Cannot add media type')); } $this->setResponse($response); } diff --git a/ui/app/controllers/CControllerMediatypeDelete.php b/ui/app/controllers/CControllerMediatypeDelete.php index f6dc8e6fc1a..d6bf54e3a85 100644 --- a/ui/app/controllers/CControllerMediatypeDelete.php +++ b/ui/app/controllers/CControllerMediatypeDelete.php @@ -63,10 +63,10 @@ class CControllerMediatypeDelete extends CController { if ($result) { $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_n('Media type deleted', 'Media types deleted', $deleted)); + CMessageHelper::setSuccessTitle(_n('Media type deleted', 'Media types deleted', $deleted)); } else { - CMessages::addError(_n('Cannot delete media type', 'Cannot delete media types', $deleted)); + CMessageHelper::setErrorTitle(_n('Cannot delete media type', 'Cannot delete media types', $deleted)); } $this->setResponse($response); } diff --git a/ui/app/controllers/CControllerMediatypeDisable.php b/ui/app/controllers/CControllerMediatypeDisable.php index 41ee77277de..fe9410970e3 100644 --- a/ui/app/controllers/CControllerMediatypeDisable.php +++ b/ui/app/controllers/CControllerMediatypeDisable.php @@ -69,10 +69,10 @@ class CControllerMediatypeDisable extends CController { if ($result) { $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_n('Media type disabled', 'Media types disabled', $updated)); + CMessageHelper::setSuccessTitle(_n('Media type disabled', 'Media types disabled', $updated)); } else { - CMessages::addError(_n('Cannot disable media type', 'Cannot disable media types', $updated)); + CMessageHelper::setErrorTitle(_n('Cannot disable media type', 'Cannot disable media types', $updated)); } $this->setResponse($response); } diff --git a/ui/app/controllers/CControllerMediatypeEnable.php b/ui/app/controllers/CControllerMediatypeEnable.php index 23f482d662e..2ee3849de89 100644 --- a/ui/app/controllers/CControllerMediatypeEnable.php +++ b/ui/app/controllers/CControllerMediatypeEnable.php @@ -69,10 +69,10 @@ class CControllerMediatypeEnable extends CController { if ($result) { $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_n('Media type enabled', 'Media types enabled', $updated)); + CMessageHelper::setSuccessTitle(_n('Media type enabled', 'Media types enabled', $updated)); } else { - CMessages::addError(_n('Cannot enable media type', 'Cannot enable media types', $updated)); + CMessageHelper::setErrorTitle(_n('Cannot enable media type', 'Cannot enable media types', $updated)); } $this->setResponse($response); } diff --git a/ui/app/controllers/CControllerMediatypeUpdate.php b/ui/app/controllers/CControllerMediatypeUpdate.php index 21854d16885..373a1525ea7 100644 --- a/ui/app/controllers/CControllerMediatypeUpdate.php +++ b/ui/app/controllers/CControllerMediatypeUpdate.php @@ -74,7 +74,7 @@ class CControllerMediatypeUpdate extends CController { case self::VALIDATION_ERROR: $response = new CControllerResponseRedirect('zabbix.php?action=mediatype.edit'); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update media type')); + CMessageHelper::setErrorTitle(_('Cannot update media type')); $this->setResponse($response); break; @@ -170,14 +170,14 @@ class CControllerMediatypeUpdate extends CController { ->setArgument('page', CPagerHelper::loadPage('mediatype.list', null)) ); $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_('Media type updated')); + CMessageHelper::setSuccessTitle(_('Media type updated')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'mediatype.edit') ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update media type')); + CMessageHelper::setErrorTitle(_('Cannot update media type')); } $this->setResponse($response); } diff --git a/ui/app/controllers/CControllerMiscConfigUpdate.php b/ui/app/controllers/CControllerMiscConfigUpdate.php index 491e9f91931..8cff9ceef4a 100644 --- a/ui/app/controllers/CControllerMiscConfigUpdate.php +++ b/ui/app/controllers/CControllerMiscConfigUpdate.php @@ -40,7 +40,7 @@ class CControllerMiscConfigUpdate extends CController { ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update configuration')); + CMessageHelper::setErrorTitle(_('Cannot update configuration')); $this->setResponse($response); break; @@ -74,10 +74,10 @@ class CControllerMiscConfigUpdate extends CController { $result = DBend($result); if ($result) { - CMessages::addSuccess(_('Configuration updated')); + CMessageHelper::setSuccessTitle(_('Configuration updated')); } else { - CMessages::addError(_('Cannot update configuration')); + CMessageHelper::setErrorTitle(_('Cannot update configuration')); $response->setFormData($this->getInputAll()); } diff --git a/ui/app/controllers/CControllerModuleEdit.php b/ui/app/controllers/CControllerModuleEdit.php index 10ba8cfe9ba..bd71844419a 100644 --- a/ui/app/controllers/CControllerModuleEdit.php +++ b/ui/app/controllers/CControllerModuleEdit.php @@ -103,7 +103,7 @@ class CControllerModuleEdit extends CController { ->setArgument('action', 'module.list') ->setArgument('page', CPagerHelper::loadPage('module.list', null)) ); - CMessages::addError(_s('Cannot load module at: %1$s.', $this->module['relative_path'])); + CMessageHelper::setErrorTitle(_s('Cannot load module at: %1$s.', $this->module['relative_path'])); $this->setResponse($response); } } diff --git a/ui/app/controllers/CControllerModuleScan.php b/ui/app/controllers/CControllerModuleScan.php index 49555be5103..2dc8c3374df 100644 --- a/ui/app/controllers/CControllerModuleScan.php +++ b/ui/app/controllers/CControllerModuleScan.php @@ -37,7 +37,7 @@ class CControllerModuleScan extends CController { } protected function doAction() { - clear_messages(); + get_and_clear_messages(); $db_modules_create = []; $db_modules_create_names = []; @@ -132,10 +132,10 @@ class CControllerModuleScan extends CController { : _('No new modules discovered'); if (hasErrorMesssages()) { - CMessages::addError($message); + CMessageHelper::setErrorTitle($message); } else { - CMessages::addSuccess($message); + CMessageHelper::setSuccessTitle($message); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerModuleUpdate.php b/ui/app/controllers/CControllerModuleUpdate.php index 21e848f48d1..fbbfc9019d1 100644 --- a/ui/app/controllers/CControllerModuleUpdate.php +++ b/ui/app/controllers/CControllerModuleUpdate.php @@ -139,30 +139,30 @@ class CControllerModuleUpdate extends CController { if ($result) { if ($this->getAction() === 'module.update') { - CMessages::addSuccess(_s('Module updated: %1$s.', $db_modules_update_names[0])); + CMessageHelper::setSuccessTitle(_s('Module updated: %1$s.', $db_modules_update_names[0])); } elseif ($set_status == MODULE_STATUS_ENABLED) { - CMessages::addSuccess(_n('Module enabled: %1$s.', 'Modules enabled: %1$s.', + CMessageHelper::setSuccessTitle(_n('Module enabled: %1$s.', 'Modules enabled: %1$s.', implode(', ', $db_modules_update_names), count($this->modules) )); } else { - CMessages::addSuccess(_n('Module disabled: %1$s.', 'Modules disabled: %1$s.', + CMessageHelper::setSuccessTitle(_n('Module disabled: %1$s.', 'Modules disabled: %1$s.', implode(', ', $db_modules_update_names), count($this->modules) )); } } else { if ($this->getAction() === 'module.update') { - CMessages::addError(_s('Cannot update module: %1$s.', $db_modules_update_names[0])); + CMessageHelper::setErrorTitle(_s('Cannot update module: %1$s.', $db_modules_update_names[0])); } elseif ($set_status == MODULE_STATUS_ENABLED) { - CMessages::addError(_n('Cannot enable module: %1$s.', 'Cannot enable modules: %1$s.', + CMessageHelper::setErrorTitle(_n('Cannot enable module: %1$s.', 'Cannot enable modules: %1$s.', implode(', ', $db_modules_update_names), count($this->modules) )); } else { - CMessages::addError(_n('Cannot disable module: %1$s.', 'Cannot disable modules: %1$s.', + CMessageHelper::setErrorTitle(_n('Cannot disable module: %1$s.', 'Cannot disable modules: %1$s.', implode(', ', $db_modules_update_names), count($this->modules) )); } diff --git a/ui/app/controllers/CControllerProxyCreate.php b/ui/app/controllers/CControllerProxyCreate.php index 8aa11f6513d..d1d6277a2fd 100644 --- a/ui/app/controllers/CControllerProxyCreate.php +++ b/ui/app/controllers/CControllerProxyCreate.php @@ -53,7 +53,7 @@ class CControllerProxyCreate extends CController { case self::VALIDATION_ERROR: $response = new CControllerResponseRedirect('zabbix.php?action=proxy.edit'); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot add proxy')); + CMessageHelper::setErrorTitle(_('Cannot add proxy')); $this->setResponse($response); break; case self::VALIDATION_FATAL_ERROR: @@ -102,14 +102,14 @@ class CControllerProxyCreate extends CController { ->setArgument('page', CPagerHelper::loadPage('proxy.list', null)) ); $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_('Proxy added')); + CMessageHelper::setSuccessTitle(_('Proxy added')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'proxy.edit') ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot add proxy')); + CMessageHelper::setErrorTitle(_('Cannot add proxy')); } $this->setResponse($response); } diff --git a/ui/app/controllers/CControllerProxyDelete.php b/ui/app/controllers/CControllerProxyDelete.php index 9829caf49c2..778d44e8bf1 100644 --- a/ui/app/controllers/CControllerProxyDelete.php +++ b/ui/app/controllers/CControllerProxyDelete.php @@ -63,10 +63,10 @@ class CControllerProxyDelete extends CController { if ($result) { $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_n('Proxy deleted', 'Proxies deleted', $deleted)); + CMessageHelper::setSuccessTitle(_n('Proxy deleted', 'Proxies deleted', $deleted)); } else { - CMessages::addError(_n('Cannot delete proxy', 'Cannot delete proxies', $deleted)); + CMessageHelper::setErrorTitle(_n('Cannot delete proxy', 'Cannot delete proxies', $deleted)); } $this->setResponse($response); } diff --git a/ui/app/controllers/CControllerProxyHostDisable.php b/ui/app/controllers/CControllerProxyHostDisable.php index bc69cecbc6f..902ffb78727 100644 --- a/ui/app/controllers/CControllerProxyHostDisable.php +++ b/ui/app/controllers/CControllerProxyHostDisable.php @@ -74,10 +74,10 @@ class CControllerProxyHostDisable extends CController { if ($result) { $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_n('Host disabled', 'Hosts disabled', $updated)); + CMessageHelper::setSuccessTitle(_n('Host disabled', 'Hosts disabled', $updated)); } else { - CMessages::addError(_n('Cannot disable host', 'Cannot disable hosts', $updated)); + CMessageHelper::setErrorTitle(_n('Cannot disable host', 'Cannot disable hosts', $updated)); } $this->setResponse($response); } diff --git a/ui/app/controllers/CControllerProxyHostEnable.php b/ui/app/controllers/CControllerProxyHostEnable.php index fb1f72ca8f4..fd5abf781e2 100644 --- a/ui/app/controllers/CControllerProxyHostEnable.php +++ b/ui/app/controllers/CControllerProxyHostEnable.php @@ -74,10 +74,10 @@ class CControllerProxyHostEnable extends CController { if ($result) { $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_n('Host enabled', 'Hosts enabled', $updated)); + CMessageHelper::setSuccessTitle(_n('Host enabled', 'Hosts enabled', $updated)); } else { - CMessages::addError(_n('Cannot enable host', 'Cannot enable hosts', $updated)); + CMessageHelper::setErrorTitle(_n('Cannot enable host', 'Cannot enable hosts', $updated)); } $this->setResponse($response); } diff --git a/ui/app/controllers/CControllerProxyUpdate.php b/ui/app/controllers/CControllerProxyUpdate.php index 3a2ca56e675..6bf16d0622b 100644 --- a/ui/app/controllers/CControllerProxyUpdate.php +++ b/ui/app/controllers/CControllerProxyUpdate.php @@ -55,7 +55,7 @@ class CControllerProxyUpdate extends CController { case self::VALIDATION_ERROR: $response = new CControllerResponseRedirect('zabbix.php?action=proxy.edit'); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update proxy')); + CMessageHelper::setErrorTitle(_('Cannot update proxy')); $this->setResponse($response); break; case self::VALIDATION_FATAL_ERROR: @@ -112,7 +112,7 @@ class CControllerProxyUpdate extends CController { ->setArgument('page', CPagerHelper::loadPage('proxy.list', null)) ); $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_('Proxy updated')); + CMessageHelper::setSuccessTitle(_('Proxy updated')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) @@ -120,7 +120,7 @@ class CControllerProxyUpdate extends CController { ->setArgument('proxyid', $this->getInput('proxyid')) ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update proxy')); + CMessageHelper::setErrorTitle(_('Cannot update proxy')); } $this->setResponse($response); } diff --git a/ui/app/controllers/CControllerRegExCreate.php b/ui/app/controllers/CControllerRegExCreate.php index 58abfeb52fe..5873932181a 100644 --- a/ui/app/controllers/CControllerRegExCreate.php +++ b/ui/app/controllers/CControllerRegExCreate.php @@ -40,7 +40,7 @@ class CControllerRegExCreate extends CController { $response = new CControllerResponseRedirect($url); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot add regular expression')); + CMessageHelper::setErrorTitle(_('Cannot add regular expression')); $this->setResponse($response); break; @@ -82,12 +82,12 @@ class CControllerRegExCreate extends CController { if ($result) { $response = new CControllerResponseRedirect((new CUrl('zabbix.php'))->setArgument('action', 'regex.list')); - CMessages::addSuccess(_('Regular expression added')); + CMessageHelper::setSuccessTitle(_('Regular expression added')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php'))->setArgument('action', 'regex.edit')); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot add regular expression')); + CMessageHelper::setErrorTitle(_('Cannot add regular expression')); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerRegExDelete.php b/ui/app/controllers/CControllerRegExDelete.php index b1feb70bed5..3afb6f762f0 100644 --- a/ui/app/controllers/CControllerRegExDelete.php +++ b/ui/app/controllers/CControllerRegExDelete.php @@ -75,12 +75,12 @@ class CControllerRegExDelete extends CController { $response = new CControllerResponseRedirect((new CUrl('zabbix.php'))->setArgument('action', 'regex.list')); if ($result) { $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_n('Regular expression deleted', 'Regular expressions deleted', + CMessageHelper::setSuccessTitle(_n('Regular expression deleted', 'Regular expressions deleted', count($this->db_regexes) )); } else { - CMessages::addError(_n('Cannot delete regular expression', 'Cannot delete regular expressions', + CMessageHelper::setErrorTitle(_n('Cannot delete regular expression', 'Cannot delete regular expressions', count($this->db_regexes) )); } diff --git a/ui/app/controllers/CControllerRegExUpdate.php b/ui/app/controllers/CControllerRegExUpdate.php index 6378626bc04..d70ec60784e 100644 --- a/ui/app/controllers/CControllerRegExUpdate.php +++ b/ui/app/controllers/CControllerRegExUpdate.php @@ -42,7 +42,7 @@ class CControllerRegExUpdate extends CController { ->setArgument('regexid', $this->getInput('regexid')) ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update regular expression')); + CMessageHelper::setErrorTitle(_('Cannot update regular expression')); $this->setResponse($response); break; @@ -91,14 +91,14 @@ class CControllerRegExUpdate extends CController { if ($result) { $response = new CControllerResponseRedirect((new CUrl('zabbix.php'))->setArgument('action', 'regex.list')); - CMessages::addSuccess(_('Regular expression updated')); + CMessageHelper::setSuccessTitle(_('Regular expression updated')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'regex.edit') ->setArgument('regexid', $this->getInput('regexid'))); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update regular expression')); + CMessageHelper::setErrorTitle(_('Cannot update regular expression')); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerScriptCreate.php b/ui/app/controllers/CControllerScriptCreate.php index f4cf06e2515..569d8930a0d 100644 --- a/ui/app/controllers/CControllerScriptCreate.php +++ b/ui/app/controllers/CControllerScriptCreate.php @@ -44,7 +44,7 @@ class CControllerScriptCreate extends CController { case self::VALIDATION_ERROR: $response = new CControllerResponseRedirect('zabbix.php?action=script.edit'); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot add script')); + CMessageHelper::setErrorTitle(_('Cannot add script')); $this->setResponse($response); break; case self::VALIDATION_FATAL_ERROR: @@ -87,14 +87,14 @@ class CControllerScriptCreate extends CController { ->setArgument('page', CPagerHelper::loadPage('script.list', null)) ); $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_('Script added')); + CMessageHelper::setSuccessTitle(_('Script added')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'script.edit') ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot add script')); + CMessageHelper::setErrorTitle(_('Cannot add script')); } $this->setResponse($response); } diff --git a/ui/app/controllers/CControllerScriptDelete.php b/ui/app/controllers/CControllerScriptDelete.php index 26e6e4435da..1aba4911497 100644 --- a/ui/app/controllers/CControllerScriptDelete.php +++ b/ui/app/controllers/CControllerScriptDelete.php @@ -63,10 +63,10 @@ class CControllerScriptDelete extends CController { if ($result) { $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_n('Script deleted', 'Scripts deleted', $deleted)); + CMessageHelper::setSuccessTitle(_n('Script deleted', 'Scripts deleted', $deleted)); } else { - CMessages::addError(_n('Cannot delete script', 'Cannot delete scripts', $deleted)); + CMessageHelper::setErrorTitle(_n('Cannot delete script', 'Cannot delete scripts', $deleted)); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerScriptUpdate.php b/ui/app/controllers/CControllerScriptUpdate.php index 6209634f594..7a77b470620 100644 --- a/ui/app/controllers/CControllerScriptUpdate.php +++ b/ui/app/controllers/CControllerScriptUpdate.php @@ -45,7 +45,7 @@ class CControllerScriptUpdate extends CController { case self::VALIDATION_ERROR: $response = new CControllerResponseRedirect('zabbix.php?action=script.edit'); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update script')); + CMessageHelper::setErrorTitle(_('Cannot update script')); $this->setResponse($response); break; case self::VALIDATION_FATAL_ERROR: @@ -97,7 +97,7 @@ class CControllerScriptUpdate extends CController { ->setArgument('page', CPagerHelper::loadPage('script.list', null)) ); $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_('Script updated')); + CMessageHelper::setSuccessTitle(_('Script updated')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) @@ -105,7 +105,7 @@ class CControllerScriptUpdate extends CController { ->setArgument('scriptid', $this->getInput('scriptid')) ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update script')); + CMessageHelper::setErrorTitle(_('Cannot update script')); } $this->setResponse($response); } diff --git a/ui/app/controllers/CControllerSystemWarning.php b/ui/app/controllers/CControllerSystemWarning.php index f19d88d827e..e62531715b8 100644 --- a/ui/app/controllers/CControllerSystemWarning.php +++ b/ui/app/controllers/CControllerSystemWarning.php @@ -39,7 +39,7 @@ class CControllerSystemWarning extends CController { 'messages' => [] ]; - $data['messages'] = CMessages::get(); + $data['messages'] = CMessageHelper::getMessages(); $this->setResponse(new CControllerResponseData($data)); } diff --git a/ui/app/controllers/CControllerTimeSelectorUpdate.php b/ui/app/controllers/CControllerTimeSelectorUpdate.php index 6872a38e0cc..80c5e579395 100644 --- a/ui/app/controllers/CControllerTimeSelectorUpdate.php +++ b/ui/app/controllers/CControllerTimeSelectorUpdate.php @@ -61,7 +61,7 @@ class CControllerTimeSelectorUpdate extends CController { * throw a JS alert() with current message in timeSelectorEventHandler() in gtlc.js. */ - $messages = CMessages::get(); + $messages = CMessageHelper::getMessages(); $this->setResponse(new CControllerResponseData([ 'main_block' => json_encode(['error' => $messages[0]['message']]) diff --git a/ui/app/controllers/CControllerTrigDisplayUpdate.php b/ui/app/controllers/CControllerTrigDisplayUpdate.php index b391f6ff665..40821ecad76 100644 --- a/ui/app/controllers/CControllerTrigDisplayUpdate.php +++ b/ui/app/controllers/CControllerTrigDisplayUpdate.php @@ -44,7 +44,7 @@ class CControllerTrigDisplayUpdate extends CController { ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update configuration')); + CMessageHelper::setErrorTitle(_('Cannot update configuration')); $this->setResponse($response); } @@ -83,10 +83,10 @@ class CControllerTrigDisplayUpdate extends CController { $result = DBend($result); if ($result) { - CMessages::addSuccess(_('Configuration updated')); + CMessageHelper::setSuccessTitle(_('Configuration updated')); } else { - CMessages::addError(_('Cannot update configuration')); + CMessageHelper::setErrorTitle(_('Cannot update configuration')); $response->setFormData($this->getInputAll()); } diff --git a/ui/app/controllers/CControllerTrigSeverityUpdate.php b/ui/app/controllers/CControllerTrigSeverityUpdate.php index a554a31b108..8f2b8bd9bd5 100644 --- a/ui/app/controllers/CControllerTrigSeverityUpdate.php +++ b/ui/app/controllers/CControllerTrigSeverityUpdate.php @@ -43,7 +43,7 @@ class CControllerTrigSeverityUpdate extends CController { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'trigseverity.edit') ); - CMessages::addError(_('Cannot update configuration')); + CMessageHelper::setErrorTitle(_('Cannot update configuration')); $response->setFormData($this->getInputAll()); $this->setResponse($response); } @@ -76,11 +76,11 @@ class CControllerTrigSeverityUpdate extends CController { ]); if ($result) { - CMessages::addSuccess(_('Configuration updated')); + CMessageHelper::setSuccessTitle(_('Configuration updated')); } else { $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update configuration')); + CMessageHelper::setErrorTitle(_('Cannot update configuration')); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerUserCreate.php b/ui/app/controllers/CControllerUserCreate.php index a622ab81eb7..c6b7dc7788f 100644 --- a/ui/app/controllers/CControllerUserCreate.php +++ b/ui/app/controllers/CControllerUserCreate.php @@ -58,7 +58,7 @@ class CControllerUserCreate extends CControllerUserUpdateGeneral { case self::VALIDATION_ERROR: $response = new CControllerResponseRedirect('zabbix.php?action=user.edit'); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot add user')); + CMessageHelper::setErrorTitle(_('Cannot add user')); $this->setResponse($response); break; @@ -107,14 +107,14 @@ class CControllerUserCreate extends CControllerUserUpdateGeneral { ->setArgument('page', CPagerHelper::loadPage('user.list', null)) ); $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_('User added')); + CMessageHelper::setSuccessTitle(_('User added')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'user.edit') ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot add user')); + CMessageHelper::setErrorTitle(_('Cannot add user')); } $this->setResponse($response); } diff --git a/ui/app/controllers/CControllerUserDelete.php b/ui/app/controllers/CControllerUserDelete.php index f231f4db14f..d49629ed30b 100644 --- a/ui/app/controllers/CControllerUserDelete.php +++ b/ui/app/controllers/CControllerUserDelete.php @@ -53,10 +53,10 @@ class CControllerUserDelete extends CController { if ($result) { $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_n('User deleted', 'Users deleted', $deleted)); + CMessageHelper::setSuccessTitle(_n('User deleted', 'Users deleted', $deleted)); } else { - CMessages::addError(_n('Cannot delete user', 'Cannot delete users', $deleted)); + CMessageHelper::setErrorTitle(_n('Cannot delete user', 'Cannot delete users', $deleted)); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerUserProfileUpdate.php b/ui/app/controllers/CControllerUserProfileUpdate.php index 54089cb3243..d08aed44981 100644 --- a/ui/app/controllers/CControllerUserProfileUpdate.php +++ b/ui/app/controllers/CControllerUserProfileUpdate.php @@ -58,7 +58,7 @@ class CControllerUserProfileUpdate extends CControllerUserUpdateGeneral { case self::VALIDATION_ERROR: $response = new CControllerResponseRedirect('zabbix.php?action=userprofile.edit'); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update user')); + CMessageHelper::setErrorTitle(_('Cannot update user')); $this->setResponse($response); break; @@ -111,12 +111,12 @@ class CControllerUserProfileUpdate extends CControllerUserUpdateGeneral { if ($result) { $response = new CControllerResponseRedirect(ZBX_DEFAULT_URL); - CMessages::addSuccess(_('User updated')); + CMessageHelper::setSuccessTitle(_('User updated')); } else { $response = new CControllerResponseRedirect('zabbix.php?action=userprofile.edit'); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update user')); + CMessageHelper::setErrorTitle(_('Cannot update user')); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerUserUnblock.php b/ui/app/controllers/CControllerUserUnblock.php index df966a335b2..fca35fada51 100644 --- a/ui/app/controllers/CControllerUserUnblock.php +++ b/ui/app/controllers/CControllerUserUnblock.php @@ -72,10 +72,10 @@ class CControllerUserUnblock extends CController { if ($result) { $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_n('User unblocked', 'Users unblocked', $unblocked)); + CMessageHelper::setSuccessTitle(_n('User unblocked', 'Users unblocked', $unblocked)); } else { - CMessages::addError(_n('Cannot unblock user', 'Cannot unblock users', $unblocked)); + CMessageHelper::setErrorTitle(_n('Cannot unblock user', 'Cannot unblock users', $unblocked)); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerUserUpdate.php b/ui/app/controllers/CControllerUserUpdate.php index d81edd982bf..e722ee679ce 100644 --- a/ui/app/controllers/CControllerUserUpdate.php +++ b/ui/app/controllers/CControllerUserUpdate.php @@ -62,7 +62,7 @@ class CControllerUserUpdate extends CControllerUserUpdateGeneral { case self::VALIDATION_ERROR: $response = new CControllerResponseRedirect('zabbix.php?action=user.edit'); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update user')); + CMessageHelper::setErrorTitle(_('Cannot update user')); $this->setResponse($response); break; @@ -119,14 +119,14 @@ class CControllerUserUpdate extends CControllerUserUpdateGeneral { ->setArgument('page', CPagerHelper::loadPage('user.list', null)) ); $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_('User updated')); + CMessageHelper::setSuccessTitle(_('User updated')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'user.edit') ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update user')); + CMessageHelper::setErrorTitle(_('Cannot update user')); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerUsergroupCreate.php b/ui/app/controllers/CControllerUsergroupCreate.php index 548676c8592..e6a6aa90368 100644 --- a/ui/app/controllers/CControllerUsergroupCreate.php +++ b/ui/app/controllers/CControllerUsergroupCreate.php @@ -48,7 +48,7 @@ class CControllerUsergroupCreate extends CController { ->getUrl() ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot add user group')); + CMessageHelper::setErrorTitle(_('Cannot add user group')); $this->setResponse($response); break; @@ -91,13 +91,13 @@ class CControllerUsergroupCreate extends CController { ->setArgument('page', CPagerHelper::loadPage('usergroup.list', null)) ); $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_('User group added')); + CMessageHelper::setSuccessTitle(_('User group added')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'usergroup.edit') ); - CMessages::addError(_('Cannot add user group')); + CMessageHelper::setErrorTitle(_('Cannot add user group')); $response->setFormData($this->getInputAll()); } diff --git a/ui/app/controllers/CControllerUsergroupDelete.php b/ui/app/controllers/CControllerUsergroupDelete.php index 1ca27764f8e..8a735728a79 100644 --- a/ui/app/controllers/CControllerUsergroupDelete.php +++ b/ui/app/controllers/CControllerUsergroupDelete.php @@ -53,10 +53,10 @@ class CControllerUsergroupDelete extends CController { if ($result) { $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_n('User group deleted', 'User groups deleted', $deleted)); + CMessageHelper::setSuccessTitle(_n('User group deleted', 'User groups deleted', $deleted)); } else { - CMessages::addError(_n('Cannot delete user group', 'Cannot delete user groups', $deleted)); + CMessageHelper::setErrorTitle(_n('Cannot delete user group', 'Cannot delete user groups', $deleted)); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerUsergroupMassUpdate.php b/ui/app/controllers/CControllerUsergroupMassUpdate.php index 4ef45148424..baba30cb3d9 100644 --- a/ui/app/controllers/CControllerUsergroupMassUpdate.php +++ b/ui/app/controllers/CControllerUsergroupMassUpdate.php @@ -63,10 +63,10 @@ class CControllerUsergroupMassUpdate extends CController { if ($result) { $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_n('User group updated', 'User groups updated', $updated)); + CMessageHelper::setSuccessTitle(_n('User group updated', 'User groups updated', $updated)); } else { - CMessages::addError(_n('Cannot update user group', 'Cannot update user groups', $updated)); + CMessageHelper::setErrorTitle(_n('Cannot update user group', 'Cannot update user groups', $updated)); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerUsergroupUpdate.php b/ui/app/controllers/CControllerUsergroupUpdate.php index 50cd8fc861c..882f2f9e855 100644 --- a/ui/app/controllers/CControllerUsergroupUpdate.php +++ b/ui/app/controllers/CControllerUsergroupUpdate.php @@ -50,7 +50,7 @@ class CControllerUsergroupUpdate extends CController { ->getUrl() ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update user group')); + CMessageHelper::setErrorTitle(_('Cannot update user group')); $this->setResponse($response); break; @@ -95,14 +95,14 @@ class CControllerUsergroupUpdate extends CController { ->setArgument('page', CPagerHelper::loadPage('usergroup.list', null)) ); $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_('User group updated')); + CMessageHelper::setSuccessTitle(_('User group updated')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'usergroup.edit') ->setArgument('usrgrpid', $this->getInput('usrgrpid')) ); - CMessages::addError(_('Cannot update user group')); + CMessageHelper::setErrorTitle(_('Cannot update user group')); $response->setFormData($this->getInputAll()); } diff --git a/ui/app/controllers/CControllerValuemapCreate.php b/ui/app/controllers/CControllerValuemapCreate.php index 828d3a78783..5da16653341 100644 --- a/ui/app/controllers/CControllerValuemapCreate.php +++ b/ui/app/controllers/CControllerValuemapCreate.php @@ -38,7 +38,7 @@ class CControllerValuemapCreate extends CController { $response = new CControllerResponseRedirect($url); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot add value map')); + CMessageHelper::setErrorTitle(_('Cannot add value map')); $this->setResponse($response); break; @@ -68,13 +68,13 @@ class CControllerValuemapCreate extends CController { ->setArgument('page', CPagerHelper::loadPage('valuemap.list', null)) ); $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_('Value map added')); + CMessageHelper::setSuccessTitle(_('Value map added')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'valuemap.edit') ); - CMessages::addError(_('Cannot add value map')); + CMessageHelper::setErrorTitle(_('Cannot add value map')); $response->setFormData($this->getInputAll()); } diff --git a/ui/app/controllers/CControllerValuemapDelete.php b/ui/app/controllers/CControllerValuemapDelete.php index 99884b2b8f3..8c4925c1ebc 100644 --- a/ui/app/controllers/CControllerValuemapDelete.php +++ b/ui/app/controllers/CControllerValuemapDelete.php @@ -64,10 +64,10 @@ class CControllerValuemapDelete extends CController { if ($result) { $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_n('Value map deleted', 'Value maps deleted', count($valuemapids))); + CMessageHelper::setSuccessTitle(_n('Value map deleted', 'Value maps deleted', count($valuemapids))); } else { - CMessages::addError(_n('Cannot delete value map', 'Cannot delete value maps', count($valuemapids))); + CMessageHelper::setErrorTitle(_n('Cannot delete value map', 'Cannot delete value maps', count($valuemapids))); } $this->setResponse($response); diff --git a/ui/app/controllers/CControllerValuemapUpdate.php b/ui/app/controllers/CControllerValuemapUpdate.php index 9c82819cb8c..00edd0e722e 100644 --- a/ui/app/controllers/CControllerValuemapUpdate.php +++ b/ui/app/controllers/CControllerValuemapUpdate.php @@ -41,7 +41,7 @@ class CControllerValuemapUpdate extends CController { $response = new CControllerResponseRedirect($url); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update value map')); + CMessageHelper::setErrorTitle(_('Cannot update value map')); $this->setResponse($response); break; @@ -92,14 +92,14 @@ class CControllerValuemapUpdate extends CController { ->setArgument('page', CPagerHelper::loadPage('valuemap.list', null)) ); $response->setFormData(['uncheck' => '1']); - CMessages::addSuccess(_('Value map updated')); + CMessageHelper::setSuccessTitle(_('Value map updated')); } else { $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'valuemap.edit') ->setArgument('valuemapid', $this->getInput('valuemapid')) ); - CMessages::addError(_('Cannot update value map')); + CMessageHelper::setErrorTitle(_('Cannot update value map')); $response->setFormData($this->getInputAll()); } diff --git a/ui/app/controllers/CControllerWorkingTimeUpdate.php b/ui/app/controllers/CControllerWorkingTimeUpdate.php index c0e9a3dfc6e..4e0b67cbc91 100644 --- a/ui/app/controllers/CControllerWorkingTimeUpdate.php +++ b/ui/app/controllers/CControllerWorkingTimeUpdate.php @@ -34,7 +34,7 @@ class CControllerWorkingTimeUpdate extends CController { ->getUrl() ); $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update configuration')); + CMessageHelper::setErrorTitle(_('Cannot update configuration')); $this->setResponse($response); } @@ -55,11 +55,11 @@ class CControllerWorkingTimeUpdate extends CController { $result = DBend($result); if ($result) { - CMessages::addSuccess(_('Configuration updated')); + CMessageHelper::setSuccessTitle(_('Configuration updated')); } else { $response->setFormData($this->getInputAll()); - CMessages::addError(_('Cannot update configuration')); + CMessageHelper::setErrorTitle(_('Cannot update configuration')); } $this->setResponse($response); |