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