ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ILIAS\Badge\URL\StaticUrlHandler Class Reference
+ Inheritance diagram for ILIAS\Badge\URL\StaticUrlHandler:
+ Collaboration diagram for ILIAS\Badge\URL\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 string NAMESPACE = 'badge'
 

Detailed Description

Definition at line 30 of file StaticUrlHandler.php.

Member Function Documentation

◆ getNamespace()

ILIAS\Badge\URL\StaticUrlHandler::getNamespace ( )

Implements ILIAS\StaticURL\Handler\Handler.

Definition at line 34 of file StaticUrlHandler.php.

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

References ILIAS\Badge\URL\StaticUrlHandler\NAMESPACE.

◆ handle()

ILIAS\Badge\URL\StaticUrlHandler::handle ( Request  $request,
Context  $context,
Factory  $response_factory 
)

Implements ILIAS\StaticURL\Handler\Handler.

Definition at line 39 of file StaticUrlHandler.php.

39 : Response
40 {
41 if (!$context->isUserLoggedIn()) {
42 return $response_factory->loginFirst();
43 }
44
45 if (!\ilBadgeHandler::getInstance()->isActive()) {
46 return $response_factory->cannot();
47 }
48
49 $params = implode('/', $request->getAdditionalParameters() ?? []);
50 $path = parse_url($params, PHP_URL_PATH);
51
52 return match ($path) {
53 'profile' => $response_factory->can($context->ctrl()->getLinkTargetByClass(
54 [
55 \ilDashboardGUI::class,
56 \ilAchievementsGUI::class,
57 \ilBadgeProfileGUI::class
58 ]
59 )),
60 default => $response_factory->cannot(),
61 };
62 }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
$path
Definition: ltiservices.php:30

References $params, $path, ILIAS\StaticURL\Response\Factory\can(), ILIAS\StaticURL\Response\Factory\cannot(), ILIAS\StaticURL\Context\ctrl(), ILIAS\StaticURL\Request\Request\getAdditionalParameters(), ilBadgeHandler\getInstance(), ILIAS\StaticURL\Context\isUserLoggedIn(), and ILIAS\StaticURL\Response\Factory\loginFirst().

+ Here is the call graph for this function:

Field Documentation

◆ NAMESPACE

const string ILIAS\Badge\URL\StaticUrlHandler::NAMESPACE = 'badge'

Definition at line 32 of file StaticUrlHandler.php.

Referenced by ILIAS\Badge\URL\StaticUrlHandler\getNamespace().


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