You are here

function mmenu_theme_list in Mobile sliding menu 8

Same name and namespace in other branches
  1. 7.2 mmenu.module \mmenu_theme_list()

Gets a list of available mmenu themes.

Parameters

string $theme_name: A class name if you just want to get a particular mmenu theme. Leaves empty if you want to get all available mmenu themes.

Return value

array Particular mmenu theme if the 'theme_name' is given. All available mmenu themes otherwise.

1 call to mmenu_theme_list()
mmenu_add_libraries in ./mmenu.module
Generates the mmenu css list and adds to Drupal.

File

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

Code

function mmenu_theme_list($theme_name = '') {

  // Get mmenu themes from hook.
  $themes = Drupal::moduleHandler()
    ->invokeAll('mmenu_theme');

  // Invoke hook_mmenu_theme_alter().
  // To allow all modules to alter the mmenu themes.
  Drupal::moduleHandler()
    ->alter('mmenu_theme', $themes);
  if (!empty($theme_name)) {
    if (isset($themes[$theme_name])) {
      return $themes[$theme_name];
    }
    else {
      return array();
    }
  }
  return $themes;
}