widgetfactory / jce

JCE - A Content Editor for Joomla
https://www.joomlacontenteditor.net
GNU General Public License v2.0
36 stars 13 forks source link

JCE does not trigger events on file upload #38

Closed pixelstunde closed 5 years ago

pixelstunde commented 5 years ago

Hi,

I am the developer of PXLCompressor, a plugin which hooks into file uploads in Joomla media manager and processes the images (resizing/compression with some APIs). I received a request to make my plugin compatible with JCE which is not possible at the moment, because JCE does not seem to trigger the necessary events.

Could you please mimic the behavior of com_media before and after upload and fire events like this?

$dispatcher->trigger('onContentBeforeSave', array('com_media.file', &$object_file, true));
//upload happens inbetween
$dispatcher->trigger('onContentAfterSave', array('com_media.file', &$object_file, true));

See: administrator/components/com_media/controllers/file.php [lines 158+]

Best regards, Christian

ryandemmer commented 5 years ago

Added in commit - https://github.com/widgetfactory/jce/commit/0187579793c1fd6b2518fcf34984fb09f495a250

pixelstunde commented 5 years ago

@ryandemmer Thank you very much for your quick support. I haven't had the time to include JCE support until today, but it all works fine now - except for the success/error messages. But your file browser does not seem to show any success messages, or am I wrong?

buttonsbond commented 3 years ago

@pixelstunde - Hi Christian, does PXLCompressor now work with JCE? I don't see the same messages as I get when using the media manager?