Revise #2426 - Rename preview to previewImage

This is an exotic feature so don't include in the form fields
This commit is contained in:
Samuel Georges 2017-01-29 09:13:01 +11:00
parent 8545c9cdab
commit e2a5d54393
3 changed files with 5 additions and 16 deletions

View File

@ -376,14 +376,10 @@ class Theme
*/
public function getPreviewImageUrl()
{
$previewPath = $this->getConfigValue('preview');
$previewPath = $this->getConfigValue('previewImage', 'assets/images/theme-preview.png');
if (!$previewPath) {
$previewPath = '/assets/images/theme-preview.png';
}
if (File::exists($this->getPath().$previewPath)) {
return Url::asset('themes/'.$this->getDirName().$previewPath);
if (File::exists($this->getPath().'/'.$previewPath)) {
return Url::asset('themes/'.$this->getDirName().'/'.$previewPath);
}
return Url::asset('modules/cms/assets/images/default-theme-preview.png');

View File

@ -45,10 +45,3 @@ tabs:
code:
label: cms::lang.theme.code_label
placeholder: cms::lang.theme.code_placeholder
span: auto
preview:
label: cms::lang.theme.preview_label
placeholder: cms::lang.theme.preview_placeholder
default: '/assets/images/theme-preview.png'
span: auto

View File

@ -45,8 +45,8 @@ return [
'homepage_placeholder' => 'Website URL',
'code_label' => 'Code',
'code_placeholder' => 'A unique code for this theme used for distribution',
'preview_label' => 'Preview',
'preview_placeholder' => 'The path of theme preview image.',
'preview_image_label' => 'Preview image',
'preview_image_placeholder' => 'The path of theme preview image.',
'dir_name_label' => 'Directory name',
'dir_name_create_label' => 'The destination theme directory',
'theme_label' => 'Theme',