Hi all,
apologies if I've put this in the wrong place, but I thought it might be useful for someone.
I've previously used TinyMCE along with the Gallery module, using the G2Image filter. When I switched to WYSIWYG it took me a while to make this work, but I think I've finally managed it.
This is what I did :
wysiwyg/editors/tinymce.inc - added the following lines into the wysiwyg_tinymce_plugins function:
'g2image' => array(
'path' => $editor['library path'] .'/plugins/g2image',
'buttons' => array('g2image' => t('g2image')),
'internal' => TRUE,
'load' => TRUE,
),
This will let the profile editor show the correct button but on its own it doesn't show the button in the tinymce toolbar.
I also needed to amend code in the gallery module - I'll submit this to them, but I've included it so there's a complete solution here.
gallery/gallery_g2image/gallery_g2image_settings.inc:
in the function _gallery_g2image_settings_validate, change the switch instance for 'tinymce' to:
case 'tinymce':
$mode = t('TinyMCE');
if (module_exists('tinymce')) {
$path = drupal_get_path('module', 'tinymce');
} else if (module_exists('wysiwyg')) {
$path = drupal_get_path('module', 'wysiwyg');
}
$path .= '/tinymce/jscripts/tiny_mce/plugins/g2image';
break;
and change the function _gallery_g2image_path to:
function _gallery_g2image_path($path = NULL) {
if (!isset($path)) {
// Standalone G2Image folder
$path = drupal_get_path('module', 'gallery_g2image') .'/g2image';
if (!file_exists($path .'/config.php') && !file_check_directory($path)) {
$path = NULL;
// TinyMCE folder for G2Image plugin
if (module_exists('tinymce')) {
$path = drupal_get_path('module', 'tinymce');
$path .= '/tinymce/jscripts/tiny_mce/plugins/g2image';
if (!file_exists($path .'/config.php') && !file_check_directory($path)) {
$path = NULL;
}
} else if (module_exists('wysiwyg')) {
// WYSIWYG folder for G2Image plugin
$path = drupal_get_path('module', 'wysiwyg');
$path .= '/tinymce/jscripts/tiny_mce/plugins/g2image';
if (!file_exists($path .'/config.php') && !file_check_directory($path)) {
$path = NULL;
}
}
}
}
// Store location of G2Image
variable_set('gallery_g2image_path', isset($path) ? $path : FALSE);
return $path;
}
Comments
Comment #1
sunMarking as duplicate of #350100: Add support for Wysiwyg API to G2Image chooser steffensen
Please do not cross-post the same content into multiple issues.