ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Info.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26
30class Info extends BaseCheck implements Check
31{
32 public function canUnlock(): Capabilities
33 {
34 return Capabilities::INFO_PAGE;
35 }
36
37 public function maybeUnlock(
38 Capability $capability,
39 CheckHelpers $helpers,
42 ): Capability {
43 return $capability->withUnlocked($this->hasPermission($helpers, $context, ...$capability->getPermissions()));
44 }
45
46 public function maybeBuildURI(Capability $capability, CheckHelpers $helpers, Context $context): Capability
47 {
48 if (!$capability->isUnlocked()) {
49 return $capability;
50 }
51 $helpers->ctrl->setParameterByClass(\ilInfoScreenGUI::class, 'ref_id', $context);
52
53 return $capability->withURI(
54 $helpers->fromTarget(
55 $helpers->ctrl->getLinkTargetByClass([
56 $this->baseClass($context),
57 \ilObjFileGUI::class,
58 \ilInfoScreenGUI::class
59 ], Capabilities::INFO_PAGE->value)
60 )
61 );
62 }
63
64}
hasPermission(CheckHelpers $helpers, Context $context, Permissions ... $permission)
Definition: BaseCheck.php:36
maybeBuildURI(Capability $capability, CheckHelpers $helpers, Context $context)
Definition: Info.php:46
maybeUnlock(Capability $capability, CheckHelpers $helpers, \ilObjFileInfo $info, Context $context,)
Definition: Info.php:37
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$info
Definition: entry_point.php:21
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: BaseCheck.php:21
$context
Definition: webdav.php:31