ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
PrintLayoutProvider.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
32
34{
35 public const TEST_CONTEXT_PRINT = 'test_context_print';
36
37 private const MODIFICATION_PRIORITY = 5; //slightly above "low"
38
40 {
41 return $this->context_collection->main();
42 }
43
44 protected function isTestContextPrint(CalledContexts $called_contexts): bool
45 {
46 return $called_contexts->current()->getAdditionalData()
47 ->is(self::TEST_CONTEXT_PRINT, true);
48 }
49
50 public function getMainBarModification(CalledContexts $called_contexts): ?MainBarModification
51 {
52 if (!$this->isTestContextPrint($called_contexts)) {
53 return null;
54 }
55 return $this->globalScreen()->layout()->factory()->mainbar()->withModification(
56 static fn(?MainBar $mainbar): ?MainBar => null
57 )->withPriority(self::MODIFICATION_PRIORITY);
58 }
59
60 public function getMetaBarModification(CalledContexts $called_contexts): ?MetaBarModification
61 {
62 if (!$this->isTestContextPrint($called_contexts)) {
63 return null;
64 }
65
66 return $this->globalScreen()->layout()->factory()->metabar()->withModification(
67 static fn(?MetaBar $metabar): ?MetaBar => null
68 )->withPriority(self::MODIFICATION_PRIORITY);
69 }
70
72 {
73 if (!$this->isTestContextPrint($called_contexts)) {
74 return null;
75 }
76
77 return $this->globalScreen()->layout()->factory()->breadcrumbs()->withModification(
78 static fn(?Breadcrumbs $breadcrumbs): ?Breadcrumbs => null
79 )->withPriority(self::MODIFICATION_PRIORITY);
80 }
81}
getMainBarModification(CalledContexts $called_contexts)
@inheritDoc
getBreadCrumbsModification(CalledContexts $called_contexts)
@inheritDoc
getMetaBarModification(CalledContexts $called_contexts)
@inheritDoc
isTestContextPrint(CalledContexts $called_contexts)
This describes the MainBar.
Definition: MainBar.php:34
This describes the MetaBar.
Definition: MetaBar.php:33