ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\UI\Implementation\Component\Table Namespace Reference

Namespaces

namespace  Action
 
namespace  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.

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

References $c.

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

+ 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.

105 : array
106 {
107 return array_filter(
108 $this->getOptionalColumns(),
109 static fn($c): bool => $c->isInitiallyVisible()
110 );
111 }

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

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

+ 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.

94 : array
95 {
96 return array_filter(
97 $this->getColumns(),
98 static fn($c): bool => $c->isOptional()
99 );
100 }

References $c.

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

+ Here is the caller graph for this function:

◆ getOrder()

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

Definition at line 90 of file TableViewControlOrdering.php.

90 : Order
91 {
92 return $this->order ?? $this->data_factory->order($this->initialOrder(), Order::ASC);
93 }
Both the subject and the direction need to be specified when expressing an order.
Definition: Order.php:29

References ILIAS\Data\Order\ASC, and ILIAS\UI\Implementation\Component\Table\initialOrder().

Referenced by assMultipleChoice\deleteAnswer(), assTextQuestion\deleteAnswer(), assTextSubset\deleteAnswer(), assSingleChoice\deleteAnswer(), ILIAS\UI\Implementation\Component\Table\getViewControlOrdering(), and ILIAS\UI\Implementation\Component\Table\initViewControlOrdering().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRange()

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

Definition at line 63 of file TableViewControlPagination.php.

63 : Range
64 {
65 return $this->range ?? $this->data_factory->range(0, $this->number_of_rows);
66 }
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:29

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

+ 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.

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 }

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

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

+ 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.

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 }
This describes a Field Selection View Control.

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

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

+ 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.

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 }
This describes a Sortation View Control.
Definition: Sortation.php:29

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

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

+ 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.

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 }

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

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

+ 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.

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 }
A Column describes the form of presentation for a certain aspect of data, i.e.
Definition: Column.php:28

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

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

+ 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.

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 }

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

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

+ 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.

36 : void
37 {
38 $this->selected_optional_column_ids = $this->filterVisibleColumnIds($columns);
39 }

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

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

+ 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.

32 : void
33 {
34 $this->order = $this->getOrder();
35 }

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

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

+ 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.

32 : void
33 {
34 $this->range = $this->getRange();
35 }

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

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

+ 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.

83 : self
84 {
85 $clone = clone $this;
86 $clone->order = $order;
87 return $clone;
88 }

◆ withRange()

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

Definition at line 56 of file TableViewControlPagination.php.

56 : self
57 {
58 $clone = clone $this;
59 $clone->range = $range;
60 return $clone;
61 }

References ILIAS\UI\Implementation\Component\Table\$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\Blog\Contributor\ContributorRetrieval\applyRange(), ILIAS\UI\Examples\Listing\Entity\Standard\base(), ILIAS\UI\examples\Table\Column\Boolean\base(), ILIAS\UI\examples\Table\Column\Breadcrumb\base(), ILIAS\UI\examples\Table\Column\Date\base(), ILIAS\UI\examples\Table\Column\EMail\base(), ILIAS\UI\examples\Table\Column\Link\base(), ILIAS\UI\examples\Table\Column\LinkListing\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\Table\Data\base(), ILIAS\FileDelivery\FileDeliveryTypes\PHPChunked\deliver(), ILIAS\UI\examples\Table\Column\Breadcrumb\disabled(), ILIAS\UI\examples\Table\Data\DataTableDemoRepo\doSelect(), ilUserCertificateRepository\fetchCertificatesForOverviewCount(), ILIAS\UI\Implementation\Component\Input\ViewControl\Renderer\findCurrentPage(), ILIAS\TestQuestionPool\Questions\Presentation\QuestionTable\getData(), ILIAS\Test\Questions\Presentation\QuestionsOfAttemptTable\getData(), ILIAS\Test\Questions\RandomQuestionSetNonAvailablePoolsTable\getData(), ILIAS\components\ILIAS\Glossary\Table\GlossaryAutoLinkTable\getDataRetrieval(), ILIAS\components\ILIAS\Glossary\Table\GlossaryForeignTermTable\getDataRetrieval(), ILIAS\components\ILIAS\Glossary\Table\TermDefinitionBulkCreationTable\getDataRetrieval(), ILIAS\components\ILIAS\Glossary\Table\TermListTable\getDataRetrieval(), ILIAS\components\ILIAS\Glossary\Table\TermUsagesTable\getDataRetrieval(), ILIAS\Skill\Table\AssignedObjectsTable\getDataRetrieval(), ILIAS\Skill\Table\AssignMaterialsTable\getDataRetrieval(), ILIAS\Skill\Table\LevelResourcesTable\getDataRetrieval(), ILIAS\Skill\Table\ProfileTable\getDataRetrieval(), ILIAS\Skill\Table\ProfileUserAssignmentTable\getDataRetrieval(), DataTest\getDataRetrieval(), DataViewControlsTest\getDataRetrieval(), ilTestArchiver\getDataRetrievalForAttemptOverviewTable(), ILIAS\UI\examples\Table\Action\Multi\getExampleTable(), ILIAS\UI\examples\Table\Action\Single\getExampleTable(), ILIAS\UI\examples\Table\Action\Standard\getExampleTable(), ilLanguageFolderTable\getItems(), ilLanguageStatisticsTable\getItems(), ILIAS\Test\Logging\TestLoggingDatabaseRepository\getLogs(), ilBiblLibraryTableGUI\getRecords(), ILIAS\Cron\Job\Manager\UI\JobTable\getRecords(), ILIAS\LDAP\Server\UI\ServerTable\getRecords(), ILIAS\Mail\Attachments\MailAttachmentTableGUI\getRecords(), ilSamlIdpTableGUI\getRecords(), ILIAS\components\Authentication\Pages\AuthPageLanguagesOverviewTable\getRecords(), ILIAS\Chatroom\Bans\BannedUsersTable\getRecords(), ILIAS\Contact\MailingLists\MailingListsMembersTable\getRecords(), ILIAS\Contact\MailingLists\MailingListsTable\getRecords(), ILIAS\Contact\MemberSearch\MailMemberSearchTable\getRecords(), ILIAS\Forum\Moderation\ForumModeratorsTable\getRecords(), ilDidacticTemplateSettingsTableDataRetrieval\getRecords(), ILIAS\Forum\Drafts\ForumDraftsTable\getRecords(), ILIAS\Forum\Statistics\ForumStatisticsTable\getRecords(), LDAPRoleAssignmentTable\getRecords(), LDAPRoleMappingTable\getRecords(), ilMailTemplateTable\getRecords(), ILIAS\Forum\Notification\ForumNotificationTable\getRecords(), ILIAS\Registration\RegistrationCodesTable\getRecords(), ILIAS\Dashboard\DataRetrieval\Language\getRows(), ilMediaCastManageTableGUI\getRows(), ilOrgUnitTypeGUI\getTableDataRetrieval(), ilOrgUnitUserAssignmentDBRepository\getUserDataByOrgUnitsAndPosition(), ILIAS\Test\Participants\ParticipantTable\getViewControlledRecords(), ILIAS\UI\Implementation\Component\Table\getViewControlPagination(), ILIAS\MetaData\Settings\Vocabularies\DataRetrieval\getVocabs(), ILIAS\components\ResourceStorage\Collections\View\RequestToDataTable\initSortingAndOrdering(), ILIAS\components\ResourceStorage\Container\View\RequestToDataTable\initSortingAndOrdering(), ILIAS\Calendar\ConsultationHours\BookingDataProvider\limitData(), ILIAS\Conditions\Configuration\ConditionTriggerProvider\limitData(), ILIAS\components\Authentication\Pages\AuthPageLanguagesOverviewTable\limitRecords(), ILIAS\Chatroom\Bans\BannedUsersTable\limitRecords(), ILIAS\Contact\MailingLists\MailingListsMembersTable\limitRecords(), ILIAS\Contact\MailingLists\MailingListsTable\limitRecords(), ILIAS\Contact\MemberSearch\MailMemberSearchTable\limitRecords(), ILIAS\Forum\Drafts\ForumDraftsTable\limitRecords(), ILIAS\Forum\Notification\ForumNotificationTable\limitRecords(), ILIAS\Forum\Statistics\ForumStatisticsTable\limitRecords(), LDAPRoleAssignmentTable\limitRecords(), LDAPRoleMappingTable\limitRecords(), ilMailTemplateTable\limitRecords(), ILIAS\Test\Participants\ParticipantTable\limitRecords(), ILIAS\Test\Questions\Presentation\QuestionsBrowserTable\loadRecords(), ILIAS\UI\examples\Table\Column\Breadcrumb\long_path(), ILIAS\UI\Implementation\Component\Input\ViewControl\Renderer\renderPagination(), ILIAS\Contact\BuddySystem\Tables\RelationsTable\rows(), RangeTest\testConstructionWrongLength(), RangeTest\testConstructionWrongStart(), RangeTest\testCroppedTo(), DataRendererTest\testDataTableRenderHeaderWithActions(), DataRendererTest\testDataTableRenderHeaderWithoutSortableColums(), DataRendererTest\testDataTableRenderTableHeader(), DataTest\testDataTableWithRange(), RangeTest\testEndCalculation(), EntityListingTest\testEntityListingYieldingEntities(), RangeTest\testFactory(), PaginationTest\testGetRangeOnNull(), RangeTest\testNegativeLength(), RangeTest\testNegativeStart(), DataRendererTest\testRenderEmptyDataCell(), RangeTest\testUnpack(), RangeTest\testValues(), RangeTest\testWithLength(), RangeTest\testWithStart(), 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

Definition at line 26 of file TableViewControlFieldSelection.php.

◆ TableViewControlOrdering

trait ILIAS::UI::Implementation::Component::Table\TableViewControlOrdering
Initial value:
{
protected ?Order $order = null

Definition at line 28 of file TableViewControlOrdering.php.

◆ TableViewControlPagination

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

Definition at line 27 of file TableViewControlPagination.php.