You are here

function akamai_settings in Akamai 7.2

Same name and namespace in other branches
  1. 6.2 akamai.admin.inc \akamai_settings()
  2. 6 akamai.admin.inc \akamai_settings()
  3. 7 akamai.admin.inc \akamai_settings()

General Settings for Akamai

1 string reference to 'akamai_settings'
akamai_menu in ./akamai.module
Implements hook_menu().

File

./akamai.admin.inc, line 12
Akamai is a registered trademark of Akamai Technologies, Inc. Administrative pages for the Akamai module.

Code

function akamai_settings() {
  $form = array();
  $form['disable_fieldset'] = array(
    '#type' => 'fieldset',
    '#title' => 'Disable Akamai Cache Clearing',
    '#description' => 'Set this field to temporarity disable cache clearing during imports, migrations, or other batch processes.',
  );
  $form['disable_fieldset']['akamai_disabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Disable cache clearing'),
    '#default_value' => variable_get('akamai_disabled', FALSE),
  );
  $form['akamai_restapi'] = array(
    '#type' => 'textfield',
    '#title' => t('REST API URL'),
    '#default_value' => variable_get('akamai_restapi', 'https://api.ccu.akamai.com/ccu/v2/queues/default'),
    '#description' => t('The URL of the Akamai REST API call e.g. "https://api.ccu.akamai.com/ccu/v2/queues/default"'),
    '#required' => TRUE,
  );
  $form['akamai_basepath'] = array(
    '#type' => 'textfield',
    '#title' => t('Base Path'),
    '#default_value' => variable_get('akamai_basepath', ''),
    '#description' => t('The URL of the base path (fully qualified domain name) of the site.  This will be used as a prefix for all cache clears (Akamai indexs on the full URI). e.g. "http://www.example.com"'),
    '#required' => TRUE,
  );
  $form['akamai_timeout'] = array(
    '#type' => 'textfield',
    '#title' => t('Timeout Length'),
    '#description' => t("The timeout used by when sending the cache clear request to Akamai's servers. Most users will not need to change this value."),
    '#size' => 5,
    '#maxlength' => 3,
    '#default_value' => variable_get('akamai_timeout', '5'),
    '#required' => TRUE,
  );
  $form['akamai_username'] = array(
    '#type' => 'textfield',
    '#title' => t('Cache clearing user'),
    '#default_value' => variable_get('akamai_username', ''),
    '#description' => t('The user name of the account being used for cache clearing (most likely an email)'),
    '#required' => TRUE,
  );
  if (variable_get('akamai_password', '')) {
    $password_status_text = t('Akamai CCU Password is set.  Use the fields below to change or leave blank to use the existing password.');
  }
  else {
    $password_status_text = t('Your Akamai CCU Password is not set.  Please set it using the fields below.');
  }
  $form['password_fieldset'] = array(
    '#type' => 'fieldset',
    '#title' => 'Akamai CCU Password',
    '#description' => $password_status_text,
  );
  $form['password_fieldset']['akamai_password'] = array(
    '#type' => 'password_confirm',
    '#title' => t('Cache clearing password'),
    '#description' => t('The password of the cache clearing user'),
  );
  $form['akamai_domain'] = array(
    '#type' => 'select',
    '#title' => t('Domain'),
    '#default_value' => variable_get('akamai_domain', 'staging'),
    '#options' => array(
      'staging' => t('Staging'),
      'production' => t('Production'),
    ),
    '#description' => t('The Akamai domain to use for cache clearing'),
    '#required' => TRUE,
  );
  $form['akamai_action'] = array(
    '#type' => 'select',
    '#title' => t('Clearing Action Type Default'),
    '#default_value' => variable_get('akamai_action', 'remove'),
    '#options' => array(
      'remove' => t('Remove'),
      'invalidate' => t('Invalidate'),
    ),
    '#description' => t('The default clearing action.  The options are <em>remove</em> (which removes the item from the Akamai cache) and <em>invalidate</em> (which leaves the item in the cache, but invalidates it so that the origin will be hit on the next request)'),
    '#required' => TRUE,
  );
  return system_settings_form($form);
}