You are here

function _simplemenu_add_theme in SimpleMenu 7

Same name and namespace in other branches
  1. 6 simplemenu.module \_simplemenu_add_theme()

\brief Add the module theme.

This function adds a theme for the Simplemenu look.

By default, the original theme is used. The module also offers the blackblue theme. It is also possible to create new themes or use the theming of the current theme for simplemenu (so the menu fits perfectly for that theme.)

1 call to _simplemenu_add_theme()
simplemenu_init in ./simplemenu.module
Implements hook_init().

File

./simplemenu.module, line 189
Creates a simplemenu.

Code

function _simplemenu_add_theme() {

  // we want to put the simplemenu theme CSS first
  // so we can change some CSS entries dynamically
  // but at this time the simplemenu.css is used to
  // reset many of the CSS entries... Hmmm...
  $simplemenu_theme = variable_get('simplemenu_theme', 'original');
  if ($simplemenu_theme != 'custom') {
    $simplemenu_path = drupal_get_path('module', 'simplemenu');
    $theme_file = $simplemenu_path . '/themes/' . $simplemenu_theme . '/' . $simplemenu_theme . '.css';
    if (is_file($theme_file)) {
      drupal_add_css($theme_file);
    }
  }
}