ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
StaticUrlHandler.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29
30class StaticUrlHandler extends BaseHandler implements Handler
31{
32 public function getNamespace(): string
33 {
34 return 'wsp';
35 }
36
37 public function handle(Request $request, Context $context, Factory $response_factory): Response
38 {
39 $wsp_id = $request->getReferenceId()?->toInt() ?? 0;
40 if ($wsp_id <= 0 || !\ilWorkspaceAccessHandler::getObjectDataFromNode($wsp_id)) {
41 return $response_factory->cannot();
42 }
43
44 $ctrl = $context->ctrl();
45 $ctrl->setParameterByClass(\ilSharedResourceGUI::class, 'wsp_id', $wsp_id);
46
47 return $response_factory->can(
48 $ctrl->getLinkTargetByClass(\ilSharedResourceGUI::class, 'process')
49 );
50 }
51}
can(string $uri_path, bool $shift=false)
The Handler successfully resolved the target.
Definition: Factory.php:88
cannot()
The Handler cannot process the given Request at all, e.g.
Definition: Factory.php:47
static getObjectDataFromNode(int $a_node_id)
$request
@ilCtrl_Calls ilObjLearningSequenceContentGUI: ilObjLearningSequenceConditionsGUI
Definition: ltiauth.php:39