function ocupload_preprocess_html in One Click Upload 7.2
Same name and namespace in other branches
- 7 ocupload.module \ocupload_preprocess_html()
Implements hook_preprocess_html().
File
- ./
ocupload.module, line 138
Code
function ocupload_preprocess_html(&$vars) {
$scripts = drupal_add_js();
$item = menu_get_item();
$module_path = _ocupload_get_path();
$add_library = FALSE;
// Check BUEditor
if (module_exists('bueditor') && (isset($scripts[drupal_get_path('module', 'bueditor') . '/bueditor.js']) || $item['path'] == 'admin/config/content/bueditor/%')) {
drupal_add_js($module_path . '/js/bueditor.js', array(
'weight' => 100,
));
$add_library = TRUE;
}
// Ckeck CKEditor
if (module_exists('ckeditor') && isset($scripts[ckeditor_path('url') . '/ckeditor.js'])) {
$add_library = TRUE;
}
// Check Wysiwyg with CKEditor
if (module_exists('wysiwyg')) {
foreach ($scripts['settings']['data'] as $data) {
if (isset($data['wysiwyg']['configs']['ckeditor'])) {
$add_library = TRUE;
break;
}
}
}
if ($add_library && _ocupload_get_allowed_ext()) {
drupal_add_library('ocupload', 'ocupload');
}
}