You are here

function colorized_gmap_settings_form in Colorized google maps block 7

Colorized gmap module settings page.

1 string reference to 'colorized_gmap_settings_form'
colorized_gmap_menu in ./colorized_gmap.module
Implements hook_menu().

File

./colorized_gmap.admin.inc, line 36
Administrative page for colorized gmap module.

Code

function colorized_gmap_settings_form($form, &$form_state) {
  $form['colorized_gmap_auth_method'] = array(
    '#type' => 'select',
    '#title' => t('Google API Authentication Method'),
    '#description' => t('Google API Authentication Method'),
    '#default_value' => variable_get('colorized_gmap_auth_method', 1),
    '#options' => array(
      1 => t('API Key'),
      2 => t('Google Maps API for Work'),
    ),
  );
  $form['colorized_gmap_api_key'] = array(
    '#type' => 'textfield',
    '#title' => t('Google Maps API Key'),
    '#description' => t('Obtain a Google Maps Javascript API key at <a href="@link">@link</a>', array(
      '@link' => 'https://developers.google.com/maps/documentation/javascript/get-api-key',
    )),
    '#default_value' => variable_get('colorized_gmap_api_key', ''),
    '#required' => FALSE,
    '#states' => array(
      'visible' => array(
        ':input[name="colorized_gmap_auth_method"]' => array(
          'value' => 1,
        ),
      ),
    ),
  );
  $form['colorized_gmap_client_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Google Maps API for Work: Client ID'),
    '#description' => t('For more information, visit: <a href="@link">@link</a>', array(
      '@link' => 'https://developers.google.com/maps/documentation/javascript/get-api-key#client-id',
    )),
    '#default_value' => variable_get('colorized_gmap_client_id', ''),
    '#required' => FALSE,
    '#states' => array(
      'visible' => array(
        ':input[name="colorized_gmap_auth_method"]' => array(
          'value' => 2,
        ),
      ),
    ),
  );
  $form['colorized_gmap_private_key'] = array(
    '#type' => 'textfield',
    '#title' => t('Google Maps API for Work: Private/Signing Key'),
    '#description' => t('For more information, visit: <a href="@link">@link</a>', array(
      '@link' => 'https://developers.google.com/maps/documentation/business/webservices/auth#how_do_i_get_my_signing_key',
    )),
    '#default_value' => variable_get('colorized_gmap_private_key', ''),
    '#required' => FALSE,
    '#states' => array(
      'visible' => array(
        ':input[name="colorized_gmap_auth_method"]' => array(
          'value' => 2,
        ),
      ),
    ),
  );
  return system_settings_form($form);
}