You are here

function taxonomy_patterns_export_all_vocs in Patterns 7.2

Same name and namespace in other branches
  1. 7 patterns_components/components/taxonomy.inc \taxonomy_patterns_export_all_vocs()
1 string reference to 'taxonomy_patterns_export_all_vocs'
taxonomy_patterns in patterns_components/components/taxonomy.inc

File

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

Code

function taxonomy_patterns_export_all_vocs($args = NULL, &$result = NULL) {
  $action_type = PATTERNS_MODIFY;

  // pre-init
  if (isset($args['type'])) {
    if ($args['type'] == PATTERNS_CREATE) {
      $action_type = PATTERNS_CREATE;
    }

    // other action types
  }
  $info = taxonomy_patterns();
  $form_id = current($info['vocabulary'][PATTERNS_MODIFY]);
  $vocs = taxonomy_get_vocabularies();
  $result = array();
  foreach ($vocs as $voc) {

    // It is important to user array merge. Pushing is not enough
    $result = array_merge($result, patterns_export_actions_from_form($form_id, $voc, 'vocabulary', $action_type));
  }
  return $result;
}