UPDATE-RATE

Die Test-Installation wird aktuell zwischen 8:00 und 18:00 Uhr stündlich zur vollen Stunde aktualisiert.

Alles neu macht der Mai

ILIAS 9 ist da! Alle Infos zu den Highlights der neuen Version gibt es hier!

Documentation

Kitchen Sink documentation of style: 'Delos' of skin: 'ILIAS'

Standard

Description

Purpose
The Standard View Control Container is used as the binding element of a collection of View Control Inputs concerning one visualization.
Composition
A View Control Container holds one ore more View Controls; it is otherwise transparent to the user and does not add "own" elements.
Effect
The View Control Container is responsible for aligning request-parameters for all contained View Controls as well as receiving and distributing values accordingly. When operating a contained View Control, the location is amended with parameters of all contained View Controls and reloaded. rules:

Rules

Usage
  1. The Standard View Control Container MUST be provided with a Request before rendering.

Example 1: Base

Array
(
    [vc_range] => ILIAS\Data\Range Object
        (
            [start:protected] => 0
            [length:protected] => 50
        )

    [vc_sortation] => ILIAS\Data\Order Object
        (
            [order:protected] => Array
                (
                    [field2] => ASC
                )

        )

    [vc_columns] => Array
        (
            [0] => field1
            [1] => field2
        )

)

<?php
 
declare(strict_types=1);
 
namespace ILIAS\UI\examples\Input\Container\ViewControl\Standard;
 
use ILIAS\Data\Order;
use ILIAS\UI\Implementation\Component\Input\ViewControl\Pagination;
 
function base()
{
    global $DIC;
    $f = $DIC->ui()->factory();
    $r = $DIC->ui()->renderer();
    $refinery = $DIC->refinery();
    $request = $DIC->http()->request();
 
    $vcs = [
        $f->input()->viewControl()->pagination()
            ->withAdditionalTransformation(
                $refinery->custom()->transformation(
                    fn($v) => ['vc_range' => $v]
                )
            )
            ->withTotalCount(312)
            ->withValue([Pagination::FNAME_OFFSET => 0, Pagination::FNAME_LIMIT => 50]),
 
        $f->input()->viewControl()->sortation([
                'Field 1, ascending' => new Order('field1', 'ASC'),
                'Field 1, descending' => new Order('field1', 'DESC'),
                'Field 2, descending' => new Order('field2', 'ASC')
            ])
            ->withAdditionalTransformation(
                $refinery->custom()->transformation(
                    fn($v) => ['vc_sortation' => $v]
                )
            )
            ->withValue(['field2', 'ASC']),
 
        $f->input()->viewControl()->fieldSelection([
                'field1' => 'Feld 1',
                'field2' => 'Feld 2'
            ], 'shown columns', 'apply')
            ->withAdditionalTransformation(
                $refinery->custom()->transformation(
                    fn($v) => ['vc_columns' => $v]
                )
            )
            ->withValue(['field1','field2']),
    ];
 
    $vc_container = $f->input()->container()->viewControl()->standard($vcs)
         ->withAdditionalTransformation(
             $refinery->custom()->transformation(
                 fn($v) => array_filter(array_values($v)) === [] ? null : array_merge(...array_values($v))
             )
         )
        ->withRequest($request);
 
    return $r->render([
        $f->legacy('<pre>' . print_r($vc_container->getData(), true) . '</pre>'),
        $f->divider()->horizontal(),
        $vc_container
    ]);
}
 

Relations

Parents
  1. UIComponent
  2. Input
  3. Container
  4. View Control