Skip to content

Commit

Permalink
[FEATURE] UI: move UI\Component\Table\Storage to UI\Storage for g…
Browse files Browse the repository at this point in the history
…eneric use. (#8818)

* Moves the `UI\Component\Table\Storage` interface (and file) to `UI\Storage`.
  • Loading branch information
nhaagen authored Jan 16, 2025
1 parent 3d75176 commit 287f649
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions components/ILIAS/Authentication/Authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public function init(
// currently this is will be a session storage because we cannot store
// data on the client, see https://mantis.ilias.de/view.php?id=38503.
// @todo: this should be implemented by some proper key-value storage (or service).
$implement[UI\Component\Table\Storage::class] = static fn() =>
new class () implements UI\Component\Table\Storage {
$implement[UI\Storage::class] = static fn() =>
new class () implements UI\Storage {
public function offsetExists(mixed $offset): bool
{
return \ilSession::has($offset);
Expand Down
4 changes: 2 additions & 2 deletions components/ILIAS/UI/UI.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function init(
$define[] = UI\Factory::class;
$define[] = UI\Renderer::class;
$define[] = UI\HelpTextRetriever::class;
$define[] = UI\Component\Table\Storage::class;
$define[] = UI\Storage::class;
$define[] = UI\Component\Progress\AsyncRefreshInterval::class;
$define[] = UI\Component\Input\Field\PhpUploadLimit::class;
$define[] = UI\Component\Input\Field\GlobalUploadLimit::class;
Expand Down Expand Up @@ -362,7 +362,7 @@ public function init(
$pull[Data\Factory::class],
$internal[UI\Implementation\Component\Table\Column\Factory::class],
$internal[UI\Implementation\Component\Table\Action\Factory::class],
$use[UI\Component\Table\Storage::class],
$use[UI\Storage::class],
$internal[UI\Implementation\Component\Table\DataRowBuilder::class],
$internal[UI\Implementation\Component\Table\OrderingRowBuilder::class],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@
* https://github.com/ILIAS-eLearning
*/

namespace ILIAS\UI\Component\Table;
namespace ILIAS\UI;

/**
* @author Thibeau Fuhrer <[email protected]>
* Storage is simple key/value store without further schema definition.
* It's used to (mainly temporarily) keep parameters induced by a user interaction,
* e.g. operating view controls.
* Storage has no data-separation or id-handling on its own, so, recommandedly,
* you will store the whole of your data at once in a suitable format
* as a single value depending on a key unique to your view.
*/
interface Storage extends \ArrayAccess
{
Expand Down

0 comments on commit 287f649

Please sign in to comment.