ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Questions\Presentation\Definitions\DefaultEnvironment Class Reference
+ Inheritance diagram for ILIAS\Questions\Presentation\Definitions\DefaultEnvironment:
+ Collaboration diagram for ILIAS\Questions\Presentation\Definitions\DefaultEnvironment:

Public Member Functions

 __construct (private readonly \ilCtrl $ctrl, private readonly HTTPServices $http, private readonly Refinery $refinery, private readonly Language $lng, private readonly \ilTabsGUI $tabs_gui, private readonly UuidFactory $uuid_factory, private readonly Factory $presentation_factory, private readonly Editability $editability, private readonly RequiredCapabilities $required_capabilities, private readonly int $parent_obj_id, URI $base_uri)
 
 getHttpServices ()
 
 getLanguage ()
 
 getRefinery ()
 
 getUIFactory ()
 
 setEditAnswerFormBackTarget ()
 
 addEditAnswerFormSubTab (string $sub_action, string $language_variable)
 
 activateEditAnswerFormSubTab (string $sub_action)
 
 getPresentationFactory ()
 
 getUrlBuilder ()
 
 withSubActionParameter (string $sub_action)
 
 withDefaultSubAction ()
 
 getSubAction ()
 
 getEditability ()
 
 isMarkingRequired ()
 
 getAnswerFormTableActionsForRequiredCapabilities ()
 
 isInCreationContext ()
 
 getAnswerFormId ()
 Returns the answer form id of the current context either from the answer form properties, if available, or from the corresponding get parameter. More...
 
 getAnswerFormProperties ()
 
 withAnswerFormProperties (Properties $properties)
 
 getTableRowIdToken ()
 
 getTableRowIds ()
 
 withPreservedTableRowIdsParameter ()
 
 redirectTo (URLBuilder $target)
 
 runPageMigrations ()
 
 withIsInCreationContext (bool $is_in_creation_context)
 
 getParentObjId ()
 
 getAction ()
 
 withActionParameter (string $action)
 
 withQuestionIdParameter (Uuid $question_id)
 
 withAnswerFormTypeHashParameter (string $type_hash)
 
 withAnswerFormIdParameter (Uuid $answer_form_id)
 
 withCreateModeParameter ()
 
 withFormStartSubActionParameter (string $sub_action)
 
 withPreservedFormStartSubActionParameter ()
 
 getQuestionId ()
 
 getQuestionIds ()
 This function will either return the QuestionIds from the $_GET parameter for row ids OR from an InterruptiveItems $_POST value. More...
 
 getTypeClassHash ()
 
 getFormStartSubAction ()
 
 isCreateModeSimple ()
 
 setEditAnswerFormTabs (array $additional_actions)
 
 preserveParametersForPageEditorCmds ()
 
 setParamtersForSimpleCreateCmd (Uuid $question_id)
 
 isCreateAndNewAction ()
 
 buildURLBuilderTokenForCreateAndNew ()
 
 getHttpServices ()
 
 getLanguage ()
 
 getRefinery ()
 
 getUIFactory ()
 
 setEditAnswerFormBackTarget ()
 
 addEditAnswerFormSubTab (string $sub_action, string $text)
 
 activateEditAnswerFormSubTab (string $sub_action)
 
 getPresentationFactory ()
 
 getUrlBuilder ()
 
 getTableRowIdToken ()
 
 getTableRowIds ()
 
 getSubAction ()
 
 withDefaultSubAction ()
 
 getEditability ()
 
 isMarkingRequired ()
 
 getAnswerFormTableActionsForRequiredCapabilities ()
 
 isInCreationContext ()
 
 getAnswerFormId ()
 Returns the answer form id of the current context either from the answer form properties, if available, or from the corresponding get parameter. More...
 
 getAnswerFormProperties ()
 
 withAnswerFormProperties (Properties $properties)
 
 withSubActionParameter (string $sub_action)
 
 getFormStartSubAction ()
 
 withFormStartSubActionParameter (string $form_start_command)
 
 withPreservedFormStartSubActionParameter ()
 
 withPreservedTableRowIdsParameter ()
 
 redirectTo (URLBuilder $target)
 

Private Member Functions

 setQuestionIdParamterForPageEditorCmds (Uuid $question_id)
 
 buildEditAnswerFormBackUrl ()
 
 acquireURLBuilderAndParameters (URI $base_uri)
 
 retrieveStringValueForToken (URLBuilderToken $token)
 
 buildStringTrafo ()
 
 buildRetrieveUuidClosure ()
 

