function bueditor_add_library in BUEditor 7
Same name and namespace in other branches
- 6.2 bueditor.inc \bueditor_add_library()
Include js and css files from library.
1 call to bueditor_add_library()
- _bueditor_settle in ./
bueditor.inc - Include necessary js and css files for editor settlement.
File
- ./
bueditor.inc, line 159 - Implements commonly used functions for bueditor.
Code
function bueditor_add_library($library) {
$internal = array(
'weight' => JS_THEME,
);
$external = array(
'type' => 'external',
'scope' => 'footer',
);
foreach (bueditor_get_library($library) as $key => $file) {
$options = strpos($file, '://') ? $external : $internal;
$ext = substr($file, -4);
if ($ext == '.css') {
drupal_add_css($file, $options);
}
elseif (substr($ext, 1) == '.js') {
drupal_add_js($file, $options);
}
}
}