ObjectsController: add missing loadForm

fixes #1518
This commit is contained in:
Thomas Gelf 2018-06-12 20:20:25 +02:00
parent 5fe976e059
commit df4c3b925c
1 changed files with 18 additions and 0 deletions

View File

@ -14,6 +14,7 @@ use Icinga\Module\Director\Objects\IcingaObject;
use Icinga\Module\Director\RestApi\IcingaObjectsHandler;
use Icinga\Module\Director\Web\ActionBar\ObjectsActionBar;
use Icinga\Module\Director\Web\ActionBar\TemplateActionBar;
use Icinga\Module\Director\Web\Form\FormLoader;
use Icinga\Module\Director\Web\Table\ApplyRulesTable;
use Icinga\Module\Director\Web\Table\ObjectSetTable;
use Icinga\Module\Director\Web\Table\ObjectsTable;
@ -319,6 +320,23 @@ abstract class ObjectsController extends ActionController
return $objects;
}
/**
* @param string $name
*
* @return \Icinga\Module\Director\Web\Form\QuickForm
* @throws \Icinga\Exception\ProgrammingError
*/
public function loadForm($name)
{
$form = FormLoader::load($name, $this->Module());
if ($this->getRequest()->isApiRequest()) {
// TODO: Ask form for API support?
$form->setApiRequest();
}
return $form;
}
/**
* @param ZfQueryBasedTable $table
* @return ZfQueryBasedTable