You are here

function tb_megamenu_block_view in The Better Mega Menu 7

File

./tb_megamenu.module, line 278

Code

function tb_megamenu_block_view($delta = 0) {
  static $added_js_css = false;
  if (!$added_js_css) {
    $added_js_css = true;
    if (module_exists('fontawesome') && file_exists(libraries_get_path('fontawesome') . '/css/font-awesome.css')) {
      tb_megamenu_add_css(libraries_get_path('fontawesome') . '/css/font-awesome.css');
    }
    else {
      drupal_add_css(FONT_AWESOME_44, array(
        'type' => 'external',
      ));
    }
    tb_megamenu_add_css(drupal_get_path('module', 'tb_megamenu') . '/css/bootstrap.css');
    tb_megamenu_add_css(drupal_get_path('module', 'tb_megamenu') . '/css/base.css');
    tb_megamenu_add_css(drupal_get_path('module', 'tb_megamenu') . '/css/default.css');
    tb_megamenu_add_css(drupal_get_path('module', 'tb_megamenu') . '/css/compatibility.css');
    drupal_add_js(drupal_get_path('module', 'tb_megamenu') . '/js/tb-megamenu-frontend.js');
    drupal_add_js(drupal_get_path('module', 'tb_megamenu') . '/js/tb-megamenu-touch.js');
  }
  return array(
    'content' => array(
      '#type' => 'markup',
      '#markup' => theme('tb_megamenu', array(
        'menu_name' => $delta,
      )),
    ),
  );
}