diff --git a/extension/Documentation/Manual.rst b/extension/Documentation/Manual.rst index 1e3778f01ccf9703d1c8cecba6a852bc43bac7c7..77aebfa1e52ac6f08250f83f278245a2d1f340c7 100644 --- a/extension/Documentation/Manual.rst +++ b/extension/Documentation/Manual.rst @@ -5127,6 +5127,10 @@ Special column names +------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | _htmlentities |Characters will be encoded to their HTML entity representation. | +------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| _mimetype |Show mime type of a given file | ++------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| _filesize |Show file size of a given file | ++------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | _thumbnail |Create thumbnails on the fly. See `column-thumbnail`_. | +------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | _+??? |The content will be wrapped in the tag '???'. Example: SELECT 'example' AS '_+a href="http://example.com"' creates '<a href="http://example.com">example</a>' | diff --git a/extension/qfq/qfq/Constants.php b/extension/qfq/qfq/Constants.php index 3dbc550ac3aabb5a1af4d15371faef2f04f14d74..2155bf8434a78afcf8398e169612f9938e992c0f 100644 --- a/extension/qfq/qfq/Constants.php +++ b/extension/qfq/qfq/Constants.php @@ -244,7 +244,7 @@ const ERROR_MISSING_TYPE_AHEAD_SQL_PREFETCH = 1604; const ERROR_DOWNLOAD_CREATE_NEW_FILE = 1700; const ERROR_DOWNLOAD_NO_FILES = 1701; const ERROR_DOWNLOAD_NOTHING_TO_DO = 1702; -const ERROR_DOWNLOAD_UNEXPECTED_MIMETYPE = 1703; +const ERROR_DOWNLOAD_UNEXPECTED_MIME_TYPE = 1703; const ERROR_DOWNLOAD_UNEXPECTED_NUMBER_OF_SOURCES = 1704; // KeyValueParser @@ -1245,6 +1245,9 @@ const COLUMN_NL2BR = 'nl2br'; const COLUMN_HTMLENTITIES = 'htmlentities'; const COLUMN_STRIPTAGS = 'striptags'; +const COLUMN_MIME_TYPE = 'mimetype'; +const COLUMN_FILE_SIZE = 'filesize'; + const COLUMN_WRAP_TOKEN = '+'; const FORM_NAME_FORM = 'form'; diff --git a/extension/qfq/qfq/report/Download.php b/extension/qfq/qfq/report/Download.php index d75cae044032796dad80867ad384e6514498c425..289cb8209fb6f81ad3df99199283e45761e308f7 100644 --- a/extension/qfq/qfq/report/Download.php +++ b/extension/qfq/qfq/report/Download.php @@ -110,7 +110,7 @@ class Download { foreach ($files AS $filename) { $mimetype = mime_content_type($filename); if ($mimetype != 'application/pdf') { - throw new downloadException("Error concat file $filename. Mimetype 'application/pdf' expected, got: $mimetype", ERROR_DOWNLOAD_UNEXPECTED_MIMETYPE); + throw new downloadException("Error concat file $filename. Mimetype 'application/pdf' expected, got: $mimetype", ERROR_DOWNLOAD_UNEXPECTED_MIME_TYPE); } } diff --git a/extension/qfq/qfq/report/Report.php b/extension/qfq/qfq/report/Report.php index 5a77a62b2ed7f9bec4ca893c86575226ec7f191c..9ffd8d583fe00ec1668a061bf2a9cd1a45d8883c 100644 --- a/extension/qfq/qfq/report/Report.php +++ b/extension/qfq/qfq/report/Report.php @@ -725,6 +725,14 @@ class Report { $content .= $this->thumbnail->process($columnValue); break; + case COLUMN_MIME_TYPE: + $content .= HelperFile::getMimeType($columnValue); + break; + + case COLUMN_FILE_SIZE: + $content .= filesize($columnValue); + break; + case COLUMN_NL2BR: $content .= nl2br($columnValue); break;