diff --git a/templates/transformation_overview.twig b/templates/transformation_overview.twig
new file mode 100644
index 0000000000..7607d1c675
--- /dev/null
+++ b/templates/transformation_overview.twig
@@ -0,0 +1,32 @@
+
{% trans 'Available MIME types' %}
+
+{% for mime_type in types.mimetype %}
+ {% if types.empty_mimetype.mimetype %}
+ {{ mime_type }}
+ {% else %}
+ {{ mime_type }}
+ {% endif %}
+{% endfor %}
+
+{% for ttype in transformation_types %}
+
+ {{ ttype.label }}
+
+
+ |
+ {{ table_headings_label[ttype.title] }}
+ |
+
+ {% trans %}Description {{ ttype._pgettext }} for MIME transformation{% endtrans %}
+ |
+
+
+ {% for type in ttype.types %}
+
+ | {{ type.transform }} |
+ {{ type.description }} |
+
+ {% endfor %}
+
+
+{% endfor %}
diff --git a/transformation_overview.php b/transformation_overview.php
index 8af8298d7f..b2ec5f7ee9 100644
--- a/transformation_overview.php
+++ b/transformation_overview.php
@@ -9,6 +9,7 @@ declare(strict_types=1);
use PhpMyAdmin\Response;
use PhpMyAdmin\Transformations;
+use PhpMyAdmin\Template;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
@@ -20,60 +21,60 @@ if (! defined('ROOT_PATH')) {
require_once ROOT_PATH . 'libraries/common.inc.php';
$response = Response::getInstance();
-$header = $response->getHeader();
+$header = $response->getHeader();
$header->disableMenuAndConsole();
$transformations = new Transformations();
$types = $transformations->getAvailableMimeTypes();
-?>
-
- $mimetype) {
- if (isset($types['empty_mimetype'][$mimetype])) {
- echo '' , htmlspecialchars($mimetype) , '
';
- } else {
- echo htmlspecialchars($mimetype) , '
';
- }
-}
-$transformation_types = [
- 'transformation',
- 'input_transformation',
-];
-$label = [
+/**
+ * Preparing all labels which are required on view template
+ */
+$labels = [
+ 'available_MIME_types' => __('Available MIME types'),
'transformation' => __('Available browser display transformations'),
'input_transformation' => __('Available input transformations'),
];
-$th = [
+
+/**
+ * Preparing labels for table Table Heading ()
+ */
+$tableHeadLabels = [
'transformation' => __('Browser display transformation'),
'input_transformation' => __('Input transformation'),
];
-?>
-
-
-
-
-
-
-
- |
- |
-
-
-
- [],
+ 'input_transformation' => [],
+];
+
+/**
+ * Looping over transformations and preparing labels, titles, text and transformation types to prepare
+ * nested array so that view template can easily get all required information.
+ */
+foreach (['transformation', 'input_transformation'] as $ttype) {
+ // settings title, text and labels for transformation
+ $transformation_types[$ttype]['title'] = $ttype;
+ $transformation_types[$ttype]['_pgettext'] = _pgettext('for MIME transformation', 'Description');
+ $transformation_types[$ttype]['label'] = $labels[$ttype];
+
+ $transformation_types[$ttype]['types'] = [];
+
+ // Settings types for current transformation
foreach ($types[$ttype] as $key => $transform) {
- $desc = $transformations->getDescription($types[$ttype . '_file'][$key]);
- ?>
-
- |
- |
-
- $transform,
+ 'description' => $transformations->getDescription($types[$ttype . '_file'][$key]),
+ ];
}
- ?>
-
-
- render('transformation_overview', [
+ 'label' => $labels,
+ 'types' => $transformations->getAvailableMimeTypes(),
+ 'transformation_types' => $transformation_types,
+ 'table_headings_label' => $tableHeadLabels,
+]);
|