You are here

uc_googleanalytics.install in Ubercart 7.3

Same filename and directory in other branches
  1. 8.4 uc_googleanalytics/uc_googleanalytics.install

Install, update and uninstall functions for the uc_googleanalytics module.

File

uc_googleanalytics/uc_googleanalytics.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the uc_googleanalytics module.
 */

/**
 * Implements hook_enable().
 */
function uc_googleanalytics_enable() {

  // Get the weight of the Google Analytics module.
  $weight = db_query("SELECT weight FROM {system} WHERE name = :module", array(
    ':module' => 'googleanalytics',
  ))
    ->fetchField();

  // Update the weight of the UC Google Analytics module so its hooks get called
  // after the actual Google Analytics module.
  db_update('system')
    ->fields(array(
    'weight' => max(1000, $weight + 1),
  ))
    ->condition('name', 'uc_googleanalytics')
    ->execute();
}

Functions

Namesort descending Description
uc_googleanalytics_enable Implements hook_enable().