Index: INSTALL.txt =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/img_assist/INSTALL.txt,v retrieving revision 1.16 diff -u -p -r1.16 INSTALL.txt --- INSTALL.txt 6 Apr 2008 16:43:18 -0000 1.16 +++ INSTALL.txt 1 Jul 2008 19:37:17 -0000 @@ -6,7 +6,7 @@ * Image module -* TinyMCE module (optional) +* Wysiwyg Editor module (optional) -- PRE-REQUISITES -- @@ -59,32 +59,7 @@ want your users to be able to easily choose images from their galleries, select for example "Acidfree albums" as the vocabulary to use for Image assist. - --- TINYMCE PLUGIN INSTALLATION -- - -If you use the TinyMCE WYSIWYG editor, you need to install a plugin for Image -Assist. - -* Move or copy the folder 'drupalimage' in the img_assist directory to - - [sites/all/]modules/tinymce/tinymce/jscripts/tiny_mce/plugins/ - - Edit the file plugin_reg.php in the tinymce directory. It's located in: - - [sites/all/]modules/tinymce/plugin_reg.php - - Add the following lines anywhere above the 'return' statement (without the - tags): - - $plugins['drupalimage'] = array(); - $plugins['drupalimage']['theme_advanced_buttons1'] = array('drupalimage'); - $plugins['drupalimage']['extended_valid_elements'] = array('img[class|src|border=0|alt|title|width|height|align|name]'); - - - Next, go to - - Administer > Site configuration > TinyMCE - - and enable the drupalimage plugin in your TinyMCE profile. +* If Wysiwyg Editor module is installed, you need to edit your Wysiwyg profile + configuration and enable the plugin for Image Assist. Index: README.txt =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/img_assist/README.txt,v retrieving revision 1.14.2.1 diff -u -p -r1.14.2.1 README.txt --- README.txt 15 Apr 2008 20:12:18 -0000 1.14.2.1 +++ README.txt 1 Jul 2008 19:37:17 -0000 @@ -20,7 +20,7 @@ Bug reports, feature suggestions and lat Read this after installing the module. -* Using this module with TinyMCE: +* Using this module with TinyMCE, provided by Wysiwyg Editor module: 1. Click the camera icon on the TinyMCE toolbar. 2. Upload a new photo or choose an existing image. 3. Set the properties for how you want the image to display. @@ -40,7 +40,7 @@ Read this after installing the module. Users with the 'access img_assist' permission will see the 'add image' link or icon (configurable). Access to img_assist via the TinyMCE plugin is - controlled by the TinyMCE module. + controlled by the Wysiwyg Editor module. Users with the 'create images' permission will be able to upload images using img_assist. All users will be able to see and insert their own pictures, even @@ -86,16 +86,6 @@ Read this after installing the module. See http://drupal.org/patch/apply for further information. --- FAQ -- - -Q: After installing Image Assist plugin for TinyMCE, the plugin does not show up - in TinyMCE's list of "Buttons and Plugins"? - -A: Unfortunately, TinyMCE module comes with two folders named 'plugins'. Please - ensure that you have copied Image Assist's drupalimage plugin into the folder - [sites/all]/modules/tinymce/tinymce/jscripts/tiny_mce/plugins/ - - -- CONTACT -- Current maintainers: Index: img_assist.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/img_assist/img_assist.module,v retrieving revision 1.72.2.3 diff -u -p -r1.72.2.3 img_assist.module --- img_assist.module 29 Jun 2008 23:05:59 -0000 1.72.2.3 +++ img_assist.module 1 Jul 2008 19:41:27 -0000 @@ -150,6 +150,10 @@ function img_assist_elements() { * Add image link underneath textareas. */ function img_assist_textarea($element) { + // FAPI #wysiwyg support. + if (isset($element['#wysiwyg']) && $element['#wysiwyg']) { + return $element; + } $link = variable_get('img_assist_link', 'icon'); if (($link == 'icon') || ($link == 'text')) { if (_img_assist_textarea_match($element['#id']) && _img_assist_page_match() && !strstr($_GET['q'], 'img_assist')) { @@ -497,7 +501,7 @@ function img_assist_loader() { $path = drupal_get_path('module', 'img_assist'); $output .= ''."\n"; if ($editor == 'tinymce') { - $tinymce_path = drupal_get_path('module', 'tinymce'); + $tinymce_path = drupal_get_path('module', 'wysiwyg_editor'); $tinymce_js = base_path() . $tinymce_path .'/tinymce/jscripts/tiny_mce/tiny_mce_popup.js'; $output .= '' . "\n"; } @@ -792,7 +796,7 @@ function img_assist_properties_form($for // Select (or generate) a preview image. $img_assist_create_derivatives = variable_get('img_assist_create_derivatives', array()); - if ($img_assist_create_derivatives['properties']) { + if (!empty($img_assist_create_derivatives['properties'])) { $properties_size['label'] = t('Properties'); $properties_size['key'] = 'img_assist_properties'; $properties_size['width'] = 200; @@ -851,7 +855,7 @@ function img_assist_properties_form($for // Add a choice for 'other' if the user has the proper permission to create // custom sizes. - if ($img_assist_create_derivatives['custom_advanced'] && user_access('access advanced options')) { + if (!empty($img_assist_create_derivatives['custom_advanced']) && user_access('access advanced options')) { $derivatives['other'] = t('Other'); } @@ -1773,6 +1777,23 @@ function theme_img_assist_page($content, */ /** + * Implementation of hook_wysiwyg_plugin(). + */ +function img_assist_wysiwyg_plugin($editor) { + switch ($editor) { + case 'tinymce': + return array( + 'drupalimage' => array( + 'path' => drupal_get_path('module', 'img_assist') .'/drupalimage', + 'buttons' => array('drupalimage' => t('Image Assist')), + 'url' => 'http://drupal.org/project/img_assist', + 'extended_valid_elements' => array('img[class|src|border=0|alt|title|width|height|align|name]'), + ), + ); + } +} + +/** * @defgroup img_assist_legacy Image Assist Legacy functions * @{ * Used for backwards compatibility with original img_assist module. Index: drupalimage/editor_plugin.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/img_assist/drupalimage/editor_plugin.js,v retrieving revision 1.3 diff -u -p -r1.3 editor_plugin.js --- drupalimage/editor_plugin.js 6 Apr 2008 16:43:19 -0000 1.3 +++ drupalimage/editor_plugin.js 1 Jul 2008 19:37:17 -0000 @@ -15,7 +15,7 @@ var TinyMCE_DrupalImagePlugin = { initInstance : function(inst) { if (!tinyMCE.settings['drupalimage_skip_plugin_css']) - tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + '/plugins/drupalimage/drupalimage.css'); + tinyMCE.importCSS(inst.getDoc(), this.baseURL + '/drupalimage.css'); }, getControlHTML : function(cn) { Index: drupalimage/editor_plugin_src.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/img_assist/drupalimage/editor_plugin_src.js,v retrieving revision 1.3 diff -u -p -r1.3 editor_plugin_src.js --- drupalimage/editor_plugin_src.js 6 Apr 2008 16:43:19 -0000 1.3 +++ drupalimage/editor_plugin_src.js 1 Jul 2008 19:37:17 -0000 @@ -15,7 +15,7 @@ var TinyMCE_DrupalImagePlugin = { initInstance : function(inst) { if (!tinyMCE.settings['drupalimage_skip_plugin_css']) - tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + '/plugins/drupalimage/drupalimage.css'); + tinyMCE.importCSS(inst.getDoc(), this.baseURL + '/drupalimage.css'); }, getControlHTML : function(cn) {