Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: fbd9a224a6
Fetching contributors…

Cannot retrieve contributors at this time

62 lines (51 sloc) 1.682 kb
<?php
/**
* Implementation of hook_menu().
*/
function webtrends_menu() {
$items = array();
$items['admin/settings/webtrends'] = array(
'title' => 'WebTrends',
'description' => 'Settings for the WebTrends analytics tool.',
'page callback' => 'drupal_get_form',
'page arguments' => array('webtrends_admin_settings_form'),
'access arguments' => array('administer site configuration'),
'file' => 'webtrends.admin.inc',
);
return $items;
}
/**
* Implementation of hook_footer().
*/
function webtrends_footer() {
$domain = variable_get('webtrends_domain', FALSE);
$dcs_id = variable_get('webtrends_dcs_id', FALSE);
if (!$domain || !$dcs_id) {
watchdog('webtrends', 'Webtrends module not configured.', array(), WATCHDOG_NOTICE);
return;
}
$script = <<<EOT
var _tag=new WebTrends();
_tag.fpcdom = ".$domain";
_tag.dcsid = "$dcs_id";
_tag.dcsGetId();
_tag.dcsCustom=function(){
if (typeof Drupal.settings.tingSearch != 'undefined') {
_tag.WT.oss = encodeURIComponent(Drupal.settings.tingSearch.keys);
// The result count is unknown when the page is loaded, so we just say 1.
_tag.WT.oss_r = 1;
}
}
_tag.dcsCollect();
EOT;
$html = <<<EOT
<noscript>
<div><img alt="DCSIMG" id="DCSIMG" width="1" height="1" src="http://visionize10.visionize.dk/$dcs_id/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=9.3.0&amp;WT.dcssip=$domain"/></div>
</noscript>
EOT;
// We're relying on Drupal inserting inline js after references to
// external files.
drupal_add_js($script, 'inline', 'footer');
drupal_add_js(drupal_get_path('module', 'webtrends') . '/webtrends.js', 'module', 'footer');
return $html;
}
Jump to Line
Something went wrong with that request. Please try again.