ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ModificationHandler.php
Go to the documentation of this file.
1 <?php namespace ILIAS\GlobalScreen\Scope\Layout;
2 
3 use Closure;
17 
26 {
27  use SingletonTrait;
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 
148  public function getPageWithPagePartProviders() : Page
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 }
modifyContentWithClosure(Closure $closure_returning_content)
modifyShortTitleWithClosure(Closure $closure_returning_short_title)
modifyMetaBarWithClosure(Closure $closure_returning_meta_bar)
modifyPageBuilderWithClosure(Closure $closure_returning_page)
modifyTitleWithClosure(Closure $closure_returning_title)
modifyFooterWithClosure(Closure $closure_returning_footer)
modifyViewTitleWithClosure(Closure $closure_returning_view_title)
replaceWithAutoWiredInstance(string $interface, Closure $closure)
trait SingletonTrait
Class SingletonTrait.
modifyResponsiveLogoWithClosure(Closure $closure_returning_image)
This describes the Page.
Definition: Page.php:13
modifyBreadCrumbsWithClosure(Closure $closure_returning_breadcrumbs)
modifyPageWithClosure(Closure $closure_returning_page)
modifyMainBarWithClosure(Closure $closure_returning_main_bar)
modifyLogoWithClosure(Closure $closure_returning_image)