Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Add save events for content plugins #552

Merged
merged 4 commits into from
May 31, 2018
Merged

Add save events for content plugins #552

merged 4 commits into from
May 31, 2018

Conversation

laoneo
Copy link
Contributor

@laoneo laoneo commented May 25, 2018

Pull Request for Issue #523.

Summary of Changes

A onContentBeforeSave and onContentAfterSaveevent gets triggered when a file is created or updated or when a folder is created. This includes also cloud adapters. The file data which is uploaded is sent in the event which can be modified by a plugin.

This pr includes also two new batch settings for the resize plugin where the admin can define a max width and height for any image which gets uploaded.

Testing Instructions

  • Set a max width or height in the resize plugin.
  • Upload an image which is bigger than these two values.

Expected result

Image get resized to be not bigger than the defined values.

Actual result

No automatic resize is possible.

@laoneo laoneo added the feature label May 25, 2018
@laoneo laoneo added this to the Alpha milestone May 25, 2018
@laoneo laoneo self-assigned this May 25, 2018
@laoneo laoneo requested a review from dgrammatiko May 25, 2018 09:14
@kasvith
Copy link
Contributor

kasvith commented May 26, 2018

Seems nice

@@ -4,6 +4,12 @@
; Note : All ini files need to be saved as UTF-8

PLG_MEDIA-ACTION_RESIZE="Media Action - Resize"
PLG_MEDIA-ACTION_RESIZE_BATCH_DESC="Settings for server side actions when images got created."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to are created

@@ -4,6 +4,12 @@
; Note : All ini files need to be saved as UTF-8

PLG_MEDIA-ACTION_RESIZE="Media Action - Resize"
PLG_MEDIA-ACTION_RESIZE_BATCH_DESC="Settings for server side actions when images got created."
PLG_MEDIA-ACTION_RESIZE_BATCH_LABEL="Batch Settings"
PLG_MEDIA-ACTION_RESIZE_BATCH_MAX_HEIGHT_LABEL="Image Max Width"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Height

PLG_MEDIA-ACTION_RESIZE_BATCH_DESC="Settings for server side actions when images got created."
PLG_MEDIA-ACTION_RESIZE_BATCH_LABEL="Batch Settings"
PLG_MEDIA-ACTION_RESIZE_BATCH_MAX_HEIGHT_LABEL="Image Max Width"
PLG_MEDIA-ACTION_RESIZE_BATCH_MAX_HEIGHT_DESC="The maximum width an image can have. When empty, no resizing is performed."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this? The maximum height of an image to resize.

label="PLG_MEDIA-ACTION_RESIZE_BATCH_MAX_WIDTH_LABEL"
descripton="PLG_MEDIA-ACTION_RESIZE_BATCH_MAX_WIDTH_DESC"
addonAfter="px"
filter="int"
Copy link
Contributor

@Quy Quy May 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduce indent by 1.
filter="integer"

label="PLG_MEDIA-ACTION_RESIZE_BATCH_MAX_HEIGHT_LABEL"
descripton="PLG_MEDIA-ACTION_RESIZE_BATCH_MAX_HEIGHT_DESC"
addonAfter="px"
filter="int"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduce indent by 1.
filter="integer"

@laoneo
Copy link
Contributor Author

laoneo commented May 28, 2018

Thanks @Quy, made the changes.

@ciar4n ciar4n merged commit 3f8ba6c into dev May 31, 2018
@ciar4n ciar4n deleted the events branch May 31, 2018 07:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants