Add temporary template thumbnails

This commit is contained in:
Rostislav Wolny
2020-09-29 11:27:58 +02:00
committed by Veljko V
parent a6f865414c
commit 1664a0fb30
7 changed files with 18 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -202,6 +202,7 @@ class FormEditor {
$templatesData[$formType][] = [
'id' => $templateId,
'name' => $form->getName(),
'thumbnail' => $form->getThumbnailUrl(),
];
}
}

View File

@ -2,6 +2,7 @@
namespace MailPoet\Form\Templates;
use MailPoet\Config\Env;
use MailPoet\Entities\FormEntity;
use MailPoet\Util\CdnAssetUrl;
use MailPoet\Util\Helpers;
@ -109,6 +110,22 @@ EOL;
];
}
public function getThumbnailUrl(): string {
if (strpos(get_class($this), 'BelowPages')) {
return Env::$assetsUrl . '/img/form_template/belowpage@1130.png';
}
if (strpos(get_class($this), 'Popup')) {
return Env::$assetsUrl . '/img/form_template/popup@1130.png';
}
if (strpos(get_class($this), 'SlideIn')) {
return Env::$assetsUrl . '/img/form_template/slidein@1130.png';
}
if (strpos(get_class($this), 'FixedBar')) {
return Env::$assetsUrl . '/img/form_template/fixedbar@1130.png';
}
return Env::$assetsUrl . '/img/form_template/widget@1130.png';
}
public function getStyles(): string {
return self::DEFAULT_STYLES;
}