diff --git a/controllers/ManageAlbums.php b/controllers/ManageAlbums.php
index e725db1..248e369 100644
--- a/controllers/ManageAlbums.php
+++ b/controllers/ManageAlbums.php
@@ -35,18 +35,14 @@ class ManageAlbums extends HTMLController
'tag' => [
'header' => 'Album',
'is_sortable' => true,
- 'format' => [
- 'link' => BASEURL . '/editalbum/?id={ID_TAG}',
- 'data' => 'tag',
- ],
+ 'link' => BASEURL . '/editalbum/?id={ID_TAG}',
+ 'value' => 'tag',
],
'slug' => [
'header' => 'Slug',
'is_sortable' => true,
- 'format' => [
- 'link' => BASEURL . '/editalbum/?id={ID_TAG}',
- 'data' => 'slug',
- ],
+ 'link' => BASEURL . '/editalbum/?id={ID_TAG}',
+ 'value' => 'slug',
],
'count' => [
'header' => '# Photos',
diff --git a/controllers/ManageAssets.php b/controllers/ManageAssets.php
index 3f5923b..59895ff 100644
--- a/controllers/ManageAssets.php
+++ b/controllers/ManageAssets.php
@@ -38,40 +38,33 @@ class ManageAssets extends HTMLController
'checkbox' => [
'header' => '',
'is_sortable' => false,
- 'format' => [
- 'type' => 'function',
- 'data' => function($row) {
- return '';
- },
- ],
+ 'format' => fn($row) =>
+ '',
],
'thumbnail' => [
'header' => ' ',
'is_sortable' => false,
'cell_class' => 'text-center',
- 'format' => [
- 'type' => 'function',
- 'data' => function($row) {
- $asset = Image::byRow($row);
- $width = $height = 65;
- if ($asset->isImage())
- {
- if ($asset->isPortrait())
- $width = null;
- else
- $height = null;
-
- $thumb = $asset->getThumbnailUrl($width, $height);
- }
+ 'format' => function($row) {
+ $asset = Image::byRow($row);
+ $width = $height = 65;
+ if ($asset->isImage())
+ {
+ if ($asset->isPortrait())
+ $width = null;
else
- $thumb = BASEURL . '/images/nothumb.svg';
+ $height = null;
- $width = isset($width) ? $width . 'px' : 'auto';
- $height = isset($height) ? $height . 'px' : 'auto';
+ $thumb = $asset->getThumbnailUrl($width, $height);
+ }
+ else
+ $thumb = BASEURL . '/images/nothumb.svg';
- return sprintf('', $thumb, $width, $height);
- },
- ],
+ $width = isset($width) ? $width . 'px' : 'auto';
+ $height = isset($height) ? $height . 'px' : 'auto';
+
+ return sprintf('', $thumb, $width, $height);
+ },
],
'id_asset' => [
'value' => 'id_asset',
@@ -87,38 +80,29 @@ class ManageAssets extends HTMLController
'value' => 'filename',
'header' => 'Filename',
'is_sortable' => true,
- 'format' => [
- 'type' => 'value',
- 'link' => BASEURL . '/editasset/?id={ID_ASSET}',
- 'data' => 'filename',
- ],
+ 'link' => BASEURL . '/editasset/?id={ID_ASSET}',
+ 'value' => 'filename',
],
'id_user_uploaded' => [
'header' => 'User uploaded',
'is_sortable' => true,
- 'format' => [
- 'type' => 'function',
- 'data' => function($row) {
- if (!empty($row['id_user']))
- return sprintf('%s', BASEURL, $row['id_user'],
- $row['first_name'] . ' ' . $row['surname']);
- else
- return 'n/a';
- },
- ],
+ 'format' => function($row) {
+ if (!empty($row['id_user']))
+ return sprintf('%s', BASEURL, $row['id_user'],
+ $row['first_name'] . ' ' . $row['surname']);
+ else
+ return 'n/a';
+ },
],
'dimensions' => [
'header' => 'Dimensions',
'is_sortable' => false,
- 'format' => [
- 'type' => 'function',
- 'data' => function($row) {
- if (!empty($row['image_width']))
- return $row['image_width'] . ' x ' . $row['image_height'];
- else
- return 'n/a';
- },
- ],
+ 'format' => function($row) {
+ if (!empty($row['image_width']))
+ return $row['image_width'] . ' x ' . $row['image_height'];
+ else
+ return 'n/a';
+ },
],
],
'default_sort_order' => 'id_asset',
diff --git a/controllers/ManageErrors.php b/controllers/ManageErrors.php
index 1496617..cdb75dc 100644
--- a/controllers/ManageErrors.php
+++ b/controllers/ManageErrors.php
@@ -45,20 +45,17 @@ class ManageErrors extends HTMLController
'is_sortable' => true,
],
'message' => [
- 'format' => [
- 'type' => 'function',
- 'data' => function($row) {
- return $row['message'] . '
' .
- '