From bcae38716533e0b8402b04743ea6f8a7bcc91ed6 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Tue, 1 Sep 2015 15:09:17 +0200 Subject: [PATCH] Add general proxy config class form refs #9916 --- .../forms/Config/General/ProxyConfigForm.php | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 application/forms/Config/General/ProxyConfigForm.php diff --git a/application/forms/Config/General/ProxyConfigForm.php b/application/forms/Config/General/ProxyConfigForm.php new file mode 100644 index 000000000..b5b0741d6 --- /dev/null +++ b/application/forms/Config/General/ProxyConfigForm.php @@ -0,0 +1,66 @@ +setName('form_config_general_proxy'); + } + + /** + * @see Form::createElements() + */ + public function createElements(array $formData) + { + $this->addElement( + 'checkbox', + 'global_use_proxy', + array( + 'required' => true, + 'autosubmit' => true, + 'value' => false, + 'label' => $this->translate('Use proxy for Internet connections'), + 'description' => $this->translate( + 'Set whether to use a proxy for all Internet connections if the application is behind a proxy.' + ) + ) + ); + + if (isset($formData['global_use_proxy']) && $formData['global_use_proxy'] === "1") { + $this->addElement( + 'text', + 'proxy_http', + array( + 'required' => true, + 'label' => $this->translate('HTTP(S) Proxy'), + 'description' => $this->translate('The proxy which will be used for poxy connections.') + ) + ); + $this->addElement( + 'checkbox', + 'proxy_http_request_fulluri', + array( + 'required' => true, + 'value' => false, + 'label' => $this->translate('Request Full URI'), + 'description' => $this->translate( + 'When checked, the entire URI will be used when constructing the request.' + ) + ) + ); + } + + return $this; + } +}