Use template for _buildValueDisplay
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
parent
9d79d04af7
commit
70e9ec0fcd
@ -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
|
||||
|
||||
3
templates/display/results/value_display.twig
Normal file
3
templates/display/results/value_display.twig
Normal file
@ -0,0 +1,3 @@
|
||||
<td class="left {{ class }}{{ condition_field ? ' condition' }}">
|
||||
{{ value|raw }}
|
||||
</td>
|
||||
@ -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&table=tbl&server=0&lang=en'
|
||||
. '&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',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user