You are here

function tft_rules_create_og_root_folder in Taxonomy File Tree 7

File

./tft.module, line 440
Module hooks.

Code

function tft_rules_create_og_root_folder($group) {
  $term = (object) array(
    'vid' => variable_get('tft_vocabulary_vid', 0),
    'name' => $group->title,
  );
  taxonomy_term_save($term);
  db_insert('tft_tid_og_nid')
    ->fields(array(
    'tid' => $term->tid,
    'og_nid' => $group->nid,
  ))
    ->execute();
  module_load_include('inc', 'tft', 'tft.admin');

  // Add an "Archive" folder
  $form_state = array();
  $form_state['values']['name'] = "Archives";
  $form_state['values']['parent'] = $term->tid;
  tft_add_term_form_submit(array(), $form_state);
}