Extract HTML from themes.php
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
parent
57c8f11a07
commit
345bd29706
7
templates/themes.twig
Normal file
7
templates/themes.twig
Normal file
@ -0,0 +1,7 @@
|
||||
<h1>phpMyAdmin - {% trans 'Theme' %}</h1>
|
||||
<p>
|
||||
<a href="{{ 'https://www.phpmyadmin.net/themes/'|link }}#pma_{{ version }}" rel="noopener noreferrer" target="_blank">
|
||||
{% trans 'Get more themes!' %}
|
||||
</a>
|
||||
</p>
|
||||
{{ previews|raw }}
|
||||
26
themes.php
26
themes.php
@ -7,7 +7,7 @@
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use PhpMyAdmin\Core;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\ThemeManager;
|
||||
use PhpMyAdmin\Response;
|
||||
|
||||
@ -15,11 +15,10 @@ if (! defined('ROOT_PATH')) {
|
||||
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* get some globals
|
||||
*/
|
||||
include ROOT_PATH . 'libraries/common.inc.php';
|
||||
|
||||
$template = new Template();
|
||||
|
||||
$response = Response::getInstance();
|
||||
$response->getFooter()->setMinimal();
|
||||
$header = $response->getHeader();
|
||||
@ -27,14 +26,11 @@ $header->setBodyId('bodythemes');
|
||||
$header->setTitle('phpMyAdmin - ' . __('Theme'));
|
||||
$header->disableMenuAndConsole();
|
||||
|
||||
$hash = '#pma_' . preg_replace('/([0-9]*)\.([0-9]*)\..*/', '\1_\2', PMA_VERSION);
|
||||
$url = Core::linkURL('https://www.phpmyadmin.net/themes/') . $hash;
|
||||
$output = '<h1>phpMyAdmin - ' . __('Theme') . '</h1>';
|
||||
$output .= '<p>';
|
||||
$output .= '<a href="' . $url . '" rel="noopener noreferrer" target="_blank">';
|
||||
$output .= __('Get more themes!');
|
||||
$output .= '</a>';
|
||||
$output .= '</p>';
|
||||
$output .= ThemeManager::getInstance()->getPrintPreviews();
|
||||
|
||||
$response->addHTML($output);
|
||||
$response->addHTML($template->render('themes', [
|
||||
'version' => preg_replace(
|
||||
'/([0-9]*)\.([0-9]*)\..*/',
|
||||
'\1_\2',
|
||||
PMA_VERSION
|
||||
),
|
||||
'previews' => ThemeManager::getInstance()->getPrintPreviews(),
|
||||
]));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user