You are here

function tabs_load in Javascript Tools 5

Add required js and css files.

1 call to tabs_load()
tabs_menu in tabs/tabs.module
Implementation of hook_menu().

File

tabs/tabs.module, line 171
API for creating tabbed pages.

Code

function tabs_load() {
  static $loaded = FALSE;
  if (!$loaded) {
    $path = drupal_get_path('module', 'tabs');
    jstools_add_js(array(
      $path . '/jquery.tabs.pack.js',
      $path . '/tabs.js',
    ));
    if (variable_get('jstools_history_remote', 0)) {
      drupal_add_js(drupal_get_path('module', 'jstools') . '/jquery.history_remote.pack.js');
    }
    drupal_add_js(array(
      'tabs' => array(
        'slide' => (bool) variable_get('tabs_slide', 0),
        'fade' => (bool) variable_get('tabs_fade', 0),
        'speed' => variable_get('tabs_speed', 'slow'),
        'auto_height' => (bool) variable_get('tabs_auto_height', 0),
        'next_text' => variable_get('tabs_nav_next', t('next')),
        'previous_text' => variable_get('tabs_nav_prev', t('previous')),
      ),
    ), 'setting');
    drupal_add_css($path . '/drupal-tabs.css');
    drupal_add_css($path . '/tabs.css');
    drupal_set_html_head('
      <!-- Additional IE/Win specific style sheet (Conditional Comments) -->
      <!--[if IE]>
      <style type="text/css" media="all">@import "' . base_path() . $path . '/tabs-ie.css";</style>
      <![endif]-->
    ');
    $loaded = TRUE;
  }
}