You are here

function mmenu_add_css in Mobile sliding menu 7.3

Same name and namespace in other branches
  1. 7 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 1026
Primarily Drupal hooks and global API functions to manipulate mmenus.

Code

function mmenu_add_css(array $mmenu) {

  // Uses custom css if it is set.
  if (isset($mmenu['custom']['css'])) {
    foreach ($mmenu['custom']['css'] as $css) {
      drupal_add_css($css, array(
        'group' => CSS_DEFAULT,
        'weight' => 100,
      ));
    }
    return;
  }
  $extensions = mmenu_extension_list();
  foreach ($extensions as $extension) {
    foreach ($extension['options'] as $option) {
      if (in_array($option['name'], $mmenu['options']['extensions']) && isset($option['css'])) {
        foreach ($option['css'] as $css) {
          drupal_add_css($css, array(
            'group' => CSS_DEFAULT,
            'weight' => 100,
          ));
        }
      }
    }
  }
}