You are here

function _thickbox_doheader in Thickbox 5

Same name and namespace in other branches
  1. 6 thickbox.module \_thickbox_doheader()

Loads the various js and css files.

1 call to _thickbox_doheader()
thickbox_menu in ./thickbox.module
Implementation of hook_menu().

File

./thickbox.module, line 135
Author: Fredrik Jonsson fredrik at combonet dot se The thickbox module is a simple wrapper for the jquery plugin ThickBox http://jquery.com/demo/thickbox/.

Code

function _thickbox_doheader() {
  global $user;
  $path = drupal_get_path('module', 'thickbox');
  drupal_add_css($path . '/thickbox.css');

  // Insert translated strings as javascript settings.
  $tb_msg = array(
    'close' => t('Close'),
    'next' => t('Next >'),
    'prev' => t('< Prev'),
    'esc_key' => t('or Esc Key'),
    'next_close' => t('Next / Close on last'),
    'image_count' => t('Image !current of !total'),
  );
  drupal_add_js(array(
    'thickbox' => $tb_msg,
  ), 'setting');
  if ($user->uid == 0 && variable_get('thickbox_login', 0)) {
    drupal_add_js($path . '/thickbox_login.js');
  }
  if (variable_get('thickbox_auto', 0) && module_exists('image')) {
    drupal_add_js(array(
      'thickbox' => array(
        'derivative' => variable_get('thickbox_derivative', 'preview'),
      ),
    ), 'setting');
    drupal_add_js($path . '/thickbox_auto.js');
  }
  drupal_add_js($path . '/thickbox.js');
}