From 540bdac2a6cb6e27c9615d87d4ceb2d7e7b8f480 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Tue, 6 Oct 2020 15:44:03 +0300 Subject: [PATCH 1/7] fixed media field type --- .../resources/config/settings/sections.php | 20 ++- .../resources/config/settings/settings.php | 163 +++++++++++------- .../advs-module/resources/lang/en/section.php | 1 + .../advs-module/resources/lang/en/setting.php | 72 +++++--- .../resources/config/settings.php | 23 --- .../media-field_type/resources/js/upload.js | 4 +- .../resources/lang/en/message.php | 15 +- .../resources/lang/en/setting.php | 16 -- .../resources/views/upload/index.twig | 6 + .../src/Http/Controller/UploadController.php | 140 +++++++++------ 10 files changed, 259 insertions(+), 201 deletions(-) delete mode 100644 addons/default/visiosoft/media-field_type/resources/config/settings.php delete mode 100644 addons/default/visiosoft/media-field_type/resources/lang/en/setting.php diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php index 6c3a9af6c..b5b18a6d0 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php @@ -28,17 +28,27 @@ return [ 'estimated_pending_time', 'default_published_time', 'default_GET', - 'add_canvas', + 'hide_standard_price_field', + 'listing_page_image', + ], + ], + 'ads-image' => [ + 'title' => 'visiosoft.module.advs::section.ads-image', + 'fields' => [ + 'image_resize_backend', + 'full_image_width', + 'full_image_height', + 'medium_image_width', + 'medium_image_height', 'thumbnail_width', 'thumbnail_height', - 'picture_width', - 'picture_height', + 'add_canvas', + 'image_canvas_width', + 'image_canvas_height', 'watermark_type', 'watermark_text', 'watermark_image', 'watermark_position', - 'listing_page_image', - 'hide_standard_price_field', ], ], 'user' => [ diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php index 1c096479f..28d90c75c 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -108,71 +108,6 @@ return [ 'default_value' => 0, ], ], - 'thumbnail_width' => [ - 'type' => 'anomaly.field_type.integer', - 'config' => [ - 'default_value' => 270, - ], - ], - 'add_canvas' => [ - 'type' => 'anomaly.field_type.boolean', - 'config' => [ - 'default_value' => true, - 'mode' => 'checkbox', - ], - ], - 'thumbnail_height' => [ - 'type' => 'anomaly.field_type.integer', - 'config' => [ - 'default_value' => 180, - ], - ], - 'picture_width' => [ - 'type' => 'anomaly.field_type.integer', - 'config' => [ - 'default_value' => 600, - ], - ], - 'picture_height' => [ - 'type' => 'anomaly.field_type.integer', - 'config' => [ - 'default_value' => 400, - ], - ], - 'watermark_type' => [ - 'type' => 'anomaly.field_type.select', - 'bind' => 'adv.watermark_type', - 'env' => 'ADV_WATERMARK_TYPE', - 'required' => true, - 'config' => [ - 'options' => ['image' => 'Image', 'text' => 'Text'], - 'default_value' => 'text', - ] - ], - 'watermark_text' => [ - 'type' => 'anomaly.field_type.text', - 'bind' => 'adv.watermark_text', - 'env' => 'ADV_WATERMARK_TEXT', - ], - 'watermark_image' => [ - 'type' => 'anomaly.field_type.file', - 'bind' => 'adv.watermark_image', - 'env' => 'ADV_WATERMARK_IMAGE', - 'config' => [ - 'default_value' => '', - ], - ], - 'watermark_position' => [ - 'type' => 'anomaly.field_type.select', - 'bind' => 'adv.watermark_position', - 'env' => 'ADV_WATERMARK_POSITION', - 'required' => true, - 'config' => [ - 'options' => ['top-right' => 'Top Right', 'top-left' => 'Top Left', 'bottom-right' => 'Bottom Right', - 'bottom-left' => 'Bottom Left', 'center' => 'Middle'], - 'default_value' => 'top-right', - ] - ], 'listing_page_image' => [ 'type' => 'anomaly.field_type.file', @@ -255,4 +190,102 @@ return [ 'default_value' => 15, ], ], + + //Image Settings + + 'image_resize_backend' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => true, + ], + ], + 'full_image_width' => [ + 'type' => 'anomaly.field_type.integer', + 'config' => [ + 'default_value' => 800, + ], + ], + + 'full_image_height' => [ + 'type' => 'anomaly.field_type.integer', + 'config' => [ + 'default_value' => 600, + ], + ], + 'medium_image_width' => [ + 'type' => 'anomaly.field_type.integer', + 'config' => [ + 'default_value' => 600, + ], + ], + 'medium_image_height' => [ + 'type' => 'anomaly.field_type.integer', + 'config' => [ + 'default_value' => 400, + ], + ], + 'thumbnail_width' => [ + 'type' => 'anomaly.field_type.integer', + 'config' => [ + 'default_value' => 270, + ], + ], + 'thumbnail_height' => [ + 'type' => 'anomaly.field_type.integer', + 'config' => [ + 'default_value' => 180, + ], + ], + 'add_canvas' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => true, + ], + ], + 'image_canvas_width' => [ + 'type' => 'anomaly.field_type.integer', + 'config' => [ + 'default_value' => 800, + ], + ], + 'image_canvas_height' => [ + 'type' => 'anomaly.field_type.integer', + 'config' => [ + 'default_value' => 600, + ], + ], + 'watermark_type' => [ + 'type' => 'anomaly.field_type.select', + 'bind' => 'adv.watermark_type', + 'env' => 'ADV_WATERMARK_TYPE', + 'required' => true, + 'config' => [ + 'options' => ['image' => 'Image', 'text' => 'Text'], + 'default_value' => 'text', + ] + ], + 'watermark_text' => [ + 'type' => 'anomaly.field_type.text', + 'bind' => 'adv.watermark_text', + 'env' => 'ADV_WATERMARK_TEXT', + ], + 'watermark_image' => [ + 'type' => 'anomaly.field_type.file', + 'bind' => 'adv.watermark_image', + 'env' => 'ADV_WATERMARK_IMAGE', + 'config' => [ + 'default_value' => '', + ], + ], + 'watermark_position' => [ + 'type' => 'anomaly.field_type.select', + 'bind' => 'adv.watermark_position', + 'env' => 'ADV_WATERMARK_POSITION', + 'required' => true, + 'config' => [ + 'options' => ['top-right' => 'Top Right', 'top-left' => 'Top Left', 'bottom-right' => 'Bottom Right', + 'bottom-left' => 'Bottom Left', 'center' => 'Middle'], + 'default_value' => 'top-right', + ] + ], ]; diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/section.php b/addons/default/visiosoft/advs-module/resources/lang/en/section.php index 926f1c534..4e3fbc5f0 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/section.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/section.php @@ -44,4 +44,5 @@ return [ 'options' => [ 'title' => 'Options', ], + 'ads-image' => 'Ads Image', ]; diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php index 458a81617..07d95f740 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php @@ -79,21 +79,6 @@ return [ 'default_GET' => [ 'name' => 'Default Ad GET', ], - 'add_canvas' => [ - 'name' => 'Add Canvas', - ], - 'thumbnail_width' => [ - 'name' => 'Thumbnail Width', - ], - 'thumbnail_height' => [ - 'name' => 'Thumbnail Height', - ], - 'picture_width' => [ - 'name' => 'Picture Width', - ], - 'picture_height' => [ - 'name' => 'Picture Height', - ], 'twitter' => [ 'name' => 'Twitter', ], @@ -106,18 +91,6 @@ return [ 'google' => [ 'name' => 'Google', ], - 'watermark_type' => [ - 'name' => 'Watermark Type', - ], - 'watermark_text' => [ - 'name' => 'Watermark Text', - ], - 'watermark_image' => [ - 'name' => 'Watermark Image', - ], - 'watermark_position' => [ - 'name' => 'Watermark Position', - ], 'listing_page_image' => [ 'name' => 'Listing Page Image', ], @@ -158,4 +131,49 @@ return [ 'popular_ads_limit' => [ 'name' => 'Popular Ads Limit', ], + + //Image + + 'image_resize_backend' => [ + 'name' => 'Image Resize Backend', + ], + 'full_image_width' => [ + 'name' => 'Full Image Width', + ], + 'full_image_height' => [ + 'name' => 'Full Image Height', + ], + 'medium_image_width' => [ + 'name' => 'Medium Image Width', + ], + 'medium_image_height' => [ + 'name' => 'Medium Image Height', + ], + 'thumbnail_width' => [ + 'name' => 'Thumbnail Width', + ], + 'thumbnail_height' => [ + 'name' => 'Thumbnail Height', + ], + 'add_canvas' => [ + 'name' => 'Add Canvas', + ], + 'image_canvas_width' => [ + 'name' => 'Image Canvas Width', + ], + 'image_canvas_height' => [ + 'name' => 'Image Canvas Height', + ], + 'watermark_type' => [ + 'name' => 'Watermark Type', + ], + 'watermark_text' => [ + 'name' => 'Watermark Text', + ], + 'watermark_image' => [ + 'name' => 'Watermark Image', + ], + 'watermark_position' => [ + 'name' => 'Watermark Position', + ], ]; diff --git a/addons/default/visiosoft/media-field_type/resources/config/settings.php b/addons/default/visiosoft/media-field_type/resources/config/settings.php deleted file mode 100644 index d541497e1..000000000 --- a/addons/default/visiosoft/media-field_type/resources/config/settings.php +++ /dev/null @@ -1,23 +0,0 @@ - [ - 'type' => 'anomaly.field_type.integer', - 'config' => [ - 'default_value' => 800, - ], - ], - 'imageCanvasH' => [ - 'type' => 'anomaly.field_type.integer', - 'config' => [ - 'default_value' => 600, - ], - ], - 'imageResizeH' => [ - 'type' => 'anomaly.field_type.integer', - 'config' => [ - 'default_value' => 600, - ], - ], -]; diff --git a/addons/default/visiosoft/media-field_type/resources/js/upload.js b/addons/default/visiosoft/media-field_type/resources/js/upload.js index 52b315380..cf0c7fef7 100644 --- a/addons/default/visiosoft/media-field_type/resources/js/upload.js +++ b/addons/default/visiosoft/media-field_type/resources/js/upload.js @@ -16,8 +16,8 @@ $(function () { var dropzone = new Dropzone('.dropzone:not(data-initialized)', { paramName: 'upload', - resizeWidth: 800, - resizeHeight: 600, + resizeWidth: settings_image['resize_width'], + resizeHeight: settings_image['resize_height'], autoProcessQueue: true, parallelUploads: 1, resizeMethod: 'contain', diff --git a/addons/default/visiosoft/media-field_type/resources/lang/en/message.php b/addons/default/visiosoft/media-field_type/resources/lang/en/message.php index 442c2387b..b554b6955 100644 --- a/addons/default/visiosoft/media-field_type/resources/lang/en/message.php +++ b/addons/default/visiosoft/media-field_type/resources/lang/en/message.php @@ -1,12 +1,13 @@ 'Which folder would you like to upload to?', - 'upload' => 'Add İmages | Upload İmages | Attach a photo', - 'choose_files' => 'Which files would you like to use?', + 'choose_folder' => 'Which folder would you like to upload to?', + 'upload' => 'Add İmages | Upload İmages | Attach a photo', + 'choose_files' => 'Which files would you like to use?', 'no_files_selected' => 'No files selected.', - 'no_uploads' => 'No files uploaded.', - 'overwrite' => 'has already been uploaded. Would you like to overwrite it?', - 'uploading' => 'Uploading', - 'loading' => 'Loading', + 'no_uploads' => 'No files uploaded.', + 'overwrite' => 'has already been uploaded. Would you like to overwrite it?', + 'uploading' => 'Uploading', + 'loading' => 'Loading', + 'error_upload' => 'There was a problem uploading the file.', ]; diff --git a/addons/default/visiosoft/media-field_type/resources/lang/en/setting.php b/addons/default/visiosoft/media-field_type/resources/lang/en/setting.php deleted file mode 100644 index eec5e70ba..000000000 --- a/addons/default/visiosoft/media-field_type/resources/lang/en/setting.php +++ /dev/null @@ -1,16 +0,0 @@ - [ - 'name' => 'Image Canvas Width' - ], - 'imageCanvasH' => [ - 'name' => 'Image Canvas Height' - ], - 'imageResizeW' => [ - 'name' => 'Image Resize Width' - ], - 'imageResizeH' => [ - 'name' => 'Image Resize Height' - ], -]; diff --git a/addons/default/visiosoft/media-field_type/resources/views/upload/index.twig b/addons/default/visiosoft/media-field_type/resources/views/upload/index.twig index d1c7f95a5..bb51d1f01 100644 --- a/addons/default/visiosoft/media-field_type/resources/views/upload/index.twig +++ b/addons/default/visiosoft/media-field_type/resources/views/upload/index.twig @@ -14,3 +14,9 @@ + \ No newline at end of file diff --git a/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php b/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php index bae2b9d24..ae5938fe2 100644 --- a/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php +++ b/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php @@ -5,7 +5,6 @@ use Anomaly\Streams\Platform\Model\Files\FilesFilesEntryModel; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Storage; -use Visiosoft\MediaFieldType\Table\FileTableBuilder; use Visiosoft\MediaFieldType\Table\UploadTableBuilder; use Anomaly\FilesModule\File\FileUploader; use Anomaly\FilesModule\Folder\Command\GetFolder; @@ -13,7 +12,6 @@ use Anomaly\FilesModule\Folder\Contract\FolderRepositoryInterface; use Anomaly\Streams\Platform\Http\Controller\AdminController; use Illuminate\Foundation\Bus\DispatchesJobs; use Intervention\Image\Facades\Image as WaterMark; -use Anomaly\SettingsModule\Setting\Contract\SettingRepositoryInterface; use Anomaly\FilesModule\File\Contract\FileRepositoryInterface; /** @@ -25,16 +23,22 @@ use Anomaly\FilesModule\File\Contract\FileRepositoryInterface; */ class UploadController extends AdminController { + public $uploader; + + public $folders; + + public $files; use DispatchesJobs; - /** - * Return the uploader. - * - * @param UploadTableBuilder $table - * @param $folder - * @return \Illuminate\View\View - */ + public function __construct(FileUploader $uploader, FolderRepositoryInterface $folders, FileRepositoryInterface $files) + { + $this->uploader = $uploader; + $this->folders = $folders; + $this->files = $files; + parent::__construct(); + } + public function index(UploadTableBuilder $table, $folder) { return $this->view->make( @@ -46,90 +50,102 @@ class UploadController extends AdminController ); } - /** - * Upload a file. - * - * @param FileUploader $uploader - * @param FolderRepositoryInterface $folders - * @return \Illuminate\Http\JsonResponse - */ - public function upload(FileUploader $uploader, FolderRepositoryInterface $folders, SettingRepositoryInterface $settings, FileRepositoryInterface $files) + public function upload() { - if ($file = $uploader->upload($this->request->file('upload'), $folders->find($this->request->get('folder')))) { + $file = $this->uploader->upload($this->request->file('upload'), $this->folders->find($this->request->get('folder'))); + if ($file) { - $watermarktype = $settings->value('visiosoft.module.advs::watermark_type'); - $position = $settings->value('visiosoft.module.advs::watermark_position'); - $fullImg = WaterMark::make($this->request->file('upload')->getRealPath()) - ->resize(null, setting_value('visiosoft.field_type.media::imageResizeH', 600),function ($constraint) { - $constraint->aspectRatio(); - }); - $mdImg = WaterMark::make($this->request->file('upload')->getRealPath()) - ->resize(null, setting_value('visiosoft.module.advs::picture_height'),function ($constraint) { + $settings_key = [ + 'image_resize_backend', + 'full_image_width', + 'full_image_height', + 'medium_image_width', + 'medium_image_height', + 'thumbnail_width', + 'thumbnail_height', + 'add_canvas', + 'image_canvas_width', + 'image_canvas_height', + 'watermark_type', + 'watermark_text', + 'watermark_image', + 'watermark_position' + ]; + + $settings_value = array(); + + foreach ($settings_key as $key) { + $settings_value[$key] = setting_value('visiosoft.module.advs::' . $key); + } + + + $fullImg = WaterMark::make($this->request->file('upload')->getRealPath()); + + if ($settings_value['image_resize_backend']) { + $fullImg = $fullImg->resize(null, $settings_value['full_image_height'], + function ($constraint) { $constraint->aspectRatio(); }); - if (setting_value('visiosoft.module.advs::add_canvas')) { + } + + $mdImg = WaterMark::make($this->request->file('upload')->getRealPath()) + ->resize(null, $settings_value['medium_image_height'], function ($constraint) { + $constraint->aspectRatio(); + }); + + + if ($settings_value['add_canvas']) { + $fullImg->resizeCanvas( - setting_value('visiosoft.field_type.media::imageCanvasW', 800), - setting_value('visiosoft.field_type.media::imageCanvasH', 600), + $settings_value['image_canvas_width'], $settings_value['image_canvas_height'], 'center', false, 'fff' ); + $mdImg->resizeCanvas( - setting_value('visiosoft.module.advs::picture_width', 400), - setting_value('visiosoft.module.advs::picture_height', 300), + $settings_value['medium_image_width'], $settings_value['medium_image_height'], 'center', false, 'fff' ); } - foreach ([$fullImg, $mdImg] as $index => $image) { - if ($watermarktype == 'image') { - $watermarkimage_id = $settings->value('visiosoft.module.advs::watermark_image'); - $watermarkimage = $files->find($watermarkimage_id); - if ($watermarkimage != null) { + + $image_types = array('full' => $fullImg, 'medium' => $mdImg); + + foreach ($image_types as $key => $image) { + + 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, $position); + $image->insert($watermark, $settings_value['watermark_position']); } + } else { - $watermarktext = $settings->value('visiosoft.module.advs::watermark_text'); $v = "top"; $h = "center"; $w = $image->width() / 2; $h1 = $image->height() / 2; $font_size = $w / 20; - $image->text($watermarktext, $w, $h1, function ($font) use ($v, $h, $font_size) { + $image->text($settings_value['watermark_text'], $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 ($index === 0) { + if ($key === "full") { $fileName = $file->getAttributes()['name']; } else { $fileName = 'md-' . $file->getAttributes()['name']; - $files->create([ - 'folder_id' => $this->request->get('folder'), - 'name' => $fileName, - 'disk_id' => 1, - 'size' => $image->filesize(), - 'mime_type' => $image->mime, - 'extension' => $image->extension, - ]); + $this->createFile($this->request->get('folder'),$fileName,$image); } $image->save(app_storage_path() . '/files-module/local/images/' . $fileName); } - return $this->response->json($file->getAttributes()); } - return $this->response->json(['error' => 'There was a problem uploading the file.'], 500); + return $this->response->json(['error' => trans('visiosoft.field_type.media::message.error_upload')], 500); } - /** - * Return the recently uploaded files. - * - * @param FileTableBuilder $table - * @return \Symfony\Component\HttpFoundation\Response - */ public function recent(UploadTableBuilder $table) { return $table->setUploaded(explode(',', $this->request->get('uploaded'))) @@ -158,4 +174,16 @@ class UploadController extends AdminController } return response()->json(['status' => 'error']); } + + public function createFile($folder, $filename, $image) + { + $this->files->create([ + 'folder_id' => $folder, + 'name' => $filename, + 'disk_id' => 1, + 'size' => $image->filesize(), + 'mime_type' => $image->mime, + 'extension' => $image->extension, + ]); + } } From c885f1c8146ddb3177210ba983fa1f19be81a41e Mon Sep 17 00:00:00 2001 From: vedatakd Date: Tue, 6 Oct 2020 16:58:25 +0300 Subject: [PATCH 2/7] fixed comments --- .../advs-module/resources/config/settings/sections.php | 4 ++-- .../advs-module/resources/config/settings/settings.php | 5 ----- .../visiosoft/advs-module/resources/lang/en/section.php | 2 +- .../src/Http/Controller/UploadController.php | 2 -- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php index b5b18a6d0..7d94fd80c 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php @@ -32,8 +32,8 @@ return [ 'listing_page_image', ], ], - 'ads-image' => [ - 'title' => 'visiosoft.module.advs::section.ads-image', + 'ads_image' => [ + 'title' => 'visiosoft.module.advs::section.ads_image', 'fields' => [ 'image_resize_backend', 'full_image_width', diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php index 28d90c75c..fe39dc59c 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -192,7 +192,6 @@ return [ ], //Image Settings - 'image_resize_backend' => [ 'type' => 'anomaly.field_type.boolean', 'config' => [ @@ -205,7 +204,6 @@ return [ 'default_value' => 800, ], ], - 'full_image_height' => [ 'type' => 'anomaly.field_type.integer', 'config' => [ @@ -273,9 +271,6 @@ return [ 'type' => 'anomaly.field_type.file', 'bind' => 'adv.watermark_image', 'env' => 'ADV_WATERMARK_IMAGE', - 'config' => [ - 'default_value' => '', - ], ], 'watermark_position' => [ 'type' => 'anomaly.field_type.select', diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/section.php b/addons/default/visiosoft/advs-module/resources/lang/en/section.php index 4e3fbc5f0..b3ebe1995 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/section.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/section.php @@ -44,5 +44,5 @@ return [ 'options' => [ 'title' => 'Options', ], - 'ads-image' => 'Ads Image', + 'ads_image' => 'Ads Image', ]; diff --git a/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php b/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php index ae5938fe2..613ab7454 100644 --- a/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php +++ b/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php @@ -24,9 +24,7 @@ use Anomaly\FilesModule\File\Contract\FileRepositoryInterface; class UploadController extends AdminController { public $uploader; - public $folders; - public $files; use DispatchesJobs; From f2b436feffbfd5790c6828d7d3ff32f11ea432e1 Mon Sep 17 00:00:00 2001 From: Fatih Alp Date: Tue, 6 Oct 2020 17:29:33 +0300 Subject: [PATCH 3/7] Update DatabaseSeeder.php --- database/seeds/DatabaseSeeder.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 4ae7fb561..4593e9c23 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -44,13 +44,13 @@ class DatabaseSeeder extends Seeder $admin = $this->roles->findBySlug('admin'); $this->users->unguard(); - $this->users->newQuery()->where('email', "admin@visiosoft.com.tr")->forceDelete(); + $this->users->newQuery()->where('email', "info@openclassify.com")->forceDelete(); $visiosoft_administrator = $this->users->create( [ - 'display_name' => 'Visiosoft Dev', - 'email' => "admin@visiosoft.com.tr", - 'username' => "visiosoft", - 'password' => "visiosoft123", + 'display_name' => 'openclassify', + 'email' => "info@openclassify.com", + 'username' => "openclassify", + 'password' => "openclassify", ] ); @@ -108,4 +108,4 @@ class DatabaseSeeder extends Seeder $this->call(widgetSeeder::class); } -} \ No newline at end of file +} From f77f853985bcf5d23d746e0c5bdd79a4afb7ab43 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Tue, 6 Oct 2020 17:36:01 +0300 Subject: [PATCH 4/7] =?UTF-8?q?#2231=20Panel=20Logo=20De=C4=9Fi=C5=9Fecek?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/css/theme.css | 4 ++++ .../resources/img/login-icon.svg | 19 +++++++++++++++++ .../resources/img/panel-icon.svg | 21 +++++++++++++++++++ .../resources/views/layouts/installer.twig | 2 +- .../resources/views/login.twig | 4 ++-- .../resources/views/partials/topbar.twig | 2 +- 6 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 addons/default/visiosoft/defaultadmin-theme/resources/img/login-icon.svg create mode 100644 addons/default/visiosoft/defaultadmin-theme/resources/img/panel-icon.svg diff --git a/addons/default/visiosoft/defaultadmin-theme/resources/css/theme.css b/addons/default/visiosoft/defaultadmin-theme/resources/css/theme.css index e3f81eb98..d4f55f0c1 100644 --- a/addons/default/visiosoft/defaultadmin-theme/resources/css/theme.css +++ b/addons/default/visiosoft/defaultadmin-theme/resources/css/theme.css @@ -223,6 +223,8 @@ height: 40px; margin-top: -9px; vertical-align: middle; + object-fit: contain; + object-position: center; } #topbar .logo svg .st0 { transition: fill 300ms 500ms; @@ -2670,6 +2672,8 @@ body { max-height: 82px; margin-top: -30px; vertical-align: middle; + object-fit: contain; + object-position: center; } #login .logo svg .st0 { fill: #ffffff; diff --git a/addons/default/visiosoft/defaultadmin-theme/resources/img/login-icon.svg b/addons/default/visiosoft/defaultadmin-theme/resources/img/login-icon.svg new file mode 100644 index 000000000..3a42e2edb --- /dev/null +++ b/addons/default/visiosoft/defaultadmin-theme/resources/img/login-icon.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/addons/default/visiosoft/defaultadmin-theme/resources/img/panel-icon.svg b/addons/default/visiosoft/defaultadmin-theme/resources/img/panel-icon.svg new file mode 100644 index 000000000..3cf852ea4 --- /dev/null +++ b/addons/default/visiosoft/defaultadmin-theme/resources/img/panel-icon.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/default/visiosoft/defaultadmin-theme/resources/views/layouts/installer.twig b/addons/default/visiosoft/defaultadmin-theme/resources/views/layouts/installer.twig index 7377acf23..b2950dd81 100644 --- a/addons/default/visiosoft/defaultadmin-theme/resources/views/layouts/installer.twig +++ b/addons/default/visiosoft/defaultadmin-theme/resources/views/layouts/installer.twig @@ -19,7 +19,7 @@ diff --git a/addons/default/visiosoft/defaultadmin-theme/resources/views/login.twig b/addons/default/visiosoft/defaultadmin-theme/resources/views/login.twig index 174877348..9ce4b4ab7 100644 --- a/addons/default/visiosoft/defaultadmin-theme/resources/views/login.twig +++ b/addons/default/visiosoft/defaultadmin-theme/resources/views/login.twig @@ -7,7 +7,7 @@ {% if setting_value('visiosoft.theme.defaultadmin::login_icon') %} site icon {% else %} - {{ img('theme::img/icon.svg').data|raw }} + {{ img('theme::img/login-icon.svg').data|raw }} {% endif %} {{ setting_value('visiosoft.theme.defaultadmin::title') }} @@ -21,7 +21,7 @@ {% if setting_value('visiosoft.theme.defaultadmin::login_icon') %} site icon {% else %} - {{ img('theme::img/icon.svg').data|raw }} + {{ img('theme::img/login-icon.svg').data|raw }} {% endif %} diff --git a/addons/default/visiosoft/defaultadmin-theme/resources/views/partials/topbar.twig b/addons/default/visiosoft/defaultadmin-theme/resources/views/partials/topbar.twig index 9e2075eff..9ff1f559b 100644 --- a/addons/default/visiosoft/defaultadmin-theme/resources/views/partials/topbar.twig +++ b/addons/default/visiosoft/defaultadmin-theme/resources/views/partials/topbar.twig @@ -5,7 +5,7 @@ {% if setting_value('visiosoft.theme.defaultadmin::panel_icon') %} site icon {% else %} - {{ img('theme::img/icon.svg').data|raw }} + {{ img('theme::img/panel-icon.svg').data|raw }} {% endif %} {{ setting_value('visiosoft.theme.defaultadmin::title') }} From 45924af5289d566ee08d42dbb9e315d589327dd9 Mon Sep 17 00:00:00 2001 From: Fatih Alp Date: Tue, 6 Oct 2020 18:09:58 +0300 Subject: [PATCH 5/7] Update widgetSeeder.php --- database/seeds/widgetSeeder.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/database/seeds/widgetSeeder.php b/database/seeds/widgetSeeder.php index d5dab2a2f..1a5410367 100644 --- a/database/seeds/widgetSeeder.php +++ b/database/seeds/widgetSeeder.php @@ -29,8 +29,8 @@ class widgetSeeder extends Seeder ->create( [ 'en' => [ - 'title' => 'ARecent News', - 'description' => 'ARecent news from http://pyrocms.com/', + 'title' => 'Recent News', + 'description' => 'Recent news' ], 'extension' => 'anomaly.extension.xml_feed_widget', 'dashboard' => $dashboard, @@ -43,7 +43,7 @@ class widgetSeeder extends Seeder [ 'scope' => $widget->getId(), 'key' => 'anomaly.extension.xml_feed_widget::url', - 'value' => 'http://www.pyrocms.com/posts/rss.xml', + 'value' => 'https://openclassify.com/posts/rss.xml', ] ); } From 592be415fe82362076700bc8913aecb6791b346f Mon Sep 17 00:00:00 2001 From: Diatrex Date: Tue, 6 Oct 2020 18:12:05 +0300 Subject: [PATCH 6/7] #2278 Emlak24 Bugs 10.5.20 --- .../profile-module/resources/views/profile/detail.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/default/visiosoft/profile-module/resources/views/profile/detail.twig b/addons/default/visiosoft/profile-module/resources/views/profile/detail.twig index 52368270e..7d53dee4d 100644 --- a/addons/default/visiosoft/profile-module/resources/views/profile/detail.twig +++ b/addons/default/visiosoft/profile-module/resources/views/profile/detail.twig @@ -50,7 +50,7 @@
{% set userForm = form('userProfile').entry(user.id).get() %} {{ userForm.open()|raw }} -
+
From 4e5bc7cd4aefc34bb4c5170c78327aae47217090 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Wed, 7 Oct 2020 11:02:19 +0300 Subject: [PATCH 7/7] #2278 Emlak24 Bugs 10.5.20 --- addons/default/visiosoft/advs-module/src/Adv/AdvModel.php | 6 ++++++ .../visiosoft/advs-module/src/Adv/Contract/AdvInterface.php | 1 + .../advs-module/src/Http/Controller/advsController.php | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php index 3e0b283ac..bf879d2ad 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php @@ -2,6 +2,7 @@ use Anomaly\Streams\Platform\Image\Command\MakeImageInstance; use Anomaly\Streams\Platform\Model\Advs\AdvsCustomFieldsEntryModel; +use Carbon\Carbon; use GuzzleHttp\Client; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; @@ -371,4 +372,9 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface $neighborhood = $neighborhoodModel->newQuery()->find($this->neighborhood); return $neighborhood ? $neighborhood->name : false; } + + public function expired() + { + return $this->finish_at ? $this->finish_at < Carbon::now() : true; + } } diff --git a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php index 6f022c006..a9cb314fd 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php +++ b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php @@ -4,4 +4,5 @@ use Anomaly\Streams\Platform\Entry\Contract\EntryInterface; interface AdvInterface extends EntryInterface { + public function expired(); } diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php index 15adeb88b..bea56a763 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php @@ -433,7 +433,7 @@ class AdvsController extends PublicController $adv = $this->adv_repository->getListItemAdv($id); - if ($adv) { + if ($adv && !$adv->expired()) { if ($this->adv_model->is_enabled('complaints')) { $complaints = ComplaintsComplainTypesEntryModel::all();