function elfinder_wysiwyg_plugin in elFinder file manager 7
Same name and namespace in other branches
- 8.2 elfinder.module \elfinder_wysiwyg_plugin()
- 6.2 elfinder.module \elfinder_wysiwyg_plugin()
- 6 elfinder.module \elfinder_wysiwyg_plugin()
- 7.3 elfinder.module \elfinder_wysiwyg_plugin()
- 7.2 elfinder.module \elfinder_wysiwyg_plugin()
Implements hook_wysiwyg_plugin().
File
- ./
elfinder.module, line 467
Code
function elfinder_wysiwyg_plugin($editor, $version) {
$path = drupal_get_path('module', 'elfinder');
drupal_add_js($path . '/js/helper.js');
$language_default = variable_get('language_default', 'en');
$options = array(
'elfinder_url' => url('elfinder', array(
'query' => array(
'app' => $editor,
),
'language' => language_default(),
)),
'homepage_url' => elfinder_homepage_url(),
'path' => $path,
);
/* bueditor hack */
if (preg_match('/^(bueditor|bue)/', $editor)) {
$editor = 'bueditor';
}
$editor_plugins = elfinder_system_listing("^{$editor}\\.inc\$", $path . '/editors', NULL, NULL);
/* loading editor plugin */
$plugin_file = key($editor_plugins);
if ($plugin_file != '') {
$options['plugin_url_base'] = "{$path}/editors/{$editor}";
require_once $plugin_file;
}
/* hook for adding another editor support */
//module_invoke_all('elfinder_editor_plugin');
/* wysiwyg plugin generation func for selected editor */
$pluginfunc = 'elfinder_' . $editor . '_elfinder_editor_plugin';
/* returning elFinder wysiwyg editor plugin for selected editor */
if (function_exists($pluginfunc)) {
return call_user_func_array($pluginfunc, array(
$options,
));
}
}