svg = acym_loaderLogo(false); $this->columnsHeaderNotToDisplay = ['color']; } private function _getListing($type, $allSelector, $entity, $columnsToDisplay = [], $displayedName = '') { 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; } public function entitySelect( $entity, $entityParams = [], $columnsToDisplay = ['name'], $buttonSubmit = [ 'text' => '', 'action' => '', 'class' => '', ], $displaySelected = true, $additionalData = '', $displayedName = '' ) { $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($join = '', $small = false) { $columns = [ 'color' => $small ? 'small-2' : 'small-1', 'name' => 'auto', 'id' => 'small-2', ]; if (!empty($join)) $columns['join'] = $join; return $columns; } public function getColumnsForUser($join = '') { $columns = [ 'email' => 'auto', 'name' => 'auto', 'id' => 'small-1', ]; if (!empty($join)) { $columns['join'] = $join; } return $columns; } }