You are here

function media_browser_plus_taxonomy_term_insert in Media Browser Plus 7.2

Same name and namespace in other branches
  1. 7.3 media_browser_plus.module \media_browser_plus_taxonomy_term_insert()

Implements hook_taxonomy_term_insert().

File

./media_browser_plus.module, line 2129
Adds fields to the media browser forms for better UX

Code

function media_browser_plus_taxonomy_term_insert($term) {
  if ($term->vocabulary_machine_name == 'media_folders') {
    $dir = media_browser_plus_construct_dir_path($term);
    if (file_prepare_directory($dir, FILE_CREATE_DIRECTORY)) {
      drupal_set_message(t('Folder %term_name created successfully', array(
        '%term_name' => $term->name,
      )));
    }
    else {
      drupal_set_message(t('Folder %term_name created successfully as term but failed to create as physical folder.Please do it manually', array(
        '%term_name' => $term->name,
      )), 'warning');
    }
  }
}