mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #490 from simonwelsh/cms-oembed
BUGFIX: Provide a default width and height of 100px for those endpoints ...
This commit is contained in:
commit
497aa9bfa9
@ -39,3 +39,4 @@ and [installation from source](http://doc.silverstripe.org/framework/en/installa
|
|||||||
## Attribution ##
|
## Attribution ##
|
||||||
|
|
||||||
* Some icons by [Yusuke Kamiyamane](http://p.yusukekamiyamane.com/). All rights reserved. Licensed under a [Creative Commons Attribution 3.0 License](http://creativecommons.org/licenses/by/3.0/).
|
* Some icons by [Yusuke Kamiyamane](http://p.yusukekamiyamane.com/). All rights reserved. Licensed under a [Creative Commons Attribution 3.0 License](http://creativecommons.org/licenses/by/3.0/).
|
||||||
|
* default_media.png by Thibault Geffroy from [The Noun Project](http://thenounproject.com/). All rights reserved. Licensed under a [Creative Commons Attribution 3.0 License](http://creativecommons.org/licenses/by/3.0/).
|
||||||
|
@ -553,7 +553,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
|||||||
} elseif($file->Type == 'photo') {
|
} elseif($file->Type == 'photo') {
|
||||||
$thumbnailURL = $file->Oembed->url;
|
$thumbnailURL = $file->Oembed->url;
|
||||||
} else {
|
} else {
|
||||||
$thumbnailURL = $url;
|
$thumbnailURL = FRAMEWORK_DIR . '/images/default_media.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
$previewField = new LiteralField("ImageFull",
|
$previewField = new LiteralField("ImageFull",
|
||||||
@ -825,11 +825,11 @@ class HtmlEditorField_Embed extends HtmlEditorField_File {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getWidth() {
|
public function getWidth() {
|
||||||
return $this->oembed->Width;
|
return $this->oembed->Width ?: 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHeight() {
|
public function getHeight() {
|
||||||
return $this->oembed->Height;
|
return $this->oembed->Height ?: 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPreview() {
|
public function getPreview() {
|
||||||
|
BIN
images/default_media.png
Normal file
BIN
images/default_media.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.0 KiB |
Loading…
Reference in New Issue
Block a user