Fixed issues from bevanw.
[sandbox/ab_connor/1436376.git] / gccode.install
1 <?php
2 /**
3 * @file
4 * Provides a personal Geocaches-Database for Drupal.
5 *
6 * Offers a content type "GCCode", which expects an official
7 * GC-Code as title. Additional your status of the geocache and
8 * notices can be entered. By importing GPX-Files or by down-
9 * loading informations directly from the node using the ruby-
10 * script "geotoad", the node will be completed with the official
11 * attributes from GC.com.
12 */
13
14 /**
15 * Implements hook_install().
16 */
17 function gccode_install() {
18 // No comments for default.
19 variable_set('comment_gccode', 0);
20 // Only "published" as default option for workflow.
21 variable_set('node_options_gccode', array('status'));
22 // No attachments needed.
23 variable_set('upload_gccode', 0);
24 drupal_install_schema('gccode');
25 }
26
27 /**
28 * Implements hook_uninstall().
29 */
30 function gccode_uninstall() {
31 drupal_uninstall_schema('gccode');
32 variable_del('comment_gccode');
33 variable_del('node_options_gccode');
34 variable_del('upload_gccode');
35 variable_del('gccode_infos_collapsed');
36 variable_del('gccode_import_dir');
37 variable_del('gccode_use_geotoad');
38 variable_del('gccode_geotoad_dir');
39 variable_del('gccode_update_infos');
40 variable_del('gccode_block_status');
41 variable_del('gccode_block_count');
42 variable_del('gccode_import_now');
43 }
44
45 /**
46 * Implements hook_schema().
47 *
48 * This is the database schema of the additional infos.
49 */
50 function gccode_schema() {
51 $schema['gccode_info'] = array(
52 'description' => 'Stores information about a geocache.',
53 'fields' => array(
54 'gc' => array(
55 'type' => 'char',
56 'not null' => TRUE,
57 'description' => 'The geocode on geocaching.com.',
58 'length' => 7,
59 ),
60 'lat' => array(
61 'type' => 'char',
62 'not null' => TRUE,
63 'description' => 'The Latitude of the coordinates. Schema is NXX°XXX.XX.',
64 'length' => 12,
65 ),
66 'lon' => array(
67 'type' => 'char',
68 'not null' => TRUE,
69 'description' => 'The Longitude of the coordinates. Schema is EXXX°XXX.XX.',
70 'length' => 13,
71 ),
72 'headline' => array(
73 'type' => 'text',
74 'not null' => TRUE,
75 'description' => 'The title of the cache.',
76 'size' => 'small',
77 ),
78 'type' => array(
79 'type' => 'text',
80 'not null' => TRUE,
81 'description' => 'The type of the cache.',
82 'size' => 'tiny',
83 ),
84 'owner' => array(
85 'type' => 'text',
86 'not null' => TRUE,
87 'description' => 'The alias of the owner of the cache.',
88 'size' => 'tiny',
89 ),
90 'description' => array(
91 'type' => 'text',
92 'not null' => TRUE,
93 'description' => 'The description of the cache.',
94 'size' => 'big',
95 ),
96 ),
97 'primary key' => array(
98 'gc',
99 ),
100 );
101 $schema['gccode_node'] = array(
102 'description' => 'Stores the GC-Code, the status and personal notices about a geocache.',
103 'fields' => array(
104 'nid' => array(
105 'type' => 'int',
106 'unsigned' => TRUE,
107 'not null' => TRUE,
108 'default' => 0,
109 'description' => "The GC-Code's {node}.nid.",
110 ),
111 'vid' => array(
112 'type' => 'int',
113 'unsigned' => TRUE,
114 'not null' => TRUE,
115 'default' => 0,
116 'description' => "The GC-Code's {node}.vid.",
117 ),
118 'stat' => array(
119 'type' => 'int',
120 'not null' => TRUE,
121 'unsigned' => TRUE,
122 'default' => 0,
123 'description' => 'The status of this geocache.',
124 ),
125 ),
126 'primary key' => array('nid', 'vid'),
127 'unique keys' => array(
128 'vid' => array('vid'),
129 ),
130 'indexes' => array(
131 'nid' => array('nid'),
132 ),
133 );
134 return $schema;
135 }