4 * Provides a personal Geocaches-Database for Drupal.
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.
15 * Implements hook_install().
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');
28 * Implements hook_uninstall().
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');
46 * Implements hook_schema().
48 * This is the database schema of the additional infos.
50 function gccode_schema() {
51 $schema['gccode_info'] = array(
52 'description' => 'Stores information about a geocache.',
57 'description' => 'The geocode on geocaching.com.',
63 'description' => 'The Latitude of the coordinates. Schema is NXX°XXX.XX.',
69 'description' => 'The Longitude of the coordinates. Schema is EXXX°XXX.XX.',
75 'description' => 'The title of the cache.',
81 'description' => 'The type of the cache.',
87 'description' => 'The alias of the owner of the cache.',
90 'description' => array(
93 'description' => 'The description of the cache.',
97 'primary key' => array(
101 $schema['gccode_node'] = array(
102 'description' => 'Stores the GC-Code, the status and personal notices about a geocache.',
109 'description' => "The GC-Code's {node}.nid.",
116 'description' => "The GC-Code's {node}.vid.",
123 'description' => 'The status of this geocache.',
126 'primary key' => array('nid', 'vid'),
127 'unique keys' => array(
128 'vid' => array('vid'),
131 'nid' => array('nid'),