19declare(strict_types=1);
24use ILIAS\UI\Implementation\Component\ComponentHelper;
25use Psr\Http\Message\ServerRequestInterface;
42 protected ?ServerRequestInterface
$request =
null;
48 protected ?
string $id =
null;
51 protected DataFactory $data_factory,
54 protected ISequence\SegmentRetrieval $segment_retrieval
60 return $this->segment_retrieval;
101 if (! $this->request) {
102 throw new \LogicException(
'no request was set on the sequence');
108 $clone = clone $this;
110 $clone->initFromRequest();
122 $base_uri = $this->data_factory->uri($this->request->getUri()->__toString());
127 $this->token_position
133 $query = new \ILIAS\HTTP\Wrapper\ArrayBasedRequestWrapper($this->request->getQueryParams());
134 $this->position = $query->retrieve(
135 $this->token_position->getName(),
136 $this->refinery->byTrying([
137 $this->refinery->kindlyTo()->int(),
138 $this->refinery->always(0)
142 if ($this->viewcontrols) {
153 return $this->url_builder
154 ->withParameter($this->token_position, (
string) ($this->position + $direction))
161 return $this->storage[$storage_id] ??
null;
169 $this->storage[$storage_id] =
$data;
175 if (
null !== (
$id = $this->
getId())) {
176 return static::STORAGE_ID_PREFIX .
$id;
183 $clone = clone $this;
194 ViewControlContainer $view_controls,
196 ): ViewControlContainer {
198 $view_controls = $view_controls
199 ->withStoredInput($stored_values)
201 $this->
setStorageData($view_controls->getComponentInternalValues());
202 return $view_controls;
The scope of this class is split ilias-conform URI's into components.
applyValuesToViewcontrols(ViewControlContainer $view_controls, ServerRequestInterface $request)
withRequest(ServerRequestInterface $request)
Rendering the sequence must be done using the current request: it (the request) will carry parameters...
withActions(... $actions)
ViewControlContainer $viewcontrols
URLBuilderToken $token_position
withCurrentPosition(int $position)
ServerRequestInterface $request
setStorageData(array $data)
withId(string $id)
The Sequence comes with a storage to keep ViewControl-settings throughout requests.
__construct(protected DataFactory $data_factory, protected Refinery $refinery, protected Storage $storage, protected ISequence\SegmentRetrieval $segment_retrieval)
withViewControls(ViewControlContainer $viewcontrols)
You may add view controls to the sequences's player that alter the way, order or focus in which the s...
acquireParameters(array $namespace, string ... $names)
if($err=$client->getError()) $namespace
Storage is simple key/value store without further schema definition.