From a70015306534336f0aa528232ea98cebcb777031 Mon, 31 Dec 2012 14:03:01 +0100 From: hass Date: Mon, 31 Dec 2012 14:02:31 +0100 Subject: [PATCH] #1874764: Code style and usability fixes diff --git a/httprl.admin.inc b/httprl.admin.inc index 26a29a7..f5b0273 100644 --- a/httprl.admin.inc +++ b/httprl.admin.inc @@ -10,49 +10,58 @@ */ function httprl_admin_settings_form() { $form['httprl_server_addr'] = array( - '#type' => 'textfield', - '#title' => t('IP Address to send all self server requests to'), - '#default_value' => variable_get('httprl_server_addr', FALSE), - '#description' => t('If left blank it will use the same server as the request. If set to -1 it will use the host name instead of an IP address. This controls the output of httprl_build_url_self()'), + '#type' => 'textfield', + '#title' => t('IP Address to send all self server requests to'), + '#default_value' => variable_get('httprl_server_addr', FALSE), + '#description' => t('If left blank it will use the same server as the request. If set to -1 it will use the host name instead of an IP address. This controls the output of httprl_build_url_self()'), ); - $form['timeous'] = array( + $form['timeouts'] = array( '#type' => 'fieldset', - '#title' => t('Default Timeouts'), + '#title' => t('Default timeouts'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#description' => t('Set the default timeouts. These will be overridden if a different timeout is set in the options array.'), ); - $form['timeous']['httprl_dns_timeout'] = array( - '#type' => 'textfield', - '#title' => t('dns_timeout. Maximum number of seconds a DNS lookup request may take'), - '#default_value' => variable_get('httprl_dns_timeout', HTTPRL_DNS_TIMEOUT), - '#description' => t('Value can be a float. The default is %value seconds.', array('%value' => HTTPRL_DNS_TIMEOUT)), + $form['timeouts']['httprl_dns_timeout'] = array( + '#type' => 'textfield', + '#title' => t('DNS timeout (dns_timeout)'), + '#default_value' => variable_get('httprl_dns_timeout', HTTPRL_DNS_TIMEOUT), + '#description' => t('Maximum number of seconds a DNS lookup request may take. Value can be a float. The default is %value seconds.', array('%value' => HTTPRL_DNS_TIMEOUT)), + '#field_suffix' => t('seconds'), + '#size' => 5, ); - $form['timeous']['httprl_connect_timeout'] = array( - '#type' => 'textfield', - '#title' => t('connect_timeout. Maximum number of seconds establishing the TCP connection may take'), - '#default_value' => variable_get('httprl_connect_timeout', HTTPRL_CONNECT_TIMEOUT), - '#description' => t('Value can be a float. The default is %value seconds.', array('%value' => HTTPRL_CONNECT_TIMEOUT)), + $form['timeouts']['httprl_connect_timeout'] = array( + '#type' => 'textfield', + '#title' => t('Connection timeout (connect_timeout)'), + '#default_value' => variable_get('httprl_connect_timeout', HTTPRL_CONNECT_TIMEOUT), + '#description' => t('Maximum number of seconds establishing the TCP connection may take. Value can be a float. The default is %value seconds.', array('%value' => HTTPRL_CONNECT_TIMEOUT)), + '#field_suffix' => t('seconds'), + '#size' => 5, ); - $form['timeous']['httprl_ttfb_timeout'] = array( - '#type' => 'textfield', - '#title' => t('ttfb_timeout. Maximum number of seconds a connection may take to download the first byte'), - '#default_value' => variable_get('httprl_ttfb_timeout', HTTPRL_TTFB_TIMEOUT), - '#description' => t('Value can be a float. The default is %value seconds.', array('%value' => HTTPRL_TTFB_TIMEOUT)), + $form['timeouts']['httprl_ttfb_timeout'] = array( + '#type' => 'textfield', + '#title' => t('Time to first byte (ttfb_timeout)'), + '#default_value' => variable_get('httprl_ttfb_timeout', HTTPRL_TTFB_TIMEOUT), + '#description' => t('Maximum number of seconds a connection may take to download the first byte. Value can be a float. The default is %value seconds.', array('%value' => HTTPRL_TTFB_TIMEOUT)), + '#field_suffix' => t('seconds'), + '#size' => 5, ); - $form['timeous']['httprl_timeout'] = array( - '#type' => 'textfield', - '#title' => t('timeout. Maximum number of seconds the request may take'), - '#default_value' => variable_get('httprl_timeout', HTTPRL_TIMEOUT), - '#description' => t('Value can be a float. The default is %value seconds.', array('%value' => HTTPRL_TIMEOUT)), + $form['timeouts']['httprl_timeout'] = array( + '#type' => 'textfield', + '#title' => t('Timeout (timeout)'), + '#default_value' => variable_get('httprl_timeout', HTTPRL_TIMEOUT), + '#description' => t('Maximum number of seconds the request may take. Value can be a float. The default is %value seconds.', array('%value' => HTTPRL_TIMEOUT)), + '#field_suffix' => t('seconds'), + '#size' => 5, ); - $form['timeous']['httprl_global_timeout'] = array( - '#type' => 'textfield', - '#title' => t('global_timeout. Maximum number of seconds httprl_send_request() may take'), - '#default_value' => variable_get('httprl_global_timeout', HTTPRL_GLOBAL_TIMEOUT), - '#description' => t('Value can be a float. The default is %value seconds.', array('%value' => HTTPRL_GLOBAL_TIMEOUT)), + $form['timeouts']['httprl_global_timeout'] = array( + '#type' => 'textfield', + '#title' => t('Global timeout (global_timeout)'), + '#default_value' => variable_get('httprl_global_timeout', HTTPRL_GLOBAL_TIMEOUT), + '#description' => t('Maximum number of seconds httprl_send_request() may take. Value can be a float. The default is %value seconds.', array('%value' => HTTPRL_GLOBAL_TIMEOUT)), + '#field_suffix' => t('seconds'), + '#size' => 5, ); - return system_settings_form($form); }