Private Attributes

const array QUERY_PARAMETER_NAME_SPACE = ['q']
 
const string TOKEN_STRING_ACTION = 'a'
 
const string TOKEN_STRING_SUB_ACTION = 'sa'
 
const string TOKEN_STRING_QUESTION_ID = 'q'
 
const string TOKEN_STRING_TABLE_ROW_ID = 'r'
 
const string TOKEN_STRING_TYPE_HASH = 't'
 
const string TOKEN_STRING_ANSWER_FORM_ID = 'af'
 
const string TOKEN_STRING_CREATE_MODE = 'cm'
 
const string TOKEN_STRING_FORM_START_SUB_ACTION = 'fssa'
 
const string TOKEN_STRING_CREATE_AND_NEW = 'can'
 
const string PARAMETER_STRING_HIER_ID = 'hier_id'
 
const string INTERRUPTIVE_ITEMS_KEY = 'interruptive_items'
 
const string TAB_ID_ANSWER_FORM = 'answer_form'
 
Properties $answer_form_properties = null
 
bool $default_sub_action = false
 
bool $is_in_creation_context = false
 
URLBuilder $url_builder
 
readonly URLBuilderToken $table_row_token
 
readonly URLBuilderToken $question_id_token
 
URLBuilderToken $sub_action_token = null
 
URLBuilderToken $action_token = null
 
URLBuilderToken $type_hash_token = null
 
URLBuilderToken $answer_form_id_token = null
 
URLBuilderToken $create_mode_token = null
 
URLBuilderToken $form_start_sub_action_token = null
 
array $table_row_ids = null
 

Detailed Description

Definition at line 40 of file DefaultEnvironment.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::__construct ( private readonly \ilCtrl  $ctrl,
private readonly HTTPServices  $http,
private readonly Refinery  $refinery,
private readonly Language  $lng,
private readonly \ilTabsGUI  $tabs_gui,
private readonly UuidFactory  $uuid_factory,
private readonly Factory  $presentation_factory,
private readonly Editability  $editability,
private readonly RequiredCapabilities  $required_capabilities,
private readonly int  $parent_obj_id,
URI  $base_uri 
)

Definition at line 76 of file DefaultEnvironment.php.

References ILIAS\Questions\Presentation\Definitions\DefaultEnvironment\acquireURLBuilderAndParameters().

+ Here is the call graph for this function:

Member Function Documentation

◆ acquireURLBuilderAndParameters()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::acquireURLBuilderAndParameters ( URI  $base_uri)
private

Definition at line 671 of file DefaultEnvironment.php.

673 : void {
674 [
678 ] = (new URLBuilder($base_uri))
679 ->acquireParameters(
680 self::QUERY_PARAMETER_NAME_SPACE,
681 self::TOKEN_STRING_TABLE_ROW_ID,
682 self::TOKEN_STRING_QUESTION_ID
683 );
684 }

Referenced by ILIAS\Questions\Presentation\Definitions\DefaultEnvironment\__construct().

+ Here is the caller graph for this function:

◆ activateEditAnswerFormSubTab()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::activateEditAnswerFormSubTab ( string  $sub_action)

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 143 of file DefaultEnvironment.php.

145 : void {
146 $this->tabs_gui->activateSubTab($sub_action);
147 }

◆ addEditAnswerFormSubTab()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::addEditAnswerFormSubTab ( string  $sub_action,
string  $language_variable 
)

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 127 of file DefaultEnvironment.php.

130 : void {
131 $this->tabs_gui->addSubTab(
132 $sub_action,
133 $this->lng->txt($language_variable),
134 $this->withSubActionParameter($sub_action)
135 ->withActionParameter(Edit::ACTION_OTHER_ANSWER_FORM)
136 ->getUrlBuilder()
137 ->buildURI()
138 ->__toString()
139 );
140 }

◆ buildEditAnswerFormBackUrl()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::buildEditAnswerFormBackUrl ( )
private

Definition at line 644 of file DefaultEnvironment.php.

