GenericTable: remove unused formatting types
This commit is contained in:
parent
9740416cb2
commit
7c25d628e1
@ -217,31 +217,9 @@ class GenericTable
|
||||
|
||||
private function processFormatting($options, $rowData)
|
||||
{
|
||||
if (!isset($options['type']))
|
||||
$options['type'] = 'value';
|
||||
|
||||
// Parse the basic value first.
|
||||
switch ($options['type'])
|
||||
{
|
||||
// Basic option: simply take a use a particular data property.
|
||||
case 'value':
|
||||
$value = htmlspecialchars($rowData[$options['data']] ?? '');
|
||||
break;
|
||||
|
||||
// Processing via a lambda function.
|
||||
case 'function':
|
||||
$value = $options['data']($rowData);
|
||||
break;
|
||||
|
||||
// Using sprintf to fill out a particular pattern.
|
||||
case 'sprintf':
|
||||
$parameters = [$options['data']['pattern']];
|
||||
foreach ($options['data']['arguments'] as $identifier)
|
||||
$parameters[] = $rowData[$identifier];
|
||||
|
||||
$value = sprintf(...$parameters);
|
||||
break;
|
||||
|
||||
// Timestamps get custom treatment.
|
||||
case 'timestamp':
|
||||
if (empty($options['data']['pattern']) || $options['data']['pattern'] === 'long')
|
||||
|
Loading…
Reference in New Issue
Block a user