From ae8e52e742ddc71392fb7d8aabfd8d42a15e48a1 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 30 Oct 2018 13:10:20 +0530 Subject: added default install --- osdag_workshop_booking.install | 67 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 4 deletions(-) diff --git a/osdag_workshop_booking.install b/osdag_workshop_booking.install index 7827f15..ee1bfdf 100644 --- a/osdag_workshop_booking.install +++ b/osdag_workshop_booking.install @@ -1,10 +1,56 @@ 'DefaultMailSystem', 'osdag_workshop_booking' => 'WorkshopMailSystem')); } /** @@ -12,6 +58,7 @@ function osdag_workshop_booking_install() */ function osdag_workshop_booking_schema() { +$schema = array(); $schema['list_states_of_india'] = array( 'description' => 'TODO: please describe this table!', 'fields' => array( @@ -256,15 +303,27 @@ $schema['osdag_workshop_booking_proposal'] = array( ), 'primary key' => array('id'), ); + return $schema; +} +/** + * Inserts default entry into list_states_of_india table + * + * @param $states of the list states of india + */ +function _osdag_workshop_booking_default_insert($states) { + $data = array( + 'state' => $states, + ); + drupal_write_record('list_states_of_india', $data); } /** * Implementation of hook_uninstall(). */ function osdag_workshop_booking_uninstall() { - + drupal_uninstall_schema('osdag_workshop_booking'); //Unset module keys in variable mail_system - $mail_system = variable_get('mail_system', array('default-system' => 'DefaultMailSystem', 'osdag_workshop_booking' => 'WorkshopMailSystem')); - unset($mail_system['osdag_workshop_booking']); - variable_set('mail_system', $mail_system); + $mail_system = variable_get('mail_system', array('default-system' => 'DefaultMailSystem', 'osdag_workshop_booking' => 'WorkshopMailSystem')); + unset($mail_system['osdag_workshop_booking']); + variable_set('mail_system', $mail_system); } -- cgit