From b0dfd93c089109705e7f9daadc2876626fdc0111 Mon Sep 17 00:00:00 2001 From: Thibeau Fuhrer Date: Wed, 5 Aug 2026 11:50:46 +0200 Subject: [PATCH] [FEATURE] UI: deprecate `UI\ViewControl` components The `UI\ViewControl` component family is superseded by the `UI\Input\ViewControl` and `UI\Input\Container\ViewControl` components. The deprecation should stop new developments from using the components. No specific deadline is set (yet). --- .../UI/src/Component/ViewControl/Factory.php | 26 +++++++++++++------ .../Component/ViewControl/HasViewControls.php | 2 ++ .../UI/src/Component/ViewControl/Mode.php | 2 ++ .../src/Component/ViewControl/Pagination.php | 2 ++ .../UI/src/Component/ViewControl/Section.php | 2 ++ .../src/Component/ViewControl/Sortation.php | 2 ++ components/ILIAS/UI/src/Factory.php | 3 +++ 7 files changed, 31 insertions(+), 8 deletions(-) diff --git a/components/ILIAS/UI/src/Component/ViewControl/Factory.php b/components/ILIAS/UI/src/Component/ViewControl/Factory.php index b15f3e2a9d7b..f9386cd424c0 100755 --- a/components/ILIAS/UI/src/Component/ViewControl/Factory.php +++ b/components/ILIAS/UI/src/Component/ViewControl/Factory.php @@ -26,6 +26,8 @@ /** * This is how the factory for UI elements looks. + * + * @deprecated use {@see \ILIAS\UI\Component\Input\ViewControl\Factory} */ interface Factory { @@ -47,10 +49,12 @@ interface Factory * 1: The HTML container enclosing the buttons of the Mode View Control MUST cary the role-attribute "group". * 2: The HTML container enclosing the buttons of the Mode View Control MUST set an aria-label describing the element. Eg. "Mode View Control" * --- - * @param array $labelled_actions Set of labelled actions (string|string)[]. The label of the action is used as key, the action itself as value. - * The first of the actions will be activated by default. - * @param string $aria_label Defines the functionality. + * @param array $labelled_actions Set of labelled actions (string|string)[]. The label of the action is used as key, the action itself as value. + * The first of the actions will be activated by default. + * @param string $aria_label Defines the functionality. * @return \ILIAS\UI\Component\ViewControl\Mode + * + * @deprecated use {@see \ILIAS\UI\Component\Input\ViewControl\Mode} */ public function mode(array $labelled_actions, string $aria_label): Mode; @@ -68,10 +72,12 @@ public function mode(array $labelled_actions, string $aria_label): Mode; * Clicking on the Buttons left or right changes the selection of the displayed data by a fixed interval. Clicking * the Button in the middle opens the sections hinted by the label of the button (e.g. "Today"). * --- - * @param \ILIAS\UI\Component\Button\Button $previous_action Button to be placed in the left. - * @param \ILIAS\UI\Component\Button\Button|\ILIAS\UI\Component\Button\Month $button Button to be placed in the middle (Month Button or Default Button). - * @param \ILIAS\UI\Component\Button\Button $next_action Button to be placed in the right. + * @param \ILIAS\UI\Component\Button\Button $previous_action Button to be placed in the left. + * @param \ILIAS\UI\Component\Button\Button|\ILIAS\UI\Component\Button\Month $button Button to be placed in the middle (Month Button or Default Button). + * @param \ILIAS\UI\Component\Button\Button $next_action Button to be placed in the right. * @return \ILIAS\UI\Component\ViewControl\Section + * + * @deprecated no alternative (yet). */ public function section(Button $previous_action, Component $button, Button $next_action): Section; @@ -109,9 +115,11 @@ public function section(Button $previous_action, Component $button, Button $next * https://mantis.ilias.de/view.php?id=26634 * * --- - * @param array $options a dictionary with value=>title - * @param string $selected a value from $options + * @param array $options a dictionary with value=>title + * @param string $selected a value from $options * @return \ILIAS\UI\Component\ViewControl\Sortation + * + * @deprecated use {@see \ILIAS\UI\Component\Input\ViewControl\Sortation} */ public function sortation(array $options, string $selected): Sortation; @@ -153,6 +161,8 @@ public function sortation(array $options, string $selected): Sortation; * * --- * @return \ILIAS\UI\Component\ViewControl\Pagination + * + * @deprecated use {@see \ILIAS\UI\Component\Input\ViewControl\Pagination} */ public function pagination(): Pagination; } diff --git a/components/ILIAS/UI/src/Component/ViewControl/HasViewControls.php b/components/ILIAS/UI/src/Component/ViewControl/HasViewControls.php index 7970100ba228..19de8890f9bc 100755 --- a/components/ILIAS/UI/src/Component/ViewControl/HasViewControls.php +++ b/components/ILIAS/UI/src/Component/ViewControl/HasViewControls.php @@ -24,6 +24,8 @@ /** * Trait for adding view controls to a component + * + * @deprecated moves to {@see \ILIAS\UI\Component\Input\Container\ViewControl} */ interface HasViewControls extends Component { diff --git a/components/ILIAS/UI/src/Component/ViewControl/Mode.php b/components/ILIAS/UI/src/Component/ViewControl/Mode.php index 77d4bb054be2..819189513e9e 100755 --- a/components/ILIAS/UI/src/Component/ViewControl/Mode.php +++ b/components/ILIAS/UI/src/Component/ViewControl/Mode.php @@ -24,6 +24,8 @@ /** * This describes a Mode Control + * + * @deprecated use {@see \ILIAS\UI\Component\Input\ViewControl\Mode} */ interface Mode extends Component { diff --git a/components/ILIAS/UI/src/Component/ViewControl/Pagination.php b/components/ILIAS/UI/src/Component/ViewControl/Pagination.php index 5893a4b2fdc9..8ef5b3c3aed5 100755 --- a/components/ILIAS/UI/src/Component/ViewControl/Pagination.php +++ b/components/ILIAS/UI/src/Component/ViewControl/Pagination.php @@ -28,6 +28,8 @@ /** * This describes a Pagination Control + * + * @deprecated use {@see \ILIAS\UI\Component\Input\ViewControl\Pagination} */ interface Pagination extends Component, JavaScriptBindable, Triggerer { diff --git a/components/ILIAS/UI/src/Component/ViewControl/Section.php b/components/ILIAS/UI/src/Component/ViewControl/Section.php index 2f1fe21d73c1..877d69e48fba 100755 --- a/components/ILIAS/UI/src/Component/ViewControl/Section.php +++ b/components/ILIAS/UI/src/Component/ViewControl/Section.php @@ -25,6 +25,8 @@ /** * This describes a Section Control + * + * @deprecated no alternative (yet). */ interface Section extends Component { diff --git a/components/ILIAS/UI/src/Component/ViewControl/Sortation.php b/components/ILIAS/UI/src/Component/ViewControl/Sortation.php index 03fc1cc8f3a6..019ada8671dd 100755 --- a/components/ILIAS/UI/src/Component/ViewControl/Sortation.php +++ b/components/ILIAS/UI/src/Component/ViewControl/Sortation.php @@ -27,6 +27,8 @@ /** * This describes a Sortation Control + * + * @deprecated use {@see \ILIAS\UI\Component\Input\ViewControl\Sortation} */ interface Sortation extends Component, JavaScriptBindable, Triggerer { diff --git a/components/ILIAS/UI/src/Factory.php b/components/ILIAS/UI/src/Factory.php index ee0630e2a60a..8ddaa0856df1 100755 --- a/components/ILIAS/UI/src/Factory.php +++ b/components/ILIAS/UI/src/Factory.php @@ -403,6 +403,9 @@ public function breadcrumbs(array $crumbs): Breadcrumbs; * effect: Interacting with a view control changes to display in some content area. * --- * @return \ILIAS\UI\Component\ViewControl\Factory + * + * @deprecated use {@see \ILIAS\UI\Component\Input\ViewControl\Factory} + * via {@see \ILIAS\UI\Factory::input()} */ public function viewControl(): C\ViewControl\Factory;