function wysiwyg_load_includes in Wysiwyg 7.2
Same name and namespace in other branches
- 5.2 wysiwyg.module \wysiwyg_load_includes()
- 5 wysiwyg.module \wysiwyg_load_includes()
- 6.2 wysiwyg.module \wysiwyg_load_includes()
- 6 wysiwyg.module \wysiwyg_load_includes()
Load include files for wysiwyg implemented by all modules.
Parameters
$type: The type of includes to search for, can be 'editors'.
$hook: The hook name to invoke.
$file: An optional include file name without .inc extension to limit the search to.
See also
wysiwyg_get_directories(), _wysiwyg_process_include()
Related topics
2 calls to wysiwyg_load_includes()
- wysiwyg_get_all_editors in ./
wysiwyg.module - Compile a list holding all supported editors including installed editor version information.
- wysiwyg_get_all_plugins in ./
wysiwyg.module - Invoke hook_wysiwyg_plugin() in all modules.
File
- ./
wysiwyg.module, line 1218
Code
function wysiwyg_load_includes($type = 'editors', $hook = 'editor', $file = NULL) {
// Determine implementations.
$directories = wysiwyg_get_directories($type);
$directories['wysiwyg'] = drupal_get_path('module', 'wysiwyg') . '/' . $type;
$file_list = array();
foreach ($directories as $module => $path) {
$file_list[$module] = drupal_system_listing("/{$file}.inc\$/", $path, 'name', 0);
}
// Load implementations.
$info = array();
foreach (array_filter($file_list) as $module => $files) {
foreach ($files as $file) {
include_once './' . $file->uri;
$result = _wysiwyg_process_include($module, $module . '_' . $file->name, dirname($file->uri), $hook);
if (is_array($result)) {
$info = array_merge($info, $result);
}
}
}
drupal_alter('wysiwyg_load_includes', $info, $hook);
return $info;
}