Permalink
Browse files

MDL-43570 filetypes: Added new filetypes - ddoc, bdoc, cdoc

  • Loading branch information...
1 parent 83ddacf commit ecdb94d3e0b86f4272859cefabafb5201981754f @KristerV KristerV committed Apr 30, 2014
Showing with 20 additions and 1 deletion.
  1. +16 −0 lib/db/upgrade.php
  2. +3 −0 lib/filelib.php
  3. +1 −1 version.php
View
16 lib/db/upgrade.php
@@ -3624,5 +3624,21 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2014041500.01);
}
+ if ($oldversion < 2014043000.00) {
+ // Fixing possible wrong MIME type for DigiDoc files.
+ $extensions = array('%.bdoc', '%.cdoc', '%.ddoc');
+ $select = $DB->sql_like('filename', '?', false);
+ foreach ($extensions as $extension) {
+ $DB->set_field_select(
+ 'files',
+ 'mimetype',
+ 'application/x-digidoc',
+ $select,
+ array($extension)
+ );
+ }
+ upgrade_main_savepoint(true, 2014043000.00);
+ }
+
return true;
}
View
3 lib/filelib.php
@@ -1410,6 +1410,9 @@ function &get_mimetypes_array() {
'dmg' => array ('type'=>'application/octet-stream', 'icon'=>'unknown'),
'doc' => array ('type'=>'application/msword', 'icon'=>'document', 'groups'=>array('document')),
+ 'bdoc' => array ('type'=>'application/x-digidoc', 'icon'=>'document', 'groups'=>array('archive')),
+ 'cdoc' => array ('type'=>'application/x-digidoc', 'icon'=>'document', 'groups'=>array('archive')),
+ 'ddoc' => array ('type'=>'application/x-digidoc', 'icon'=>'document', 'groups'=>array('archive')),
'docx' => array ('type'=>'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'icon'=>'document', 'groups'=>array('document')),
'docm' => array ('type'=>'application/vnd.ms-word.document.macroEnabled.12', 'icon'=>'document'),
'dotx' => array ('type'=>'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'icon'=>'document'),
View
2 version.php
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2014042400.00; // YYYYMMDD = weekly release date of this DEV branch.
+$version = 2014043000.00; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.

0 comments on commit ecdb94d

Please sign in to comment.