From 04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 9 Jan 2020 10:55:03 +0100 Subject: phpmyadmin working --- .../Controllers/Server/CollationsController.php | 100 +++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 srcs/phpmyadmin/libraries/classes/Controllers/Server/CollationsController.php (limited to 'srcs/phpmyadmin/libraries/classes/Controllers/Server/CollationsController.php') diff --git a/srcs/phpmyadmin/libraries/classes/Controllers/Server/CollationsController.php b/srcs/phpmyadmin/libraries/classes/Controllers/Server/CollationsController.php new file mode 100644 index 0000000..2d806e8 --- /dev/null +++ b/srcs/phpmyadmin/libraries/classes/Controllers/Server/CollationsController.php @@ -0,0 +1,100 @@ +charsets = $charsets ?? Charsets::getCharsets( + $this->dbi, + $cfg['Server']['DisableIS'] + ); + $this->collations = $collations ?? Charsets::getCollations( + $this->dbi, + $cfg['Server']['DisableIS'] + ); + } + + /** + * Index action + * + * @return string HTML + */ + public function indexAction(): string + { + include_once ROOT_PATH . 'libraries/server_common.inc.php'; + + $charsets = []; + /** @var Charset $charset */ + foreach ($this->charsets as $charset) { + $charsetCollations = []; + /** @var Collation $collation */ + foreach ($this->collations[$charset->getName()] as $collation) { + $charsetCollations[] = [ + 'name' => $collation->getName(), + 'description' => $collation->getDescription(), + 'is_default' => $collation->isDefault(), + ]; + } + + $charsets[] = [ + 'name' => $charset->getName(), + 'description' => $charset->getDescription(), + 'collations' => $charsetCollations, + ]; + } + + return $this->template->render('server/collations/index', [ + 'charsets' => $charsets, + ]); + } +} -- cgit