35 Commits

Author SHA1 Message Date
Marina Glancy
6dd92c0234 MDL-39177 Updating userid when file is overwritten 2013-05-20 14:09:11 +10:00
Marina Glancy
935429af8b MDL-39177 More comments about confusing files.source field 2013-05-17 13:43:45 +10:00
Marina Glancy
e9e32b1d88 MDL-39177 File reference is not updated when overwriting the file 2013-05-17 13:43:44 +10:00
Petr Škoda
e029dff4cd MDL-38154 improve dir delete performance 2013-02-23 15:10:48 +01:00
Marina Glancy
42aa6e15bb MDL-34290, MDL-33416 prepare to deprecate fields files.referencelastsync and referencelifetime 2012-08-29 11:56:18 +08:00
Marina Glancy
bc6f241ca2 MDL-34290 repository API: add repository function to import referenced file
it must be independed from sync_external_file because sync often does not actually download contents, it is used just to retrieve
the size of the file. Besides the timeouts for get_file and sync requests are very different.

Also add option to send_stored_file() to ignore reference and send cached contents
2012-08-29 11:56:15 +08:00
Marina Glancy
14b7e50001 MDL-34290 update all references after the source is changed
- When several records in {files} have the same record in {files_reference} and the synchronisation is performed, we need to update
all records in {files} so all files know if source is changed and that sync was performed;
- also when local moodle file content is changed we immediately update all files referencing to it (therefore sync of references
to the local files is unnecessary);
2012-08-29 11:56:00 +08:00
Rajesh Taneja
4e782b32f3 MDL-33425 user: Replaced filepicker with filemanager on edit profile page 2012-06-18 10:19:48 +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
David Mudrak
3b2465fee6 MDL-33587 Delete the reference properly in stored_file::delete() 2012-06-07 18:02:12 +02:00
David Mudrak
1c0da8498f MDL-33587 Improve stored_file::delete_reference() method 2012-06-07 17:37:25 +02:00
David Mudrak
2fa8aea279 MDL-33587 Throw coding exception when trying to unlink a non-reference file 2012-06-07 17:36:29 +02:00
Marina Glancy
efa28f30f2 MDL-33391 Files API, Repository : mimetype should be determined from file extension when possible 2012-06-05 13:29:07 +08:00
Sam Hemelryk
63f2813497 Merge branch 'dev_MDL-33147_transaction' of git://github.com/dongsheng/moodle 2012-05-28 11:04:43 +12:00
Dan Poltawski
37eba7d5d6 Merge branch 'dev_MDL-33149_stored_file_access' of git://github.com/dongsheng/moodle 2012-05-22 16:51:33 +08:00
Dongsheng Cai
291a3d1fb6 MDL-33149 stored_file::repository should be private 2012-05-22 15:00:49 +08:00
Dongsheng Cai
e3c0211879 MDL-33147 Added transaction support for some Files APIs 2012-05-22 13:51:04 +08:00
Dan Poltawski
b99065be04 MDL-33032 - dont require repository/lib.php until necessary
This is an ugly fix to a broken installer only.
2012-05-21 20:04:42 +08:00
Dongsheng Cai
70c1bc843a MDL-33127 stored_file::update should use get_content_file_location because it tried to update file_record 2012-05-21 16:37:53 +08: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
Dongsheng Cai
8177b7b9f0 MDL-33082 Detecting mimetype based on content bytes 2012-05-21 15:26:39 +08:00
Dongsheng Cai
61506a0af9 MDL-33032 Fixed issues for file integration
1. Added tracker issue number in comment
2. Fixed stored_file::delete_reference()
3. repository::send_file() will throw exception if not implemented by subclass
4. Fixed renaming unit test, added one unit test for deleting original file
5. Fixed copyright statement for googledoc and picasa repository plugin
6. Implemented stored_file::set_filesize()
2012-05-21 11:57:56 +08:00
Dongsheng Cai
fc4e8034fc MDL-32867 filemanager and repository
1. Allowing "." as filename, so filemanager can rename folder
2. Fixed import_external_file method
3. Disallow recent repository to list file references
2012-05-21 11:57:55 +08:00
Dongsheng Cai
04e3b007c2 MDL-28666 phpdoc improvements 2012-05-21 11:57:54 +08:00
Dongsheng Cai
7051415cca MDL-28666 Files API and db changes
1. Fix db regression
2. Unit tests for is_external_file() and rename exception
3. Searching reference method exclude draft files
2012-05-21 11:57:54 +08:00
Marina Glancy
6dd299befa MDL-31901, MDL-28666 merged files API changes 2012-05-21 11:57:53 +08:00
Marina Glancy
b7725e30c2 MDL-32914 fixed function get_imageinfo() to get rid of notice messages 2012-05-21 11:57:53 +08:00
Marina Glancy
c092681b4b MDL-31901: Updating/moving files in FileManager
- added new functions to the backend (repository/draftfiles_ajax.php) to allow changing of file name, location, license and author in one request
- enabled changing file properties using JS UI (lib/form/filemanager.js)
2012-05-21 11:57:52 +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
Dongsheng Cai
d2b7803e5a MDL-30973 Files API, check and update DocBlock 2012-02-15 12:48:57 +08:00
Petr Skoda
31cd5fe8ef MDL-29867 fix invalid file author 2011-10-22 20:18:11 +02:00
Tim Hunt
d610cb8980 MDL-27915 improved debuginfo for some file exceptions. 2011-06-17 19:46:09 +01:00
Petr Skoda
693ef3a8af MDL-24283 improved stored_file encapsulation, this should allow us to hack with stored_file/file_storage internals in the future without breaking BC 2010-09-19 15:50:18 +00:00
Petr Skoda
d0b6f92a23 MDL-23885 flattening filepool directory structure - hopefully this will lower the number of directories but still keep a reasonable number of files in each directory on large installs; see tracker for more details 2010-08-25 21:45:34 +00:00
Petr Skoda
64f93798d4 MDL-22950 adding new component column to the files table, unfortunately this change requires changes in all 2.0dev code, please review all custom code that was already upgraded to 2.0; fixing multiple problems and regressions in mod/assignment 2010-07-03 13:37:13 +00:00