Code review and cleanup.
[project/addthis.git] / addthis.install
CommitLineData
b3ac575e 1<?php
b3ac575e
VP
2
3/**
4 * @file
9268db58 5 * Install, update and uninstall functions for the AddThis module.
b3ac575e
VP
6 */
7
bce2d04e
MG
8// We need some constant values from the AddThis class.
9include_once('classes/AddThis.php');
10
b3ac575e
VP
11/**
12 * Implements hook_field_schema().
13 */
14function addthis_field_schema($field) {
9268db58 15 $schema = array();
43a336b9 16 if ($field['type'] == AddThis::FIELD_TYPE) {
9268db58
JP
17 $columns = array(
18 'value' => array(
19 'type' => 'varchar',
20 'length' => $field['settings']['max_length'],
21 'not null' => FALSE,
22 ),
23 );
24 $schema = array(
25 'columns' => $columns,
26 'indexes' => array(),
27 'foreign keys' => array(),
28 );
b3ac575e 29 }
9268db58 30 return $schema;
b3ac575e 31}
043b9aa2
JP
32
33/**
f921d468
JP
34 * Implements hook_uninstall().
35 */
36function addthis_uninstall() {
79751477 37 variable_del(AddThis::ADDRESSBOOK_ENABLED_KEY);
65e6db6f 38 variable_del(AddThis::BLOCK_WIDGET_TYPE_KEY);
5fc529ad 39 variable_del(AddThis::BOOKMARK_URL_KEY);
5ce0cb2b 40 variable_del(AddThis::CLICKBACK_TRACKING_ENABLED_KEY);
4aa15ce9 41 variable_del(AddThis::CLICK_TO_OPEN_COMPACT_MENU_ENABLED_KEY);
dc19bfa2 42 variable_del(AddThis::CO_BRAND_KEY);
90e669c3 43 variable_del(AddThis::COMPLIANT_508_KEY);
460f1e3c
JP
44 variable_del(AddThis::CUSTOM_CONFIGURATION_CODE_ENABLED_KEY);
45 variable_del(AddThis::CUSTOM_CONFIGURATION_CODE_KEY);
18b01289 46 variable_del(AddThis::ENABLED_SERVICES_KEY);
4aa15ce9 47 variable_del(AddThis::OPEN_WINDOWS_ENABLED_KEY);
cfab0d33 48 variable_del(AddThis::PROFILE_ID_KEY);
8109364c 49 variable_del(AddThis::SERVICES_CSS_URL_KEY);
fc3ad5d3 50 variable_del(AddThis::SERVICES_JSON_URL_KEY);
4aa15ce9
JP
51 variable_del(AddThis::STANDARD_CSS_ENABLED_KEY);
52 variable_del(AddThis::UI_DELAY_KEY);
57765925
JP
53 variable_del(AddThis::UI_HEADER_BACKGROUND_COLOR_KEY);
54 variable_del(AddThis::UI_HEADER_COLOR_KEY);
8109364c 55 variable_del(AddThis::WIDGET_JS_URL_KEY);
f921d468 56}