mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
Merge branch 'MDL-61215-master' of git://github.com/sarjona/moodle
This commit is contained in:
commit
d48a0a9a5d
8 changed files with 27 additions and 15 deletions
|
@ -107,7 +107,8 @@ abstract class core_filetypes {
|
|||
'groups' => array('spreadsheet')),
|
||||
'gslides' => array('type' => 'application/vnd.google-apps.presentation', 'icon' => 'powerpoint',
|
||||
'groups' => array('presentation')),
|
||||
'gif' => array('type' => 'image/gif', 'icon' => 'gif', 'groups' => array('image', 'web_image'), 'string' => 'image'),
|
||||
'gif' => array('type' => 'image/gif', 'icon' => 'gif', 'groups' => array('image', 'web_image', 'optimised_image'),
|
||||
'string' => 'image'),
|
||||
'gtar' => array('type' => 'application/x-gtar', 'icon' => 'archive',
|
||||
'groups' => array('archive'), 'string' => 'archive'),
|
||||
'tgz' => array('type' => 'application/g-zip', 'icon' => 'archive', 'groups' => array('archive'), 'string' => 'archive'),
|
||||
|
@ -136,9 +137,12 @@ abstract class core_filetypes {
|
|||
'jmt' => array('type' => 'text/xml', 'icon' => 'markup'),
|
||||
'jmx' => array('type' => 'text/xml', 'icon' => 'markup'),
|
||||
'jnlp' => array('type' => 'application/x-java-jnlp-file', 'icon' => 'markup'),
|
||||
'jpe' => array('type' => 'image/jpeg', 'icon' => 'jpeg', 'groups' => array('image', 'web_image'), 'string' => 'image'),
|
||||
'jpeg' => array('type' => 'image/jpeg', 'icon' => 'jpeg', 'groups' => array('image', 'web_image'), 'string' => 'image'),
|
||||
'jpg' => array('type' => 'image/jpeg', 'icon' => 'jpeg', 'groups' => array('image', 'web_image'), 'string' => 'image'),
|
||||
'jpe' => array('type' => 'image/jpeg', 'icon' => 'jpeg', 'groups' => array('image', 'web_image', 'optimised_image'),
|
||||
'string' => 'image'),
|
||||
'jpeg' => array('type' => 'image/jpeg', 'icon' => 'jpeg', 'groups' => array('image', 'web_image', 'optimised_image'),
|
||||
'string' => 'image'),
|
||||
'jpg' => array('type' => 'image/jpeg', 'icon' => 'jpeg', 'groups' => array('image', 'web_image', 'optimised_image'),
|
||||
'string' => 'image'),
|
||||
'jqz' => array('type' => 'text/xml', 'icon' => 'markup'),
|
||||
'js' => array('type' => 'application/x-javascript', 'icon' => 'text', 'groups' => array('web_file')),
|
||||
'json' => array('type' => 'application/json', 'icon' => 'text'),
|
||||
|
@ -206,7 +210,8 @@ abstract class core_filetypes {
|
|||
'php' => array('type' => 'text/plain', 'icon' => 'sourcecode'),
|
||||
'pic' => array('type' => 'image/pict', 'icon' => 'image', 'groups' => array('image'), 'string' => 'image'),
|
||||
'pict' => array('type' => 'image/pict', 'icon' => 'image', 'groups' => array('image'), 'string' => 'image'),
|
||||
'png' => array('type' => 'image/png', 'icon' => 'png', 'groups' => array('image', 'web_image'), 'string' => 'image'),
|
||||
'png' => array('type' => 'image/png', 'icon' => 'png', 'groups' => array('image', 'web_image', 'optimised_image'),
|
||||
'string' => 'image'),
|
||||
'pps' => array('type' => 'application/vnd.ms-powerpoint', 'icon' => 'powerpoint', 'groups' => array('presentation')),
|
||||
'ppt' => array('type' => 'application/vnd.ms-powerpoint', 'icon' => 'powerpoint', 'groups' => array('presentation')),
|
||||
'pptx' => array('type' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||
|
|
|
@ -1639,6 +1639,7 @@ function download_file_content($url, $headers=null, $postdata=null, $fullrespons
|
|||
* commonly used in moodle the following groups:
|
||||
* - web_image - image that can be included as <img> in HTML
|
||||
* - image - image that we can parse using GD to find it's dimensions, also used for portfolio format
|
||||
* - optimised_image - image that will be processed and optimised
|
||||
* - video - file that can be imported as video in text editor
|
||||
* - audio - file that can be imported as audio in text editor
|
||||
* - archive - we can extract files from this archive
|
||||
|
|
|
@ -302,10 +302,10 @@ class filetypes_util_testcase extends advanced_testcase {
|
|||
// All these three files are in both "image" and also "web_image"
|
||||
// groups. We display both groups.
|
||||
$data = $util->data_for_browser('jpg png gif', true, '.gif');
|
||||
$this->assertEquals(2, count($data));
|
||||
$this->assertEquals(3, count($data));
|
||||
$this->assertTrue($data[0]->key !== $data[1]->key);
|
||||
foreach ($data as $group) {
|
||||
$this->assertTrue(($group->key === 'image' || $group->key === 'web_image'));
|
||||
$this->assertTrue(($group->key === 'image' || $group->key === 'web_image' || $group->key === 'optimised_image'));
|
||||
$this->assertEquals(3, count($group->types));
|
||||
$this->assertFalse($group->selectable);
|
||||
foreach ($group->types as $ext) {
|
||||
|
@ -317,11 +317,11 @@ class filetypes_util_testcase extends advanced_testcase {
|
|||
}
|
||||
}
|
||||
|
||||
// There is a group web_image which is a subset of the group image. The
|
||||
// file extensions that fall into both groups will be displayed twice.
|
||||
// The groups web_image and optimised_image are a subset of the group image. The
|
||||
// file extensions that fall into these groups will be displayed thrice.
|
||||
$data = $util->data_for_browser('web_image');
|
||||
foreach ($data as $group) {
|
||||
$this->assertTrue(($group->key === 'image' || $group->key === 'web_image'));
|
||||
$this->assertTrue(($group->key === 'image' || $group->key === 'web_image' || $group->key === 'optimised_image'));
|
||||
}
|
||||
|
||||
// Check that "All file types" are displayed first.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue