tft_og.install in Taxonomy File Tree 7.2
Module install logic.
File
modules/tft_og/tft_og.installView source
<?php
/**
* @file
* Module install logic.
*/
/**
* Implements hook_install().
*/
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();
}
}
}
/**
* Implements hook_schema().
*/
function tft_og_schema() {
return array(
'tft_tid_og_nid' => array(
'description' => 'Relationship between a term and an og',
'fields' => array(
'tid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'og_nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
),
),
);
}
Functions
Name![]() |
Description |
---|---|
tft_og_install | Implements hook_install(). |
tft_og_schema | Implements hook_schema(). |