Use template for _buildValueDisplay

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
Maurício Meneghini Fauth 2017-11-18 23:40:56 -02:00
parent 9d79d04af7
commit 70e9ec0fcd
3 changed files with 20 additions and 12 deletions

View File

@ -2339,9 +2339,9 @@ class Results
/**
* Prepares the display for a value
*
* @param string $class class of table cell
* @param bool $condition_field whether to add CSS class condition
* @param string $value value to display
* @param string $class class of table cell
* @param bool $conditionField whether to add CSS class condition
* @param string $value value to display
*
* @return string the td
*
@ -2350,12 +2350,14 @@ class Results
* @see _getDataCellForGeometryColumns(),
* _getDataCellForNonNumericColumns()
*/
private function _buildValueDisplay($class, $condition_field, $value)
private function _buildValueDisplay($class, $conditionField, $value)
{
return '<td class="left ' . $class . ($condition_field ? ' condition' : '')
. '">' . $value . '</td>';
} // end of the '_buildValueDisplay()' function
return Template::get('display/results/value_display')->render([
'class' => $class,
'condition_field' => $conditionField,
'value' => $value,
]);
}
/**
* Prepares the display for a null value

View File

@ -0,0 +1,3 @@
<td class="left {{ class }}{{ condition_field ? ' condition' }}">
{{ value|raw }}
</td>

View File

@ -1491,11 +1491,13 @@ class ResultsTest extends PmaTestCase
array(),
0,
'binary',
'<td class="left hex"><a href="tbl_get_field.php?'
'<td class="left hex">' . PHP_EOL
. ' <a href="tbl_get_field.php?'
. 'db=foo&amp;table=tbl&amp;server=0&amp;lang=en'
. '&amp;collation_connection=utf-8'
. '" '
. 'class="disableAjax">[BLOB - 4 B]</a></td>'
. 'class="disableAjax">[BLOB - 4 B]</a>' . PHP_EOL
. '</td>' . PHP_EOL
),
array(
'noblob',
@ -1512,8 +1514,9 @@ class ResultsTest extends PmaTestCase
array(),
0,
'binary',
'<td class="left grid_edit transformed hex">'
. '1001</td>'
'<td class="left grid_edit transformed hex">' . PHP_EOL
. ' 1001' . PHP_EOL
. '</td>' . PHP_EOL
),
array(
'noblob',