You are here

function taxonomy_manager_tree_operations in Taxonomy Manager 6

Same name and namespace in other branches
  1. 5 taxonomy_manager.module \taxonomy_manager_tree_operations()

function gets called by the taxonomy_manager_tree form type (form_id +_operations) return an form array with values to show next to every term value

File

./taxonomy_manager.module, line 160
Taxonomy Manager

Code

function taxonomy_manager_tree_operations($term) {
  $form = array();
  if (!variable_get('taxonomy_manager_disable_mouseover', 0)) {
    $module_path = drupal_get_path('module', 'taxonomy_manager') . '/';
    $form['up'] = array(
      '#value' => theme("image", $module_path . "images/go-up-small.png", "go up", NULL, array(
        'class' => 'term-up',
      )),
    );
    $form['down'] = array(
      '#value' => theme("image", $module_path . "images/go-down-small.png", "go down", NULL, array(
        'class' => 'term-down',
      )),
    );
    $link_img = theme("image", $module_path . "images/link-small.png", "link to term page");
    $link = l(' ' . $link_img, taxonomy_term_path($term), array(
      'attributes' => array(
        'rel' => 'tag',
        'title' => strip_tags($term->description),
        'target' => '_blank',
      ),
      'html' => TRUE,
    ));
    $form['link'] = array(
      '#value' => $link,
      '#weight' => 10,
    );
  }
  return $form;
}