You are here

function taxonomy_manager_tree_build_siblings_form in Taxonomy Manager 6

Same name and namespace in other branches
  1. 5 taxonomy_manager.module \taxonomy_manager_tree_build_siblings_form()
  2. 6.2 taxonomy_manager.module \taxonomy_manager_tree_build_siblings_form()
  3. 7 taxonomy_manager.module \taxonomy_manager_tree_build_siblings_form()

callback for generating and rendering next siblings terms form (AHAH)

Parameters

$tree_id:

$page current page:

$prev_tid last sibling, that appears:

$parent if in hierarchies, parent id:

1 string reference to 'taxonomy_manager_tree_build_siblings_form'
taxonomy_manager_menu in ./taxonomy_manager.module
Implementation of hook_menu

File

./taxonomy_manager.module, line 693
Taxonomy Manager

Code

function taxonomy_manager_tree_build_siblings_form($tree_id, $page, $prev_tid, $parent = 0) {
  $GLOBALS['devel_shutdown'] = FALSE;

  //prevent devel queries footprint
  $form_state = array(
    'submitted' => FALSE,
  );
  $vid = db_result(db_query("SELECT vid FROM {term_data} WHERE tid = %d", $prev_tid));
  $siblings_form = array(
    '#type' => 'taxonomy_manager_tree',
    '#vid' => $vid,
    '#parent' => $parent,
    '#pager' => TRUE,
    '#siblings_page' => $page + 1,
  );
  $opertions_callback = str_replace('-', '_', $tree_id) . '_operations';
  if (function_exists($opertions_callback)) {
    $siblings_form['#operations_callback'] = $opertions_callback;
  }
  $link_callback = str_replace('-', '_', $tree_id) . '_link';
  if (function_exists($link_callback)) {
    $siblings_form['#link_callback'] = $link_callback;
  }
  _taxonomy_manager_tree_sub_forms_set_parents($tree_id, $parent, $siblings_form);
  $siblings_form = form_builder('taxonomy_manager_form', $siblings_form, $form_state);
  $output = drupal_render($siblings_form);

  //cutting of <ul> and ending </ul> ... can this be done cleaner?
  $output = drupal_substr($output, 4, -5);
  print $output;
  exit;
}