function _google_tag_variable_info_path in GoogleTagManager 7
Same name and namespace in other branches
- 7.2 includes/variable.inc \_google_tag_variable_info_path()
Implements hook_variable_info().
File
- includes/
variable.inc, line 78 - Contains the variable definitions.
Code
function _google_tag_variable_info_path($options) {
// Gather data.
$args = array(
'%blog' => 'blog',
'%blog-wildcard' => 'blog/*',
'%front' => '<front>',
);
$list_description = t('Enter one relative path per line using the "*" character as a wildcard. Example paths are: "%blog" for the blog page, "%blog-wildcard" for each individual blog, and "%front" for the front page.', $args, $options);
// Build variables.
$variables['google_tag_path_toggle'] = array(
'type' => 'select',
'title' => t('Add snippet on specific paths', array(), $options),
'options' => array(
GOOGLE_TAG_EXCLUDE_LISTED => t('All paths except the listed paths', array(), $options),
GOOGLE_TAG_INCLUDE_LISTED => t('Only the listed paths', array(), $options),
),
'default' => GOOGLE_TAG_EXCLUDE_LISTED,
);
$variables['google_tag_path_list'] = array(
'type' => 'text',
'title' => t('Listed paths', array(), $options),
'description' => $list_description,
'default' => GOOGLE_TAG_PATHS,
'validate callback' => '_google_tag_validate_text',
'element' => array(
'#rows' => 10,
),
);
return $variables;
}