644 : URLBuilder
645 {
646 if (!$this->is_in_creation_context) {
647 return $this->withDefaultSubAction()->getUrlBuilder();
648 }
649
650 if (!$this->isCreateModeSimple()) {
651 return new URLBuilder(
652 new URI(
653 ILIAS_HTTP_PATH . '/' . $this->ctrl->getLinkTargetByClass(
654 \QstsQuestionPageGUI::class,
655 'edit'
656 )
657 )
658 );
659 }
660
661 return $this->withActionParameter(
663 )->withSubActionParameter(
665 )->getUrlBuilder()->withParameter(
666 $this->table_row_token,
667 [$this->getQuestionId()->toString()]
668 );
669 }

References ILIAS\Repository\ctrl(), and ILIAS\Export\ImportHandler\File\XML\Manifest\toString.

+ Here is the call graph for this function:

◆ buildRetrieveUuidClosure()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::buildRetrieveUuidClosure ( )
private

Definition at line 703 of file DefaultEnvironment.php.

703 : \Closure
704 {
705 return fn($v): Uuid => is_string($v)
706 ? $this->uuid_factory->fromString($v)
707 : throw new \UnexpectedValueException();
708 }

◆ buildStringTrafo()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::buildStringTrafo ( )
private

Definition at line 695 of file DefaultEnvironment.php.

695 : Transformation
696 {
697 return $this->refinery->byTrying([
698 $this->refinery->kindlyTo()->string(),
699 $this->refinery->always('')
700 ]);
701 }

References ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ buildURLBuilderTokenForCreateAndNew()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::buildURLBuilderTokenForCreateAndNew ( )

Definition at line 626 of file DefaultEnvironment.php.

627 {
628 return new URLBuilderToken(
629 self::QUERY_PARAMETER_NAME_SPACE,
630 self::TOKEN_STRING_CREATE_AND_NEW
631 );
632 }

◆ getAction()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getAction ( )

Definition at line 348 of file DefaultEnvironment.php.

348 : string
349 {
351 if ($action_token === null) {
352 [,$action_token] = $this->url_builder->acquireParameter(
353 self::QUERY_PARAMETER_NAME_SPACE,
354 self::TOKEN_STRING_ACTION
355 );
356 }
358 }

◆ getAnswerFormId()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getAnswerFormId ( )

Returns the answer form id of the current context either from the answer form properties, if available, or from the corresponding get parameter.

There should always be one of the two ids availabe, but be aware that is not guaranteed, e.g. if somebody messed with the URI.

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 239 of file DefaultEnvironment.php.

239 : ?Uuid
240 {
241 if ($this->answer_form_properties !== null) {
242 return $this->answer_form_properties->getAnswerFormId();
243 }
244
246 if ($answer_form_id_token === null) {
247 [,$answer_form_id_token] = $this->url_builder->acquireParameter(
248 self::QUERY_PARAMETER_NAME_SPACE,
249 self::TOKEN_STRING_ANSWER_FORM_ID
250 );
251 }
252 return $this->http->wrapper()->query()->retrieve(
254 $this->refinery->byTrying([
255 $this->refinery->custom()->transformation(
256 $this->buildRetrieveUuidClosure()
257 ),
258 $this->refinery->always(null)
259 ])
260 );
261 }
getName()
Get the full name of the token including its namespace.
static http()
Fetches the global http state from ILIAS.

References ILIAS\UI\URLBuilderToken\getName(), and ILIAS\FileDelivery\http().

+ Here is the call graph for this function:

◆ getAnswerFormProperties()

◆ getAnswerFormTableActionsForRequiredCapabilities()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getAnswerFormTableActionsForRequiredCapabilities ( )

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 222 of file DefaultEnvironment.php.

222 : array
223 {
224 return array_map(
225 fn(AdditionalFormStepAction $v): TableAction => $v->getAsTableAction(
226 $this->withActionParameter($v->getIdentifier())
227 ),
228 $this->required_capabilities->getRequiredFormStepActions()
229 );
230 }

References ILIAS\Questions\AnswerForm\Capabilities\Definitions\AdditionalFormStepAction\getAsTableAction(), and ILIAS\Questions\AnswerForm\Capabilities\Definitions\AdditionalFormStepAction\getIdentifier().

+ Here is the call graph for this function:

◆ getEditability()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getEditability ( )

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 210 of file DefaultEnvironment.php.

211 {
212 return $this->editability;
213 }

◆ getFormStartSubAction()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getFormStartSubAction ( )

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 533 of file DefaultEnvironment.php.

