Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-35622 files: Add support for SMART Notebook MIME types

- The MIME type for Notebook files is: application/x-smarttech-notebook
- The MIME type for Gallery files is also: application/x-smarttech-notebook
Refs: http://exchange-forum.smarttech.com/forums/p/5152/11945.aspx#11945

Original author: Matteo Scaramuccia <moodle@matteoscaramuccia.com>
Fixed by: Paul Holden <pholden@greenhead.ac.uk>

Conflicts:

	lib/db/upgrade.php
	version.php
  • Loading branch information...
commit e4594f737e22f2340c0ad706c11fed4f6c6b4923 1 parent d623842
@FMCorz FMCorz authored danpoltawski committed
Showing with 29 additions and 1 deletion.
  1. +18 −0 lib/db/upgrade.php
  2. +10 −0 lib/filelib.php
  3. +1 −1  version.php
View
18 lib/db/upgrade.php
@@ -992,5 +992,23 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2012062503.07);
}
+ if ($oldversion < 2012062504.07) {
+ // Fixing possible wrong MIME types for SMART Notebook files.
+ $extensions = array('%.gallery', '%.galleryitem', '%.gallerycollection', '%.nbk', '%.notebook', '%.xbk');
+ $select = $DB->sql_like('filename', '?', false);
+ foreach ($extensions as $extension) {
+ $DB->set_field_select(
+ 'files',
+ 'mimetype',
+ 'application/x-smarttech-notebook',
+ $select,
+ array($extension)
+ );
+ }
+
+ // Main savepoint reached.
+ upgrade_main_savepoint(true, 2012062504.07);
+ }
+
return true;
}
View
10 lib/filelib.php
@@ -1408,6 +1408,10 @@ function &get_mimetypes_array() {
'fdf' => array ('type'=>'application/pdf', 'icon'=>'pdf'),
'flv' => array ('type'=>'video/x-flv', 'icon'=>'flash', 'groups'=>array('video','web_video'), 'string'=>'video'),
'f4v' => array ('type'=>'video/mp4', 'icon'=>'flash', 'groups'=>array('video','web_video'), 'string'=>'video'),
+
+ 'gallery' => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'),
+ 'galleryitem,' => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'),
+ 'gallerycollection' => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'),
'gif' => array ('type'=>'image/gif', 'icon'=>'gif', 'groups'=>array('image', 'web_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'),
@@ -1451,6 +1455,9 @@ function &get_mimetypes_array() {
'mpe' => array ('type'=>'video/mpeg', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'),
'mpg' => array ('type'=>'video/mpeg', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'),
+ 'nbk' => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'),
+ 'notebook' => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'),
+
'odt' => array ('type'=>'application/vnd.oasis.opendocument.text', 'icon'=>'writer', 'groups'=>array('document')),
'ott' => array ('type'=>'application/vnd.oasis.opendocument.text-template', 'icon'=>'writer', 'groups'=>array('document')),
'oth' => array ('type'=>'application/vnd.oasis.opendocument.text-web', 'icon'=>'oth', 'groups'=>array('document')),
@@ -1530,6 +1537,8 @@ function &get_mimetypes_array() {
'webm' => array ('type'=>'video/webm', 'icon'=>'video', 'groups'=>array('video'), 'string'=>'video'),
'wmv' => array ('type'=>'video/x-ms-wmv', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'),
'asf' => array ('type'=>'video/x-ms-asf', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'),
+
+ 'xbk' => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'),
'xdp' => array ('type'=>'application/pdf', 'icon'=>'pdf'),
'xfd' => array ('type'=>'application/pdf', 'icon'=>'pdf'),
'xfdf' => array ('type'=>'application/pdf', 'icon'=>'pdf'),
@@ -1544,6 +1553,7 @@ function &get_mimetypes_array() {
'xml' => array ('type'=>'application/xml', 'icon'=>'markup'),
'xsl' => array ('type'=>'text/xml', 'icon'=>'markup'),
+
'zip' => array ('type'=>'application/zip', 'icon'=>'archive', 'groups'=>array('archive'), 'string'=>'archive')
);
return $mimearray;
View
2  version.php
@@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2012062504.06; // YYYYMMDD = weekly release date of this DEV branch
+$version = 2012062504.07; // YYYYMMDD = weekly release date of this DEV branch
// RR = release increments - 00 in DEV branches
// .XX = incremental changes
Please sign in to comment.
Something went wrong with that request. Please try again.