setName('form_config_general_application'); } /** * @see Form::createElements() */ public function createElements(array $formData) { $this->addElement( 'text', 'global_module_path', array( 'label' => $this->translate('Module Path'), 'required' => true, 'value' => implode(':', Icinga::app()->getModuleManager()->getModuleDirs()), 'description' => $this->translate( 'Contains the directories that will be searched for available modules, separated by ' . 'colons. Modules that don\'t exist in these directories can still be symlinked in ' . 'the module folder, but won\'t show up in the list of disabled modules.' ) ) ); $this->addElement( 'select', 'preferences_store', array( 'required' => true, 'autosubmit' => true, 'label' => $this->translate('User Preference Storage Type'), 'multiOptions' => array( 'ini' => $this->translate('File System (INI Files)'), 'db' => $this->translate('Database'), 'null' => $this->translate('Don\'t Store Preferences') ) ) ); if (isset($formData['preferences_store']) && $formData['preferences_store'] === 'db') { $backends = array(); foreach (ResourceFactory::getResourceConfigs()->toArray() as $name => $resource) { if ($resource['type'] === 'db') { $backends[$name] = $name; } } $this->addElement( 'select', 'preferences_resource', array( 'required' => true, 'multiOptions' => $backends, 'label' => $this->translate('Database Connection') ) ); } return $this; } }