533 : string
534 {
535 $form_start_command_token = $this->form_start_sub_action_token;
536 if ($form_start_command_token === null) {
537 [,$form_start_command_token] = $this->url_builder->acquireParameter(
538 self::QUERY_PARAMETER_NAME_SPACE,
539 self::TOKEN_STRING_FORM_START_SUB_ACTION
540 );
541 }
542 return $this->retrieveStringValueForToken($form_start_command_token);
543 }

◆ getHttpServices()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getHttpServices ( )

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 93 of file DefaultEnvironment.php.

93 : HTTPServices
94 {
95 return $this->http;
96 }

References ILIAS\BookingManager\Common\Table\$http.

◆ getLanguage()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getLanguage ( )

◆ getParentObjId()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getParentObjId ( )

Definition at line 343 of file DefaultEnvironment.php.

343 : int
344 {
345 return $this->parent_obj_id;
346 }

◆ getPresentationFactory()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getPresentationFactory ( )

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 150 of file DefaultEnvironment.php.

150 : Factory
151 {
152 return $this->presentation_factory;
153 }

Referenced by ILIAS\Questions\Presentation\Views\Edit\deleteQuestions().

+ Here is the caller graph for this function:

◆ getQuestionId()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getQuestionId ( )

Definition at line 475 of file DefaultEnvironment.php.

475 : ?Uuid
476 {
477 return $this->http->wrapper()->query()->retrieve(
478 $this->question_id_token->getName(),
479 $this->refinery->byTrying([
480 $this->refinery->custom()->transformation(
481 $this->buildRetrieveUuidClosure()
482 ),
483 $this->refinery->always(null)
484 ])
485 );
486 }

References ILIAS\FileDelivery\http().

+ Here is the call graph for this function:

◆ getQuestionIds()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getQuestionIds ( )

This function will either return the QuestionIds from the $_GET parameter for row ids OR from an InterruptiveItems $_POST value.

Returns
array<\ILIAS\Data\UUID\Uuid>|string|null

Definition at line 493 of file DefaultEnvironment.php.

