diff --git a/application/controllers/ConfigController.php b/application/controllers/ConfigController.php new file mode 100644 index 0000000..5cd0afe --- /dev/null +++ b/application/controllers/ConfigController.php @@ -0,0 +1,16 @@ +view->form = $form = new ConfigForm(); + $form->setIniConfig($this->Config())->handleRequest(); + $this->view->tabs = $this->Module()->getConfigTabs()->activate('backend'); + } +} diff --git a/application/forms/ConfigForm.php b/application/forms/ConfigForm.php new file mode 100644 index 0000000..ac351df --- /dev/null +++ b/application/forms/ConfigForm.php @@ -0,0 +1,28 @@ +setName('form_config_graphite'); + $this->setSubmitLabel($this->translate('Save Changes')); + } + + public function createElements(array $formData) + { + $this->addElement( + 'text', + 'graphite_web_url', + array( + 'required' => true, + 'label' => $this->translate('Graphite Web URL'), + 'description' => $this->translate('URL to your Graphite Web'), + 'validators' => ['UrlValidator'] + ) + ); + } +} diff --git a/application/views/scripts/config/index.phtml b/application/views/scripts/config/index.phtml new file mode 100644 index 0000000..5022ff7 --- /dev/null +++ b/application/views/scripts/config/index.phtml @@ -0,0 +1,7 @@ +
+ +
+ +
+ +
diff --git a/configuration.php b/configuration.php index 51ffda6..52470fd 100644 --- a/configuration.php +++ b/configuration.php @@ -4,3 +4,9 @@ $this->menuSection(N_('Graphite'), ['icon' => 'chart-area'])->setUrl('graphite/show/overview'); +$this->provideConfigTab('backend', array( + 'title' => $this->translate('Configure the Graphite Web backend'), + 'label' => $this->translate('Backend'), + 'url' => 'config' +)); +