From 04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 9 Jan 2020 10:55:03 +0100 Subject: phpmyadmin working --- .../TransformationOverviewController.php | 80 ++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 srcs/phpmyadmin/libraries/classes/Controllers/TransformationOverviewController.php (limited to 'srcs/phpmyadmin/libraries/classes/Controllers/TransformationOverviewController.php') diff --git a/srcs/phpmyadmin/libraries/classes/Controllers/TransformationOverviewController.php b/srcs/phpmyadmin/libraries/classes/Controllers/TransformationOverviewController.php new file mode 100644 index 0000000..621961f --- /dev/null +++ b/srcs/phpmyadmin/libraries/classes/Controllers/TransformationOverviewController.php @@ -0,0 +1,80 @@ +transformations = $transformations; + } + + /** + * @return string HTML + */ + public function indexAction(): string + { + $types = $this->transformations->getAvailableMimeTypes(); + + $mimeTypes = []; + foreach ($types['mimetype'] as $mimeType) { + $mimeTypes[] = [ + 'name' => $mimeType, + 'is_empty' => isset($types['empty_mimetype'][$mimeType]), + ]; + } + + $transformations = [ + 'transformation' => [], + 'input_transformation' => [], + ]; + + foreach (array_keys($transformations) as $type) { + foreach ($types[$type] as $key => $transformation) { + $transformations[$type][] = [ + 'name' => $transformation, + 'description' => $this->transformations->getDescription( + $types[$type . '_file'][$key] + ), + ]; + } + } + + return $this->template->render('transformation_overview', [ + 'mime_types' => $mimeTypes, + 'transformations' => $transformations, + ]); + } +} -- cgit