493 : array|string|null
494 {
495 return $this->http->wrapper()->query()->retrieve(
496 $this->table_row_token->getName(),
497 $this->refinery->byTrying([
498 $this->refinery->custom()->transformation(
499 fn($v): string => $v === ['ALL_OBJECTS']
500 ? 'ALL_OBJECTS'
501 : throw new \UnexpectedValueException()
502 ),
503 $this->refinery->kindlyTo()->listOf(
504 $this->refinery->custom()->transformation(
505 $this->buildRetrieveUuidClosure()
506 )
507 ),
508 $this->refinery->always(null)
509 ])
510 ) ?? $this->http->wrapper()->post()->retrieve(
511 self::INTERRUPTIVE_ITEMS_KEY,
512 $this->refinery->kindlyTo()->listOf(
513 $this->refinery->custom()->transformation(
514 $this->buildRetrieveUuidClosure()
515 )
516 ),
517 $this->refinery->always(null)
518 );
519 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ getRefinery()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getRefinery ( )

◆ getSubAction()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getSubAction ( )

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 189 of file DefaultEnvironment.php.

189 : string
190 {
191 if ($this->default_sub_action) {
192 return '';
193 }
194
196 if ($sub_action_token === null) {
197 [,$sub_action_token] = $this->url_builder->acquireParameter(
198 self::QUERY_PARAMETER_NAME_SPACE,
199 self::TOKEN_STRING_SUB_ACTION
200 );
201 }
202
203 return $this->retrieveStringValueForToken(
205 self::TOKEN_STRING_SUB_ACTION
206 );
207 }

Referenced by ILIAS\Questions\AnswerForm\Capabilities\Definitions\AdditionalFormStepAction\do().

+ Here is the caller graph for this function:

◆ getTableRowIds()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getTableRowIds ( )
Returns
list<string>

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 288 of file DefaultEnvironment.php.

288 : array
289 {
290 if ($this->table_row_ids === null) {
291 $this->table_row_ids = $this->http->wrapper()->query()->retrieve(
292 $this->table_row_token->getName(),
293 $this->refinery->byTrying([
294 $this->refinery->kindlyTo()->listOf(
295 $this->refinery->custom()->transformation(
296 fn($v): string => $v !== ''
297 ? $this->refinery->kindlyTo()->string()->transform($v)
298 : throw new \UnexpectedValueException()
299 )
300 ),
301 $this->refinery->always([])
302 ])
303 );
304 }
305
307 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ getTableRowIdToken()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getTableRowIdToken ( )

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 279 of file DefaultEnvironment.php.

280 {
282 }

◆ getTypeClassHash()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getTypeClassHash ( )

Definition at line 521 of file DefaultEnvironment.php.

521 : string
522 {
524 if ($type_hash_token === null) {
525 [,$type_hash_token] = $this->url_builder->acquireParameter(
526 self::QUERY_PARAMETER_NAME_SPACE,
527 self::TOKEN_STRING_TYPE_HASH
528 );
529 }
531 }

◆ getUIFactory()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getUIFactory ( )

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 111 of file DefaultEnvironment.php.

111 : UIFactory
112 {
113 return $this->presentation_factory->getUIFactory();
114 }

Referenced by ILIAS\Questions\Question\Views\Edit\buildPreviewPanelQuestionContent().

+ Here is the caller graph for this function:

◆ getUrlBuilder()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::getUrlBuilder ( )

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 156 of file DefaultEnvironment.php.

156 : URLBuilder
157 {
158 return $this->url_builder;
159 }

◆ isCreateAndNewAction()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::isCreateAndNewAction ( )

Definition at line 619 of file DefaultEnvironment.php.

619 : bool
620 {
621 return $this->http->wrapper()->query()->has(
622 $this->buildURLBuilderTokenForCreateAndNew()->getName()
623 );
624 }

References ILIAS\FileDelivery\http().

+ Here is the call graph for this function:

◆ isCreateModeSimple()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::isCreateModeSimple ( )

Definition at line 545 of file DefaultEnvironment.php.

545 : bool
546 {
548 if ($create_mode_token === null) {
549 [, $create_mode_token] = $this->url_builder->acquireParameter(
550 self::QUERY_PARAMETER_NAME_SPACE,
551 self::TOKEN_STRING_CREATE_MODE
552 );
553 }
554
555 return $this->http->wrapper()->query()->has(
557 );
558 }

References ILIAS\UI\URLBuilderToken\getName(), and ILIAS\FileDelivery\http().

+ Here is the call graph for this function:

◆ isInCreationContext()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::isInCreationContext ( )

◆ isMarkingRequired()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::isMarkingRequired ( )

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 216 of file DefaultEnvironment.php.

216 : bool
217 {
218 return $this->required_capabilities->isMarkingRequired();
219 }

◆ preserveParametersForPageEditorCmds()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::preserveParametersForPageEditorCmds ( )

Definition at line 591 of file DefaultEnvironment.php.

591 : void
592 {
594 }

◆ redirectTo()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::redirectTo ( URLBuilder  $target)

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 320 of file DefaultEnvironment.php.

320 : void
321 {
322 $this->ctrl->redirectToURL(
323 $target->buildURI()->__toString()
324 );
325 }
buildURI()
Get a URI representation of the full URL including query string and fragment/hash.
Definition: URLBuilder.php:214

References ILIAS\UI\URLBuilder\buildURI(), and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ retrieveStringValueForToken()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::retrieveStringValueForToken ( URLBuilderToken  $token)
private

Definition at line 686 of file DefaultEnvironment.php.

688 : string {
689 return $this->http->wrapper()->query()->retrieve(
690 $token->getName(),
691 $this->buildStringTrafo()
692 );
693 }

◆ runPageMigrations()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::runPageMigrations ( )

Definition at line 327 of file DefaultEnvironment.php.

327 : void
328 {
329 foreach ($this->required_capabilities
330 ->getRequiredPageMigrationProviders() as $provider) {
331 $provider->runPageMigrations();
332 }
333 }

◆ setEditAnswerFormBackTarget()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::setEditAnswerFormBackTarget ( )

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 117 of file DefaultEnvironment.php.

117 : void
118 {
119 $this->tabs_gui->clearTargets();
120 $this->tabs_gui->setBackTarget(
121 $this->lng->txt('cancel'),
122 $this->buildEditAnswerFormBackUrl()->buildURI()->__toString()
123 );
124 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ setEditAnswerFormTabs()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::setEditAnswerFormTabs ( array  $additional_actions)
Parameters
array<

ILIAS\Questions\AnswerForm\Capabilities\Action> $additional_actions

Definition at line 564 of file DefaultEnvironment.php.

566 : void {
567 $this->tabs_gui->addTab(
568 self::TAB_ID_ANSWER_FORM,
569 $this->lng->txt('answer_form'),
570 $this->withDefaultSubAction()->getUrlBuilder()->buildURI()->__toString()
571 );
572
573 foreach ($additional_actions as $action) {
574 $action->addTab(
575 $this,
576 $this->tabs_gui,
577 $this->lng
578 );
579 }
580
581 $this->tabs_gui->addSubTab(
582 self::TAB_ID_ANSWER_FORM,
583 $this->lng->txt('overview'),
584 $this->withDefaultSubAction()->getUrlBuilder()->buildURI()->__toString()
585 );
586
587 $this->tabs_gui->activateTab(self::TAB_ID_ANSWER_FORM);
588 $this->tabs_gui->activateSubTab(self::TAB_ID_ANSWER_FORM);
589 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ setParamtersForSimpleCreateCmd()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::setParamtersForSimpleCreateCmd ( Uuid  $question_id)

Definition at line 596 of file DefaultEnvironment.php.

598 : void {
599 $this->setQuestionIdParamterForPageEditorCmds($question_id);
600
601 $this->ctrl->setParameterByClass(
602 \QstsQuestionPageGUI::class,
603 self::PARAMETER_STRING_HIER_ID,
604 '1'
605 );
606
607 [, $create_mode_token] = $this->url_builder->acquireParameter(
608 self::QUERY_PARAMETER_NAME_SPACE,
609 self::TOKEN_STRING_CREATE_MODE
610 );
611
612 $this->ctrl->setParameterByClass(
613 \QstsQuestionPageGUI::class,
615 '1'
616 );
617 }

◆ setQuestionIdParamterForPageEditorCmds()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::setQuestionIdParamterForPageEditorCmds ( Uuid  $question_id)
private

Definition at line 634 of file DefaultEnvironment.php.

636 : void {
637 $this->ctrl->setParameterByClass(
638 \QstsQuestionPageGUI::class,
639 $this->question_id_token->getName(),
640 $question_id->toString()
641 );
642 }
toString()
Converts this UUID into a string representation.

◆ withActionParameter()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::withActionParameter ( string  $action)

Definition at line 360 of file DefaultEnvironment.php.

362 : self {
363 $clone = clone $this;
364 if ($clone->action_token === null) {
365 [
366 $clone->url_builder,
367 $clone->action_token
368 ] = $this->url_builder->acquireParameter(
369 self::QUERY_PARAMETER_NAME_SPACE,
370 self::TOKEN_STRING_ACTION
371 );
372 }
373 $clone->url_builder = $clone->url_builder
374 ->withParameter($clone->action_token, $action);
375 return $clone;
376 }

Referenced by ILIAS\Questions\AnswerForm\Capabilities\RequiredCapabilities\create(), and ILIAS\Questions\AnswerForm\Capabilities\Definitions\AdditionalFormStepAction\toPrevious().

+ Here is the caller graph for this function:

◆ withAnswerFormIdParameter()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::withAnswerFormIdParameter ( Uuid  $answer_form_id)

Definition at line 406 of file DefaultEnvironment.php.

408 : self {
409 $clone = clone $this;
410 if ($clone->answer_form_id_token === null) {
411 [
412 $clone->url_builder,
413 $clone->answer_form_id_token
414 ] = $this->url_builder->acquireParameter(
415 self::QUERY_PARAMETER_NAME_SPACE,
416 self::TOKEN_STRING_ANSWER_FORM_ID
417 );
418 }
419 $clone->url_builder = $clone->url_builder->withParameter(
420 $clone->answer_form_id_token,
421 $answer_form_id->toString()
422 );
423 return $clone;
424 }

◆ withAnswerFormProperties()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::withAnswerFormProperties ( Properties  $properties)

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 270 of file DefaultEnvironment.php.

272 : self {
273 $clone = clone $this;
274 $clone->answer_form_properties = $properties;
275 return $clone;
276 }

◆ withAnswerFormTypeHashParameter()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::withAnswerFormTypeHashParameter ( string  $type_hash)

Definition at line 387 of file DefaultEnvironment.php.

389 : self {
390 $clone = clone $this;
391 if ($clone->type_hash_token === null) {
392 [
393 $clone->url_builder,
394 $clone->type_hash_token
395 ] = $this->url_builder->acquireParameter(
396 self::QUERY_PARAMETER_NAME_SPACE,
397 self::TOKEN_STRING_TYPE_HASH
398 );
399 }
400
401 $clone->url_builder = $clone->url_builder
402 ->withParameter($clone->type_hash_token, $type_hash);
403 return $clone;
404 }

◆ withCreateModeParameter()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::withCreateModeParameter ( )

Definition at line 426 of file DefaultEnvironment.php.

426 : self
427 {
428 $clone = clone $this;
429 if ($clone->create_mode_token === null) {
430 [
431 $clone->url_builder,
432 $clone->create_mode_token
433 ] = $this->url_builder->acquireParameter(
434 self::QUERY_PARAMETER_NAME_SPACE,
435 self::TOKEN_STRING_CREATE_MODE
436 );
437 }
438
439 $clone->url_builder = $clone->url_builder
440 ->withParameter($clone->create_mode_token, '1');
441 return $clone;
442 }

◆ withDefaultSubAction()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::withDefaultSubAction ( )

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 181 of file DefaultEnvironment.php.

181 : self
182 {
183 $clone = clone $this;
184 $clone->default_sub_action = true;
185 return $clone;
186 }

Referenced by ILIAS\Questions\Presentation\Views\Edit\buildAfterQuestionCreationRedirectUri().

+ Here is the caller graph for this function:

◆ withFormStartSubActionParameter()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::withFormStartSubActionParameter ( string  $sub_action)

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 445 of file DefaultEnvironment.php.

447 : self {
448 $clone = clone $this;
449 if ($clone->form_start_sub_action_token === null) {
450 [
451 $clone->url_builder,
452 $clone->form_start_sub_action_token
453 ] = $this->url_builder->acquireParameter(
454 self::QUERY_PARAMETER_NAME_SPACE,
455 self::TOKEN_STRING_FORM_START_SUB_ACTION
456 );
457 }
458
459 $clone->url_builder = $clone->url_builder
460 ->withParameter(
461 $clone->form_start_sub_action_token,
462 $sub_action
463 );
464 return $clone;
465 }

◆ withIsInCreationContext()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::withIsInCreationContext ( bool  $is_in_creation_context)

Definition at line 335 of file DefaultEnvironment.php.

337 : self {
338 $clone = clone $this;
339 $clone->is_in_creation_context = $is_in_creation_context;
340 return $clone;
341 }

◆ withPreservedFormStartSubActionParameter()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::withPreservedFormStartSubActionParameter ( )

◆ withPreservedTableRowIdsParameter()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::withPreservedTableRowIdsParameter ( )

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 310 of file DefaultEnvironment.php.

310 : self
311 {
312 $clone = clone $this;
313 $clone->table_row_ids = $clone->getTableRowIds();
314 $clone->url_builder = $this->url_builder
315 ->withParameter($this->table_row_token, $clone->table_row_ids);
316 return $clone;
317 }

Referenced by ILIAS\Questions\AnswerForm\Capabilities\Definitions\AdditionalFormStepAction\do().

+ Here is the caller graph for this function:

◆ withQuestionIdParameter()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::withQuestionIdParameter ( Uuid  $question_id)

Definition at line 378 of file DefaultEnvironment.php.

380 : self {
381 $clone = clone $this;
382 $clone->url_builder = $this->url_builder
383 ->withParameter($this->question_id_token, $question_id->toString());
384 return $clone;
385 }

◆ withSubActionParameter()

ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::withSubActionParameter ( string  $sub_action)

Implements ILIAS\Questions\Presentation\Definitions\Environment.

Definition at line 162 of file DefaultEnvironment.php.

164 : self {
165 $clone = clone $this;
166 if ($clone->sub_action_token === null) {
167 [
168 $clone->url_builder,
169 $clone->sub_action_token
170 ] = $this->url_builder->acquireParameter(
171 self::QUERY_PARAMETER_NAME_SPACE,
172 self::TOKEN_STRING_SUB_ACTION
173 );
174 }
175 $clone->url_builder = $clone->url_builder
176 ->withParameter($clone->sub_action_token, $sub_action);
177 return $clone;
178 }

Field Documentation

◆ $action_token

URLBuilderToken ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::$action_token = null
private

Definition at line 68 of file DefaultEnvironment.php.

◆ $answer_form_id_token

URLBuilderToken ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::$answer_form_id_token = null
private

Definition at line 70 of file DefaultEnvironment.php.

◆ $answer_form_properties

Properties ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::$answer_form_properties = null
private

Definition at line 59 of file DefaultEnvironment.php.

◆ $create_mode_token

URLBuilderToken ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::$create_mode_token = null
private

Definition at line 71 of file DefaultEnvironment.php.

◆ $default_sub_action

bool ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::$default_sub_action = false
private

Definition at line 61 of file DefaultEnvironment.php.

◆ $form_start_sub_action_token

URLBuilderToken ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::$form_start_sub_action_token = null
private

Definition at line 72 of file DefaultEnvironment.php.

◆ $is_in_creation_context

bool ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::$is_in_creation_context = false
private

Definition at line 62 of file DefaultEnvironment.php.

◆ $question_id_token

readonly URLBuilderToken ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::$question_id_token
private

Definition at line 66 of file DefaultEnvironment.php.

◆ $sub_action_token

URLBuilderToken ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::$sub_action_token = null
private

Definition at line 67 of file DefaultEnvironment.php.

◆ $table_row_ids

array ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::$table_row_ids = null
private

Definition at line 74 of file DefaultEnvironment.php.

◆ $table_row_token

readonly URLBuilderToken ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::$table_row_token
private

Definition at line 65 of file DefaultEnvironment.php.

◆ $type_hash_token

URLBuilderToken ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::$type_hash_token = null
private

Definition at line 69 of file DefaultEnvironment.php.

◆ $url_builder

URLBuilder ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::$url_builder
private

Definition at line 64 of file DefaultEnvironment.php.

◆ INTERRUPTIVE_ITEMS_KEY

const string ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::INTERRUPTIVE_ITEMS_KEY = 'interruptive_items'
private

Definition at line 55 of file DefaultEnvironment.php.

◆ PARAMETER_STRING_HIER_ID

const string ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::PARAMETER_STRING_HIER_ID = 'hier_id'
private

Definition at line 53 of file DefaultEnvironment.php.

◆ QUERY_PARAMETER_NAME_SPACE

const array ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::QUERY_PARAMETER_NAME_SPACE = ['q']
private

Definition at line 42 of file DefaultEnvironment.php.

◆ TAB_ID_ANSWER_FORM

const string ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::TAB_ID_ANSWER_FORM = 'answer_form'
private

Definition at line 57 of file DefaultEnvironment.php.

◆ TOKEN_STRING_ACTION

const string ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::TOKEN_STRING_ACTION = 'a'
private

Definition at line 43 of file DefaultEnvironment.php.

◆ TOKEN_STRING_ANSWER_FORM_ID

const string ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::TOKEN_STRING_ANSWER_FORM_ID = 'af'
private

Definition at line 48 of file DefaultEnvironment.php.

◆ TOKEN_STRING_CREATE_AND_NEW

const string ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::TOKEN_STRING_CREATE_AND_NEW = 'can'
private

Definition at line 51 of file DefaultEnvironment.php.

◆ TOKEN_STRING_CREATE_MODE

const string ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::TOKEN_STRING_CREATE_MODE = 'cm'
private

Definition at line 49 of file DefaultEnvironment.php.

◆ TOKEN_STRING_FORM_START_SUB_ACTION

const string ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::TOKEN_STRING_FORM_START_SUB_ACTION = 'fssa'
private

Definition at line 50 of file DefaultEnvironment.php.

◆ TOKEN_STRING_QUESTION_ID

const string ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::TOKEN_STRING_QUESTION_ID = 'q'
private

Definition at line 45 of file DefaultEnvironment.php.

◆ TOKEN_STRING_SUB_ACTION

const string ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::TOKEN_STRING_SUB_ACTION = 'sa'
private

Definition at line 44 of file DefaultEnvironment.php.

◆ TOKEN_STRING_TABLE_ROW_ID

const string ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::TOKEN_STRING_TABLE_ROW_ID = 'r'
private

Definition at line 46 of file DefaultEnvironment.php.

◆ TOKEN_STRING_TYPE_HASH

const string ILIAS\Questions\Presentation\Definitions\DefaultEnvironment::TOKEN_STRING_TYPE_HASH = 't'
private

Definition at line 47 of file DefaultEnvironment.php.


The documentation for this class was generated from the following file: