function _emfield_swfobject_api_ensure_swfobject in Embedded Media Field 6.3
Same name and namespace in other branches
- 6 includes/themes/emfield.themes.inc \_emfield_swfobject_api_ensure_swfobject()
- 6.2 includes/themes/emfield.themes.inc \_emfield_swfobject_api_ensure_swfobject()
Ensure that the necessary JS files are loaded.
This function automatically checks to make sure that the JS files are only loaded once.
Parameters
array $settings:
1 call to _emfield_swfobject_api_ensure_swfobject()
- theme_emfield_swfobject in deprecated/
emfield-deprecated.themes.inc - Theme function to add a flash file to the page.
File
- deprecated/
emfield-deprecated.themes.inc, line 101 - Basic theme functions for Embedded Media Field.
Code
function _emfield_swfobject_api_ensure_swfobject($settings = array()) {
static $done = FALSE;
if (!$done) {
// Load the swfobject library and our add-on to activate it.
drupal_add_js(variable_get('emfield_swfobject_location', ''), 'module', 'header');
// Load the JS which creates loads the params into the page
drupal_add_js(drupal_get_path('module', 'emfield') . '/includes/js/swfobject_api.js', 'module', 'footer');
$done = TRUE;
}
drupal_add_js($settings, 'setting', 'footer', FALSE, TRUE, FALSE);
}