Rename ConfigForm::setConfig() to ConfigForm::setIniConfig()

We do not want to override Zend_Form::setConfig() so this renaming is
required. set*Ini*Config() because ConfigForm::save() utilizes an ini-writer
to persist the configuration to disk.

refs #5525
This commit is contained in:
Johannes Meyer 2014-09-08 13:31:25 +02:00
parent 12b4865559
commit f53519c54d
4 changed files with 17 additions and 17 deletions

View File

@ -46,7 +46,7 @@ class ConfigController extends ActionController
public function indexAction()
{
$form = new GeneralConfigForm();
$form->setConfig(IcingaConfig::app());
$form->setIniConfig(IcingaConfig::app());
$form->handleRequest();
$this->view->form = $form;
@ -131,7 +131,7 @@ class ConfigController extends ActionController
public function authenticationAction()
{
$form = new AuthenticationBackendReorderForm();
$form->setConfig(IcingaConfig::app('authentication'));
$form->setIniConfig(IcingaConfig::app('authentication'));
$form->handleRequest();
$this->view->form = $form;
@ -145,7 +145,7 @@ class ConfigController extends ActionController
public function createauthenticationbackendAction()
{
$form = new AuthenticationBackendConfigForm();
$form->setConfig(IcingaConfig::app('authentication'));
$form->setIniConfig(IcingaConfig::app('authentication'));
$form->setResourceConfig(ResourceFactory::getResourceConfigs());
$form->setRedirectUrl('config/authentication');
$form->handleRequest();
@ -161,7 +161,7 @@ class ConfigController extends ActionController
public function editauthenticationbackendAction()
{
$form = new AuthenticationBackendConfigForm();
$form->setConfig(IcingaConfig::app('authentication'));
$form->setIniConfig(IcingaConfig::app('authentication'));
$form->setResourceConfig(ResourceFactory::getResourceConfigs());
$form->setRedirectUrl('config/authentication');
$form->handleRequest();
@ -179,7 +179,7 @@ class ConfigController extends ActionController
$form = new ConfirmRemovalForm(array(
'onSuccess' => function ($request) {
$configForm = new AuthenticationBackendConfigForm();
$configForm->setConfig(IcingaConfig::app('authentication'));
$configForm->setIniConfig(IcingaConfig::app('authentication'));
$authBackend = $request->getQuery('auth_backend');
try {
@ -222,7 +222,7 @@ class ConfigController extends ActionController
public function createresourceAction()
{
$form = new ResourceConfigForm();
$form->setConfig(IcingaConfig::app('resources'));
$form->setIniConfig(IcingaConfig::app('resources'));
$form->setRedirectUrl('config/resource');
$form->handleRequest();
@ -236,7 +236,7 @@ class ConfigController extends ActionController
public function editresourceAction()
{
$form = new ResourceConfigForm();
$form->setConfig(IcingaConfig::app('resources'));
$form->setIniConfig(IcingaConfig::app('resources'));
$form->setRedirectUrl('config/resource');
$form->handleRequest();
@ -252,7 +252,7 @@ class ConfigController extends ActionController
$form = new ConfirmRemovalForm(array(
'onSuccess' => function ($request) {
$configForm = new ResourceConfigForm();
$configForm->setConfig(IcingaConfig::app('resources'));
$configForm->setIniConfig(IcingaConfig::app('resources'));
$resource = $request->getQuery('resource');
try {

View File

@ -62,7 +62,7 @@ class AuthenticationBackendReorderForm extends ConfigForm
protected function getConfigForm()
{
$form = new AuthenticationBackendConfigForm();
$form->setConfig($this->config);
$form->setIniConfig($this->config);
return $form;
}
}

View File

@ -28,7 +28,7 @@ class ConfigForm extends Form
*
* @return self
*/
public function setConfig(Config $config)
public function setIniConfig(Config $config)
{
$this->config = $config;
return $this;

View File

@ -31,7 +31,7 @@ class Monitoring_ConfigController extends ModuleActionController
public function editbackendAction()
{
$form = new BackendConfigForm();
$form->setConfig($this->Config('backends'));
$form->setIniConfig($this->Config('backends'));
$form->setResourceConfig(ResourceFactory::getResourceConfigs());
$form->setRedirectUrl('monitoring/config');
$form->handleRequest();
@ -45,7 +45,7 @@ class Monitoring_ConfigController extends ModuleActionController
public function createbackendAction()
{
$form = new BackendConfigForm();
$form->setConfig($this->Config('backends'));
$form->setIniConfig($this->Config('backends'));
$form->setResourceConfig(ResourceFactory::getResourceConfigs());
$form->setRedirectUrl('monitoring/config');
$form->handleRequest();
@ -63,7 +63,7 @@ class Monitoring_ConfigController extends ModuleActionController
'onSuccess' => function ($request) use ($config) {
$backendName = $request->getQuery('backend');
$configForm = new BackendConfigForm();
$configForm->setConfig($config);
$configForm->setIniConfig($config);
try {
$configForm->remove($backendName);
@ -95,7 +95,7 @@ class Monitoring_ConfigController extends ModuleActionController
'onSuccess' => function ($request) use ($config) {
$instanceName = $request->getQuery('instance');
$configForm = new InstanceConfigForm();
$configForm->setConfig($config);
$configForm->setIniConfig($config);
try {
$configForm->remove($instanceName);
@ -123,7 +123,7 @@ class Monitoring_ConfigController extends ModuleActionController
public function editinstanceAction()
{
$form = new InstanceConfigForm();
$form->setConfig($this->Config('instances'));
$form->setIniConfig($this->Config('instances'));
$form->setRedirectUrl('monitoring/config');
$form->handleRequest();
@ -136,7 +136,7 @@ class Monitoring_ConfigController extends ModuleActionController
public function createinstanceAction()
{
$form = new InstanceConfigForm();
$form->setConfig($this->Config('instances'));
$form->setIniConfig($this->Config('instances'));
$form->setRedirectUrl('monitoring/config');
$form->handleRequest();
@ -149,7 +149,7 @@ class Monitoring_ConfigController extends ModuleActionController
public function securityAction()
{
$form = new SecurityConfigForm();
$form->setConfig($this->Config());
$form->setIniConfig($this->Config());
$form->handleRequest();
$this->view->form = $form;