You are here

function mmenu_add_css in Mobile sliding menu 7

Same name and namespace in other branches
  1. 7.3 mmenu.module \mmenu_add_css()
  2. 7.2 mmenu.module \mmenu_add_css()

Generates the mmenu css list and adds to Drupal.

Parameters

array $mmenu: An associative array of a mmenu.

1 call to mmenu_add_css()
template_preprocess_mmenu in ./mmenu.module
Processes variables for mmenu.tpl.php.

File

./mmenu.module, line 674
Primarily Drupal hooks and global API functions to manipulate mmenus.

Code

function mmenu_add_css($mmenu = array()) {

  // Uses custom css if it is set.
  if (isset($mmenu['custom']['css'])) {
    foreach ($mmenu['custom']['css'] as $css) {
      drupal_add_css($css);
    }
    return;
  }

  // Adds mmenu class styles.
  if (isset($mmenu['options']['classes'])) {
    $mmenu_class = mmenu_class_list($mmenu['options']['classes']);
    if (isset($mmenu_class['css'])) {
      foreach ($mmenu_class['css'] as $css) {
        drupal_add_css($css);
      }
    }
  }

  // Adds mmenu effect styles.
  if (isset($mmenu['options']['effects'])) {
    foreach ($mmenu['options']['effects'] as $k => $v) {
      $mmenu_effect = mmenu_effect_list($k);
      if (isset($mmenu_effect['css'])) {
        foreach ($mmenu_effect['css'] as $css) {
          drupal_add_css($css);
        }
      }
    }
  }
}