Commit Graph

77 Commits

Author SHA1 Message Date
Marina Glancy a7a6be90c8 MDL-61937 mod_data: generator for all field types 2018-05-04 11:22:14 +08:00
Tobias Reischmann 3a133b3028 MDL-54965 mod_data: removed unused code in display_add_field()
Since the refactoring towards using the filepicker for file and picture
fields there are several variables, which are set but never read. Thus,
I removed them.
2017-07-10 14:14:41 +02:00
Tobias Reischmann bdf6753528 MDL-54965 mod_data: Init draft area for empty file/pic fields
When a file or picture field was added with existing records, these
records could not be saved, since the draft area was not created
properly.

Co-authored-by: Jérôme Mouneyrac <mouneyrac>
2017-07-10 14:14:41 +02:00
Damyon Wiese 141ee541ca MDL-58219 repository: Change how controlled links work
Files are copied to the system user as soon as they are uploaded. Write access is then controlled when
serving links to the file.

Part of MDL-58220
2017-04-03 13:41:19 +08:00
Damyon Wiese 151b0f9409 MDL-58132 repositories: Controlled link file type
This introduces a new "controlled link" file type where the file is not
stored in Moodle - but Moodle will control the access permissions on the file.

Plugins can "freeze" a filearea which means Moodle will take ownership of all the remote
files of this type.

When accessing a file, if the "filebrowser" infomation indicates the current user can write to the file, they
will be granted temporary write access.

Part of MDL-58220
2017-04-03 13:40:13 +08:00
Juan Leyva c8a804ff68 MDL-57920 mod_data: Refactor search array creation 2017-03-30 01:53:35 +02:00
Juan Leyva aefe9c5faa MDL-57919 mod_data: Refactor and new method get_configs_for_external 2017-03-29 11:38:38 +02: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
Damyon Wiese 398be7c897 MDL-56725 mod_data: coding style
Fixes from lines in the previous commit.
2016-11-10 16:21:01 +08:00
Damyon Wiese e85fda95c6 MDL-56725 mod_data: Style fixes for boost theme 2016-11-10 16:21:01 +08:00
David Mudrák a5fae3b0d2 MDL-52727 mod_data: Improve output of the form fields values
This issue mostly affects the search form fields. Submitted values for
these fields are typically obtained via optional_param() with
PARAM_NOTAGS specified as the parameter type - see parse_search_field()
methods. Such values themselves are not safe enough to be printed back
directly into the HTML as they might contain malicious code.

While working on the patch, some other places with weak protection were
detected and fixed.

In case of the itemid parameters, explicit clean_param() is added to
make sure we cast the value as an integer. That should make the s()
unnecessary but it was added anyway as an extra protection (just in case
the code flow changes or the parts of the code are re-used elsewhere).
2016-03-07 22:08:46 +01:00
Johannes Burk 8c3b27d4b2 MDL-49750 mod_data: fix updating file/picture fields breaks references
Use file_save_draft_area_files on file/picture update and
set content to null if file was removed.
2015-10-05 11:42:53 +02:00
John Okely c07c5e7bdd MDL-50127 mod_data: Fix required icons in add entry screen 2015-08-14 16:46:58 +08:00
John Okely 1c3b2058c8 MDL-5583 mod_data: Improve required fields
Fix accidental <tr> in some field modify screens
Update mod_data version
Change required asterisk to image
Improve required error message
Fix required icon positions
Remove required code from date field
Add name in labels for fields
Add required field option for multimenu
Remove old required field title text modifier
Add multimenu to behat
Add more comprehensive behat tests
Reload old input when an input error occurs
Behat grammar fixes
Allow location of 0, 0
Use html_writer
Fix existing mod_data behat tests
2015-03-09 13:56:16 +08:00
Damyon Wiese b89cca197e MDL-5583 mod_data: Add required fields
This is implemented for most fields but not all. The reason is that there are
some fields for which this does not make sense because no entry is a valid entry.

The supported fields are:
    checkbox
    file
    latlong
    menu
    number
    picture
    radio
    text
    textarea
    url

The unsupported fields are:
    date
    multimenu
2015-03-06 09:55:49 +08:00
David Monllao 57a69e7151 MDL-46500 mod_data: Removing duplicate filemanager initialisations 2014-10-30 16:10:15 +08:00
Rossiani Wijaya 7f60308a35 MDL-35934 Filemanager: add aria attributes for editing file/folder.
Add unique reference ids
2013-08-09 10:01:36 +08:00
Adrian Greeve e06d54289d MDL-39118 - mod_data: removed areamaxbytes option for uploading files and images.
Setting the maximum size for a file or picture field to the course upload limit
would send a value of 0 to the file picker. This patch checks for this 0 value
and handles it appropriately.
2013-04-22 09:28:51 +08:00
Adrian Greeve 173c6f2c8b MDL-7660 - mod_data: Changed the filepicker to filemanager for field elements.
This allows users to delete their files or pictures when editing their entries
which was previously unavailable.

