Skip to content

Commit

Permalink
#22. Add taxonomy_get_tree().
Browse files Browse the repository at this point in the history
  • Loading branch information
signalpoint committed Jul 27, 2015
1 parent 1ac1e51 commit d433f16
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/services/services.taxonomy_vocabulary.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,26 @@ function taxonomy_vocabulary_index(query, options) {
catch (error) { console.log('taxonomy_vocabulary_index - ' + error); }
}

/**
* @see https://api.drupal.org/api/drupal/modules!taxonomy!taxonomy.module/function/taxonomy_get_tree/7
*/
function taxonomy_get_tree(vid, parent, max_depth, load_entities, options) {
try {
var parent = arguments[1] ? arguments[1] : 0;
var max_depth = arguments[2] ? arguments[2] : null;
var load_entities = arguments[3] ? arguments[3] : false;
options.method = 'POST';
options.path = 'taxonomy_vocabulary/getTree.json';
options.service = 'taxonomy_vocabulary';
options.resource = 'get_tree';
options.data = JSON.stringify({
vid: vid,
parent: parent,
max_depth: max_depth,
load_entities: load_entities
});
Drupal.services.call(options);
}
catch (error) { console.log('taxonomy_get_tree - ' + error); }
}

0 comments on commit d433f16

Please sign in to comment.