diff options
-rw-r--r-- | finder_menu.module | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/finder_menu.module b/finder_menu.module index 793e983..340d300 100644 --- a/finder_menu.module +++ b/finder_menu.module @@ -20,7 +20,8 @@ function finder_menu_uninstall() { * Implementation of hook_init(); */ function finder_menu_init() { - drupal_add_css(drupal_get_path('module', 'finder_menu') .'/finder_menu.css'); + theme('finder_menu_css'); + theme('finder_menu_javascript'); } /** @@ -64,6 +65,12 @@ function finder_menu_theme() { 'parent' => NULL, ), ), + 'finder_menu_javascript' => array( + 'arguments' => array(), + ), + 'finder_menu_css' => array( + 'arguments' => array(), + ), ); } @@ -127,7 +134,6 @@ function theme_finder_menu($menu_name, $mlid) { $output = '<div id="finderparent">'; $output .= finder_menu_build($menu); $output .= '</div>'; - drupal_add_js(drupal_get_path('module', 'finder_menu') .'/finder_menu.js'); return $output; } @@ -187,3 +193,21 @@ function finder_menu_has_unhidden_submenu($menu = FALSE) { return FALSE; } + +/** + * Finder Menu Javascript theme function. + * + * @ingroup themeable + */ +function theme_finder_menu_javascript() { + drupal_add_js(drupal_get_path('module', 'finder_menu') .'/finder_menu.js'); +} + +/** + * Finder Menu CSS theme function. + * + * @ingroup themeable + */ +function theme_finder_menu_css() { + drupal_add_css(drupal_get_path('module', 'finder_menu') .'/finder_menu.css'); +} |