mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-03 22:58:24 +02:00
Merge pull request #3721 from gordonbanderson/TINY_MCE_EDIT_EXTENSION_POINTS
ENHANCEMENT: Additional extension points when editing with Tiny MCE
This commit is contained in:
commit
03bf7324a9
@ -140,8 +140,15 @@ class HtmlEditorField extends TextareaField {
|
||||
// Add default empty title & alt attributes.
|
||||
if(!$img->getAttribute('alt')) $img->setAttribute('alt', '');
|
||||
if(!$img->getAttribute('title')) $img->setAttribute('title', '');
|
||||
|
||||
// Use this extension point to manipulate images inserted using TinyMCE, e.g. add a CSS class, change default title
|
||||
// $image is the image, $img is the DOM model
|
||||
$this->extend('processImage', $image, $img);
|
||||
}
|
||||
|
||||
// optionally manipulate the HTML after a TinyMCE edit and prior to a save
|
||||
$this->extend('processHTML', $htmlValue);
|
||||
|
||||
// Store into record
|
||||
$record->{$this->name} = $htmlValue->getContent();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user