You are here

function tb_megamenu_configure_form in The Better Mega Menu 7

1 string reference to 'tb_megamenu_configure_form'
tb_megamenu_menu in ./tb_megamenu.module
Implements hook_menu().

File

./tb_megamenu.admin.inc, line 42

Code

function tb_megamenu_configure_form($form, &$form_state, $menu_names = array()) {
  $lib_fontawesome = tb_megamenu_check_library('fontawesome', 'fontawesome');
  if (module_exists('fontawesome') && $lib_fontawesome) {
    tb_megamenu_add_css($lib_fontawesome['css']);
  }
  else {
    drupal_add_css(FONT_AWESOME_44, array(
      'type' => 'external',
    ));
  }
  $lib_chosen = tb_megamenu_check_library('chosen', 'chosen');
  $lib_chosen_existed = module_exists('chosen') && $lib_chosen;
  if ($lib_chosen_existed) {
    if (!empty($lib_chosen['css'])) {
      tb_megamenu_add_css($lib_chosen['css']);
    }
    if (!empty($lib_chosen['js'])) {
      drupal_add_js($lib_chosen['js']);
    }
  }
  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/admin.css');
  tb_megamenu_add_css(drupal_get_path('module', 'tb_megamenu') . '/css/backend.css');
  drupal_add_js('
    (function ($) {
      Drupal.TBMegaMenu = Drupal.TBMegaMenu || {};
      Drupal.TBMegaMenu.ajax_link = "' . (variable_get('clean_url', 0) ? '' : '?q=') . '";
    })(jQuery);
  ', 'inline');
  drupal_add_js(drupal_get_path('module', 'tb_megamenu') . '/js/tb-megamenu-backend.js');
  drupal_add_js(drupal_get_path('module', 'tb_megamenu') . '/js/tb-megamenu-object.js');
  if (!empty($menu_names)) {
    $form['tb_megamenu'] = array(
      '#markup' => theme('tb_megamenu_backend', array(
        'menu_name' => $menu_names[0],
      )),
    );
  }
  return $form;
}