303 Commits

Author SHA1 Message Date
Petr Škoda
faf40ca3e3 MDL-34585 fix broken blog file access control 2012-08-02 09:58:16 +02:00
Adrian Greeve
b0c6dc1cac MDL-34465 - lib - Replacing get_context_instance with context_XXXX::instance (group 8) 2012-07-27 10:10:46 +08:00
David Balch
96aeb5be35 MDL-34143 Add file type information for .mdb .accdb (MS Access databases) 2012-07-06 09:44:25 +08:00
Eloy Lafuente (stronk7)
2fba8f5a92 Merge branch 'wip-MDL-34063-master' of git://github.com/marinaglancy/moodle 2012-07-05 18:34:27 +02:00
Sam Hemelryk
c425663c4c Merge branch 'MDL-27125_master_2' of git://git.catalyst.net.nz/moodle-r2 2012-07-04 09:32:45 +12:00
David Balch
c7aed1e11b MDL-34063 XHTML files should use the HTML icon, not the markup icon 2012-07-02 14:25:56 +08:00
Marina Glancy
3b6629c088 MDL-33948 file_save_draft_area_files() validates if references are allowed and allows unlimited file size 2012-07-02 14:11:55 +08:00
Martin Dougiamas
386a862f95 MDL-34004 - reinstate the custom HTML icon as separate from other markup icons, because it usually means a "page" to most people that displays in the browser. These icons are temporary (but workable) until Barbara can put in some nice ones that work as a set. The 16px one is from Moodle 2.2 and the others are copies of "unknown". 2012-06-25 23:05:44 +08:00
Barbara Ramiro
5a322c8cfc MDL-33381 Icon label removed for all file types to make it generic 2012-06-21 18:19:33 +08:00
Marina Glancy
83d2700ec9 MDL-33832 Fixed filling of files.source field
- also supress the error on unserialise (because people already may have broken files.source field)
- also display details about unparseable JSON error
- make source field look the same across repositories
2012-06-20 16:09:37 +08:00
Jonathan Harker
def4a8f5b7 MDL-27125 better manage file handles when downloading multiple files.
Based on Dongsheng Cai's branch: s11_MDL-27125_curl_file_handler_master
2012-06-20 16:46:29 +12: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
Marina Glancy
ff32444a7c MDL-33590 Correctly determine that file is an archive to enable unzip in filemanager 2012-06-13 08:57:10 +08:00
Dongsheng Cai
8a288971e2 MDL-33513: Make files->source field consistent 2012-06-10 17:47:00 +10:00
Sam Hemelryk
238858e362 MDL-26277: Fixed whitespace post integration 2012-06-06 09:15:18 +12:00
Sam Hemelryk
7df271d9b3 Merge branch 'MDL-27559-master-v2' of https://github.com/mackensen/moodle 2012-06-06 08:51:11 +12:00
Dan Poltawski
9856d05c26 Merge branch 'MDL-33378-tiff-thumb' of git://github.com/mudrd8mz/moodle 2012-05-29 15:00:21 +08:00
David Mudrak
77a439336f MDL-33378 file thumbnail falls back to the default mimetype icon
If for some reason the thumbnail generation fails, the default core
mimetype icon for the given file is sent to the browser.
2012-05-28 12:19:05 +02:00
Sam Hemelryk
c67b08828c MDL-18763 Fixed up typo in comments of new pic size 2012-05-28 16:52:53 +12:00
Sam Hemelryk
a2aba3f612 Merge branch 'w21_MDL-18763_m23_avatar512' of git://github.com/skodak/moodle 2012-05-28 16:50:46 +12:00
Charles Fulton
80c27aab8c MDL-27559 opendir: validate directory pointer on open 2012-05-25 08:52:12 -07:00
Dan Poltawski
0fb13aa3d8 Merge branch 'dev_MDL-33127_draft_storing' of git://github.com/dongsheng/moodle 2012-05-24 16:34:32 +08:00
Dan Poltawski
2625d99b52 Merge branch 'wip-MDL-33144-master' of git://github.com/marinaglancy/moodle 2012-05-24 16:32:32 +08:00
Marina Glancy
ae7f35b934 MDL-33144 display filetype icon and mimetype based on extension
- use finfo to determine mimetype of a file only when it is unknown from file extension
- display filetype icon and mimetype in filemanager based on file extension
- fixed a small issue with specifying extension instead of group in file_get_typegroup()
- allow only web-compartible image types when embedding into editor or using in database field
- created new groups web_video and web_audio to use in resource module
2012-05-23 14:51:55 +08:00
Rajesh Taneja
34b455fc98 MDL-32155 blocks: User can't access file, if block is hidden or doesn't have block:view capability 2012-05-23 12:52:27 +08:00
Dongsheng Cai
65fead53fb MDL-33127 Fixed the problem when storing draft files 2012-05-22 14:50:47 +08:00
Dan Poltawski
21878be7c8 Merge branch 'wip-files23-fixes' of git://github.com/marinaglancy/moodle 2012-05-22 14:32:35 +08:00
Marina Glancy
e563582760 MDL-33158 fixed bugs with restricting file typs in filepicker
- extension was returned without leading dot which resulted in improper validation
- fixed human-readable mime type in error message
- fixed youtube repository to support video files and pass filetype validation
2012-05-22 14:24:11 +08:00
Marina Glancy
ca9875db1b MDL-33160 fixed some icons and groups for file types 2012-05-22 14:18:06 +08:00
Dan Poltawski
1082e7daf7 MDL-31901: Fix trailing whitespace 2012-05-21 19:18:44 +08:00
Dan Poltawski
7d44f9c2a2 MDL-28666: filelib - remove unusused globals 2012-05-21 18:21:36 +08:00
Marina Glancy
a8d6dda4f2 MDL-32247 fixed bug with displaying icon for unknown filetype, fixed merge mistakes 2012-05-21 17:12:55 +08:00
Barbara Ramiro
0f1bdd0d2c MDL-32900 Change Icons to FileTypesIcons 2012-05-21 16:37:14 +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
David Mudrak
f653c9d830 MDL-33096 update the file's timemodified if it was changed in the draft area
Previously up to 2.2, new file records were created for all files that
were modified in the draft area - see file_save_draft_area_files().
The commit aba1e17dd7ffa5e42d309fb2efe7945aeb3b3d39 introduced a new way
of re-using the previous file's record. We need to transfer the
timemodified of the file in the draft area into the file in the real
area when saving the draft area to achieve the same behaviour now in 2.3.

Note this may eventually lead to kinda weird situation when the file was
created say on a certain timecreated but then was replaced with another file
that has timemodified set to a lower value (in other words, the file
will look as if it was firstly modified and then created). This case
should be handled by the filepicker if it is seen as the issue.
2012-05-21 11:57:56 +08:00
David Mudrak
3333e7e20c MDL-33093 invalidate the thumbnail in the local browser's cache on update
This adds &oid= parameter to the URL of file preview images. The
parameter is supposed to be ignored by draftfile.php and pluginfile.php.
It just holds some unique identification of the original file's
revision. Currently, we use the timestamp of the most recent
modification of the original file.
2012-05-21 11:57:56 +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
Marina Glancy
6dd299befa MDL-31901, MDL-28666 merged files API changes 2012-05-21 11:57:53 +08:00
David Mudrak
dafe129637 MDL-31901 draft files manager supports realthumbnail, realicon and dimensions for images 2012-05-21 11:57:53 +08:00
Marina Glancy
9a62f7799b MDL-32867 Working with external references in filemanager
- Files that are references to external resources have special shortcut icon in filemanager
- When user selects a REF file in filemanager, he can see the 'Original' of the file in the way that original repository wants to show it, it is loaded dynamically via AJAX request
- Files that are themselves the source of references of other files in the system have 'link' icon in filemanager. When user tries to remove/rename/overwrite SRC file he is warned that all ## existing references will be updated/converted to copies.
- Changed confirmation messages for deleting, moving/renaming of the folders
- confirmation dialog in filemanager is using YUI3 now
2012-05-21 11:57:53 +08:00
Marina Glancy
e709ddd29c MDL-31901: Allow FileManager to re-use FilePicker JS code for view modes:
- when loading core_filepicker we extend the Node element with functions necessary to display files list in different view modes;
- repository/filepicker.js is changed to use those functions;
- FileManager now has three different view modes (icon view, tree view and table view), JS code is re-used from FilePicker;
- files in FileManager no longer have context menu, they have one popup Widget with different actions instead;
- Added more templates for JS code to FileManager, use similar CSS class names as FilePicker;
- lib/filelib.php : fixed double slashes in path, return more data about files;
- lib/form/filemanager.php : pass information to FileManager about available licenses and default author;
- repository/draftfiles_ajax.php : return information about directory tree for file moving UI in FileManager, return formatted information;
- repository/lib.php : function repository::prepare_listing() now can work also with draftarea files listing;
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
Petr Skoda
33d9f44bc6 MDL-18763 add 512x512px user avatar support 2012-05-19 18:47:23 +02:00
Charles Fulton
66969d5004 MDL-32889 lib: escape filename in Content-Disposition header 2012-05-09 16:03:33 -04:00
Dan Poltawski
4d6206ce67 MDL-32628 lib/filelib.php: Set user profile image expires to 1 year
This is to reduce the performance impact of user profile images
requests. Pictures are now referenced by a revision counter so
any changes in picture will not be badly cached any longer.
2012-05-04 09:36:11 +08:00
Dan Poltawski
0dda790c05 Merge branch 'w18_MDL-32628_m23_avatarperf2' of git://github.com/skodak/moodle
Conflicts:
    lib/db/upgrade.php
	version.php
2012-05-04 09:28:41 +08:00