ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ModificationHandler.php
Go to the documentation of this file.
2
3use Closure;
17
26{
36
37
41 public function __construct()
42 {
43 $this->current_page_builder = new StandardPageBuilder();
44 $this->current_page_part_provider = new StandardPagePartProvider();
45 }
46
47
48
49
50 //
51 // Modifiers
52 //
62 public function modifyPageWithClosure(Closure $closure_returning_page)
63 {
64 $this->current_page_builder = new DecoratedPageBuilder($this->current_page_builder, $closure_returning_page);
65 }
66
67
73 public function modifyContentWithClosure(Closure $closure_returning_content)
74 {
75 $this->replaceWithAutoWiredInstance(Legacy::class, $closure_returning_content);
76 }
77
78
84 public function modifyMainBarWithClosure(Closure $closure_returning_main_bar)
85 {
86 $this->replaceWithAutoWiredInstance(MainBar::class, $closure_returning_main_bar);
87 }
88
89
95 public function modifyMetaBarWithClosure(Closure $closure_returning_meta_bar)
96 {
97 $this->replaceWithAutoWiredInstance(MetaBar::class, $closure_returning_meta_bar);
98 }
99
104 public function modifyLogoWithClosure(Closure $closure_returning_image)
105 {
107 }
108
109 public function modifyResponsiveLogoWithClosure(Closure $closure_returning_image)
110 {
113 $closure_returning_image
114 );
115 }
116
121 public function modifyBreadCrumbsWithClosure(Closure $closure_returning_breadcrumbs)
122 {
123 $this->replaceWithAutoWiredInstance(Breadcrumbs::class, $closure_returning_breadcrumbs);
124 }
125
126
130 public function modifyPageBuilderWithClosure(Closure $closure_returning_page) : void
131 {
132 $this->current_page_builder = new DecoratedPageBuilder($this->current_page_builder, $closure_returning_page);
133 }
134
135
139 public function modifyFooterWithClosure(Closure $closure_returning_footer) : void
140 {
141 $this->replaceWithAutoWiredInstance(Footer::class, $closure_returning_footer);
142 }
143
144
149 {
150 return $this->current_page_builder->build($this->current_page_part_provider);
151 }
152
153
154 public function modifyTitleWithClosure(Closure $closure_returning_title) : void
155 {
158 $closure_returning_title
159 );
160 }
161 public function modifyShortTitleWithClosure(Closure $closure_returning_short_title) : void
162 {
165 $closure_returning_short_title
166 );
167 }
168 public function modifyViewTitleWithClosure(Closure $closure_returning_view_title) : void
169 {
172 $closure_returning_view_title
173 );
174 }
175
176
177
182 private function replaceWithAutoWiredInstance(string $interface, Closure $closure) : void
183 {
184 $this->current_page_part_provider = new DecoratedPagePartProvider($this->current_page_part_provider, $closure, $interface);
185 }
186}
An exception for terminatinating execution or to throw for unit testing.
modifyTitleWithClosure(Closure $closure_returning_title)
modifyMainBarWithClosure(Closure $closure_returning_main_bar)
modifyBreadCrumbsWithClosure(Closure $closure_returning_breadcrumbs)
replaceWithAutoWiredInstance(string $interface, Closure $closure)
modifyPageWithClosure(Closure $closure_returning_page)
modifyContentWithClosure(Closure $closure_returning_content)
modifyResponsiveLogoWithClosure(Closure $closure_returning_image)
modifyFooterWithClosure(Closure $closure_returning_footer)
modifyPageBuilderWithClosure(Closure $closure_returning_page)
modifyViewTitleWithClosure(Closure $closure_returning_view_title)
modifyMetaBarWithClosure(Closure $closure_returning_meta_bar)
modifyShortTitleWithClosure(Closure $closure_returning_short_title)
modifyLogoWithClosure(Closure $closure_returning_image)
This describes the Page.
Definition: Page.php:14
This describes the Footer.
Definition: Footer.php:12
This describes the MainBar.
Definition: MainBar.php:16
This describes the MetaBar.
Definition: MetaBar.php:15
trait SingletonTrait
Class SingletonTrait.