You are here

function tb_megamenu_theme_registry_alter in The Better Mega Menu 7

Implements hook_theme_registry_alter().

File

./tb_megamenu.module, line 324

Code

function tb_megamenu_theme_registry_alter(&$theme_registry) {
  if (isset($theme_registry['tb_megamenu_submenu'])) {
    $submenu_registry = $theme_registry['tb_megamenu_submenu'];
    $cache = array(
      'tb_megamenu_submenu' => $submenu_registry,
    );
    $templates = tb_megamenu_find_hook_templates($cache, drupal_get_path('module', "tb_megamenu") . "/templates/submenu-types");
    foreach ($templates as $hook => $info) {
      if (!isset($theme_registry[$hook])) {
        $new_hook = $submenu_registry;
        $new_hook['path'] = $info['path'];
        $new_hook['template'] = str_replace("_", "-", $hook);
        $theme_registry[$hook] = $new_hook;
      }
    }
  }
}