diff options
author | Silvio <s1lv10@uol.com.br> | 2009-10-07 12:20:40 -0300 |
---|---|---|
committer | Silvio <s1lv10@uol.com.br> | 2009-10-07 12:20:40 -0300 |
commit | 403b0e39d2b4d783bef743f9dda37ac9e93db1e9 (patch) | |
tree | 29eadb478efa321dd3de081346dacd00a9bc04c5 | |
parent | b3802a79cecb13794934562e70c3940e4aa07707 (diff) | |
download | finder_menu-403b0e39d2b4d783bef743f9dda37ac9e93db1e9.tar.gz finder_menu-403b0e39d2b4d783bef743f9dda37ac9e93db1e9.tar.bz2 |
Using theme functions to add css and js
-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'); +} |