Merge pull request #989 from openclassify/vedat

watermark settings
This commit is contained in:
Ozcan Durak 2021-03-12 10:52:14 +03:00 committed by GitHub
commit 850a104c36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 45 deletions

View File

@ -62,6 +62,7 @@ return [
'ads_image' => [ 'ads_image' => [
'title' => 'visiosoft.module.advs::section.ads_image', 'title' => 'visiosoft.module.advs::section.ads_image',
'fields' => [ 'fields' => [
'watermark',
'image_resize_backend', 'image_resize_backend',
'full_image_width', 'full_image_width',
'full_image_height', 'full_image_height',

View File

@ -295,6 +295,12 @@ return [
'default_value' => 600, 'default_value' => 600,
], ],
], ],
'watermark' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
]
],
'watermark_type' => [ 'watermark_type' => [
'type' => 'anomaly.field_type.select', 'type' => 'anomaly.field_type.select',
'bind' => 'adv.watermark_type', 'bind' => 'adv.watermark_type',

View File

@ -247,4 +247,8 @@ return [
'name' => 'GET Categories', 'name' => 'GET Categories',
'instructions' => 'It represents the categories in which the GET property will be valid.' 'instructions' => 'It represents the categories in which the GET property will be valid.'
], ],
'watermark' => [
'name' => 'Watermark',
'instructions' => 'Is watermark active?'
],
]; ];

View File

@ -118,6 +118,7 @@ class UploadController extends AdminController
foreach ($image_types as $key => $image) { foreach ($image_types as $key => $image) {
if (setting_value('visiosoft.module.advs::watermark', false)) {
if ($settings_value['watermark_type'] == 'image') { if ($settings_value['watermark_type'] == 'image') {
if ($watermarkimage = $this->files->find($settings_value['watermark_image'])) { if ($watermarkimage = $this->files->find($settings_value['watermark_image'])) {
@ -139,6 +140,7 @@ class UploadController extends AdminController
}); });
} }
}
if ($key === "full") { if ($key === "full") {
$fileName = $file->getAttributes()['name']; $fileName = $file->getAttributes()['name'];