/[drupal]/contributions/modules/rsvp/rsvp_eventconnector.install
ViewVC logotype

Contents of /contributions/modules/rsvp/rsvp_eventconnector.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Sun Jan 11 07:59:39 2009 UTC (10 months, 2 weeks ago) by ulf1
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-6--2
Changes since 1.1: +23 -7 lines
File MIME type: text/x-php
Merge from DRUPAL-6--1-0
1 <?php
2 // $Id: rsvp_eventconnector.install,v 1.1.2.2 2008/12/29 21:09:35 ulf1 Exp $
3
4 /**
5 * Implementation of hook_install().
6 */
7 function rsvp_eventconnector_install() {
8
9 // check the rsvp module weight:
10 $rsvp_weight = db_result(db_query("SELECT weight FROM {system} WHERE name = 'rsvp'"));
11 // make rsvp_eventconnector execute after rsvp:
12 db_query("UPDATE {system} SET weight = %d+1 WHERE name = 'rsvp_eventconnector'", $rsvp_weight);
13 }
14
15 /**
16 * Implementation of hook_uninstall().
17 */
18 function rsvp_eventconnector_uninstall() {
19
20 if (drupal_get_schema('rsvp') != false)
21 db_query('DELETE FROM {rsvp}');
22
23 if (drupal_get_schema('rsvp_invite') != false)
24 db_query('DELETE FROM {rsvp_invite}');
25
26 variable_del('rsvp_content_types');
27
28 $connector = variable_get('rsvp_connector', NULL);
29 if (isset($connector) && $connector == 'event' ) {
30 variable_del('rsvp_connector');
31 }
32
33 }
34
35 /**
36 * Implementation of hook_enable().
37 */
38 function rsvp_eventconnector_enable() {
39 $connector = variable_get('rsvp_connector', NULL);
40 if (isset($connector) && $connector != 'event' ) {
41 drupal_set_message(t('RSVP event connector: It is not permitted to enable multiple RSVP connectors. RSVP connector %conn already enabled. Disable and uninstall other connector first. Then enable this connector again.', array('%conn' => $connector)), 'error');
42 }
43 else {
44 variable_set('rsvp_connector', 'event');
45 variable_set('rsvp_content_types', array('event' => ''));
46 }
47
48 }
49
50 /**
51 * Implementation of hook_disable().
52 */
53 function rsvp_eventconnector_disable() {
54 $connector = variable_get('rsvp_connector', NULL);
55 //This disable func is being called preventive, even if other modules are being modified.
56 //Delete variable only if we have set it.
57 if (isset($connector) && $connector == 'event' ) {
58 variable_del('rsvp_connector');
59 }
60 }
61

  ViewVC Help
Powered by ViewVC 1.1.2