| ... | ... |
@@ -18,7 +18,7 @@ |
| 18 | 18 |
"madeyourday/contao-rocksolid-custom-elements": "^2.2", |
| 19 | 19 |
"madeyourday/contao-rocksolid-icon-picker": "^2.0", |
| 20 | 20 |
"esalesmedia/contao-swiperjs-slider": "^2.3", |
| 21 |
- "oveleon/contao-component-style-manager": "^2.6" |
|
| 21 |
+ "oveleon/contao-component-stylcde-manager": "^2.6" |
|
| 22 | 22 |
}, |
| 23 | 23 |
"require-dev": {
|
| 24 | 24 |
"contao/maker-bundle": "^4.13" |
| ... | ... |
@@ -45,7 +45,7 @@ $GLOBALS['TL_DCA']['tl_eSM_team'] = array |
| 45 | 45 |
'fields' => array('division', 'lastname'),
|
| 46 | 46 |
'headerFields' => array('title'),
|
| 47 | 47 |
'panelLayout' => 'filter,search;sort,limit', |
| 48 |
- 'child_record_callback' => array('tl_eSM_team', 'listMembers')
|
|
| 48 |
+// 'child_record_callback' => array('tl_eSM_team', 'listMembers')
|
|
| 49 | 49 |
), |
| 50 | 50 |
'label' => array |
| 51 | 51 |
( |
| 930 | 938 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,31 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+declare(strict_types=1); |
|
| 4 |
+ |
|
| 5 |
+namespace App\EventListener\DataContainer; |
|
| 6 |
+ |
|
| 7 |
+use Contao\Controller; |
|
| 8 |
+use Contao\CoreBundle\DependencyInjection\Attribute\AsCallback; |
|
| 9 |
+use Contao\Image; |
|
| 10 |
+ |
|
| 11 |
+#[AsCallback(table: "tl_eSM_team", target: "list.sorting.child_record")] |
|
| 12 |
+class TeamListSortingChildRecordListener |
|
| 13 |
+{
|
|
| 14 |
+ public function __invoke(array $recordData): string |
|
| 15 |
+ {
|
|
| 16 |
+ $imageService = Controller::getContainer()->get('contao.image.factory');
|
|
| 17 |
+ $projectDir = Controller::getContainer()->getParameter('kernel.project_dir');
|
|
| 18 |
+ $strImage = ''; |
|
| 19 |
+ |
|
| 20 |
+ if (($image = \FilesModel::findByUuid($recordData['singleSRC'])) !== null) |
|
| 21 |
+ {
|
|
| 22 |
+ $strImage = sprintf('<img src="%s">',$imageService->create($projectDir. '/' .$image->path,[50,50])->getUrl($projectDir));
|
|
| 23 |
+ } |
|
| 24 |
+ |
|
| 25 |
+ |
|
| 26 |
+ return '<div style="float: left; width: 75px">'.$strImage.'</div> |
|
| 27 |
+<div style="float: left; width: 35%;">' . $recordData['firstname'] . ' ' . $recordData['lastname'] . '</div> |
|
| 28 |
+<div style="font-size: .625rem; color: #c6c6c6;"><strong>[' . $recordData['position'] . ']</strong></div>' . "\n"; |
|
| 29 |
+ return ''; |
|
| 30 |
+ } |
|
| 31 |
+} |