1 | <?php |
---|
2 | // $Id: number.install,v 1.28.2.6 2008/10/04 13:14:22 karens Exp $ |
---|
3 | |
---|
4 | /** |
---|
5 | * @file |
---|
6 | * Implementation of hook_install(). |
---|
7 | */ |
---|
8 | function number_install() { |
---|
9 | drupal_load('module', 'content'); |
---|
10 | content_notify('install', 'number'); |
---|
11 | } |
---|
12 | |
---|
13 | /** |
---|
14 | * Implementation of hook_uninstall(). |
---|
15 | */ |
---|
16 | function number_uninstall() { |
---|
17 | drupal_load('module', 'content'); |
---|
18 | content_notify('uninstall', 'number'); |
---|
19 | } |
---|
20 | |
---|
21 | /** |
---|
22 | * Implementation of hook_enable(). |
---|
23 | * |
---|
24 | * Notify content module when this module is enabled. |
---|
25 | */ |
---|
26 | function number_enable() { |
---|
27 | drupal_load('module', 'content'); |
---|
28 | content_notify('enable', 'number'); |
---|
29 | } |
---|
30 | |
---|
31 | /** |
---|
32 | * Implementation of hook_disable(). |
---|
33 | * |
---|
34 | * Notify content module when this module is disabled. |
---|
35 | */ |
---|
36 | function number_disable() { |
---|
37 | drupal_load('module', 'content'); |
---|
38 | content_notify('disable', 'number'); |
---|
39 | } |
---|
40 | |
---|
41 | function number_update_last_removed() { |
---|
42 | return 5; |
---|
43 | } |
---|
44 | |
---|
45 | /** |
---|
46 | * Rename old decimal fields, which were really floats, to float |
---|
47 | */ |
---|
48 | function number_update_6000() { |
---|
49 | if ($abort = content_check_update('number')) { |
---|
50 | return $abort; |
---|
51 | } |
---|
52 | |
---|
53 | $ret = array(); |
---|
54 | |
---|
55 | drupal_load('module', 'content'); |
---|
56 | $ret[] = update_sql("UPDATE {". content_field_tablename() ."} SET type='number_float' WHERE type = 'number_decimal'"); |
---|
57 | |
---|
58 | content_clear_type_cache(); |
---|
59 | return $ret; |
---|
60 | } |
---|