ILIAS  trunk Revision v11.0_alpha-1862-g4e205cb56d4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\UI\Implementation\Component\Table Namespace Reference

Namespaces

 Action
 
 Column
 

Data Structures

class  AbstractTable
 
class  Data
 
class  DataRow
 
class  DataRowBuilder
 
class  Factory
 
class  Ordering
 
class  OrderingRow
 
class  OrderingRowBuilder
 
class  Presentation
 
class  PresentationRow
 
class  Renderer
 
class  RowBuilder
 
class  Table
 

Functions

 initViewControlFieldSelection (array $columns)
 
 getViewControlFieldSelection ()
 
 filterVisibleColumnIds (array $columns)
 
 withSelectedOptionalColumns (?array $selected_optional_column_ids)
 
 getSelectedOptionalColumns ()
 
 getOptionalColumns ()
 
 getInitiallyVisibleColumns ()
 
 getVisibleColumns ()
 
 initViewControlOrdering ()
 
 initialOrder ()
 
 getViewControlOrdering (int|null $total_count)
 
 withOrder (?Order $order)
 
 getOrder ()
 
 initViewControlpagination ()
 
 getViewControlPagination (?int $total_count=null)
 
 withRange (?Range $range)
 
 getRange ()
 

Variables

trait TableViewControlFieldSelection
 
trait TableViewControlOrdering
 
trait TableViewControlPagination
 
Range $range = null
 

Function Documentation

◆ filterVisibleColumnIds()

ILIAS\UI\Implementation\Component\Table\filterVisibleColumnIds ( array  $columns)
protected
Parameters
array<string,Column>$columns
Returns
array<string>

Definition at line 60 of file TableViewControlFieldSelection.php.

References $c.

Referenced by ILIAS\UI\Implementation\Component\Table\initViewControlFieldSelection().

60  : array
61  {
62  return array_keys(
63  array_filter(
64  $columns,
65  static fn($c): bool => $c->isInitiallyVisible()
66  )
67  );
68  }
$c
Definition: deliver.php:25
+ Here is the caller graph for this function:

◆ getInitiallyVisibleColumns()

ILIAS\UI\Implementation\Component\Table\getInitiallyVisibleColumns ( )
protected
Returns
array<int, Column>

Definition at line 105 of file TableViewControlFieldSelection.php.

References $c, and ILIAS\UI\Implementation\Component\Table\getOptionalColumns().

Referenced by ILIAS\UI\Implementation\Component\Table\getSelectedOptionalColumns().

105  : array
106  {
107  return array_filter(
108  $this->getOptionalColumns(),
109  static fn($c): bool => $c->isInitiallyVisible()
110  );
111  }
$c
Definition: deliver.php:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOptionalColumns()

ILIAS\UI\Implementation\Component\Table\getOptionalColumns ( )
protected
Returns
array<int, Column>

Definition at line 94 of file TableViewControlFieldSelection.php.

References $c.

Referenced by ILIAS\UI\Implementation\Component\Table\getInitiallyVisibleColumns(), and ILIAS\UI\Implementation\Component\Table\getViewControlFieldSelection().

94  : array
95  {
96  return array_filter(
97  $this->getColumns(),
98  static fn($c): bool => $c->isOptional()
99  );
100  }
$c
Definition: deliver.php:25
+ Here is the caller graph for this function:

◆ getOrder()

ILIAS\UI\Implementation\Component\Table\getOrder ( )

◆ getRange()

ILIAS\UI\Implementation\Component\Table\getRange ( )

Definition at line 63 of file TableViewControlPagination.php.

Referenced by ILIAS\UI\Implementation\Component\Table\getViewControlPagination(), and ILIAS\UI\Implementation\Component\Table\initViewControlpagination().

63  : Range
64  {
65  return $this->range ?? $this->data_factory->range(0, $this->number_of_rows);
66  }
+ Here is the caller graph for this function:

◆ getSelectedOptionalColumns()

ILIAS\UI\Implementation\Component\Table\getSelectedOptionalColumns ( )
Returns
string[]

Definition at line 83 of file TableViewControlFieldSelection.php.

References ILIAS\UI\Implementation\Component\Table\getInitiallyVisibleColumns().

Referenced by ILIAS\UI\Implementation\Component\Table\getViewControlFieldSelection(), and ILIAS\UI\Implementation\Component\Table\getVisibleColumns().

