From 7dba2312a71b38d6bfce8397764086d47425ab62 Mon Sep 17 00:00:00 2001 From: Silvio Date: Mon, 28 Sep 2009 23:57:23 -0300 Subject: Starting to change module to 'Finder Menu' --- dynamic_taxonomy.info | 5 ----- dynamic_taxonomy.module | 55 ------------------------------------------------- finder_menu.info | 5 +++++ finder_menu.module | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 60 deletions(-) delete mode 100644 dynamic_taxonomy.info delete mode 100644 dynamic_taxonomy.module create mode 100644 finder_menu.info create mode 100644 finder_menu.module diff --git a/dynamic_taxonomy.info b/dynamic_taxonomy.info deleted file mode 100644 index 3627dbd..0000000 --- a/dynamic_taxonomy.info +++ /dev/null @@ -1,5 +0,0 @@ -; $Id$ -name = Dynamic Taxonomy -description = Show taxonomy items in a dynamic select list. -core = 6.x -dependencies[] = taxonomy diff --git a/dynamic_taxonomy.module b/dynamic_taxonomy.module deleted file mode 100644 index a78d33f..0000000 --- a/dynamic_taxonomy.module +++ /dev/null @@ -1,55 +0,0 @@ - '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; -} diff --git a/finder_menu.info b/finder_menu.info new file mode 100644 index 0000000..25244e2 --- /dev/null +++ b/finder_menu.info @@ -0,0 +1,5 @@ +; $Id$ +name = Finder Menu. +description = Show menu with Finder style. +core = 6.x +dependencies[] = diff --git a/finder_menu.module b/finder_menu.module new file mode 100644 index 0000000..9eb17b6 --- /dev/null +++ b/finder_menu.module @@ -0,0 +1,55 @@ + 'radios', + '#title' => t('Select the vocabulary to list'), + '#default_value' => variable_get('finder_taxonomy_vid', 1), + '#options' => finder_taxonomy_get_vocabularies(), + ); + return $form; + + case 'save': + variable_set('finder_taxonomy_vid', (int) $edit['finder_taxonomy_vid']); + break; + + case 'view': + $vid = variable_get('finder_taxonomy_vid', 1); + $tree = finder_taxonomy_get_terms($vid); + $block['content'] = theme('item_list', $tree); + return $block; + } +} + +/** + * Get all vocabularies; + */ +function finder_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 finder_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; +} -- cgit v1.2.3