50 Commits

Author SHA1 Message Date
Simey Lameze
4ce27477fb MDL-64882 repository_filesystem: deprecate legacy cron function 2019-03-01 11:12:55 +08:00
Cameron Ball
03756f0bdb
MDL-59700 filestorage: Rework repositories to avoid add_file_to_pool
For historical reasons repositories need to call add_file_to_pool
to sync file records. However now that a before_file_created hook
has been added additional information is needed by add_file_to_pool.

Ideally add_file_to_pool and friends will become private/protected,
so we need to remove all uses of it in core.

This patch adds some new methods to the file class to allow syncing
to be managed internally by the file and the file_storage class.
2017-08-07 15:50:15 +08:00
Juan Leyva
fcdd7730bd MDL-58823 repository: Fix redirections to external files
We cannot use redirect() because is not compatible with
webservice/pluginfile.php
This script is defined as an AJAX_SCRIPT so redirections are not
allowed by redirect() function.
2017-05-05 10:04:51 +02:00
Andrew Nicols
e6a4780452 MDL-58297 core: Update to use new hashing functions 2017-04-07 10:40:23 +08:00
Damyon Wiese
663640f5b3 MDL-40759 icons: convert uses of pix_url to pix_icon
Also change filepicker to use scaled svgs instead of sets of custom pngs. The svgs are taken from font-awesome.
2017-03-17 15:52:17 +08:00
Frederic Massart
048f8073d1
Revert "Merge branch 'MDL-54110_master' of https://github.com/marxjohnson/moodle"
This reverts commit 016e0abfbc1992f01eadfdef02de6e56ffad8e9f, reversing
changes made to 58a2f0ac40f24da9c9955110902f8e14cd0d8419.
2016-06-23 11:51:44 +08:00
Frederic Massart
796f86f753
Revert "MDL-54110 repositories: Whitespace, Typo + unit test fixes"
This reverts commit 7e4d43e1a263f7003207a382251de900341db92c.
2016-06-23 11:51:44 +08:00
Andrew Nicols
7e4d43e1a2 MDL-54110 repositories: Whitespace, Typo + unit test fixes 2016-05-11 10:39:40 +08:00
Mark Johnson
121b67411f MDL-54110 repositories: Allow repositories to ignore post_max_size
Repositories can now override usespost() if they don't upload using POST
requests. This restores the ability of users with
moodle/course:ignorefilesizelimits to upload files of unlimited size
lost in MDL-44626.
2016-05-10 16:10:24 +01:00
Frederic Massart
1039b52e9a MDL-53057 repository_filesystem: Added support for search 2016-02-19 14:46:31 +08:00
Marina Glancy
58e5ab1bac MDL-51985 files: sync timemodified when possible 2015-10-30 14:46:09 +08:00
Andrew Nicols
2b53b13ff7 MDL-49627 core: Update uses of generate_image_thumbnail
This removes the need to write tempfiles in these locations.
2015-04-01 11:05:19 +08:00
Marina Glancy
1c4f42e1b2 MDL-47729 repository_filesystem: smarter sync of references
It was noticed that if file content was once imported the following
synchronisations do not discover the changes
2015-03-13 11:01:02 +08:00
Nelson Moller
413907cff3 MDL-48929 repository_filesystem: Valide relative path against realpath
On Windows systems, there could have been a mix of back and forward
slashes, causing the validation of the relative path to fail. Now
we will always get the realpath before comparing.
2015-01-23 17:26:32 +08:00
Tim Hunt
5bcfd504df MDL-45618 Fix @since PHPdoc tags. 2014-05-19 17:03:04 +01:00
Dan Marsden
8164a2b549 MDL-43192 Repository: param doesn't exist - should use function 2013-12-04 20:54:57 +13:00
Frederic Massart
37b6c65dfe MDL-41807 repository_filesystem: Coding style clean up 2013-11-04 13:35:04 +08:00
Frederic Massart
5df695d221 MDL-41807 repository_filesystem: Prevent access to parent directories 2013-11-04 13:34:59 +08:00
Petr Škoda
0c431257e9 MDL-42387 standardise file lifetime handling 2013-11-01 10:42:18 +01:00
Marina Glancy
5e5923ea28 MDL-42016 repository: Implement new sync method in repositories 2013-10-06 18:05:13 +11:00
Dan Marsden
361a47d409 MDL-41580 SCORM: allow imsmanifest.xml to be used in file system repos 2013-09-24 12:08:38 +12:00
Marina Glancy
a7e505e659 MDL-23044 Use Files API functions in filesystem cron 2013-09-03 17:00:29 +10:00
Marina Glancy
2ef39ca4c5 MDL-23044 Support for storing thumbnails in repository filesystem 2013-08-30 14:22:48 +10:00
Petr Škoda
2f1e464a88 MDL-40438 migrate all collatorlib:: and textlib:: uses 2013-08-06 21:04:35 +02:00
Frederic Massart
c122f484c5 MDL-38366 repository_filesystem: Prevent use of empty subdir 2013-07-10 14:03:46 +08:00
Ankit Agarwal
0601e0eef6 MDL-40402 libraries: Replace get_system_context() with context_system::instance() in core 2013-07-04 15:41:06 +08:00
Dan Poltawski
8fb59b10fc MDL-38852 repository_filesystem: missing setType calls 2013-04-03 11:13:58 +08:00
Frederic Massart
31581ae65d MDL-36426 repository: Prevent login_as() users to access private repositories 2013-03-04 02:38:35 +01:00
Marina Glancy
63d8ccef81 MDL-34290 repository_filesystem: do not store files in moodle filepool unless images 2012-08-29 11:56:19 +08:00
Marina Glancy
96221c605a MDL-34290 repository_filesystem add original info function and reduce ref lifetime 2012-08-29 11:56:15 +08:00
Marina Glancy
7355640aed MDL-34748 repository_filesystem: Sort files by title by default 2012-08-13 11:58:58 +08:00
Dongsheng Cai
d6453211b6 MDL-33513: Make files->source field consistent 2012-06-15 14:51:07 +08:00
Dan Poltawski
4585e6ac98 Merge branch 'wip-MDL-33550-master' of git://github.com/marinaglancy/moodle 2012-06-14 16:23:08 +08:00
Dan Poltawski
414ce30812 Revert MDL-33513
This reverts commit b2cf2b807f7a7c8d1a02ebb52038c61cc63a1494.
This reverts commit 24b96f01702571989fa77a05c5cd11b9fedc2745.
This reverts commit 39c60294a6a027ae56f4b9eda159bb589b60c0c0.
This reverts commit 8a288971e25eaaa4c8cbd67e450cee0e12435d4e.
2012-06-14 13:57:45 +08:00
Dan Poltawski
cd925ac79b Merge branch 'dev_MDL-33513_files_source' of git://github.com/danpoltawski/moodle 2012-06-14 11:12:21 +08:00
Marina Glancy
0b2bfbd1c6 MDL-33550 Correctly process situation when file reference source is missing
- do not die with fatal error if source file in moodle internal repository is missing;
- moved code duplication for moodle repositories into class repository (functions send_file, get_reference_details, get_file_by_reference, get_file_reference);
- update file status after repository::sync_external_file so we know that it is missing (or not missing anymore). Do not run this function more than once for file within one request;
- display readable name for Private Files and Server files with the new format;
- display broken icon in filemanager if we know that source is missing, display information (for admin) where it was located before: see repository::get_reference_details() and extending classes;
- removed unnecessary queries in stored_file::sync_external_file();
- syncronize files before displaying it's size in mod_resource, do not query  directly
2012-06-13 12:11:06 +08:00
Dan Poltawski
4a126f1725 MDL-32573 - repository: make instance_config_form static 2012-06-12 22:17:29 +08:00
Dongsheng Cai
8a288971e2 MDL-33513: Make files->source field consistent 2012-06-10 17:47:00 +10:00
Marina Glancy
559276b153 MDL-32247,MDL-32831,MDL-32900 Use correct url building of file type icons
- function get_mimetypes_array() now contains also information about filetype groups and language strings
- use 'smart' human-readable mimetype description
- never determine filetype group based on filetype icon image! remove function mimeinfo_from_icon()
- get rid of class filetype_parser and file lib/filestorage/file_types.mm, replaced with functions file_get_typegroup(), file_extension_in_typegroup() and file_mimetype_in_typegroup()
- support multiple icon sizes, not only 16 and 32
- retrieve filetype icon only using proper functions file_..._icon() from lib/filelib.php throughout the code
- increase size of repository thumbnails to 90 and icons to 24 (will take effect when new icons exist)
2012-05-21 16:01:04 +08:00
Marina Glancy
5bdf63cce0 MDL-14636: Support table view in Filepicker, provide more info about files
- Added table view in Filepicker where for each file we show Name, Last modified, Size and Type. Sortable by column
- Preprocess list of files returned from repositories to include formatted size, dates, type and also add filetype icon
- Make sure that local repositories (coursefiles, filesystem, local, recent, user) return information about file size, datemodified, datecreated, author, license
2012-05-21 11:57:51 +08:00
Dongsheng Cai
6723372514 MDL-28666 Extends repository to support references
1. Allow repository to create references to external contents
2. Extends files API to handle file references
3. Generic file caching
4. Backup/restore file references
5. Download external contents if repository uninstalled
6. Allow filepicker to display iframe
7. PHPUnit test suits
2012-05-21 11:57:51 +08:00
Petr Skoda
d078f6d38e standardized PHPDocs package info 2010-09-06 11:29:21 +00:00
Petr Skoda
8512eebe07 MDL-23984 fixed filesystem repository to use our default permissions 2010-08-29 16:35:22 +00:00
Petr Skoda
ede7252234 MDL-23784 finally getting rid of all legacy .gif and .png extensions, yay! fixing issues with incorrect & in JS code 2010-08-12 20:37:24 +00:00
Dongsheng Cai
6b172cdc7f "MDL-23326, fixed undefined index in repository conf form, added validation function to repository plugin" 2010-08-09 09:03:07 +00:00
Dongsheng Cai
5513379ae6 "MDL-23326, fixed undefined index" 2010-08-09 06:26:14 +00:00
Dongsheng Cai
85b5ed5de2 "MDL-13766, filesystem plugin should return empty url attribute" 2010-08-03 09:03:56 +00:00
Dongsheng Cai
8e5af6cfa1 "MDL-23530, filesystem plugin should be configured by admins only" 2010-08-02 06:33:34 +00:00
Dongsheng Cai
a5adfa2658 MDL-23072, properly localised repository instance name 2010-07-27 09:03:54 +00:00
Dongsheng Cai
e35194bec4 MDL-22982
1. rename repository.class to lib.php
2. fixed repository_callback.php
3. repository_ajax use moodle default exception handler
4. improve file_get_user_used_space performance
2010-07-05 07:27:49 +00:00