| 1 |
<?php |
<?php |
| 2 |
// $Id$ |
// $Id: omniture.module,v 1.4 2008/10/03 02:33:16 ultimateboy Exp $ |
| 3 |
/* |
/* |
| 4 |
* @file |
* @file |
| 5 |
* Drupal Module: Omniture Stats |
* Drupal Module: Omniture SiteCatalyst Stats |
| 6 |
* Adds the required Javascript to the bottom of all your Drupal pages |
* Adds the required Javascript to the bottom of all your Drupal pages |
| 7 |
* to allow tracking by the Omniture statistics package. |
* to allow tracking by the Omniture statistics package. |
| 8 |
* Based on the Google Analytics package by Mike Carter |
* Based on the Google Analytics package by Mike Carter |
| 15 |
function omniture_help($path, $arg) { |
function omniture_help($path, $arg) { |
| 16 |
switch ($path) { |
switch ($path) { |
| 17 |
case 'admin/help#omniture': |
case 'admin/help#omniture': |
| 18 |
return t('Omniture is a powerful statistics and site optimization package.'); |
return t("Settings for Omniture's SiteCatalyst package"); |
| 19 |
} |
} |
| 20 |
} |
} |
| 21 |
|
|
| 22 |
function omniture_perm() { |
function omniture_perm() { |
| 23 |
return array('administer Omniture configuration'); |
return array('administer SiteCatalyst configuration'); |
| 24 |
} |
} |
| 25 |
|
|
| 26 |
|
|
| 31 |
$items = array(); |
$items = array(); |
| 32 |
|
|
| 33 |
$items['admin/settings/omniture'] = array( |
$items['admin/settings/omniture'] = array( |
| 34 |
'title' => 'Omniture Confiruration', |
'title' => 'SiteCatalyst', |
| 35 |
'description' => 'Configure omniture', |
'description' => 'Configure the settings used to integrate Omniture\'s SiteCatalyst.', |
| 36 |
'page callback' => 'drupal_get_form', |
'page callback' => 'drupal_get_form', |
| 37 |
'page arguments' => array('omniture_admin_settings'), |
'page arguments' => array('omniture_admin_settings'), |
| 38 |
'access arguments' => array('administer Omniture configuration'), |
'access arguments' => array('administer SiteCatalyst configuration'), |
| 39 |
'type' => MENU_NORMAL_ITEM, |
'type' => MENU_NORMAL_ITEM, |
| 40 |
); |
); |
| 41 |
|
|
| 172 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 173 |
'#title' => t('General Settings'), |
'#title' => t('General Settings'), |
| 174 |
'#collapsible' => TRUE, |
'#collapsible' => TRUE, |
| 175 |
'#description' => t('General settings for Omniture module') |
'#description' => t('General settings') |
| 176 |
); |
); |
| 177 |
|
|
| 178 |
$form['general']['omniture_js_file_location'] = array( |
$form['general']['omniture_js_file_location'] = array( |
| 179 |
'#type' => 'textfield', |
'#type' => 'textfield', |
| 180 |
'#title' => t("Complete path to Omniture Javascript file"), |
'#title' => t("Complete path to SiteCatalyst Javascript file"), |
| 181 |
'#default_value' => check_plain(variable_get("omniture_js_file_location", 'http://www.example.com/js/s_code_remote_h.js')), |
'#default_value' => check_plain(variable_get("omniture_js_file_location", 'http://www.example.com/js/s_code_remote_h.js')), |
| 182 |
); |
); |
| 183 |
|
|
| 184 |
$form['general']['omniture_image_file_location'] = array( |
$form['general']['omniture_image_file_location'] = array( |
| 185 |
'#type' => 'textfield', |
'#type' => 'textfield', |
| 186 |
'#title' => t("Complete path to Omniture Image file"), |
'#title' => t("Complete path to SiteCatalyst Image file"), |
| 187 |
'#default_value' => check_plain(variable_get("omniture_image_file_location", 'http://examplecom.112.2O7.net/b/ss/examplecom/1/H.13--NS/0')), |
'#default_value' => check_plain(variable_get("omniture_image_file_location", 'http://examplecom.112.2O7.net/b/ss/examplecom/1/H.13--NS/0')), |
| 188 |
); |
); |
| 189 |
|
|
| 194 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 195 |
'#title' => t('User Role Tracking'), |
'#title' => t('User Role Tracking'), |
| 196 |
'#collapsible' => TRUE, |
'#collapsible' => TRUE, |
| 197 |
'#description' => t('Define what user roles should be tracked by Omniture.') |
'#description' => t('Define what user roles should be tracked by SiteCatalyst.') |
| 198 |
); |
); |
| 199 |
|
|
| 200 |
while ($role = db_fetch_object($result)) { |
while ($role = db_fetch_object($result)) { |
| 211 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 212 |
'#title' => t('Vocabulary Variables'), |
'#title' => t('Vocabulary Variables'), |
| 213 |
'#collapsible' => TRUE, |
'#collapsible' => TRUE, |
| 214 |
'#description' => t('Define which vocabularies should should be tracked by which Omniture variables. Only applies to the full node view (e.g. node/1 or the aliased version of a node). Leave blank to disable for a vocabulary. Multiple terms from a "Multiple select" vocabulary will be placed into a comma separated list. Not available for "Free tagging" vocabularies.') |
'#description' => t('Define which vocabularies should should be tracked by which SiteCatalyst variables. Only applies to the full node view (e.g. node/1 or the aliased version of a node). Leave blank to disable for a vocabulary. Multiple terms from a "Multiple select" vocabulary will be placed into a comma separated list. Not available for "Free tagging" vocabularies.') |
| 215 |
); |
); |
| 216 |
|
|
| 217 |
// Allow setting a vocabulary into a variable |
// Allow setting a vocabulary into a variable |
| 231 |
'#title' => t('Advanced'), |
'#title' => t('Advanced'), |
| 232 |
'#collapsible' => TRUE, |
'#collapsible' => TRUE, |
| 233 |
'#collapsed' => TRUE, |
'#collapsed' => TRUE, |
| 234 |
'#description' => t('You can add custom Omniture code here.') |
'#description' => t('You can add custom SiteCatalyst code here.') |
| 235 |
); |
); |
| 236 |
$form['advanced']['omniture_codesnippet'] = array( |
$form['advanced']['omniture_codesnippet'] = array( |
| 237 |
'#type' => 'textarea', |
'#type' => 'textarea', |
| 238 |
'#title' => t('JavaScript Code'), |
'#title' => t('JavaScript Code'), |
| 239 |
'#default_value' => variable_get('omniture_codesnippet', ''), |
'#default_value' => variable_get('omniture_codesnippet', ''), |
| 240 |
'#rows' => 15, |
'#rows' => 15, |
| 241 |
'#description' => t('Paste <a href="@snippets">custom code snippets here</a>. These will be added to every page that Omniture appears on. For help with this feature see the <a href="@blog">cutroni.com blog</a>. <strong>Do not include the <script> tags</strong>, and always end your code with a semicolon (;).', array('@snippets' => 'http://drupal.org/node/39282', '@blog' => 'http://cutroni.com/blog/') ) |
'#description' => t('Paste <a href="@snippets">custom code snippets here</a>. These will be added to every page that SiteCatalyst appears on. For help with this feature see the <a href="@blog">cutroni.com blog</a>. <strong>Do not include the <script> tags</strong>, and always end your code with a semicolon (;).', array('@snippets' => 'http://drupal.org/node/39282', '@blog' => 'http://cutroni.com/blog/') ) |
| 242 |
); |
); |
| 243 |
|
|
| 244 |
return system_settings_form($form); |
return system_settings_form($form); |