Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
73f1007c35
@ -3713,34 +3713,12 @@ function PMA_getHtmlForInitials($array_initials)
|
||||
|
||||
uksort($array_initials, "strnatcasecmp");
|
||||
|
||||
$html_output = '<table id="initials_table" cellspacing="5">'
|
||||
. '<tr>';
|
||||
foreach ($array_initials as $tmp_initial => $initial_was_found) {
|
||||
if ($tmp_initial === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!$initial_was_found) {
|
||||
$html_output .= '<td>' . $tmp_initial . '</td>';
|
||||
continue;
|
||||
}
|
||||
|
||||
$html_output .= '<td>'
|
||||
. '<a class="ajax'
|
||||
. ((isset($_REQUEST['initial'])
|
||||
&& $_REQUEST['initial'] === $tmp_initial
|
||||
) ? ' active' : '')
|
||||
. '" href="server_privileges.php'
|
||||
. URL::getCommon(array('initial' => $tmp_initial))
|
||||
. '">' . $tmp_initial
|
||||
. '</a>'
|
||||
. '</td>' . "\n";
|
||||
}
|
||||
$html_output .= '<td>'
|
||||
. '<a href="server_privileges.php'
|
||||
. URL::getCommon(array('showall' => 1))
|
||||
. '" class="nowrap">' . __('Show all') . '</a></td>' . "\n";
|
||||
$html_output .= '</tr></table>';
|
||||
$html_output = Template::get('privileges/initials_row')
|
||||
->render(
|
||||
array(
|
||||
'array_initials' => $array_initials
|
||||
)
|
||||
);
|
||||
|
||||
return $html_output;
|
||||
}
|
||||
|
||||
28
templates/privileges/initials_row.phtml
Normal file
28
templates/privileges/initials_row.phtml
Normal file
@ -0,0 +1,28 @@
|
||||
<table id="initials_table" cellspacing="5">
|
||||
<tr>
|
||||
<?php foreach ($array_initials as $tmp_initial => $initial_was_found) : ?>
|
||||
<?php if ($tmp_initial === null) : ?>
|
||||
<?php continue; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!$initial_was_found) : ?>
|
||||
<td><?= $tmp_initial ?></td>
|
||||
<?php continue; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<td>
|
||||
<?php
|
||||
$additional_class
|
||||
= (isset($_REQUEST['initial']) && $_REQUEST['initial'] === $tmp_initial) ? ' active' : '';
|
||||
?>
|
||||
<?php $url_params = PMA\libraries\URL::getCommon(array('initial' => $tmp_initial)); ?>
|
||||
<a class="ajax<?= $additional_class ?>" href="server_privileges.php<?= $url_params ?>"><?= $tmp_initial ?></a>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
<td>
|
||||
<a href="server_privileges.php<?= PMA\libraries\URL::getCommon(array('showall' => 1)) ?>" class="nowrap">
|
||||
<?= __('Show all') ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2426,13 +2426,13 @@ class PMA_ServerPrivileges_Test extends PHPUnit_Framework_TestCase
|
||||
$this->assertContains('<td>A</td>', $actual);
|
||||
$this->assertContains('<td>Z</td>', $actual);
|
||||
$this->assertContains(
|
||||
'<td><a class="ajax" href="server_privileges.php?initial=-&'
|
||||
'<a class="ajax" href="server_privileges.php?initial=-&'
|
||||
. 'server=1&lang=en&collation_connection='
|
||||
. 'collation_connection">-</a></td>',
|
||||
. 'collation_connection">-</a>',
|
||||
$actual
|
||||
);
|
||||
$this->assertContains(
|
||||
'<td><a class="ajax" href="server_privileges.php?initial=%22&'
|
||||
'<a class="ajax" href="server_privileges.php?initial=%22&'
|
||||
. 'server=1&lang=en&collation_connection='
|
||||
. 'collation_connection">"</a>',
|
||||
$actual
|
||||
|
||||
Loading…
Reference in New Issue
Block a user