You are here

function tft_og_rules_create_og_root_folder in Taxonomy File Tree 7.2

Action callback: add a folder for newly created groups.

File

modules/tft_og/tft_og.module, line 236
Hook implementations for TFT OG.

Code

function tft_og_rules_create_og_root_folder($group) {
  $term = (object) array(
    'vid' => variable_get('tft_vocabulary_vid', 0),
    'name' => $group->title . " (node/{$group->nid})",
    'parent' => array(
      0,
    ),
  );
  taxonomy_term_save($term);
  db_insert('tft_tid_og_nid')
    ->fields(array(
    'tid' => $term->tid,
    'og_nid' => $group->nid,
  ))
    ->execute();
}