config forms: prepend our custom view decorator when saving the configuration failed

This commit is contained in:
Eric Lippmann 2014-11-04 14:48:24 +01:00
parent a965017d73
commit aac161d7a0
2 changed files with 4 additions and 3 deletions

View File

@ -5,6 +5,7 @@
namespace Icinga\Form; namespace Icinga\Form;
use Exception; use Exception;
use Zend_Form_Decorator_Abstract;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\File\Ini\IniWriter; use Icinga\File\Ini\IniWriter;
@ -58,7 +59,8 @@ class ConfigForm extends Form
'viewScript' => 'showConfiguration.phtml', 'viewScript' => 'showConfiguration.phtml',
'errorMessage' => $e->getMessage(), 'errorMessage' => $e->getMessage(),
'configString' => $writer->render(), 'configString' => $writer->render(),
'filePath' => $this->config->getConfigFile() 'filePath' => $this->config->getConfigFile(),
'placement' => Zend_Form_Decorator_Abstract::PREPEND
)); ));
return false; return false;
} }

View File

@ -1,6 +1,5 @@
<div> <div>
<h4><?= $this->translate('Saving Configuration Failed'); ?></h4> <h4><?= $this->translate('Saving Configuration Failed'); ?></h4>
<br>
<p> <p>
<?= sprintf( <?= sprintf(
$this->translate('The file %s couldn\'t be stored. (Error: "%s")'), $this->translate('The file %s couldn\'t be stored. (Error: "%s")'),
@ -25,4 +24,4 @@
<pre> <pre>
<code><?= $this->escape($configString); ?></code> <code><?= $this->escape($configString); ?></code>
</pre> </pre>
</p> </p>