44 Commits

Author SHA1 Message Date
Sara Arjona
7430208d56
MDL-78884 files: Deprecate size parameter for icons
The parameter $size of the following functions has been deprecated and is not used any more:
  - file_extension_icon
  - file_file_icon
  - file_folder_icon
  - file_mimetype_icon
  - mimeinfo_from_type
  - url_guess_icon

That way, the sized icons (xxxxxxx-yyy.png) can be removed and replaced by SVG, to make it easier
to keep them updated because once they are replaced, there will only be one single file for each
MIME icon.
2023-08-23 07:30:16 +02:00
Peter Dias
cf66500557 MDL-70271 repository_dropbox: Switch to core\oauth2 API
Dropbox is updating their OAuth2 authentication to issue short-term
tokens, which are already supported by core\oauth2\client.

This commit updates the dropbox repository to use the
core\oauth2 API, which has built-in support for tokens and
offline access.
2021-06-22 11:44:11 +08:00
Peter Dias
44664d35e5 MDL-70048 dropbox: Update the dropbox search URL.
- Update fetch_dropbox_data to allow different result nodes and version
- Update search to the new URL with new params
- Update the get entities function to account for the change in structure.
2021-01-28 07:31:07 +08:00
Simey Lameze
653842539c MDL-64882 repository_dropbox: deprecate legacy cron function 2019-03-01 10:43:18 +08:00
John Okely
7eb50b3290 MDL-42834 admin: Remove wwwroot if used with moodle_url 2017-10-23 12:25:36 +08:00
John Okely
672f483670 MDL-42834 admin: Removal of httpswwwroot 2017-10-23 12:25:36 +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
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
Andrew Nicols
066963cd18 MDL-52051 repository_dropbox: Migrate to v2 API 2016-10-11 11:17:09 +08:00
Russell Smith
1fcf0ca8a5 MDL-35628 performance: Remove dirname() where possible.
dirname() is a slow function compared with __DIR__ and using
'/../'.  Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code.  This allows those required includes to perform as
best as possible in this situation.
2016-06-10 08:06:49 +10:00
Tim Hunt
5bcfd504df MDL-45618 Fix @since PHPdoc tags. 2014-05-19 17:03:04 +01:00
Rajesh Taneja
c3df05a9f9 MDL-43311 Repository: Added missing global CFG 2013-12-10 16:50:10 +08:00
Rajesh Taneja
c1b3ac4358 MDL-40079 repositories: Replaced const with configs 2013-12-02 09:41:41 +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
Frederic Massart
926a3512a5 MDL-39203 repository: Fixed authentication errors with Dropbox 2013-04-18 14:47:22 +08:00
Dan Poltawski
63745aef3c MDL-38852 repository_dropbox: fix missing setType calls 2013-04-03 11:13:57 +08:00
Marina Glancy
006bbbdf34 MDL-35542 Fixed a bug when trying to directly link to a file from Dropbox 2012-09-20 15:37:48 +08:00
Rossiani Wijaya
a3433213a1 MDL-29872 Dropbox repository: add message handler to filepicker header and add message to logout from dropbox. When user clicked on logout button from dropbox repository, it will also logging them out from dropbox site through a popup window 2012-09-07 15:42:43 +08:00
Dan Poltawski
7e3f70bed7 MDL-34290 using moodleform cast to int in dropbox repository settings 2012-08-29 11:56:18 +08:00
Marina Glancy
f4fe646b71 MDL-34665 Dropbox displays thumbnails and return info about file size and date last modified 2012-08-29 11:56:17 +08:00
Marina Glancy
75dd40b265 MDL-34290 repository_dropbox reference handling
- When Dropbox file is inserted by reference, the shared link is created and stored
- Added a function to fix old references (containing access_key/secret) with the proper ones
- Added support for external links in Dropbox (FILE_EXTERNAL), using the shared link API
- Make sure that repository::get_link() receives reference and not source (other repositories than Dropbox have those fields identical)
- Function get_file_by_reference respects request timeouts, downloads only images (for thumbnail generation),
- Function get_file respects request timeout
- do not use cache_file class (content is cached in moodle filepool if needed)
- added parameter for maximum size of files to cache
- added 'Manage' link for Filepicker
- added user name to
- added user name (if different from current) to 'Original' field
- added/corrected phpdocs
2012-08-29 11:56:16 +08:00
Marina Glancy
59cb759850 MDL-34290 repository API: do not confuse source and reference
make sure that repository function get_file_source_info receives as argument the source of the file,
and get_file receives a reference;
reference is a value of DB field files_reference.reference and result of get_file_reference(source).
Fix dropbox as the only repository that have different values in those fields;
also added information about user in dropbox reference and original
2012-08-29 11:56:14 +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
Dongsheng Cai
d6453211b6 MDL-33513: Make files->source field consistent 2012-06-15 14:51:07 +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
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
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
68a7c9a696 MDL-32095 some more E_STRICT fixes 2012-03-26 11:47:15 +02:00
Dan Poltawski
4b05a49bcb MDL-29960 repository/dropbox - Fix obvious incorrect url 2011-11-25 10:13:29 +00:00
Dan Poltawski
c745d1e80e MDL-29960 repository/dropbox - update to use 1.0 API version 2011-11-25 09:59:01 +00:00
Sam Hemelryk
a02f87a838 Merge branch 's9_MDL-27382_dropbox_get_file_fix_master' of github.com:dongsheng/moodle 2011-05-05 13:25:36 +08:00
Dongsheng Cai
991aa8ab57 MDL-27382 repository dropbox plugin, fixed bug of
file downloading path
2011-05-05 09:58:49 +08:00
Dongsheng Cai
810aea11df MDL-27330 repository dropbox plugin
Dropbox changed authorization URL, and added a few error check code
2011-05-03 17:41:03 +08:00
Myles Carrick
ab603b243c MDL-26798 encode file path in dropbox repository plugin, credits to Myles Carrick 2011-03-24 13:54:10 +08:00
Dongsheng Cai
0e61528d31 MDL-19168, dropbox plugin now have full access 2010-11-09 09:11:28 +00:00
Petr Skoda
6bdfef5da9 MDL-24321 switching to standard stdClass() 2010-09-21 08:54:01 +00:00
Dongsheng Cai
32368e9915 REPOSITORY MDL-24205, added more check of path and files 2010-09-20 04:00:57 +00:00
Petr Skoda
d078f6d38e standardized PHPDocs package info 2010-09-06 11:29:21 +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
a5adfa2658 MDL-23072, properly localised repository instance name 2010-07-27 09:03:54 +00:00
Dongsheng Cai
0b75ea780e MDL-22985, repository plugins use new callback url. 2010-07-12 04:53:31 +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
Dongsheng Cai
3e1233680a MDL-19168, dropbox repository plugin for moodle, and oauth support for filepicker. dropbox plugin has a known bug: cannot access folders or files with space, using urlencode to encode filepath is not helping, needs to contact dropbox team to find workaround 2010-05-14 08:29:33 +00:00