You are here

function _google_tag_variable_info_status in GoogleTagManager 7

Same name and namespace in other branches
  1. 7.2 includes/variable.inc \_google_tag_variable_info_status()

Implements hook_variable_info().

File

includes/variable.inc, line 161
Contains the variable definitions.

Code

function _google_tag_variable_info_status($options) {

  // Gather data.
  $args = array(
    '@path' => 'http://en.wikipedia.org/wiki/List_of_HTTP_status_codes',
  );
  $list_description = t('Enter one response status per line. For more information, refer to the <a href="@path">list of HTTP status codes</a>.', $args, $options);

  // Build variables.
  $variables['google_tag_status_toggle'] = array(
    'type' => 'select',
    'title' => t('Add snippet for specific statuses', array(), $options),
    'options' => array(
      GOOGLE_TAG_EXCLUDE_LISTED => t('All statuses except the listed statuses', array(), $options),
      GOOGLE_TAG_INCLUDE_LISTED => t('Only the listed statuses', array(), $options),
    ),
    'default' => GOOGLE_TAG_EXCLUDE_LISTED,
  );
  $variables['google_tag_status_list'] = array(
    'type' => 'text',
    'title' => t('Listed statuses', array(), $options),
    'description' => $list_description,
    'default' => GOOGLE_TAG_STATUSES,
    'validate callback' => '_google_tag_validate_text',
    'element' => array(
      '#rows' => 5,
    ),
  );
  return $variables;
}