mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
commit
850a104c36
@ -62,6 +62,7 @@ return [
|
||||
'ads_image' => [
|
||||
'title' => 'visiosoft.module.advs::section.ads_image',
|
||||
'fields' => [
|
||||
'watermark',
|
||||
'image_resize_backend',
|
||||
'full_image_width',
|
||||
'full_image_height',
|
||||
|
||||
@ -295,6 +295,12 @@ return [
|
||||
'default_value' => 600,
|
||||
],
|
||||
],
|
||||
'watermark' => [
|
||||
'type' => 'anomaly.field_type.boolean',
|
||||
'config' => [
|
||||
'default_value' => false,
|
||||
]
|
||||
],
|
||||
'watermark_type' => [
|
||||
'type' => 'anomaly.field_type.select',
|
||||
'bind' => 'adv.watermark_type',
|
||||
@ -389,31 +395,31 @@ return [
|
||||
},
|
||||
],
|
||||
],
|
||||
'favicon' => [
|
||||
'type' => 'anomaly.field_type.file',
|
||||
],
|
||||
'ads_date_hidden' => [
|
||||
'type' => 'anomaly.field_type.boolean',
|
||||
'config' => [
|
||||
'default_value' => false,
|
||||
]
|
||||
],
|
||||
'hide_listing_header' => [
|
||||
'type' => 'anomaly.field_type.boolean',
|
||||
'config' => [
|
||||
'default_value' => false,
|
||||
]
|
||||
],
|
||||
'hide_filter_section' => [
|
||||
'type' => 'anomaly.field_type.boolean',
|
||||
'config' => [
|
||||
'default_value' => false,
|
||||
]
|
||||
],
|
||||
'hide_seller_info' => [
|
||||
'type' => 'anomaly.field_type.boolean',
|
||||
'config' => [
|
||||
'default_value' => false,
|
||||
]
|
||||
]
|
||||
'favicon' => [
|
||||
'type' => 'anomaly.field_type.file',
|
||||
],
|
||||
'ads_date_hidden' => [
|
||||
'type' => 'anomaly.field_type.boolean',
|
||||
'config' => [
|
||||
'default_value' => false,
|
||||
]
|
||||
],
|
||||
'hide_listing_header' => [
|
||||
'type' => 'anomaly.field_type.boolean',
|
||||
'config' => [
|
||||
'default_value' => false,
|
||||
]
|
||||
],
|
||||
'hide_filter_section' => [
|
||||
'type' => 'anomaly.field_type.boolean',
|
||||
'config' => [
|
||||
'default_value' => false,
|
||||
]
|
||||
],
|
||||
'hide_seller_info' => [
|
||||
'type' => 'anomaly.field_type.boolean',
|
||||
'config' => [
|
||||
'default_value' => false,
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@ -247,4 +247,8 @@ return [
|
||||
'name' => 'GET Categories',
|
||||
'instructions' => 'It represents the categories in which the GET property will be valid.'
|
||||
],
|
||||
'watermark' => [
|
||||
'name' => 'Watermark',
|
||||
'instructions' => 'Is watermark active?'
|
||||
],
|
||||
];
|
||||
|
||||
@ -118,26 +118,28 @@ class UploadController extends AdminController
|
||||
|
||||
foreach ($image_types as $key => $image) {
|
||||
|
||||
if ($settings_value['watermark_type'] == 'image') {
|
||||
if (setting_value('visiosoft.module.advs::watermark', false)) {
|
||||
if ($settings_value['watermark_type'] == 'image') {
|
||||
|
||||
if ($watermarkimage = $this->files->find($settings_value['watermark_image'])) {
|
||||
$watermark = WaterMark::make(app_storage_path() . '/files-module/local/' . $watermarkimage->path());
|
||||
$image->insert($watermark, $settings_value['watermark_position']);
|
||||
}
|
||||
|
||||
} else {
|
||||
$v = "top";
|
||||
$h = "center";
|
||||
$w = $image->width() / 2;
|
||||
$h1 = $image->height() / 2;
|
||||
$font_size = $w / 20;
|
||||
$image->text(($watermark_text = setting_value('visiosoft.module.advs::watermark_text')) ? $watermark_text : 'Openclassify', $w, $h1, function ($font) use ($v, $h, $font_size) {
|
||||
$font->file(public_path('Antonio-Bold.ttf'));
|
||||
$font->size($font_size);
|
||||
$font->align($h);
|
||||
$font->valign($v);
|
||||
});
|
||||
|
||||
if ($watermarkimage = $this->files->find($settings_value['watermark_image'])) {
|
||||
$watermark = WaterMark::make(app_storage_path() . '/files-module/local/' . $watermarkimage->path());
|
||||
$image->insert($watermark, $settings_value['watermark_position']);
|
||||
}
|
||||
|
||||
} else {
|
||||
$v = "top";
|
||||
$h = "center";
|
||||
$w = $image->width() / 2;
|
||||
$h1 = $image->height() / 2;
|
||||
$font_size = $w / 20;
|
||||
$image->text(($watermark_text = setting_value('visiosoft.module.advs::watermark_text')) ? $watermark_text : 'Openclassify', $w, $h1, function ($font) use ($v, $h, $font_size) {
|
||||
$font->file(public_path('Antonio-Bold.ttf'));
|
||||
$font->size($font_size);
|
||||
$font->align($h);
|
||||
$font->valign($v);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if ($key === "full") {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user