summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Carter2007-01-18 01:14:11 (GMT)
committer Mike Carter2007-01-18 01:14:11 (GMT)
commitedc7799a10bd78d22e4868c4a9ba7ea1af8c94a8 (patch)
tree788e3ed123898c4456b7a4bb8297c1bf7722e4e1
parent67fc820b714e1494b85eb2d0b9f1c1b40f2febd8 (diff)
no message
-rw-r--r--googleanalytics.info1
-rw-r--r--googleanalytics.module11
2 files changed, 9 insertions, 3 deletions
diff --git a/googleanalytics.info b/googleanalytics.info
index d6d7667..a2cbfb5 100644
--- a/googleanalytics.info
+++ b/googleanalytics.info
@@ -1,3 +1,4 @@
; $Id$
name = Google Analytics
description = Adds Google Analytics javascript tracking code to all your site's pages.
+version = "$Name$" \ No newline at end of file
diff --git a/googleanalytics.module b/googleanalytics.module
index 78e495c..5e4efa5 100644
--- a/googleanalytics.module
+++ b/googleanalytics.module
@@ -45,6 +45,7 @@ function googleanalytics_footer($main = 0) {
// Check if we should track the currently active user's role
$track = 0;
foreach($user->roles as $role) {
+ $role = str_replace(' ', '_', $role);
$track += variable_get("googleanalytics_track_{$role}", FALSE);
}
@@ -59,7 +60,7 @@ function googleanalytics_footer($main = 0) {
}
// Add User profile segmentation values
- if(is_array($profile_fields = variable_get('googleanalytics_segmentation', '')) && ($user->uid > 0)) {;
+ if(is_array($profile_fields = variable_get('googleanalytics_segmentation', '')) && ($user->uid > 0)) {
$p = profile_load_profile($user);
@@ -115,7 +116,7 @@ function googleanalytics_admin_settings() {
while ($role = db_fetch_object($result)) {
// can't use empty spaces in varname
- $role_varname = $string = str_replace(" ", "_", $role->name);
+ $role_varname = $string = str_replace(' ', '_', $role->name);
$form['roles']["googleanalytics_track_{$role_varname}"] = array(
'#type' => 'checkbox',
'#title' => t($role->name),
@@ -132,7 +133,11 @@ function googleanalytics_admin_settings() {
if(!module_exists('profile')) {
$form['segmentation']['profile'] = array(
- '#value' => t('You need to activate the <a href="@profile">Profile module</a> to use this feature.', array('@profile' => url('admin/build/modules'))) );
+ '#type' => 'markup',
+ '#value' => t('You need to activate the !profile to use this feature.', array('!profile' => l(t('Profile module'), 'admin/build/modules')) ),
+ '#prefix' => '<p>',
+ '#suffix' => '</p>'
+ );
} else {
// Compile a list of fields to show.
$fields = array('uid' => 'User ID', 'name' => 'Username');