Commit Graph

488 Commits

Author SHA1 Message Date
Flavio Copes
b775ff934d Fix removing responsive image from page media re #111 re #952 2017-02-06 18:03:14 +01:00
Flavio Copes
f7401543df Fixed issue admin.super or admin.users users changing the account when saving another user [#713] 2017-01-31 11:11:27 +01:00
Flavio Copes
8ecf367356 Add method to clear the media cache 2017-01-28 19:09:30 +01:00
Flavio Copes
3627e0ec59 Handle removing a media also if it's not a json request
Was not working after
https://github.com/getgrav/grav-plugin-admin/commit/6b343365996ce838759d
80fa3917d4d994f1aeb4
2017-01-28 19:08:58 +01:00
Flavio Copes
4faf0c0b95 Fix #943 allow non admin.super users to change their account information. Allow admin.super and admin.users to change other users information. 2017-01-28 16:48:11 +01:00
Flavio Copes
2c58db3418 Allow to see plugins and themes list without internet connection. Also add a more helpful message in the "add" view. re https://github.com/getgrav/grav/issues/1008 2017-01-22 15:50:37 +01:00
Djamil Legato
81b7dd10c7 Cleanup 2017-01-20 13:55:03 -08:00
Djamil Legato
39ef71f5d2 Fixed issue with downloaded package when installing a testing release 2017-01-19 12:56:58 -08:00
Andy Miller
8b6d97da29 Merge branch 'feature/exit_after_removel_package' into develop
# Conflicts:
#	CHANGELOG.md
2017-01-12 12:00:34 -07:00
Flavio Copes
6a1ee7481a Remove unnneded code, related to ca00a9b150 2017-01-12 19:55:43 +01:00
Flavio Copes
ca00a9b150 Fix #920 bug in deleting a file uploaded with the file field 2017-01-12 19:36:13 +01:00
Andy Miller
78a7d60c82 Fix for processing exiting after removing package so events are not fired on missing plugins 2017-01-11 20:05:07 -07:00
Flavio Copes
964a4f8ea3 Fixed saving the configuration if not admin.super 2017-01-03 10:58:24 +01:00
Flavio Copes
92eb33493e Allow to clear the cache if admin.maintenance, as stated in the docs 2016-12-31 11:21:38 +01:00
Andy Miller
bd87afd3e5 Added several new onAdminAfter...() events for 3rd party interaction 2016-12-07 05:46:43 -07:00
Flavio Copes
a8d8b048bd Fix updating/installing packages from admin 2016-11-24 15:13:47 +01:00
Amélie Turgeon
91bda37957 added 'afterAdminSave' hook (#866)
* added 'afterAdminSave' hook

this event is fired just after the save was correctly completed from Admin plugin

* Change of the new event hook name

consistency oblige, new name is `onAdminAfterSave`
2016-11-19 11:24:54 -07:00
Flavio Copes
63c83d785c Fix #857 login to admin with permission inherited from group 2016-11-08 16:42:57 +01: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
Renata
3d829f4d21 Removed the possibility to enumerate the users (#849)
Using the forgot password feature.
2016-11-03 15:20:03 +01:00
Flavio Copes
9697b07aa6 Fix #843 use rawRoute for parent too when saving 2016-10-31 19:23:33 +01:00
Fredrik Ekelund
a42fd33c4f Use Media class to retrieve files in AdminController#taskGetFilesInFolder (#842)
Using the same class that's used to list media when rendering
pages ensures a consistent experience. The goal here was to avoid
listing image alternatives, but retain all the files available
through $page->media()->all()
2016-10-27 11:28:09 +02:00
Fredrik Ekelund
96ac75379f Always delete image alternatives in AdminController#taskDelmedia (#814)
* Always delete image alternatives in AdminController#taskDelmedia

Previously, image alternatives would only be deleted if the base
image wasn't found, and only the first three alternatives would
be removed. This commit changes that, so that all image
alternatives are always deleted when the base image is.

* Remove use of $deleteCount in AdminController#taskDelmedia
2016-10-27 11:12:01 +02:00
Andy Miller
4dbeb5ab57 Added getRouteDetails() method 2016-10-26 17:52:26 -06:00
Djamil Legato
02eeca78e8 Support for Premium Resources (#809)
* Initial premium preparation for licenses and gpm handling

* Premium styling

* Removed unused import

* Synced CSS

* Updated selectize
2016-10-13 10:13:18 -07:00
Flavio Copes
04f17a02b3 Fix #821 issue in saving a page to a new language when the filename does not contain the filename yet.
Also extract determineFilenameIncludingLanguage() method  and add
corresponding test.
2016-10-13 16:44:11 +02:00
Flavio Copes
c284c8a26c Allow controller to be initialized in test without having to instantiate Grav 2016-10-13 16:44:11 +02:00
Flavio Copes
fd426b4d49 Show more helpful error message if destination is not specified in a file field 2016-10-10 13:07:34 +02:00
Flavio Copes
ef063f0e7d Show helpful error message if no tmp folder is found #811 2016-10-10 13:07:14 +02:00
Flavio Copes
0b42f8e34c Add an onAdminData event to allow plugins to add additional blueprints data 2016-10-04 16:51:41 +02:00
Djamil Legato
c4ed5aff44 Allow filepicker field to peak at the pending uploaded files and optimistically select them (fixes #792) 2016-10-02 14:00:53 -07:00
Djamil Legato
a011368e40 Fixed issue with file field in collections that caused unexpected duplication of items (fixes #775) 2016-09-30 21:55:49 -07:00
Andy Miller
1ea0a54903 Added new onAdminCreatePageFrontmatter event - https://github.com/getgrav/grav-plugin-admin/pull/781 2016-09-30 08:58:26 -06:00
Andy Miller
a77ac2f5be Added new onAdminTaskExecute() event to better support 3rd party plugin tasks 2016-09-27 18:30:55 -06:00
Matias Griese
8e5720f7b9 Improve multi-site support 2016-09-27 18:21:11 +03:00
Djamil Legato
aba43374de Clean up POST keys containing square brackets, allows for regex ranges in routes (fixes #776) 2016-09-15 12:57:28 -07:00
Flavio Copes
fd8c7889d1 Fix #1034 redirect of page creation procedure when system.home.hide_in_urls is enabled 2016-09-13 13:45:09 +02:00
Flavio Copes
a86623f432 Fix issue with checking the package dependencies when more than one package is being inspected 2016-09-08 19:37:50 +02:00
Andy Miller
5176e5b3ff Use cache/tmp fallback rather than just cache/ 2016-09-08 08:56:48 -06:00
Andy Miller
8a02b72307 Fallback for missing tmp:// stream and unified method 2016-09-07 22:00:57 -06:00
Flavio Copes
11666e3329 pagemediaselect is now an extend of filepicker. Add default for folder field. Fill changelog. 2016-09-05 15:12:27 +02:00
Flavio Copes
8a39b36603 Filepicker form field (#750)
# What this PR introduces
This PR introduces a `filepicker` field which is a replacement for the `pagemediaselect` field. 

This field loads the files list via AJAX each time it's triggered. This means you can now upload a file via FTP or via Admin and the new file is immediately available to be selected.

Previously, `pagemediaselect` required a page reload to see the newly added files.
--

### Options

#### `accept`

`accept` allows file extensions. For example, to only allow `yaml` and `json` files:

```yaml
accept:
  - .yaml
  - .json
```

By default, any file is listed.

#### `folder`
```yaml
folder: 'user/plugins/testing`
```

folder has been enhanced to allow `self@` as well as `page@:` and `theme@:` prefixes.
Example of usage, assuming we have a blog item at the route `/blog/ajax-upload` (physical location being `user/pages/02.blog/ajax-upload`), with the `page@:` prefix the folder would be:

```yaml
folder: 'page@:/blog/ajax-upload'
```

#### `preview_images`
```yaml
preview_images: true
```

If enabled, shows a preview for the images file types

> ### NOTE: `self@` is not allowed outside of the Pages scope, an error will be thrown. 


## Example usage


```
            header.a_file:
              type: filepicker
              folder: 'user/plugins/admin'
              label: Select a file
```
2016-09-02 18:29:47 +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
bccaa47544 Better date format guesser 2016-08-26 17:28:55 -06:00
Andy Miller
2dc2feca32 Fixed broken page types filtering 2016-08-26 13:45:22 -06:00
Djamil Legato
86c9d33b64 Fixed tmp find resource 2016-08-25 12:44:33 -07:00
Djamil Legato
19799ce2db Updated Selfupgrade and Install tasks to use tmp:// for storing the downloaded packages 2016-08-23 16:35:41 -07:00
Andy Miller
18c3b3e39f Potential Curl fix for invalid cert errors with News Feeds 2016-08-15 10:45:58 -06:00
Flavio Copes
988f4a0389 [WIP] Notifications (#599)
Adds a new notifications feature to the Admin plugin. It will now lookup notifications which are set up on getgrav.org and will inform users, and also alert for new updates and provide awareness on various topics.

Also fixes issue with Array field in `value_only` mode, improperly displaying the key when novalue was set, and fixes issue with drag handlers in Array not showing/hiding properly (#950)

Updated FontAwesome to 4.6.3
2016-08-11 19:17:02 +02:00
Flavio Copes
4a50d2f0e2 Only avoid overwriting files (introduced in b159581156) if avoid_overwriting is set on the field 2016-08-02 17:48:07 +02:00