*/
define('PORTFOLIO_FORMAT_TEXT', 'text');
+/**
+* pdf - subtype of file
+*/
+define('PORTFOLIO_FORMAT_PDF', 'pdf');
+
+/**
+* document - subtype of file
+*/
+define('PORTFOLIO_FORMAT_DOCUMENT', 'document');
+
+/**
+* document - subtype of file
+*/
+define('PORTFOLIO_FORMAT_SPREADSHEET', 'spreadsheet');
+
+/**
+* document - subtype of file
+*/
+define('PORTFOLIO_FORMAT_PRESENTATION', 'presentation');
// ************************************************** //
// EXPORT TIME LEVELS
* it's commented out in portfolio_supported_formats so cannot currently be used.
*/
class portfolio_format_mbkp extends portfolio_format_rich {}
+
+/**
+* 'PDF format', subtype of file.
+*
+* for portfolio plugins that support PDFs specifically
+*/
+class portfolio_format_pdf extends portfolio_format_file {
+ public static function mimetypes() {
+ return array('application/pdf');
+ }
+}
+
+/**
+* 'Document format', subtype of file.
+*
+* for portfolio plugins that support documents specifically
+*/
+class portfolio_format_document extends portfolio_format_file {
+ public static function mimetypes() {
+ return array_merge(
+ array('text/plain', 'text/rtf'),
+ mimeinfo_from_icon('type', 'word.gif', true),
+ mimeinfo_from_icon('type', 'docx.gif', true),
+ mimeinfo_from_icon('type', 'odt.gif', true)
+ );
+ }
+}
+
+/**
+* 'Spreadsheet format', subtype of file.
+*
+* for portfolio plugins that support spreadsheets specifically
+*/
+class portfolio_format_spreadsheet extends portfolio_format_file {
+ public static function mimetypes() {
+ return array_merge(
+ mimeinfo_from_icon('type', 'excel.gif', true),
+ mimeinfo_from_icon('type', 'xlsm.gif', true),
+ mimeinfo_from_icon('type', 'ods.gif', true)
+ );
+ }
+}
+
+/**
+* 'Presentation format', subtype of file.
+*
+* for portfolio plugins that support presentation specifically
+*/
+class portfolio_format_presentation extends portfolio_format_file {
+ public static function mimetypes() {
+ return mimeinfo_from_icon('type', 'powerpoint.gif', true);
+ }
+}
*/
function portfolio_supported_formats() {
return array(
- PORTFOLIO_FORMAT_FILE => 'portfolio_format_file',
- PORTFOLIO_FORMAT_IMAGE => 'portfolio_format_image',
- PORTFOLIO_FORMAT_RICHHTML => 'portfolio_format_richhtml',
- PORTFOLIO_FORMAT_PLAINHTML => 'portfolio_format_plainhtml',
- PORTFOLIO_FORMAT_TEXT => 'portfolio_format_text',
- PORTFOLIO_FORMAT_VIDEO => 'portfolio_format_video',
+ PORTFOLIO_FORMAT_FILE => 'portfolio_format_file',
+ PORTFOLIO_FORMAT_IMAGE => 'portfolio_format_image',
+ PORTFOLIO_FORMAT_RICHHTML => 'portfolio_format_richhtml',
+ PORTFOLIO_FORMAT_PLAINHTML => 'portfolio_format_plainhtml',
+ PORTFOLIO_FORMAT_TEXT => 'portfolio_format_text',
+ PORTFOLIO_FORMAT_VIDEO => 'portfolio_format_video',
+ PORTFOLIO_FORMAT_PDF => 'portfolio_format_pdf',
+ PORTFOLIO_FORMAT_DOCUMENT => 'portfolio_format_document',
+ PORTFOLIO_FORMAT_SPREADSHEET => 'portfolio_format_spreadsheet',
+ PORTFOLIO_FORMAT_PRESENTATION => 'portfolio_format_presentation',
/*PORTFOLIO_FORMAT_MBKP, */ // later
/*PORTFOLIO_FORMAT_LEAP, */ // also later
);
private $sessiontoken;
public static function supported_formats() {
- return array(PORTFOLIO_FORMAT_PLAINHTML, PORTFOLIO_FORMAT_IMAGE, PORTFOLIO_FORMAT_TEXT);
+ return array(
+ PORTFOLIO_FORMAT_PLAINHTML,
+ PORTFOLIO_FORMAT_IMAGE,
+ PORTFOLIO_FORMAT_TEXT,
+ PORTFOLIO_FORMAT_PDF,
+ PORTFOLIO_FORMAT_DOCUMENT,
+ PORTFOLIO_FORMAT_PRESENTATION,
+ PORTFOLIO_FORMAT_SPREADSHEET
+ );
}
public static function get_name() {