All pastes #296933 Raw Edit

Untitled

public text v1 · immutable
#296933 ·published 2006-12-30 18:50 UTC
rendered paste body
<?php
// module name: Taxo Drill Down

// v0.0.1 by morphir


// Implementation of hook_menu;

function taxo_drill_down_menu($may_cache) {

  if ($may_cache) {
    $items = array();
    $items[] = array(
      'path' => 'taxonomy/drilldown',
      'title' => t('Taxo Drilldown '),
      'callback' => 'taxo_drill_down', 
      'access' => TRUE,
      'type' => MENU_CALLBACK
    ); 

    return $items;
  } 
  else {
    drupal_add_js(drupal_get_path('module','taxo_drill_down') .'/taxo_drill_down.js');
  }
}

$vocabularies = variable_get('taxo_drill_down_vocabularies', array());

$terms = taxonomy_get_children($tid,$vid);

foreach($terms as $term) {
$form[] = array($term->tid,$term->name);
}

$form['Taxonomy'] = array(
'#type' => 'select',
'#multiple' => TRUE,
'#size' => 10,
'#title' => t('Categories'),
'#tree' => TRUE,
);

// To style the form title: 
// #prefix => div class="foo" 
// .foo label { ... }  
// this would wrap the entire form-item class div
// and hence the label    


$form['submit'] = array(
'#type' => 'submit',
'#value' => t('GO!'),
);

return drupal_get_form('taxo_drill_down_page', $form);