Skip to content

Instantly share code, notes, and snippets.

@zachseifts
Created April 20, 2011 14:10
Show Gist options
  • Save zachseifts/931422 to your computer and use it in GitHub Desktop.
Save zachseifts/931422 to your computer and use it in GitHub Desktop.
<?php
/**
* Build the Shadowbox header by adding the necessary CSS and JS files.
*/
function shadowbox_construct_header() {
global $language;
if (shadowbox_active() && variable_get('shadowbox_enabled', TRUE)) {
// Add the base files.
shadowbox_library_add_js('shadowbox.js');
shadowbox_library_add_css('shadowbox.css');
$shadowbox_location = variable_get('shadowbox_location', SHADOWBOX_DEFAULT_PATH);
// Print the JavaScript settings to the page.
drupal_add_js(shadowbox_get_settings(), 'setting');
// Add the automatic image handling.
shadowbox_add_js('shadowbox_auto.js');
// Initialize Shadowbox.
drupal_add_js('
Shadowbox.path = "' . base_path() . $shadowbox_location . '/";
Shadowbox.init(Drupal.settings.shadowbox);
', 'inline', 'footer');
shadowbox_add_css('shadowbox.css');
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment