277 Commits

Author SHA1 Message Date
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
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
Petr Skoda
4d254790c4 MDL-32628 add revision for user avatar images
This should finally resolve all avatar caching issues and should also help with performance.
2012-04-30 23:36:47 +02:00
Petr Skoda
d5dd0540c2 MDL-26028 send_file performance improvements
Includes X-Sendfile support, ETags for stored_files and general cleanup.
2012-04-29 18:27:23 +02:00
Petr Skoda
99302c5e96 MDL-26028 cleanup all IE6 gzip hacks 2012-04-28 18:00:06 +02:00
David Mudrak
7a00d4385d MDL-32471 preview thumbnails support for other component types
This commit affects mostly qtypes. Other standard components either do
not have pluginfile handler or have been already updated to the new API.
2012-04-24 14:29:44 +02:00
David Mudrak
957fc845b6 MDL-32471 preview thumbnails support for blocks
block_xxx_pluginfile() now accepts the $options parameter that is to be passed
to the send_stored_file() function.
2012-04-24 14:01:53 +02:00
David Mudrak
261cbbacc1 MDL-32471 preview thumbnails support for activity modules
Activity module's xxx_pluginfile() now accepts the $options parameter
that is to be passed to the send_stored_file() function.
2012-04-24 12:09:45 +02:00
David Mudrak
82c224ee7a MDL-32471 send_stored_file() now supports the preview option
If for any reason the preview image can't be generated for the given
file (eg we do not support its mimetype yet), the function will send
404 Not Found HTTP header. This will be useful for the lazy loading of
the file thumbnails as the JavaScript will simply ignore such response
and will not replace the default icon for the file.

In the future, a fallback thumbnail generator can be implemented that
would generate some sort of default preview for all files (eg using
the mimetype icon like some desktop OS do).
2012-04-24 12:09:45 +02:00
David Mudrak
796495fed2 MDL-32471 changing the interface of the send_stored_file() 2012-04-24 12:09:44 +02:00
David Mudrak
b071498f1b MDL-32471 pluginfile.php accepts optional parameter 'preview' 2012-04-24 12:09:44 +02:00
Dan Marsden
dbdc735559 MDL-32147 - use correct 404 for server type 2012-03-23 10:01:04 +13:00
Dongsheng Cai
d2b7803e5a MDL-30973 Files API, check and update DocBlock 2012-02-15 12:48:57 +08:00
Petr Skoda
b85b25ebb8 MDL-31006 fix various notices in PHP54
PHP54 compatibility
2012-01-18 01:03:20 +01:00
Petr Skoda
58a435f6cf MDL-31171 fix blog attachment serving in BLOG_USER_LEVEL 2012-01-15 19:11:16 +01:00
Eloy Lafuente
90911c4ff9 MDL-29844 Administration: Added new config for users to login for viewing profile image 2012-01-03 11:53:49 +08:00
Dongsheng Cai
ec0d6ea2a9 MDL-28646 Web service: core_course_get_contents()
1. Implement core_course_get_contents web service
2. Implement callbacks in folder, resource, page and url modules
3. Implement download script for web service
2011-11-28 16:22:38 +08:00
Tom Lanyon
365bec4c06 MDL-28701 Change all uses of $CFG->dataroot/cache to $CFG->cachedir 2011-09-10 10:35:46 +02:00
Tom Lanyon
7aa06e6ded MDL-28701 Change all uses of $CFG->dataroot/temp to $CFG->tempdir 2011-09-10 10:35:39 +02:00
Eloy Lafuente (stronk7)
0a4ca115b2 Merge branch 'w33_MDL-26796_m22_arrayparams' of git://github.com/skodak/moodle 2011-08-24 14:06:22 +02:00
Petr Skoda
ffa5e3ddae MDL-28708 minor unrelated cleanup and elimination of dead code 2011-08-19 17:26:28 +02:00
Tony Levi
f73c6bad2c MDL-28708: Send 304 Not Modified response when browser If-Modified-Since header is after file mtime 2011-08-19 17:14:54 +02:00
Petr Skoda
18bd7573d6 MDL-26796 convert array parameter cleaning to new functions 2011-08-18 08:40:33 +02:00
Eloy Lafuente (stronk7)
32dc8ecd16 MDL-27896 filters/editor - fix whitespace 2011-08-16 01:57:51 +02:00
Rajesh Taneja
f9157eb798 MDL-27896 editor - added sanity check to pick wrong context passed to editor creation 2011-08-12 11:33:21 +08:00
Petr Skoda
98eaf27e3c MDL-28280 remove obsolete unmaintained $CFG->usesid 2011-07-10 13:44:41 +02:00
Sam Hemelryk
5f1c825dfa Merged MDL-27251 Fixed up whitespace, Fixed broken string, reworded new strings 2011-05-03 10:51:06 +08:00
Aparup Banerjee
60b5a2fec7 MDL-27251 Files API - added timeout re-calculation as an optional argument. added setting for minimum Kbps for large files fetched from internet where the passed in timeout maybe too low.
allowed turning off the http HEAD request timeout calculation with zero (or negative) bitrate

	This was added in to allow servers that have a problem with
	HEAD requests to carry on with the given timeout without re-calculations.
	See PULL-651 for the discussion.

	the optional argument to force recalculation of timeout has been forced within scorm/locallib.php

	timeout re-calculation only increments timeout.
2011-04-27 10:49:40 +08:00