You are here

function _taxonomy_patterns_prepare_vocabulary_delete in Patterns 7

Same name and namespace in other branches
  1. 7.2 patterns_components/components/taxonomy.inc \_taxonomy_patterns_prepare_vocabulary_delete()
1 call to _taxonomy_patterns_prepare_vocabulary_delete()
taxonomy_patterns_prepare in patterns_components/components/taxonomy.inc

File

patterns_components/components/taxonomy.inc, line 439
Patterns component for taxonomy vocabularies and terms.

Code

function _taxonomy_patterns_prepare_vocabulary_delete($action, $data) {

  // Firt use the vid, if we have it
  if (isset($data['vid'])) {
    $taxo = taxonomy_vocabulary_load($data['vid']);
  }
  elseif (isset($data['machine_name'])) {
    $taxo = taxonomy_vocabulary_machine_name_load($data['machine_name']);
  }
  if (!empty($taxo)) {
    $data['vid'] = $taxo->vid;
    $data['name'] = $taxo->machine_name;
    $data['type'] = 'vocabulary';
    $data['confirm'] = 1;
    $data['op'] = 'Delete';
  }
  return $data;
}