mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
ENHANCEMENT: Additional extension points for Tiny MCE editing, for when images are regenerated and manipulating the HTML prior to a save
This commit is contained in:
parent
d28992a1e5
commit
fba688018f
@ -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…
x
Reference in New Issue
Block a user