You are here

function _taxonomy_action_parse_terms in Views Bulk Operations (VBO) 6.3

Same name and namespace in other branches
  1. 6 actions/taxonomy.action.inc \_taxonomy_action_parse_terms()

Take a multi-dimensional array of vocabularies -> selected terms and return an array of only the terms selected

2 calls to _taxonomy_action_parse_terms()
views_bulk_operations_taxonomy_action_submit in ./taxonomy.action.inc
views_bulk_operations_taxonomy_action_validate in ./taxonomy.action.inc

File

./taxonomy.action.inc, line 156

Code

function _taxonomy_action_parse_terms($taxonomy) {
  $ret = array();
  while (list($key, $vocab) = each($taxonomy)) {
    if ($key == 'tags') {
      $ret['tags'] = $vocab;
    }
    else {
      if (!is_array($vocab)) {
        if (!empty($vocab)) {
          $ret[] = $vocab;
        }
      }
      else {
        while (list(, $tid) = each($vocab)) {
          if (!empty($tid)) {
            $ret[] = $tid;
          }
        }
      }
    }
  }
  return $ret;
}