forked from ILIAS-eLearning/ILIAS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
156 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of ILIAS, a powerful learning management system | ||
* published by ILIAS open source e-Learning e.V. | ||
* | ||
* ILIAS is licensed with the GPL-3.0, | ||
* see https://www.gnu.org/licenses/gpl-3.0.en.html | ||
* You should have received a copy of said license along with the | ||
* source code, too. | ||
* | ||
* If this is not the case or you just want to try ILIAS, you'll find | ||
* us at: | ||
* https://www.ilias.de | ||
* https://github.com/ILIAS-eLearning | ||
* | ||
*********************************************************************/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ILIAS\UI\Component\Table\Column; | ||
|
||
interface LinkList extends Column | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of ILIAS, a powerful learning management system | ||
* published by ILIAS open source e-Learning e.V. | ||
* | ||
* ILIAS is licensed with the GPL-3.0, | ||
* see https://www.gnu.org/licenses/gpl-3.0.en.html | ||
* You should have received a copy of said license along with the | ||
* source code, too. | ||
* | ||
* If this is not the case or you just want to try ILIAS, you'll find | ||
* us at: | ||
* https://www.ilias.de | ||
* https://github.com/ILIAS-eLearning | ||
* | ||
*********************************************************************/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ILIAS\UI\Implementation\Component\Table\Column; | ||
|
||
use ILIAS\UI\Component\Table\Column as C; | ||
use ILIAS\UI\Component\Link\Standard; | ||
use ILIAS\UI\Component\Listing\Listing; | ||
use ILIAS\UI\Component\Component; | ||
|
||
class LinkList extends Column implements C\LinkList | ||
{ | ||
public function format($value): string|Component | ||
{ | ||
$this->checkArgInstanceOf('value', $value, Listing::class); | ||
$check = $value->getItems(); | ||
$this->checkArgListElements("list items", $check, Standard::class); | ||
return $value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ILIAS\UI\examples\Table\Column\LinkList; | ||
|
||
use ILIAS\UI\Component\Table as I; | ||
use ILIAS\Data\Range; | ||
use ILIAS\Data\Order; | ||
|
||
function base(): string | ||
{ | ||
global $DIC; | ||
$f = $DIC->ui()->factory(); | ||
$r = $DIC->ui()->renderer(); | ||
|
||
$columns = [ | ||
'l1' => $f->table()->column()->linkList("a link list column") | ||
]; | ||
|
||
$some_link = $f->link()->standard('ILIAS Homepage', 'http://www.ilias.de'); | ||
$some_linklist = $f->listing()->unordered([$some_link, $some_link, $some_link]); | ||
|
||
$dummy_records = [ | ||
['l1' => $some_linklist], | ||
['l1' => $some_linklist] | ||
]; | ||
|
||
$data_retrieval = new class ($dummy_records) implements I\DataRetrieval { | ||
protected array $records; | ||
|
||
public function __construct(array $dummy_records) | ||
{ | ||
$this->records = $dummy_records; | ||
} | ||
|
||
public function getRows( | ||
I\DataRowBuilder $row_builder, | ||
array $visible_column_ids, | ||
Range $range, | ||
Order $order, | ||
?array $filter_data, | ||
?array $additional_parameters | ||
): \Generator { | ||
foreach ($this->records as $idx => $record) { | ||
$row_id = ''; | ||
yield $row_builder->buildDataRow($row_id, $record); | ||
} | ||
} | ||
|
||
public function getTotalRowCount( | ||
?array $filter_data, | ||
?array $additional_parameters | ||
): ?int { | ||
return null; | ||
} | ||
}; | ||
|
||
$table = $f->table()->data('Link List Columns', $columns, $data_retrieval) | ||
->withRequest($DIC->http()->request()); | ||
return $r->render($table); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters