mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-20 12:24:30 +02:00
QuickBaseForm: allow for multiple module-related...
...prefix paths
This commit is contained in:
parent
66e5158ccc
commit
27634fe722
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Icinga\Module\Director\Web\Form;
|
namespace Icinga\Module\Director\Web\Form;
|
||||||
|
|
||||||
|
use Icinga\Application\Icinga;
|
||||||
use Icinga\Application\Modules\Module;
|
use Icinga\Application\Modules\Module;
|
||||||
use Zend_Form;
|
use Zend_Form;
|
||||||
|
|
||||||
@ -29,11 +30,28 @@ abstract class QuickBaseForm extends Zend_Form
|
|||||||
|
|
||||||
protected function initializePrefixPaths()
|
protected function initializePrefixPaths()
|
||||||
{
|
{
|
||||||
if ($this->icingaModule) {
|
$this->addPrefixPathsForDirector();
|
||||||
|
if ($this->icingaModule && $this->icingaModuleName !== 'director') {
|
||||||
|
$this->addPrefixPathsForModule($this->icingaModule);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function addPrefixPathsForDirector()
|
||||||
|
{
|
||||||
|
$module = Icinga::app()
|
||||||
|
->getModuleManager()
|
||||||
|
->loadModule('director')
|
||||||
|
->getModule('director');
|
||||||
|
|
||||||
|
$this->addPrefixPathsForModule($module);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addPrefixPathsForModule(Module $module)
|
||||||
|
{
|
||||||
$basedir = sprintf(
|
$basedir = sprintf(
|
||||||
'%s/%s/Web/Form',
|
'%s/%s/Web/Form',
|
||||||
$this->icingaModule->getLibDir(),
|
$module->getLibDir(),
|
||||||
ucfirst($this->icingaModuleName)
|
ucfirst($module->getName())
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->addPrefixPaths(array(
|
$this->addPrefixPaths(array(
|
||||||
@ -43,7 +61,8 @@ abstract class QuickBaseForm extends Zend_Form
|
|||||||
'type' => static::ELEMENT
|
'type' => static::ELEMENT
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
}
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addHidden($name, $value = null)
|
public function addHidden($name, $value = null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user