t('TODO'), 'fields' => array( 'nft_obj_key' => array( 'description' => t('TODO'), 'type' => 'varchar', 'length' => 36, 'not null' => TRUE, ), 'default_title' => array( 'description' => t('TODO'), 'type' => 'varchar', 'length' => 128, 'not null' => FALSE, ), 'default_body' => array( 'description' => t('TODO'), 'type' => 'text', 'size' => 'big', 'not null' => FALSE, ), ), 'primary key' => array('nft_obj_key'), ); $schema['netforum_node'] = array( 'description' => t('TODO'), 'fields' => array( 'nid' => array( 'description' => t('TODO'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, ), 'vid' => array( 'description' => t('TODO'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, ), 'nfn_obj_key' => array( 'description' => t('TODO'), 'type' => 'varchar', 'length' => 36, 'not null' => FALSE, ), 'nfn_key' => array( 'description' => t('TODO'), 'type' => 'varchar', 'length' => 36, 'not null' => FALSE, ), 'unparsed_title' => array( 'description' => t('TODO'), 'type' => 'varchar', 'length' => 128, 'not null' => FALSE, ), 'unparsed_body' => array( 'description' => t('TODO'), 'type' => 'text', 'size' => 'big', 'not null' => FALSE, ), ), 'indexes' => array( 'nfn_obj_key' => array('nfn_obj_key'), 'nfn_key' => array('nfn_key'), ), 'primary key' => array('vid', 'nid'), ); $schema['netforum_node_special_fields'] = array( 'description' => t('TODO'), 'fields' => array( 'field_code' => array( 'description' => t('TODO'), 'type' => 'varchar', 'length' => 100, 'not null' => TRUE, ), 'field_description' => array( 'description' => t('TODO'), 'type' => 'varchar', 'length' => 255, 'not null' => FALSE, ), 'field_value' => array( 'description' => t('TODO'), 'type' => 'text', 'not null' => FALSE, ), ), 'primary key' => array('field_code'), ); $schema['netforum_node_special_fields'] = array( 'description' => t('TODO'), 'fields' => array( ), ); return $schema; } /** * Implementation of hook_install * Adding table netforum_request_cache */ function netforum_node_install() { switch ($GLOBALS['db_type']) { case 'pgsql': $success = FALSE; break; case 'mysql': case 'mysqli': db_query("CREATE TABLE {netforum_node_types} ( nft_obj_key varchar(36) NOT NULL, default_title varchar(128), default_body longtext, PRIMARY KEY (nft_obj_key) ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;"); db_query("CREATE TABLE {netforum_node} ( nid int(10) unsigned not null, vid int(10) unsigned not null, nfn_obj_key varchar(36), nfn_key varchar(36), unparsed_title varchar(128), unparsed_body longtext, PRIMARY KEY (vid, nid), KEY (nfn_obj_key), KEY (nfn_key) ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;"); db_query("CREATE TABLE {netforum_node_special_fields} ( field_code varchar(100) not null, field_description varchar(255), field_value text, PRIMARY KEY (field_code) ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;"); $default_special_fields = array( 'Defaultatckey' => array('field_value' => '', 'field_description' => t('Default business unit key')), 'Businessunitdefaultkey' => array('field_value' => '', 'field_description' => t('Default business unit key')), 'Currentdate' => array('field_value' => '', 'field_description' => t('Current date in mm/dd/yyyy format')), 'Currentdatetime' => array('field_value' => '', 'field_description' => t('Current date and time in mm/dd/yyyy HH:MM am/pm format')), 'Httpserverpath' => array('field_value' => '', 'field_description' => t('Base server path')), 'Httpservername' => array('field_value' => '', 'field_description' => t('Server name')), 'Applicationpath' => array('field_value' => '', 'field_description' => t('Application path')), 'Apptitle' => array('field_value' => '', 'field_description' => t('Site title')), 'Currentusergroups' => array('field_value' => 'roles); ?>', 'field_description' => t('Current roles on the Drupal site')), 'Sessionid' => array('field_value' => '', 'field_description' => t('PHP Session ID')), 'Currentuserkey' => array('field_value' => 'cst_key; ?>', 'field_description' => t('Current user key')), 'Customerkey' => array('field_value' => 'cst_key; ?>', 'field_description' => t('Current customer key')), 'Currentusername' => array('field_value' => 'cst_name_cp; ?>', 'field_description' => t('Current user name')), 'Currentuserlogin' => array('field_value' => 'name; ?>', 'field_description' => t('Current user login')), 'Customertype' => array('field_value' => 'cst_type; ?>', 'field_description' => t('Current user customer type (Individual or Organization)')), ); foreach ($default_special_fields as $field_code => $data) { db_query("INSERT INTO {netforum_node_special_fields} (field_code, field_value, field_description) VALUES('%s', '%s', '%s') ", $field_code, $data['field_value'], $data['field_description']); } $success = TRUE; break; } // End case // Notify of changes if ($success) { drupal_set_message(t('netFORUM Dynamic Facade Nodes module installed tables successfully.')); } else { drupal_set_message(t('The installation of netFORUM Dynamic Facade Nodes module was unsuccessful.'), 'error'); } } function netforum_node_uninstall() { // Remove tables. drupal_uninstall_schema('netforum_node'); drupal_set_message(t('netFORUM Dynamic Facade Nodes module has been successfully uninstalled.')); }