GenericTable: rename 'parse' option to 'format'
This commit is contained in:
parent
cc0ff71ef7
commit
77809faada
@ -35,7 +35,7 @@ class ManageAlbums extends HTMLController
|
||||
'tag' => [
|
||||
'header' => 'Album',
|
||||
'is_sortable' => true,
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'link' => BASEURL . '/editalbum/?id={ID_TAG}',
|
||||
'data' => 'tag',
|
||||
],
|
||||
@ -43,7 +43,7 @@ class ManageAlbums extends HTMLController
|
||||
'slug' => [
|
||||
'header' => 'Slug',
|
||||
'is_sortable' => true,
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'link' => BASEURL . '/editalbum/?id={ID_TAG}',
|
||||
'data' => 'slug',
|
||||
],
|
||||
|
@ -38,7 +38,7 @@ class ManageAssets extends HTMLController
|
||||
'checkbox' => [
|
||||
'header' => '<input type="checkbox" id="selectall">',
|
||||
'is_sortable' => false,
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'type' => 'function',
|
||||
'data' => function($row) {
|
||||
return '<input type="checkbox" class="asset_select" name="delete[]" value="' . $row['id_asset'] . '">';
|
||||
@ -49,7 +49,7 @@ class ManageAssets extends HTMLController
|
||||
'header' => ' ',
|
||||
'is_sortable' => false,
|
||||
'cell_class' => 'text-center',
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'type' => 'function',
|
||||
'data' => function($row) {
|
||||
$asset = Image::byRow($row);
|
||||
@ -87,7 +87,7 @@ class ManageAssets extends HTMLController
|
||||
'value' => 'filename',
|
||||
'header' => 'Filename',
|
||||
'is_sortable' => true,
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'type' => 'value',
|
||||
'link' => BASEURL . '/editasset/?id={ID_ASSET}',
|
||||
'data' => 'filename',
|
||||
@ -96,7 +96,7 @@ class ManageAssets extends HTMLController
|
||||
'id_user_uploaded' => [
|
||||
'header' => 'User uploaded',
|
||||
'is_sortable' => true,
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'type' => 'function',
|
||||
'data' => function($row) {
|
||||
if (!empty($row['id_user']))
|
||||
@ -110,7 +110,7 @@ class ManageAssets extends HTMLController
|
||||
'dimensions' => [
|
||||
'header' => 'Dimensions',
|
||||
'is_sortable' => false,
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'type' => 'function',
|
||||
'data' => function($row) {
|
||||
if (!empty($row['image_width']))
|
||||
|
@ -45,7 +45,7 @@ class ManageErrors extends HTMLController
|
||||
'is_sortable' => true,
|
||||
],
|
||||
'message' => [
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'type' => 'function',
|
||||
'data' => function($row) {
|
||||
return $row['message'] . '<br>' .
|
||||
@ -71,7 +71,7 @@ class ManageErrors extends HTMLController
|
||||
'is_sortable' => true,
|
||||
],
|
||||
'time' => [
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'type' => 'timestamp',
|
||||
'data' => [
|
||||
'timestamp' => 'time',
|
||||
@ -89,7 +89,7 @@ class ManageErrors extends HTMLController
|
||||
'uid' => [
|
||||
'header' => 'UID',
|
||||
'is_sortable' => true,
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'link' => BASEURL . '/edituser/?id={ID_USER}',
|
||||
'data' => 'id_user',
|
||||
],
|
||||
|
@ -37,7 +37,7 @@ class ManageTags extends HTMLController
|
||||
'tag' => [
|
||||
'header' => 'Tag',
|
||||
'is_sortable' => true,
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'link' => BASEURL . '/edittag/?id={ID_TAG}',
|
||||
'data' => 'tag',
|
||||
],
|
||||
@ -45,7 +45,7 @@ class ManageTags extends HTMLController
|
||||
'slug' => [
|
||||
'header' => 'Slug',
|
||||
'is_sortable' => true,
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'link' => BASEURL . '/edittag/?id={ID_TAG}',
|
||||
'data' => 'slug',
|
||||
],
|
||||
@ -53,7 +53,7 @@ class ManageTags extends HTMLController
|
||||
'id_user_owner' => [
|
||||
'header' => 'Owning user',
|
||||
'is_sortable' => true,
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'type' => 'function',
|
||||
'data' => function($row) {
|
||||
if (!empty($row['id_user']))
|
||||
|
@ -37,7 +37,7 @@ class ManageUsers extends HTMLController
|
||||
'surname' => [
|
||||
'header' => 'Last name',
|
||||
'is_sortable' => true,
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'link' => BASEURL . '/edituser/?id={ID_USER}',
|
||||
'data' => 'surname',
|
||||
],
|
||||
@ -45,7 +45,7 @@ class ManageUsers extends HTMLController
|
||||
'first_name' => [
|
||||
'header' => 'First name',
|
||||
'is_sortable' => true,
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'link' => BASEURL . '/edituser/?id={ID_USER}',
|
||||
'data' => 'first_name',
|
||||
],
|
||||
@ -53,7 +53,7 @@ class ManageUsers extends HTMLController
|
||||
'slug' => [
|
||||
'header' => 'Slug',
|
||||
'is_sortable' => true,
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'link' => BASEURL . '/edituser/?id={ID_USER}',
|
||||
'data' => 'slug',
|
||||
],
|
||||
@ -64,7 +64,7 @@ class ManageUsers extends HTMLController
|
||||
'is_sortable' => true,
|
||||
],
|
||||
'last_action_time' => [
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'type' => 'timestamp',
|
||||
'data' => [
|
||||
'timestamp' => 'last_action_time',
|
||||
@ -82,7 +82,7 @@ class ManageUsers extends HTMLController
|
||||
'is_admin' => [
|
||||
'is_sortable' => true,
|
||||
'header' => 'Admin?',
|
||||
'parse' => [
|
||||
'format' => [
|
||||
'type' => 'function',
|
||||
'data' => function($row) {
|
||||
return $row['is_admin'] ? 'yes' : 'no';
|
||||
|
@ -191,9 +191,9 @@ class GenericTable
|
||||
|
||||
foreach ($options['columns'] as $column)
|
||||
{
|
||||
// Process data for this particular cell.
|
||||
if (isset($column['parse']))
|
||||
$value = self::processCell($column['parse'], $row);
|
||||
// Process formatting
|
||||
if (isset($column['format']))
|
||||
$value = self::processFormatting($column['format'], $row);
|
||||
else
|
||||
$value = $row[$column['value']];
|
||||
|
||||
@ -209,7 +209,7 @@ class GenericTable
|
||||
}
|
||||
}
|
||||
|
||||
private function processCell($options, $rowData)
|
||||
private function processFormatting($options, $rowData)
|
||||
{
|
||||
if (!isset($options['type']))
|
||||
$options['type'] = 'value';
|
||||
|
Loading…
Reference in New Issue
Block a user