31 Commits

Author SHA1 Message Date
Andy Miller
12bdb5af4b use spaceless filter 2024-10-30 19:32:09 -06:00
Matias Griese
e9d36b97a8 Stop using |tu filter, Grav already has the same logic in |t for admin 2021-08-18 14:12:03 +03:00
Andy Miller
13dfe58feb use base64_encode filter rather than function 2021-05-13 12:49:59 -06:00
Matias Griese
be6428922d Merge branch 'develop' of github.com:getgrav/grav-plugin-admin into 1.10
 Conflicts:
	admin.php
	classes/plugin/AdminController.php
	composer.lock
	vendor/composer/autoload_classmap.php
	vendor/composer/autoload_psr4.php
	vendor/composer/autoload_real.php
	vendor/composer/autoload_static.php
	vendor/composer/installed.json
2020-12-01 09:24:05 +02:00
Matias Griese
a6f0f4945f Tightened checks when removing a media file, cleanup 2020-11-06 15:05:33 +02:00
Andy Miller
3dc8007542 fix for file upload in admin 2020-08-25 15:12:13 -06:00
Matias Griese
80b1c331b3 Fixed broken file field preview when using streams in the path 2020-06-04 23:27:14 +03:00
Matias Griese
927ccfa526 Fixed Badly encoded JSON data warning when uploading files [grav#2663] 2019-09-17 21:58:48 +03:00
Andy Miller
c0babd988f remove legacy media.upload_limit references 2019-03-12 06:28:52 -06:00
Matias Griese
02b722c8ab Minor cleanup on file field 2019-03-05 00:42:28 +02:00
Matias Griese
e2ee01144a Updated file field to work with Flex 2019-03-04 23:12:20 +02:00
Matias Griese
6e9aca40c5 Fixed avatar image not showing up in file field 2019-02-07 15:00:08 +02:00
Matias Griese
967779dfaa Twig 2 compatibility fixes on macros 2018-08-26 11:49:11 +03:00
Djamil Legato
a756cc7975 File Field: Implemented support for 'resizeWidth', 'resizeHeight', 'resizeQuality' and updated Dropzone to latest 2018-03-22 14:11:50 -07:00
Andy Miller
21e70a98a6 Fixed file download size setting in File field 2018-01-19 11:26:01 -07:00
Andy Miller
af13b12729 Use system PHP size for upload limit 2017-10-11 14:20:39 -06:00
Andy Miller
640d9ac374 Fixed issue with theme always getting set as type 2017-05-15 14:47:00 -06:00
Andy Miller
5f4217cc7c Fix typo in file field 2017-04-17 17:49:04 -06:00
Andy Miller
f361addd60 Feature/admin fragmentation (#856)
* Separated Admin Controller into a generic and extendable Base controller. Added Autoload for properly loading classes

* Implemented custom class loader to force lowercase

* Removed composer autoloader for classes

* Updates

* Ability to pass custom upload URL for files

* Added new onAdminCanSave event for 3rd party plugins

* Moved files upload GC in onOutputGenerated event

* Cleanup

* Moved autoloader so it is always registering

* Fixed onOutputGenerated event location

* Moved `taskRemoveFileFromBlueprint`,  `taskRemoveMedia `, `canEditMedia` methods to admin base controller

* Allow to globally define `blueprint_type` and `file_url_remove` for the file field

* Moved `isMultilang()` into base controller

* Properly generate thumbnails in proportions for file fields

* Simplified execute restrictions with blacklist
2016-11-07 09:54:10 -07:00
Flavio Copes
ba2c8177f8 Simplify how we determine if it's a page, fix https://github.com/getgrav/grav/issues/1100 2016-10-12 18:34:00 +02:00
Djamil Legato
6b34336599 [WIP] Ajax Files Upload (#748)
* Reworked the `file` field. All files get uploaded via Ajax and are stored upon Save

This improves the Save task tremendously as now there is no longer the need of waiting for the files to finish uploading. Fully backward compatible, `file` field now includes also a `limit` and `filesize` option in the blueprints. The former determines how many files are allowed to be uploaded when in combination with `multiple: true` (default: 10), the latter determines the file size limit (in MB) allowed for each file (default: 5MB)

* Added support for `accept: [‘*’]` to allow any file type

* Minor tweaks in the comments and messages

* Delete any orphan file when discarding the uploaded files session

* Minor optimization

* Fixed issue with `_json` elements where nested fields merging would get stored in an unexpected way

* Potential fix for wrong order of value in Datetime

* Fixed nested fields for files

* Fixed tmp streams

* Minor cleanup

* Update JSON data when removing a file. Implemented task to remove files that haven’t been saved yet, from the flash object session

* Ensure temporary files are deleted when removing un-saved files from the flash object session

* Fixed wrong reference of HTML file field when clicking on the drop zone area to pick a file

* Added JSON template for pages

* fix a CSS issue in page order

* More CSS fixes

* Trigger file field mutation when adding or removing a file

* Recompiled JS

* Removed twig templates that are no longer needed

* Fixed issue with nested header fields in a page, not properly merging data

* [internal] Fixed issue with collections not capable of handling both param and dot notations at the same time

* Reorganized FileField structure to be more consistent with the other fields

* Added support for dynamically created file fields (ie, autoinitialization on new lists items)

* Added translationable strings for file uploads errors

* Added translasions for all Dropzone available strings

* Changed default values
2016-08-29 11:12:09 -07:00
Andy Miller
8cd0279b01 Feature/upload improvements (#617)
* various improvements.. needs cleanup

* more progress - supports deeply nested + pages

* Getting close now!

* more progress!

* some cleanup

* use data[_json] to store page-based upload

* Smarter logic to get nested form fields

* some refactoring/cleanup

* Fixed issue with removing multiple files in pages

* Refactor and support `destination: page@:/images` and `destination: self@` syntax for file fields

* Prettifying the upload field

* Handling Files API to better represent the selected files in the input field

* Better plurarl string

* Fixed harcoded height for input field

* revamped CSS!!!

* `fancy: false` turns off fancy styling

* Create folder if not exists

* Add support for @theme/theme@ destination

* Fixed create directory functionality to take into account resolved paths

* Don't allow @self on page to be uploaded to if not created

* added field languages

* css tweaks

* language integration
2016-05-26 14:49:45 -06:00
Andy Miller
2d9d71c444 Feature/file upload refactor (#598)
* refactor

* Added support for multiple files

* fixed appearance a bit

* Always store files as full path => obj data

* added some error handling

* Do not go nested when storing file

* Refactored to not need blueprint set in blueprint
2016-05-17 16:46:00 -06:00
Andy Miller
2d63fed421 Added support for multiple uploads in file field 2016-05-17 12:56:36 -06:00
Djamil Legato
35fa588438 Reworked Admin JS with ES6 2016-02-01 11:27:34 -08:00
Flavio Copes
0eb87ede66 Fix redirect in deleting media from file field. Better format for file field code 2015-12-22 14:06:23 +01:00
Flavio Copes
08b2043dd3 Fix for the image preview in the file filed on multilang sites 2015-12-21 16:33:16 +01:00
Flavio Copes
b76b79e611 Improve File input field for Admin
Add removing files from a blueprint to Admin, moved from Pro. Drop
`showuploaded`, `ispluginconfig`, `showuploadedpreview` options from
the File field. Added a "blueprint" option to specify the field name
and type, e.g. `plugins.admin` or `themes.antimatter`. Dropped the
multiple option, as it'd need more handling that now it's not there.
2015-12-21 16:22:04 +01:00
Flavio Copes
371d709630 Make "file" a form field to be used in plugins and themes blueprints only. Add warning when used inside pages blueprints 2015-12-19 14:06:27 +01:00
Flavio Copes
7d9ce1a138 Edit the admin file input to handle showing uploaded files, showing previews, allow deleting if it's a plugin config 2015-12-18 17:20:57 +01:00
Flavio Copes
18a2a21e50 Override the default file field to work in admin. Handles files.showuploaded 2015-12-18 10:37:54 +01:00