You are here

function _taxonomy_menu_insert_link_items_process in Taxonomy menu 7

Same name and namespace in other branches
  1. 6.2 taxonomy_menu.batch.inc \_taxonomy_menu_insert_link_items_process()

Batch operation callback function: inserts 10 menu link items.

Parameters

array $terms: Taxonomy terms as from taxonomy_get_tree().

string $menu_name: Setting for the menu item name assigned to the vocabulary.

array $context: Batch context array.

See also

_taxonomy_menu_insert_link_items_batch().

1 string reference to '_taxonomy_menu_insert_link_items_process'
_taxonomy_menu_insert_link_items_batch in ./taxonomy_menu.batch.inc
Starts a batch operation.

File

./taxonomy_menu.batch.inc, line 56
Batch API Code

Code

function _taxonomy_menu_insert_link_items_process($terms, $menu_name, &$context) {
  _taxonomy_menu_batch_init_context($context, $start, $end, 10);

  // Loop through $terms to process each term.
  for ($i = $start; $i < count($terms) && $i < $end; $i++) {
    $args = array(
      'term' => $terms[$i],
      'menu_name' => $menu_name,
    );
    $mlid = taxonomy_menu_handler('insert', $args);
  }
  _taxonomy_menu_batch_update_context($context, $end, count($terms), 'Creating Menu Items');
}