5 * Definition of variables for Variable API module.
9 * Implements hook_variable_info().
11 function piwik_variable_info($options) {
12 $variables['piwik_site_id'] = array(
14 'title' => t('Piwik site ID', array(), $options),
16 'description' => t('The user account number is unique to the websites domain. Click the <strong>Settings</strong> link in your Piwik account, then the <strong>Websites</strong> tab and enter the appropriate site <strong>ID</strong> into this field.'),
20 'multidomain' => TRUE,
21 'validate callback' => 'piwik_validate_piwik_site_id',
28 * Implements hook_variable_group_info().
30 function piwik_variable_group_info() {
31 $groups['piwik'] = array(
32 'title' => t('Piwik'),
33 'description' => t('Configure tracking behavior to get insights into your website traffic and marketing effectiveness.'),
34 'access' => 'administer piwik',
35 'path' => array('admin/config/system/piwik'),
42 * Validate Piwik site ID variable.
44 * @param array $variable
48 function piwik_validate_piwik_site_id($variable) {
49 if (!preg_match('/^\d{1,}$/', $variable['value'])) {
50 return t('A valid Piwik site ID is an integer only.');