New bootstrap-based layout #30

Merged
Roflin merged 79 commits from bootstrap into master 2023-03-14 19:11:25 +01:00
Showing only changes of commit fa01bf8961 - Show all commits

View File

@ -38,13 +38,17 @@ class ManageAssets extends HTMLController
'data' => 'filename',
],
],
'title' => [
'header' => 'Title',
'id_user_uploaded' => [
'header' => 'User uploaded',
'is_sortable' => true,
'parse' => [
'type' => 'value',
'link' => BASEURL . '/editasset/?id={ID_ASSET}',
'data' => 'title',
'type' => 'function',
'data' => function($row) {
if (!empty($row['first_name']))
return $row['first_name'] . ' ' . $row['surname'];
else
return 'n/a';
},
],
],
'dimensions' => [
@ -69,12 +73,15 @@ class ManageAssets extends HTMLController
'items_per_page' => 30,
'base_url' => BASEURL . '/manageassets/',
'get_data' => function($offset = 0, $limit = 30, $order = '', $direction = 'down') {
if (!in_array($order, ['id_asset', 'title', 'subdir', 'filename']))
if (!in_array($order, ['id_asset', 'id_user_uploaded', 'title', 'subdir', 'filename']))
$order = 'id_asset';
$data = Registry::get('db')->queryAssocs('
SELECT id_asset, title, subdir, filename, image_width, image_height
FROM assets
SELECT a.id_asset, a.subdir, a.filename,
a.image_width, a.image_height,
u.id_user, u.first_name, u.surname
FROM assets AS a
LEFT JOIN users AS u ON a.id_user_uploaded = u.id_user
ORDER BY {raw:order}
LIMIT {int:offset}, {int:limit}',
[