function tft_og_install in Taxonomy File Tree 7.2
Implements hook_install().
File
- modules/
tft_og/ tft_og.install, line 11 - Module install logic.
Code
function tft_og_install() {
include_once drupal_get_path('module', 'og') . '/og_ui/og_ui.module';
if (function_exists('og_ui_node_type_save')) {
variable_set('og_group_content_type_tft_file', TRUE);
og_ui_node_type_save('tft_file');
}
// Add the OG content access field.
if (module_exists('og_access')) {
og_create_field(OG_CONTENT_ACCESS_FIELD, 'node', 'tft_file');
}
if (db_table_exists('tft_tid_og_nid_d6')) {
// We need to copy all the old settings to our own.
$result = db_select('tft_tid_og_nid_d6', 't')
->fields('t', array())
->execute();
while ($row = $result
->fetchAssoc()) {
db_insert('tft_tid_og_nid')
->fields($row)
->execute();
}
}
}