svg = acym_loaderLogo(false); $this->columnsHeaderNotToDisplay = ['color']; } public function entitySelect( string $entity, array $entityParams = [], array $columnsToDisplay = ['name'], array $buttonSubmit = [ 'text' => '', 'action' => '', 'class' => '', ], bool $displaySelected = true, string $additionalData = '', string $displayedName = '' ): string { $columnJoin = ''; if (!empty($columnsToDisplay['join'])) { $columnJoin = explode('.', $columnsToDisplay['join']); } unset($columnsToDisplay['join']); if (empty($entityParams['elementsPerPage']) || $entityParams['elementsPerPage'] < 1) { $paginationHelper = new PaginationHelper(); $entityParams['elementsPerPage'] = $paginationHelper->getListLimit(); } if (!empty($columnJoin)) $columnJoin = 'data-column-join="'.$columnJoin[1].'" data-table-join="'.$columnJoin[0].'"'; $display = ''; return $display; } public function getColumnsForList(string $join = '', bool $small = false): array { $columns = [ 'color' => $small ? 'small-2' : 'small-1', 'name' => 'auto', 'id' => 'small-2', ]; if (!empty($join)) { $columns['join'] = $join; } return $columns; } public function getColumnsForUser(string $join = ''): array { $columns = [ 'email' => 'auto', 'name' => 'auto', 'id' => 'small-1', ]; if (!empty($join)) { $columns['join'] = $join; } return $columns; } private function getListing(string $type, string $allSelector, string $entity, array $columnsToDisplay = [], string $displayedName = ''): string { if (empty($displayedName)) { $displayedName = $entity; } $display = '
'.acym_translation('ACYM_'.strtoupper($type).'_'.strtoupper($displayedName)).'
'; $emptyMessage = acym_translation($type === 'available' ? 'ACYM_NOTHING_TO_SHOW_HERE_RIGHT_PANEL' : 'ACYM_PLEASE_CLICK_ON_THE_LEFT_PANEL'); $display .= '
'.$emptyMessage.'
'; if ($type !== 'available') $display .= '
'; foreach ($columnsToDisplay as $column => $class) { $display .= '
'.(in_array($column, $this->columnsHeaderNotToDisplay) ? '' : acym_translation('ACYM_'.strtoupper($column))).'
'; } if ($type === 'available') $display .= '
'; $display .= '
'; $functionClick = $type === 'available' ? 'v-on:click="selectEntity(entity.id)"' : 'v-on:click="unselectEntity(entity.id)"'; $display .= '
'; if ($type !== 'available') { $display .= '
'; } $display .= '
'; if ($type === 'available') { $display .= '
'; } $display .= '
'; $display .= acym_translation('ACYM_WE_ARE_LOADING_YOUR_DATA'); $display .= '
'.$this->svg.'
'; $display .= '
'; $display .= '
'; return $display; } }