MDL-14591 - split portfoliolib into logical parts for better readability
[moodle.git] / lib / portfolio / formats.php
CommitLineData
87fcac8d 1<?php
2/**
3 * Moodle - Modular Object-Oriented Dynamic Learning Environment
4 * http://moodle.org
5 * Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * @package moodle
21 * @subpackage portfolio
22 * @author Penny Leach <penny@catalyst.net.nz>
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL
24 * @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
25 *
26 * This file contains all the class definitions of the export formats.
27 * They are implemented in php classes rather than just a simpler hash
28 * Because it provides an easy way to do subtyping using php inheritance.
29 */
30
31/**
32* the most basic type - pretty much everything is a subtype
33*/
34class portfolio_format_file {
35 public static function mimetypes() {
36 return array(null);
37 }
38}
39
40/**
41* image format, subtype of file.
42*/
43class portfolio_format_image extends portfolio_format_file {
44 public static function mimetypes() {
45 return mimeinfo_from_icon('type', 'image.gif', true);
46 }
47}
48
49/**
50* html format - could be used for an external cms or something
51*
52* in case we want to be really specific.
53*/
54class portfolio_format_html extends portfolio_format_file {
55 public static function mimetypes() {
56 return array('text/html');
57 }
58}
59
60/**
61* video format, subtype of file.
62*
63* I guess there could be a youtube/google video plugin
64* and anyway, the flickr plugin can support it already
65*/
66class portfolio_format_video extends portfolio_format_file {
67 public static function mimetypes() {
68 return mimeinfo_from_icon('type', 'video.gif', true);
69 }
70}
71
72/**
73* class for plain text format.. not sure why we would need this yet
74* but since resource module wants to export it... we can
75*/
76class portfolio_format_text extends portfolio_format_file {
77 public static function mimetypes() {
78 return array('text/plain');
79 }
80}
81
82/**
83* later.... a moodle plugin might support this.
84* it's commented out in portfolio_supported_formats so cannot currently be used.
85*/
86class portfolio_format_mbkp extends portfolio_format_file {}
87
88
89?>