83  : array
84  {
85  if (is_null($this->selected_optional_column_ids)) {
86  return array_keys($this->getInitiallyVisibleColumns());
87  }
88  return $this->selected_optional_column_ids;
89  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getViewControlFieldSelection()

ILIAS\UI\Implementation\Component\Table\getViewControlFieldSelection ( )
protected

Definition at line 41 of file TableViewControlFieldSelection.php.

References $c, ILIAS\UI\Implementation\Component\Table\getOptionalColumns(), ILIAS\UI\Implementation\Component\Table\getSelectedOptionalColumns(), and null.

Referenced by ILIAS\UI\Implementation\Component\Table\Ordering\getViewControls(), and ILIAS\UI\Implementation\Component\Table\Data\getViewControls().

41  : ?FieldSelection
42  {
43  $optional_cols = $this->getOptionalColumns();
44  if ($optional_cols === []) {
45  return null;
46  }
47 
48  return $this->view_control_factory
49  ->fieldSelection(array_map(
50  static fn($c): string => $c->getTitle(),
51  $optional_cols
52  ))
53  ->withValue($this->getSelectedOptionalColumns());
54  }
$c
Definition: deliver.php:25
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getViewControlOrdering()

ILIAS\UI\Implementation\Component\Table\getViewControlOrdering ( int|null  $total_count)
protected

Definition at line 50 of file TableViewControlOrdering.php.

References $c, ILIAS\Data\Order\ASC, ILIAS\Data\Order\DESC, ILIAS\UI\Implementation\Component\Table\getOrder(), ILIAS\UI\Implementation\Component\Table\getVisibleColumns(), and null.

Referenced by ILIAS\UI\Implementation\Component\Table\Data\getViewControls().

50  : Sortation|ViewControl\Group
51  {
52 
53  $sortable_visible_cols = array_filter(
54  $this->getVisibleColumns(),
55  static fn($c): bool => $c->isSortable()
56  );
57 
58  if ($sortable_visible_cols === [] ||
59  ($total_count !== null && $total_count < 2)
60  ) {
61  return $this->view_control_factory->group([
62  $this->view_control_factory->nullControl(),
63  $this->view_control_factory->nullControl()
64  ]);
65  }
66 
67  $sort_options = [];
68  foreach ($sortable_visible_cols as $col_id => $col) {
69 
70  $order_asc = $this->data_factory->order($col_id, Order::ASC);
71  $order_desc = $this->data_factory->order($col_id, Order::DESC);
72 
73  $labels = $col->getOrderingLabels();
74  $sort_options[$labels[0]] = $order_asc;
75  $sort_options[$labels[1]] = $order_desc;
76  }
77 
78  $value = $this->getOrder()->join('', fn($ret, $key, $value) => [$key, $value]);
79  return $this->view_control_factory->sortation($sort_options)
80  ->withValue($value);
81  }
$c
Definition: deliver.php:25
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getViewControlPagination()

ILIAS\UI\Implementation\Component\Table\getViewControlPagination ( ?int  $total_count = null)
protected

Definition at line 37 of file TableViewControlPagination.php.

References ILIAS\Data\Range\getLength(), ILIAS\UI\Implementation\Component\Table\getRange(), and ILIAS\Data\Range\getStart().

Referenced by ILIAS\UI\Implementation\Component\Table\Data\getViewControls().

37  : ViewControl\Pagination|ViewControl\Group
38  {
39  $smallest_option = current(Pagination::DEFAULT_LIMITS);
40  if (is_null($total_count) || $total_count >= $smallest_option) {
41  $range = $this->getRange();
42  return
43  $this->view_control_factory->pagination()
44  ->withTotalCount($total_count)
45  ->withValue([
46  Pagination::FNAME_OFFSET => $range->getStart(),
47  Pagination::FNAME_LIMIT => $range->getLength()
48  ]);
49  }
50  return $this->view_control_factory->group([
51  $this->view_control_factory->nullControl(),
52  $this->view_control_factory->nullControl()
53  ]);
54  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getVisibleColumns()

ILIAS\UI\Implementation\Component\Table\getVisibleColumns ( )
Returns
array<string, Column>

Definition at line 116 of file TableViewControlFieldSelection.php.

References ILIAS\UI\Implementation\Component\Table\getSelectedOptionalColumns(), and ILIAS\UI\Component\Table\Column\Column\isOptional().

Referenced by ILIAS\UI\Implementation\Component\Table\Ordering\getRowBuilder(), ILIAS\UI\Implementation\Component\Table\Data\getRowBuilder(), ILIAS\UI\Implementation\Component\Table\getViewControlOrdering(), and ILIAS\UI\Implementation\Component\Table\initialOrder().

116  : array
117  {
118  $visible_optional_columns = $this->getSelectedOptionalColumns();
119  return array_filter(
120  $this->getColumns(),
121  fn(Column $col, string $col_id): bool => !$col->isOptional() || in_array($col_id, $visible_optional_columns, true),
122  ARRAY_FILTER_USE_BOTH
123  );
124  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialOrder()

ILIAS\UI\Implementation\Component\Table\initialOrder ( )
private

Definition at line 37 of file TableViewControlOrdering.php.

References $c, and ILIAS\UI\Implementation\Component\Table\getVisibleColumns().

Referenced by ILIAS\UI\Implementation\Component\Table\getOrder().

37  : string
38  {
39  $visible_cols = $this->getVisibleColumns();
40  $sortable_visible_cols = array_filter(
41  $visible_cols,
42  static fn($c): bool => $c->isSortable()
43  );
44  if ($sortable_visible_cols === []) {
45  return array_key_first($visible_cols);
46  }
47  return array_key_first($sortable_visible_cols);
48  }
$c
Definition: deliver.php:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initViewControlFieldSelection()

ILIAS\UI\Implementation\Component\Table\initViewControlFieldSelection ( array  $columns)
protected
Parameters
array<string,Column>$columns

Definition at line 36 of file TableViewControlFieldSelection.php.

References ILIAS\UI\Implementation\Component\Table\filterVisibleColumnIds().

Referenced by ILIAS\UI\Implementation\Component\Table\Ordering\__construct(), and ILIAS\UI\Implementation\Component\Table\Data\__construct().

36  : void
37  {
38  $this->selected_optional_column_ids = $this->filterVisibleColumnIds($columns);
39  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initViewControlOrdering()

ILIAS\UI\Implementation\Component\Table\initViewControlOrdering ( )
protected

Definition at line 32 of file TableViewControlOrdering.php.

References ILIAS\UI\Implementation\Component\Table\getOrder().

Referenced by ILIAS\UI\Implementation\Component\Table\Data\__construct().

32  : void
33  {
34  $this->order = $this->getOrder();
35  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initViewControlpagination()

ILIAS\UI\Implementation\Component\Table\initViewControlpagination ( )
protected

Definition at line 32 of file TableViewControlPagination.php.

References ILIAS\UI\Implementation\Component\Table\getRange().

Referenced by ILIAS\UI\Implementation\Component\Table\Data\__construct().

32  : void
33  {
34  $this->range = $this->getRange();
35  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withOrder()

ILIAS\UI\Implementation\Component\Table\withOrder ( ?Order  $order)

Definition at line 83 of file TableViewControlOrdering.php.

Referenced by ilBiblLibraryTableGUI\buildTable(), ILIAS\Contact\MailingLists\MailingListsMembersTable\getComponent(), ILIAS\Forum\Moderation\ForumModeratorsTable\getComponent(), and ILIAS\Contact\MailingLists\MailingListsTable\getComponent().

83  : self
84  {
85  $clone = clone $this;
86  $clone->order = $order;
87  return $clone;
88  }
+ Here is the caller graph for this function:

◆ withRange()

ILIAS\UI\Implementation\Component\Table\withRange ( ?Range  $range)

◆ withSelectedOptionalColumns()

ILIAS\UI\Implementation\Component\Table\withSelectedOptionalColumns ( ?array  $selected_optional_column_ids)
Parameters
string[]$selected_optional_column_ids

Definition at line 73 of file TableViewControlFieldSelection.php.

73  : static
74  {
75  $clone = clone $this;
76  $clone->selected_optional_column_ids = $selected_optional_column_ids;
77  return $clone;
78  }

Variable Documentation

◆ $range

Range ILIAS::UI::Implementation::Component::Table\$range = null
protected

Definition at line 30 of file TableViewControlPagination.php.

Referenced by ILIAS\Certificate\Overview\CertificateOverviewTable\__construct(), ILIAS\UI\Implementation\Component\Table\Data\applyViewControls(), ILIAS\UI\examples\Table\Column\LinkListing\base(), ILIAS\UI\examples\Table\Column\Boolean\base(), ILIAS\UI\examples\Table\Column\Date\base(), ILIAS\UI\examples\Table\Column\Link\base(), ILIAS\UI\examples\Table\Column\EMail\base(), ILIAS\UI\examples\Table\Column\Number\base(), ILIAS\UI\examples\Table\Column\Status\base(), ILIAS\UI\examples\Table\Column\StatusIcon\base(), ILIAS\UI\examples\Table\Column\Text\base(), ILIAS\UI\examples\Table\Column\TimeSpan\base(), ILIAS\UI\Examples\Listing\Entity\Standard\base(), ILIAS\UI\examples\Table\Data\base(), ILIAS\FileDelivery\FileDeliveryTypes\PHPChunked\deliver(), ilUserCertificateRepository\fetchCertificatesForOverview(), ilUserCertificateRepository\fetchCertificatesForOverviewCount(), ILIAS\UI\Implementation\Component\Input\ViewControl\Renderer\findCurrentPage(), ILIAS\UI\Implementation\Component\Chart\Bar\Renderer\getAccessibilityList(), ILIAS\Bibliographic\Field\Table\TreeTable\getActions(), ilOrgUnitPositionDBRepository\getAllPositions(), ilStudyProgrammeTypeDBRepository\getAllTypes(), DataViewControlsTest\getDataRetrieval(), DataTest\getDataRetrieval(), ILIAS\components\ILIAS\Glossary\Table\TermDefinitionBulkCreationTable\getDataRetrieval(), ILIAS\components\ILIAS\Glossary\Table\TermUsagesTable\getDataRetrieval(), ILIAS\Bibliographic\Field\Table\AssignedObjectsTable\getDataRetrieval(), ILIAS\components\ILIAS\Glossary\Table\GlossaryForeignTermTable\getDataRetrieval(), ILIAS\components\ILIAS\Glossary\Table\GlossaryAutoLinkTable\getDataRetrieval(), ILIAS\Bibliographic\Field\Table\ProfileUserAssignmentTable\getDataRetrieval(), ILIAS\Bibliographic\Field\Table\AssignMaterialsTable\getDataRetrieval(), ILIAS\Bibliographic\Field\Table\ProfileTable\getDataRetrieval(), ILIAS\Bibliographic\Field\Table\LevelResourcesTable\getDataRetrieval(), ILIAS\components\ILIAS\Glossary\Table\TermListTable\getDataRetrieval(), ilTestArchiver\getDataRetrievalForAttemptOverviewTable(), ILIAS\UI\Implementation\Component\Listing\Entity\EntityListing\getEntities(), ILIAS\UI\examples\Table\Action\Single\getExampleTable(), ILIAS\UI\examples\Table\Action\Multi\getExampleTable(), ILIAS\UI\examples\Table\Action\Standard\getExampleTable(), ilLanguageStatisticsTable\getItems(), ilLanguageFolderTable\getItems(), ILIAS\Test\Logging\TestLoggingDatabaseRepository\getLogs(), ILIAS\Test\Participants\ParticipantRepository\getParticipants(), ilBiblLibraryTableGUI\getRecords(), ILIAS\Test\Logging\LogTable\getRows(), ilOrgUnitTypeGUI\getTableDataRetrieval(), ILIAS\Test\Participants\ParticipantTable\getTotalRowCount(), ilOrgUnitUserAssignmentDBRepository\getUserDataByOrgUnitsAndPosition(), ILIAS\MetaData\Settings\Vocabularies\DataRetrieval\getVocabs(), ilPresentationTableGUI\initViewControl(), ILIAS\Test\Questions\Presentation\QuestionsBrowserTable\loadRecords(), ILIAS\UI\Implementation\Component\ViewControl\Renderer\renderPagination(), ILIAS\UI\Implementation\Component\Input\ViewControl\Renderer\renderPagination(), RangeTest\testConstructionWrongLength(), RangeTest\testConstructionWrongStart(), RangeTest\testCroppedTo(), DataRendererTest\testDataTableRenderHeaderWithActions(), DataRendererTest\testDataTableRenderHeaderWithoutSortableColums(), DataRendererTest\testDataTableRenderTableHeader(), DataTest\testDataTableWithRange(), EntityListingTest\testEntityListingYieldingEntities(), RangeTest\testFactory(), PaginationTest\testGetRangeOnNull(), DataRendererTest\testRenderEmptyDataCell(), RangeTest\testWithLength(), RangeTest\testWithStart(), ILIAS\Export\ExportHandler\Table\DataRetrieval\Handler\withExportObject(), ILIAS\UI\examples\Table\Data\without_data(), and ILIAS\UI\Implementation\Component\Table\withRange().

◆ TableViewControlFieldSelection

trait ILIAS::UI::Implementation::Component::Table\TableViewControlFieldSelection
Initial value:
{
protected ?array $selected_optional_column_ids = null
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

Definition at line 27 of file TableViewControlFieldSelection.php.

◆ TableViewControlOrdering

trait ILIAS::UI::Implementation::Component::Table\TableViewControlOrdering
Initial value:
{
protected ?Order $order = null
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

Definition at line 29 of file TableViewControlOrdering.php.

◆ TableViewControlPagination

trait ILIAS::UI::Implementation::Component::Table\TableViewControlPagination
Initial value:
{
protected int $number_of_rows = 800

Definition at line 28 of file TableViewControlPagination.php.