2 //$Id: date_popup.install,v 1.5.6.5 2009/02/16 23:46:08 karens Exp $
4 * Implementation of hook_install().
6 function date_popup_install() {
7 if (module_exists('content')) {
8 drupal_load('module', 'content');
9 if (!db_table_exists(content_instance_tablename())) {
12 if (module_exists('date_repeat')) {
13 db_query("UPDATE {". content_instance_tablename() ."} SET widget_active=1 WHERE widget_type='%s' OR widget_type='%s'", 'date_popup', 'date_popup_repeat');
16 db_query("UPDATE {". content_instance_tablename() ."} SET widget_active=1 WHERE widget_type='%s'", 'date_popup');
18 content_clear_type_cache(TRUE);
23 * Implementation of hook_uninstall().
25 function date_popup_uninstall() {
26 if (module_exists('content')) {
27 drupal_load('module', 'content');
28 if (!db_table_exists(content_instance_tablename())) {
31 if (module_exists('date_repeat')) {
32 db_query("UPDATE {". content_instance_tablename() ."} SET widget_active=0 WHERE widget_type='%s' OR widget_type='%s'", 'date_popup', 'date_popup_repeat');
35 db_query("UPDATE {". content_instance_tablename() ."} SET widget_active=0 WHERE widget_type='%s'", 'date_popup');
37 content_clear_type_cache(TRUE);
42 * Implementation of hook_enable().
44 function date_popup_enable() {
45 if (module_exists('content')) {
46 drupal_load('module', 'content');
47 if (!db_table_exists(content_instance_tablename())) {
50 if (module_exists('date_repeat')) {
51 db_query("UPDATE {". content_instance_tablename() ."} SET widget_active=1 WHERE widget_type='%s' OR widget_type='%s'", 'date_popup', 'date_popup_repeat');
54 db_query("UPDATE {". content_instance_tablename() ."} SET widget_active=1 WHERE widget_type='%s'", 'date_popup');
56 content_clear_type_cache(TRUE);
61 * Implementation of hook_disable().
63 function date_popup_disable() {
64 if (module_exists('content')) {
65 drupal_load('module', 'content');
66 if (!db_table_exists(content_instance_tablename())) {
69 if (module_exists('date_repeat')) {
70 db_query("UPDATE {". content_instance_tablename() ."} SET widget_active=0 WHERE widget_type='%s' OR widget_type='%s'", 'date_popup', 'date_popup_repeat');
73 db_query("UPDATE {". content_instance_tablename() ."} SET widget_active=0 WHERE widget_type='%s'", 'date_popup');
75 content_clear_type_cache(TRUE);