Commit da1d7353 authored by hass's avatar hass
Browse files

Replace \r\n with \n

parent 58433841
......@@ -570,40 +570,40 @@ function _googleanalytics_contains_forbidden_token($token_string) {
// User tokens are not prefixed with colon to catch 'current-user' and 'user'.
//
// TODO: If someone have better ideas, share them, please!
$token_blacklist = array(
':author]',
':author:edit-url]',
':author:url]',
':author:path]',
':current-user]',
':current-user:original]',
':fid]',
':mail]',
':name]',
':uid]',
':one-time-login-url]',
':owner]',
':owner:cancel-url]',
':owner:edit-url]',
':owner:url]',
':owner:path]',
'user:cancel-url]',
'user:edit-url]',
'user:url]',
'user:path]',
'user:picture]',
// addressfield_tokens.module
':first-name]',
':last-name]',
':name-line]',
':mc-address]',
':thoroughfare]',
':premise]',
// realname.module
':name-raw]',
// token.module
':ip-address]',
);
$token_blacklist = array(
':author]',
':author:edit-url]',
':author:url]',
':author:path]',
':current-user]',
':current-user:original]',
':fid]',
':mail]',
':name]',
':uid]',
':one-time-login-url]',
':owner]',
':owner:cancel-url]',
':owner:edit-url]',
':owner:url]',
':owner:path]',
'user:cancel-url]',
'user:edit-url]',
'user:url]',
'user:path]',
'user:picture]',
// addressfield_tokens.module
':first-name]',
':last-name]',
':name-line]',
':mc-address]',
':thoroughfare]',
':premise]',
// realname.module
':name-raw]',
// token.module
':ip-address]',
);
return preg_match('/' . implode('|', array_map('preg_quote', $token_blacklist)) . '/i', $token_string);
}
......@@ -286,19 +286,19 @@ function googleanalytics_page_alter(&$page) {
}
}
/**
* Implements hook_field_extra_fields().
*/
function googleanalytics_field_extra_fields() {
$extra['user']['user']['form']['googleanalytics'] = array(
'label' => t('Google Analytics configuration'),
'description' => t('Google Analytics module form element.'),
'weight' => 3,
);
return $extra;
}
/**
* Implements hook_field_extra_fields().
*/
function googleanalytics_field_extra_fields() {
$extra['user']['user']['form']['googleanalytics'] = array(
'label' => t('Google Analytics configuration'),
'description' => t('Google Analytics module form element.'),
'weight' => 3,
);
return $extra;
}
/**
* Implements hook_form_FORM_ID_alter().
*
......
......@@ -9,39 +9,39 @@
* Implements hook_variable_info().
*/
function googleanalytics_variable_info($options) {
$variables['googleanalytics_account'] = array(
'type' => 'string',
'title' => t('Web Property ID', array(), $options),
'default' => 'UA-',
$variables['googleanalytics_account'] = array(
'type' => 'string',
'title' => t('Web Property ID', array(), $options),
'default' => 'UA-',
'description' => t('This ID is unique to each site you want to track separately, and is in the form of UA-xxxxxxx-yy. To get a Web Property ID, <a href="@analytics">register your site with Google Analytics</a>, or if you already have registered your site, go to your Google Analytics Settings page to see the ID next to every site profile. <a href="@webpropertyid">Find more information in the documentation</a>.', array('@analytics' => 'http://www.google.com/analytics/', '@webpropertyid' => url('https://developers.google.com/analytics/resources/concepts/gaConceptsAccounts', array('fragment' => 'webProperty'))), $options),
'required' => TRUE,
'required' => TRUE,
'group' => 'googleanalytics',
'localize' => TRUE,
'validate callback' => 'googleanalytics_validate_googleanalytics_account',
);
'validate callback' => 'googleanalytics_validate_googleanalytics_account',
);
return $variables;
}
/**
* Implements hook_variable_group_info().
/**
* Implements hook_variable_group_info().
*/
function googleanalytics_variable_group_info() {
$groups['googleanalytics'] = array(
function googleanalytics_variable_group_info() {
$groups['googleanalytics'] = array(
'title' => t('Google Analytics'),
'description' => t('Configure tracking behavior to get insights into your website traffic and marketing effectiveness.'),
'access' => 'administer google analytics',
'path' => array('admin/config/system/googleanalytics'),
'description' => t('Configure tracking behavior to get insights into your website traffic and marketing effectiveness.'),
'access' => 'administer google analytics',
'path' => array('admin/config/system/googleanalytics'),
);
return $groups;
}
/**
* Validate Web Property ID variable.
*/
return $groups;
}
/**
* Validate Web Property ID variable.
*/
function googleanalytics_validate_googleanalytics_account($variable) {
if (!preg_match('/^UA-\d{4,}-\d+$/', $variable['value'])) {
return t('A valid Google Analytics Web Property ID is case sensitive and formatted like UA-xxxxxxx-yy.');
if (!preg_match('/^UA-\d{4,}-\d+$/', $variable['value'])) {
return t('A valid Google Analytics Web Property ID is case sensitive and formatted like UA-xxxxxxx-yy.');
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment