ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ILIAS\Dashboard\DataRetrieval\Language Class Reference
+ Inheritance diagram for ILIAS\Dashboard\DataRetrieval\Language:
+ Collaboration diagram for ILIAS\Dashboard\DataRetrieval\Language:

Public Member Functions

 __construct ()
 
 getRows (DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 
 getTotalRowCount (mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 Mainly for the purpose of pagination-support, it is important to know about the total number of records available. More...
 
 getRows (DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 
 getTotalRowCount (mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 Mainly for the purpose of pagination-support, it is important to know about the total number of records available. More...
 

Protected Attributes

ilLanguage $lng
 

Detailed Description

Definition at line 31 of file Language.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Dashboard\DataRetrieval\Language::__construct ( )

Definition at line 35 of file Language.php.

36 {
37 global $DIC;
38 $this->lng = $DIC->language();
39 }
global $DIC
Definition: shib_login.php:26

References $DIC, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ getRows()

ILIAS\Dashboard\DataRetrieval\Language::getRows ( DataRowBuilder  $row_builder,
array  $visible_column_ids,
Range  $range,
Order  $order,
mixed  $additional_viewcontrol_data,
mixed  $filter_data,
mixed  $additional_parameters 
)

This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g.

yield $row_builder->buildStandardRow($row_id, $record).

Parameters
string[]$visible_column_ids

Implements ILIAS\UI\Component\Table\DataRetrieval.

Definition at line 40 of file Language.php.

48 : Generator {
49 foreach (array_slice($this->lng->getInstalledLanguages(), $range->getStart(), $range->getLength()) as $key) {
50 $title = $this->lng->txt('meta_l_' . $key);
51 if ($key === $this->lng->getDefaultLanguage()) {
52 $title .= ' (' . $this->lng->txt('system_language') . ')';
53 }
54 yield $row_builder->buildDataRow($key, [
55 'name' => $title,
56 'user_count' => ilObjLanguage::countUsers($key)
57 ]);
58 }
59 }
static countUsers(string $a_lang)
Count number of users that use a language.
buildDataRow(string $id, array $record)

References ILIAS\UI\Component\Table\DataRowBuilder\buildDataRow(), ilObjLanguage\countUsers(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getTotalRowCount()

ILIAS\Dashboard\DataRetrieval\Language::getTotalRowCount ( mixed  $additional_viewcontrol_data,
mixed  $filter_data,
mixed  $additional_parameters 
)

Mainly for the purpose of pagination-support, it is important to know about the total number of records available.

Given the nature of a DataTable, which is, opposite to a PresentationTable, rather administrative than explorative, this information will increase user experience quite a bit. However, you may return null, if the call is to costly, but expect the View Control to look a little different in this case.

Make sure that potential filters or user restrictions are being applied to the count.

Implements ILIAS\UI\Component\Table\DataRetrieval.

Definition at line 61 of file Language.php.

65 : ?int {
66 return count($this->lng->getInstalledLanguages());
67 }

Field Documentation

◆ $lng

ilLanguage ILIAS\Dashboard\DataRetrieval\Language::$lng
protected

Definition at line 33 of file Language.php.


The documentation for this class was generated from the following file: