termstatus_test.module in Taxonomy Term Status 7
Taxonomy term status test stub module.
File
tests/termstatus_test.moduleView source
<?php
/**
* @file
* Taxonomy term status test stub module.
*/
/**
* Implements hook_menu().
*/
function termstatus_test_menu() {
$items['termstatus-test-term-list/%termstatus_test_vocabulary'] = array(
'title' => 'Taxonomy Term Status Test Term List',
'access callback' => TRUE,
'page callback' => 'termstatus_test_term_list',
'page arguments' => array(
1,
),
);
return $items;
}
/**
* Return the vocabulary object.
*/
function termstatus_test_vocabulary_load($vid) {
return taxonomy_vocabulary_load($vid);
}
/**
* Page callback: List terms of a given vocabulary.
*/
function termstatus_test_term_list($vocabulary = NULL) {
$vid = isset($vocabulary->vid) ? $vocabulary->vid : NULL;
$terms = taxonomy_get_tree($vid);
$items = array();
foreach ($terms as $term) {
$items[] = l($term->name, 'taxonomy/term/' . $term->tid);
}
return theme('item_list', array(
'items' => $items,
));
}
Functions
Name | Description |
---|---|
termstatus_test_menu | Implements hook_menu(). |
termstatus_test_term_list | Page callback: List terms of a given vocabulary. |
termstatus_test_vocabulary_load | Return the vocabulary object. |