forked from Public/pics
ManageAssets: trade filename for user uploaded field
This commit is contained in:
parent
54df35073d
commit
fa01bf8961
@ -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}',
|
||||
[
|
||||
|
Loading…
Reference in New Issue
Block a user