aboutsummaryrefslogtreecommitdiff
path: root/finder_menu.module
diff options
context:
space:
mode:
authorSilvio <s1lv10@uol.com.br>2009-09-29 16:49:36 -0300
committerSilvio <s1lv10@uol.com.br>2009-09-29 16:49:36 -0300
commit1ca668c4937be08c43bd0ab2d9270c5c4ac68130 (patch)
treee9a9e383d237e6e17b469936510e08a1a2155c14 /finder_menu.module
parentf694b9c31d070a2abecb34e7124ec5a4d6aacfb1 (diff)
downloadfinder_menu-1ca668c4937be08c43bd0ab2d9270c5c4ac68130.tar.gz
finder_menu-1ca668c4937be08c43bd0ab2d9270c5c4ac68130.tar.bz2
Initial working version
Diffstat (limited to 'finder_menu.module')
-rw-r--r--finder_menu.module36
1 files changed, 26 insertions, 10 deletions
diff --git a/finder_menu.module b/finder_menu.module
index 02b1edb..91a749d 100644
--- a/finder_menu.module
+++ b/finder_menu.module
@@ -2,6 +2,14 @@
// $Id$
/**
+ * Implementation of hook_init().
+ * Adds CSS, Javascript and settings to the page.
+ */
+function finder_menu_init() {
+ drupal_add_css(drupal_get_path('module', 'finder_menu') .'/finder_menu.css');
+}
+
+/**
* Implementation of hook_block();
*/
function finder_menu_block($op = 'list', $delta = 0, $edit = array()) {
@@ -102,9 +110,9 @@ function theme_finder_menu($menu_name, $mlid) {
// Build the menus
- $output = '<ul style="display:inline" class="finder-menu-menu">';
- $output = finder_menu_build($menu);
- $output .= '</ul>';
+ $output = '<div id="finderparent">';
+ $output .= finder_menu_build($menu, TRUE);
+ $output .= '</div>';
drupal_add_js(drupal_get_path('module', 'finder_menu') .'/finder_menu.js');
return $output;
@@ -115,17 +123,25 @@ function theme_finder_menu($menu_name, $mlid) {
*
* @ingroup themeable
*/
-function finder_menu_build($menu) {
+function finder_menu_build($menu, $first = FALSE) {
- $output = '<ul>';
+ if ($first === TRUE) {
+ $output = '<ul id="finder">';
+ } else {
+ $output = '<ul>';
+ }
foreach($menu as $menu_item) {
- $output .= '<li>';
- $output .= $menu_item['link']['title'];
- if ($menu_item['below'] !== FALSE) {
- $output .= finder_menu_build($menu_item['below']);
+ if ($menu_item['link']['hidden'] == 0) {
+ $output .= '<li>';
+ if ($menu_item['below'] !== FALSE) {
+ $output .= $menu_item['link']['title'];
+ $output .= finder_menu_build($menu_item['below']);
+ } else {
+ $output .= theme('menu_item_link', $menu_item['link']);
+ }
+ $output .= '</li>';
}
- $output .= '</li>';
}
$output .= '</ul>';