You are here

function media_browser_plus_taxonomy_term_presave 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_presave()

Implements hook_taxonomy_term_presave().

See also

media_browser_plus_taxonomy_term_update()

File

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

Code

function media_browser_plus_taxonomy_term_presave($term) {

  // Figure out if this is a folder term and if so store the current file path
  // for further processing in media_browser_plus_taxonomy_term_update().
  $vocabulary = taxonomy_vocabulary_machine_name_load('media_folders');
  if (!empty($term->tid) && !empty($vocabulary) && $term->vid == $vocabulary->vid) {
    $term->media_browser_plus_original_path = media_browser_plus_construct_dir_path($term);
  }
}