Also the use of the filemanager allows for drag and drop to be active.
2013-01-04 12:17:47 +08:00
Rossiani Wijaya 3a5543d43b MDL-34563 - removed double labeling and add label for input text 2012-08-16 14:15:13 +08:00
Rossiani Wijaya 01f8e80def MDL-34563 accessibility compliance for data module: Add forform input text and select tag 2012-08-13 15:13:07 +08:00
David Monllao 0b3b8c30e2 MDL-34464 mod_data Replace all instances of get_context_instance() with respective context_XXXX class in mod/data 2012-07-27 09:13:57 +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
Sam Hemelryk 3211569a6a Revert "MDL-30843 and MDL-30842 - accessibility compliance: Add <label> for form input text and select tag"
This reverts commit f9f281b8fe.
2012-04-11 17:18:58 +12:00
Sam Hemelryk 5bfeb5ffd3 Merge branch 'MDL-30843_b' of git://github.com/rwijaya/moodle 2012-04-10 12:34:37 +12:00
Petr Skoda 54352ac979 MDL-32251 more E_STRICT fixes 2012-03-30 19:02:58 +02:00
Rossiani Wijaya f9f281b8fe MDL-30843 and MDL-30842 - accessibility compliance: Add <label> for form input text and select tag 2012-03-30 16:26:58 +08:00
Andrew Robert Nicols f0f41c5e57 MDL-31515 Allow for subsequent files to overwrite old files in database activity records 2012-02-06 15:19:11 +00:00
Petr Skoda 431ac39634 MDL-26623 fix file permissions
The permissions are now going to be verified as part of the weekly release process.
2011-03-01 12:26:49 +01:00
Petr Skoda 6bdfef5da9 MDL-24321 switching to standard stdClass() 2010-09-21 08:54:01 +00:00
Petr Skoda 39790bd805 MDL-24321 switching to stdClass in /mod/ 2010-09-21 08:37:36 +00:00
Petr Skoda 800bb0f70f MDL-24079 mod/data now using new sql_like 2010-09-04 14:08:03 +00:00
Petr Skoda 50a8bd6c1d MDL-14589 file api cleanup 2010-07-11 13:30:33 +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
Dongsheng Cai e425638049 MDL-16493, database module use filepicker to choose file/pciture, url field use file picker to choose link. 2010-05-24 09:05:40 +00:00
Dongsheng Cai 4d2ee4c2c0 MDL-16597, move print_filemanager to $OUTPUT->file_manager, now theme designers are able to costomize file manager. 2010-05-19 08:05:36 +00:00
Dongsheng Cai ff3cf1c937 "MDL-15405, simplified filemanager initilising in database module" 2010-03-15 06:31:41 +00:00
Dongsheng Cai e30d75ccdd "MDL-15405, perform filemanager init tasks in one function" 2010-03-08 03:28:22 +00:00
Dongsheng Cai a14a933c2b "MDL-16596, fixed nonjs filemanager" 2010-03-07 16:40:25 +00:00
Dongsheng Cai 26032c2d20 "MDL-15405, data module to use filemanager" 2010-03-05 05:37:09 +00:00
Penny Leach 01e81431a3 data/files MDL-21281 fixed incorrect case between $fs and $FS in some data module fields 2010-01-08 02:37:37 +00:00
Petr Skoda b5d0cafc6f MDL-20787 final switch to new $OUTPUT->pix_url() - yay! 2009-12-16 21:50:45 +00:00
Petr Skoda 1adbd2c350 MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup 2009-11-01 14:55:15 +00:00
samhemelryk 19c9f09430 filelib MDL-19707 Converted existing ...str_replace('png','gif')... to use file_extension_icon and file_mimetype_icon 2009-07-07 06:16:01 +00:00
tjhunt d436d197d1 MDL-19690 - the last lot of $CFG->pixpath to $OUTPUT->old_icon_url
Including MDL-19693

RIP $CFG->pixpath
2009-07-03 07:55:30 +00:00
skodak 7826abc79f MDL-18293 $DB->something is using exceptions, no need for ifs there, removing useless strings 2009-06-03 20:25:27 +00:00
skodak 4eef139962 MDL-14589 file browsing refactoring - moving url encoding to filelib.php for now 2009-05-20 22:32:02 +00:00
thepurpleblob f62f7d8f8e MDL-18542:
Reverting various checkins related to this bug.
PLUS... proper 1 line fix included (merged from STABLE19)
2009-03-24 10:52:50 +00:00
thepurpleblob 6bfa3f3ecf MDL-18542:
Aaargh... yet another one missed. Hopefully that's it.

Merged from STABLE_19
2009-03-20 11:36:17 +00:00
mjollnir_ 276378e6b0 MDL-15777 - updated data file and picture field types to export files using file api.
There's still something about this I don't like - documented in  MDL-16493 and code
2008-09-16 15:48:24 +00:00