[icinga-checkins] icinga.org: icingaweb2/master: Make GeneralConfigStep::getSummary() working with all logging types

git at icinga.org git at icinga.org
Fri Nov 4 17:21:05 CET 2016


Module: icingaweb2
Branch: master
Commit: 3189b5b12d8cd7190004dfba6e0179f6ca35de1c
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=3189b5b12d8cd7190004dfba6e0179f6ca35de1c

Author: Alexander A. Klimov <alexander.klimov at icinga.com>
Date:   Fri Nov  4 10:30:36 2016 +0100

Make GeneralConfigStep::getSummary() working with all logging types

refs #11652

---

 .../setup/library/Setup/Steps/GeneralConfigStep.php    |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/modules/setup/library/Setup/Steps/GeneralConfigStep.php b/modules/setup/library/Setup/Steps/GeneralConfigStep.php
index 002bd96..95597f5 100644
--- a/modules/setup/library/Setup/Steps/GeneralConfigStep.php
+++ b/modules/setup/library/Setup/Steps/GeneralConfigStep.php
@@ -70,12 +70,24 @@ class GeneralConfigStep extends Step
             $loggingHtml = '<p>' . mt('setup', 'Logging will be disabled.') . '</p>';
         } else {
             $level = $this->data['generalConfig']['logging_level'];
+            switch ($type) {
+                case 'syslog':
+                    $typeText = t('Syslog', 'app.config.logging.type');
+                    break;
+                case 'php':
+                    $typeText = t('Webserver Log', 'app.config.logging.type');
+                    break;
+                case 'file':
+                    $typeText = t('File', 'app.config.logging.type');
+                    break;
+            }
+
             $loggingHtml = ''
                 . '<table>'
                 . '<tbody>'
                 . '<tr>'
                 . '<td><strong>' . t('Type', 'app.config.logging') . '</strong></td>'
-                . '<td>' . ($type === 'syslog' ? 'Syslog' : t('File', 'app.config.logging.type')) . '</td>'
+                . '<td>' . $typeText . '</td>'
                 . '</tr>'
                 . '<tr>'
                 . '<td><strong>' . t('Level', 'app.config.logging') . '</strong></td>'
@@ -88,7 +100,7 @@ class GeneralConfigStep extends Step
                 )) . '</td>'
                 . '</tr>'
                 . '<tr>'
-                . ($type === 'syslog' ? (
+                . ($type !== 'file' ? (
                     '<td><strong>' . t('Application Prefix') . '</strong></td>'
                     . '<td>' . $this->data['generalConfig']['logging_application'] . '</td>'
                 ) : (



More information about the icinga-checkins mailing list