Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-11-28 05:57:38 +01:00
commit 73f1007c35
3 changed files with 37 additions and 31 deletions

View File

@ -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;
}

View 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>

View File

@ -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=-&amp;'
'<a class="ajax" href="server_privileges.php?initial=-&amp;'
. 'server=1&amp;lang=en&amp;collation_connection='
. 'collation_connection">-</a></td>',
. 'collation_connection">-</a>',
$actual
);
$this->assertContains(
'<td><a class="ajax" href="server_privileges.php?initial=%22&amp;'
'<a class="ajax" href="server_privileges.php?initial=%22&amp;'
. 'server=1&amp;lang=en&amp;collation_connection='
. 'collation_connection">"</a>',
$actual