You are here

function hubspot_admin_settings in HubSpot 7

Same name and namespace in other branches
  1. 6.2 hubspot.admin.inc \hubspot_admin_settings()
  2. 6 hubspot.admin.inc \hubspot_admin_settings()
  3. 7.3 hubspot.admin.inc \hubspot_admin_settings()
  4. 7.2 hubspot.admin.inc \hubspot_admin_settings()

@file Provides admin settings page to adjust HubSpot API key, debugging settings, and JavaScript embedding.

1 string reference to 'hubspot_admin_settings'
hubspot_menu in ./hubspot.module
Implements hook_menu() to get the config page listed

File

./hubspot.admin.inc, line 8
Provides admin settings page to adjust HubSpot API key, debugging settings, and JavaScript embedding.

Code

function hubspot_admin_settings() {
  $form = array();
  $form['hapi'] = array(
    '#title' => t('HubSpot API Settings'),
    '#type' => 'fieldset',
  );
  $form['hapi']['hubspot_apikey'] = array(
    '#title' => t('HubSpot API Key'),
    '#type' => 'textfield',
    '#default_value' => variable_get('hubspot_apikey', ''),
    '#description' => t('This can be <a href="https://api.hubspot.com/keys/get">requested from HubSpot</a> and is required for the Latest Leads dashboard block to function. Inserting leads does not require an API key.'),
  );
  $form['hapi']['hubspot_log_code'] = array(
    '#title' => t('HubSpot Logging Code'),
    '#type' => 'textarea',
    '#default_value' => variable_get('hubspot_log_code', ''),
    '#description' => t('To enable HubSpot traffic logging on your site, paste the HubSpot JavaScript logging code here.'),
  );
  $form['debug'] = array(
    '#title' => t('HubSpot Debugging Settings'),
    '#type' => 'fieldset',
  );
  $form['debug']['hubspot_debug_on'] = array(
    '#title' => t('Debugging enabled'),
    '#type' => 'checkbox',
    '#default_value' => variable_get('hubspot_debug_on', 0),
    '#description' => t('If debugging is enabled, HubSpot errors will be emailed to the address below. Otherwise, they will be logged to the regular Drupal error log.'),
  );
  $form['debug']['hubspot_debug_email'] = array(
    '#title' => t('Debugging email'),
    '#type' => 'textfield',
    '#default_value' => variable_get('hubspot_debug_email', variable_get('site_mail', '')),
    '#description' => t('Email error reports to this address if debugging is enabled.'),
  );
  return system_settings_form($form);
}