|
1 | 1 | <?php |
| 2 | +namespace Icinga\Editor; |
2 | 3 |
|
3 | 4 | /** |
4 | 5 | * Icinga Editor - generování konfigurace |
|
10 | 11 | */ |
11 | 12 | require_once 'includes/IEInit.php'; |
12 | 13 |
|
13 | | -require_once 'classes/IEImporter.php'; |
14 | 14 |
|
15 | 15 | $oPage->onlyForLogged(); |
16 | 16 |
|
17 | | -$oPage->addItem(new IEPageTop(_('Generování konfigurace'))); |
| 17 | +$oPage->addItem(new UI\PageTop(_('Generování konfigurace'))); |
18 | 18 |
|
19 | 19 |
|
20 | 20 | if ($oUser->getSettingValue('admin')) { |
21 | 21 | $forceUserID = $oPage->getRequestValue('force_user_id', 'int'); |
22 | 22 | if (!is_null($forceUserID)) { |
23 | 23 | $originalUserID = $oUser->getUserID(); |
24 | | - EaseShared::user(new EaseUser($forceUserID)); |
| 24 | + \Ease\Shared::user(new EaseUser($forceUserID)); |
25 | 25 | } |
26 | 26 | } |
27 | 27 |
|
|
50 | 50 | $line_num++; |
51 | 51 |
|
52 | 52 | if (($line === false) && ($line_num == 1)) { |
53 | | - $errorLine = $oPage->container->addItem(new EaseHtmlDivTag(null, '<span class="label label-important">' . _('Chyba:') . '</span>', array('class' => 'alert alert-danger'))); |
| 53 | + $errorLine = $oPage->container->addItem(new \Ease\Html\Div( '<span class="label label-important">' . _('Chyba:') . '</span>', array('class' => 'alert alert-danger'))); |
54 | 54 | $oUser->addStatusMessage(_('Kontrola konfigurace nevrátila výsledek.'), 'error'); |
55 | 55 | $errorLine->addItem(_('Zkontroluj prosím zdlali nechybí potřebný fragment v /etc/sudoers:')); |
56 | | - $errorLine->addItem(new EaseHtmlDivTag(null, 'User_Alias APACHE = www-data')); |
57 | | - $errorLine->addItem(new EaseHtmlDivTag(null, 'Cmnd_Alias ICINGA = /usr/sbin/icinga, /etc/init.d/icinga')); |
58 | | - $errorLine->addItem(new EaseHtmlDivTag(null, 'APACHE ALL = (ALL) NOPASSWD: ICINGA')); |
| 56 | + $errorLine->addItem(new \Ease\Html\Div( 'User_Alias APACHE = www-data')); |
| 57 | + $errorLine->addItem(new \Ease\Html\Div( 'Cmnd_Alias ICINGA = /usr/sbin/icinga, /etc/init.d/icinga')); |
| 58 | + $errorLine->addItem(new \Ease\Html\Div( 'APACHE ALL = (ALL) NOPASSWD: ICINGA')); |
59 | 59 | break; |
60 | 60 | } |
61 | 61 |
|
62 | 62 | if (strstr($line, 'Error:')) { |
63 | 63 | $line = str_replace('Error:', '', $line); |
64 | | - $errorLine = $oPage->container->addItem(new EaseHtmlDivTag(null, '<span class="label label-important">' . _('Chyba:') . '</span>', array('class' => 'alert alert-danger'))); |
| 64 | + $errorLine = $oPage->container->addItem(new \Ease\Html\Div( '<span class="label label-important">' . _('Chyba:') . '</span>', array('class' => 'alert alert-danger'))); |
65 | 65 |
|
66 | 66 | $keywords = preg_split("/['(.*)']+/", $line); |
67 | 67 | switch (trim($keywords[0])) { |
68 | 68 | case 'Service notification period': |
69 | 69 | $errorLine->addItem(' <a href="timeperiods.php">' . _('Notifikační perioda') . '</a> služeb '); |
70 | | - $errorLine->addItem(new EaseHtmlATag('timeperiod.php?timeperiod_name=' . $keywords[1], $keywords[1])); |
| 70 | + $errorLine->addItem(new \Ease\Html\ATag('timeperiod.php?timeperiod_name=' . $keywords[1], $keywords[1])); |
71 | 71 | break; |
72 | 72 | case 'Host notification period': |
73 | 73 | $errorLine->addItem(' <a href="timeperiods.php">' . _('Notifikační perioda') . '</a> hostů'); |
74 | | - $errorLine->addItem(new EaseHtmlATag('timeperiod.php?timeperiod_name=' . $keywords[1], $keywords[1])); |
| 74 | + $errorLine->addItem(new \Ease\Html\ATag('timeperiod.php?timeperiod_name=' . $keywords[1], $keywords[1])); |
75 | 75 | break; |
76 | 76 |
|
77 | 77 | default: |
|
84 | 84 | case 'specified for contact': |
85 | 85 | $errorLine->addItem(' specifikovaná pro kontakt '); |
86 | 86 | $contact = new IEContact($keywords[3]); |
87 | | - $errorLine->addItem(new EaseHtmlATag('contact.php?contact_id=' . $contact->getMyKey(), $keywords[3])); |
| 87 | + $errorLine->addItem(new \Ease\Html\ATag('contact.php?contact_id=' . $contact->getMyKey(), $keywords[3])); |
88 | 88 | break; |
89 | 89 |
|
90 | 90 | default: |
|
105 | 105 |
|
106 | 106 | $line = str_replace('Warning:', '<span class="label label-error">' . _('Chyba v konfiguračním souboru') . '</span>', $line); |
107 | 107 |
|
108 | | - $oPage->container->addItem(new EaseHtmlDivTag(null, $line, array('class' => 'alert alert-danger'))); |
| 108 | + $oPage->container->addItem(new \Ease\Html\Div( $line, array('class' => 'alert alert-danger'))); |
109 | 109 | $errorCount++; |
110 | 110 | } |
111 | 111 |
|
|
123 | 123 | } |
124 | 124 |
|
125 | 125 | //Duplicate definition found for command 'check_ping' (config file '/etc/icinga/generated/command_check_ping_vitex.cfg', starting on line 1) |
126 | | - $oPage->container->addItem(new EaseHtmlDivTag(null, $line, array('class' => 'alert alert-warning'))); |
| 126 | + $oPage->container->addItem(new \Ease\Html\Div( $line, array('class' => 'alert alert-warning'))); |
127 | 127 | } |
128 | 128 |
|
129 | 129 | if (strstr($line, 'Total Warnings')) { |
|
148 | 148 | if (!intval($errorCount) && !is_null($WarningCount)) { |
149 | 149 | if (IECfg::reloadIcinga()) { |
150 | 150 | $oPage->container->addItem(_('Všechny vaše konfigurační soubory byly přegenerovány')); |
151 | | - $oPage->container->addItem(new EaseTWBLinkButton('main.php', _('Hotovo') . ' ' . EaseTWBPart::GlyphIcon('ok-sign'), 'success')); |
152 | | - EaseShared::user()->setSettingValue('unsaved', false); |
| 151 | + $oPage->container->addItem(new \Ease\TWB\LinkButton('main.php', _('Hotovo') . ' ' . \Ease\TWB\Part::GlyphIcon('ok-sign'), 'success')); |
| 152 | + \Ease\Shared::user()->setSettingValue('unsaved', false); |
153 | 153 | } |
154 | 154 | } |
155 | 155 | } |
156 | 156 |
|
157 | 157 | if ($oUser->getSettingValue('admin') && isset($originalUserID)) { |
158 | | - EaseShared::user(new EaseUser($originalUserID)); |
159 | | - EaseShared::user()->loginSuccess(); |
| 158 | + \Ease\Shared::user(new EaseUser($originalUserID)); |
| 159 | + \Ease\Shared::user()->loginSuccess(); |
160 | 160 | } |
161 | 161 |
|
162 | | -$oPage->addItem(new IEPageBottom()); |
| 162 | +$oPage->addItem(new UI\PageBottom()); |
163 | 163 |
|
164 | 164 | $oPage->draw(); |
0 commit comments