1
0
mirror of https://github.com/phpmyadmin/phpmyadmin.git synced 2026-10-28 07:41:55 +03:00

Template engine details page

Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
This commit is contained in:
Madhura Jayaratne
2015-12-08 10:32:42 +11:00
parent 5a885ab643
commit 45f11c4bb5
2 changed files with 56 additions and 53 deletions

View File

@@ -69,62 +69,23 @@ class ServerEnginesController extends Controller
*/
private function _getHtmlForSpecifiedServerEngines()
{
$engine_plugin = StorageEngine::getEngine($_REQUEST['engine']);
$pageOutput = ! empty($_REQUEST['page'])
? $engine_plugin->getPage($_REQUEST['page']) : '';
/**
* Displays details about a given Storage Engine
*/
$html = '';
$engine_plugin = StorageEngine::getEngine($_REQUEST['engine']);
$html .= '<h2>' . "\n"
. Util::getImage('b_engine.png')
. ' ' . htmlspecialchars($engine_plugin->getTitle()) . "\n"
. ' ' . Util::showMySQLDocu(
$engine_plugin->getMysqlHelpPage()
return Template::get('server/engines/engine')->render(
array(
'title' => $engine_plugin->getTitle(),
'helpPage' => $engine_plugin->getMysqlHelpPage(),
'comment' => $engine_plugin->getComment(),
'infoPages' => $engine_plugin->getInfoPages(),
'support' => $engine_plugin->getSupportInformationMessage(),
'variables' => $engine_plugin->getHtmlVariables(),
'pageOutput' => $pageOutput,
)
. "\n" . '</h2>' . "\n\n";
$html .= '<p>' . "\n"
. ' <em>' . "\n"
. ' ' . htmlspecialchars($engine_plugin->getComment()) . "\n"
. ' </em>' . "\n"
. '</p>' . "\n\n";
$infoPages = $engine_plugin->getInfoPages();
if (! empty($infoPages) && is_array($infoPages)) {
$html .= '<p>' . "\n"
. ' <strong>[</strong>' . "\n";
if (empty($_REQUEST['page'])) {
$html .= ' <strong>' . __('Variables') . '</strong>' . "\n";
} else {
$html .= ' <a href="server_engines.php'
. PMA_URL_getCommon(array('engine' => $_REQUEST['engine']))
. '">' . __('Variables') . '</a>' . "\n";
}
foreach ($infoPages as $current => $label) {
$html .= ' <strong>|</strong>' . "\n";
if (isset($_REQUEST['page']) && $_REQUEST['page'] == $current) {
$html .= ' <strong>' . $label . '</strong>' . "\n";
} else {
$html .= ' <a href="server_engines.php'
. PMA_URL_getCommon(
array('engine' => $_REQUEST['engine'], 'page' => $current)
)
. '">' . htmlspecialchars($label) . '</a>' . "\n";
}
}
unset($current, $label);
$html .= ' <strong>]</strong>' . "\n"
. '</p>' . "\n\n";
}
unset($infoPages, $page_output);
if (! empty($_REQUEST['page'])) {
$page_output = $engine_plugin->getPage($_REQUEST['page']);
}
if (! empty($page_output)) {
$html .= $page_output;
} else {
$html .= '<p> ' . $engine_plugin->getSupportInformationMessage() . "\n"
. '</p>' . "\n"
. $engine_plugin->getHtmlVariables();
}
return $html;
);
}
}

View File

@@ -0,0 +1,42 @@
<h2>
<?php echo \PMA\libraries\Util::getImage('b_engine.png'),
' ', htmlspecialchars($title),
' ', \PMA\libraries\Util::showMySQLDocu($helpPage); ?>
</h2>
<p>
<em>
<?php echo htmlspecialchars($comment); ?>
</em>
</p>
<?php if (! empty($infoPages) && is_array($infoPages)): ?>
<p>
<strong>[</strong>
<?php if (empty($_REQUEST['page'])): ?>
<strong><?php echo __('Variables'); ?></strong>
<?php else: ?>
<a href="server_engines.php'<?php echo PMA_URL_getCommon(array('engine' => $_REQUEST['engine'])); ?>">
<?php echo __('Variables'); ?>
</a>
<?php endif; ?>
<?php foreach ($infoPages as $current => $label): ?>
<strong>|</strong>
<?php if (isset($_REQUEST['page']) && $_REQUEST['page'] == $current): ?>
<strong><?php echo htmlspecialchars($label); ?></strong>
<?php else: ?>
<a href="server_engines.php'<?php echo PMA_URL_getCommon(array('engine' => $_REQUEST['engine'], 'page' => $current)); ?>">
<?php echo htmlspecialchars($label); ?>
</a>
<?php endif; ?>
<?php endforeach; ?>
<strong>]</strong>
</p>
<?php endif; ?>
<?php if (! empty($pageOutput)): ?>
<?php echo $pageOutput; ?>
<?php else: ?>
<p>
<?php echo $support; ?>
</p>
<?php echo $variables; ?>
<?php endif; ?>