ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Test\StaticURLHandler Class Reference
+ Inheritance diagram for ILIAS\Test\StaticURLHandler:
+ Collaboration diagram for ILIAS\Test\StaticURLHandler:

Public Member Functions

 getNamespace ()
 
 handle (Request $request, Context $context, Factory $response_factory)
 
- Public Member Functions inherited from ILIAS\StaticURL\Handler\BaseHandler
 __construct ()
 
 canHandle (Request $request)
 
- Public Member Functions inherited from ILIAS\StaticURL\Handler\Handler
 __construct ()
 
 getNamespace ()
 
 canHandle (Request $request)
 
 handle (Request $request, Context $context, Factory $response_factory)
 

Data Fields

const NAMESPACE = 'tst'
 
const QUESTION_OPERATIONS = 'qst'
 

Private Member Functions

 buildQuestionURL (string $q_id, \ilCtrl $ctrl)
 

Detailed Description

Definition at line 30 of file StaticURLHandler.php.

Member Function Documentation

◆ buildQuestionURL()

ILIAS\Test\StaticURLHandler::buildQuestionURL ( string  $q_id,
\ilCtrl  $ctrl 
)
private

Definition at line 61 of file StaticURLHandler.php.

61 : string
62 {
63 $ctrl->setParameterByClass(\ilAssQuestionPreviewGUI::class, 'q_id', $q_id);
64 $link = $ctrl->getLinkTargetByClass([\ilRepositoryGUI::class, \ilObjTestGUI::class, \ilAssQuestionPreviewGUI::class], \ilAssQuestionPreviewGUI::CMD_SHOW);
65 $ctrl->clearParameterByClass(\ilAssQuestionPreviewGUI::class, 'q_id');
66 return $link;
67 }

References ilCtrl\clearParameterByClass(), ilAssQuestionPreviewGUI\CMD_SHOW, ilCtrl\getLinkTargetByClass(), and ilCtrl\setParameterByClass().

+ Here is the call graph for this function:

◆ getNamespace()

ILIAS\Test\StaticURLHandler::getNamespace ( )

Implements ILIAS\StaticURL\Handler\Handler.

Definition at line 35 of file StaticURLHandler.php.

35 : string
36 {
37 return self::NAMESPACE;
38 }

References ILIAS\Test\StaticURLHandler\NAMESPACE.

◆ handle()

ILIAS\Test\StaticURLHandler::handle ( Request  $request,
Context  $context,
Factory  $response_factory 
)

Implements ILIAS\StaticURL\Handler\Handler.

Definition at line 40 of file StaticURLHandler.php.

44 : Response {
45 $ref_id = $request->getReferenceId()?->toInt() ?? 0;
46 $additional_params = $request->getAdditionalParameters();
47 $context->ctrl()->setParameterByClass(\ilObjTestGUI::class, 'ref_id', $ref_id);
48
49 if (!$context->checkPermission('read', $ref_id) && !$context->isUserLoggedIn()) {
50 return $response_factory->can("login.php?target=tst_{$ref_id}&cmd=force_login");
51 }
52
53 $uri = match ($additional_params[0] ?? 'default') {
54 self::QUESTION_OPERATIONS => $this->buildQuestionURL($additional_params[1], $context->ctrl()),
55 default => $context->ctrl()->getLinkTargetByClass([\ilRepositoryGUI::class, \ilObjTestGUI::class]),
56 };
57
58 return $response_factory->can($uri);
59 }
buildQuestionURL(string $q_id, \ilCtrl $ctrl)
$ref_id
Definition: ltiauth.php:66
$context
Definition: webdav.php:31

References ILIAS\StaticURL\Response\Factory\can().

+ Here is the call graph for this function:

Field Documentation

◆ NAMESPACE

const ILIAS\Test\StaticURLHandler::NAMESPACE = 'tst'

Definition at line 32 of file StaticURLHandler.php.

Referenced by ILIAS\Test\StaticURLHandler\getNamespace().

◆ QUESTION_OPERATIONS

const ILIAS\Test\StaticURLHandler::QUESTION_OPERATIONS = 'qst'

Definition at line 33 of file StaticURLHandler.php.


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