You are here

function colorbox_get_js in Colorbox 6

Same name and namespace in other branches
  1. 7 colorbox.module \colorbox_get_js()

Return the JS filename for Colorbox plugin.

Return value

Boolean indicating if the JS is located.

2 calls to colorbox_get_js()
colorbox_get_version in ./colorbox.module
Return the version of Colorbox plugin that is installed.
_colorbox_doheader in ./colorbox.module
Loads the various js and css files.

File

./colorbox.module, line 310
A light-weight, customizable lightbox plugin for jQuery 1.3

Code

function colorbox_get_js() {
  $library_path = colorbox_get_path();
  if (file_exists($library_path . '/colorbox/jquery.colorbox.js') && file_exists($library_path . '/colorbox/jquery.colorbox-min.js')) {
    $colorbox_js_map = array(
      'none' => 'jquery.colorbox.js',
      'min' => 'jquery.colorbox-min.js',
    );
    $colorbox_js = $colorbox_js_map[variable_get('colorbox_compression_type', 'min')];
    return $library_path . '/colorbox/' . $colorbox_js;
  }

  //   else {
  //     drupal_set_message(t('You need to download the !colorbox and extract the entire contents of the archive into the %path folder of your server.', array('!colorbox' => l(t('Colorbox plugin'), 'http://colorpowered.com/colorbox/'), '%path' => $library_path)), 'error', FALSE);
  //     return FALSE;
  //   }
}