'radios', '#title' => t('Select the vocabulary to list'), '#default_value' => variable_get('dynamic_taxonomy_vid', 1), '#options' => dynamic_taxonomy_get_vocabularies(), ); return $form; case 'save': variable_set('dynamic_taxonomy_vid', (int) $edit['dynamic_taxonomy_vid']); break; case 'view': $vid = variable_get('dynamic_taxonomy_vid', 1); $tree = dynamic_taxonomy_get_terms($vid); $block['content'] = theme('item_list', $tree); return $block; } } /** * Get all vocabularies; */ function dynamic_taxonomy_get_vocabularies() { $result = db_query('SELECT vid, name from {vocabulary}'); while ($item = db_fetch_object($result)) { $items[$item->vid] = $item->name; } return $items; } function dynamic_taxonomy_get_terms($vid = null) { if ($vid != null) { $tree = taxonomy_get_tree($vid); foreach ($tree as $term) { $items[$term->tid] = $term->name; } return $items; } return null; }