ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLMHtmlExportViewLayoutProvider Class Reference

LM HTML export view layout provider, hides main and meta bar. More...

+ Inheritance diagram for ilLMHtmlExportViewLayoutProvider:
+ Collaboration diagram for ilLMHtmlExportViewLayoutProvider:

Public Member Functions

 isInterestedInContexts ()
 
 getMetaBarModification (CalledContexts $screen_context_stack)
 No meta bar in HTML exports. More...
 
 getMainBarModification (CalledContexts $screen_context_stack)
 No main bar in HTML exports. More...
 
 getBreadCrumbsModification (CalledContexts $screen_context_stack)
 No breadcrumbs in HTML exports. More...
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider
 __construct (Container $dic)
 
 getContentModification (CalledContexts $screen_context_stack)
 
 getLogoModification (CalledContexts $screen_context_stack)
 
 getResponsiveLogoModification (CalledContexts $screen_context_stack)
 
 getMainBarModification (CalledContexts $screen_context_stack)
 
 getMetaBarModification (CalledContexts $screen_context_stack)
 
 getBreadCrumbsModification (CalledContexts $screen_context_stack)
 
 getFooterModification (CalledContexts $screen_context_stack)
 
 getPageBuilderDecorator (CalledContexts $screen_context_stack)
 
 getTitleModification (CalledContexts $screen_context_stack)
 
 getShortTitleModification (CalledContexts $screen_context_stack)
 
 getViewTitleModification (CalledContexts $screen_context_stack)
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (Container $dic)
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 

Data Fields

const LM_HTML_EXPORT_RENDERING = 'lm_html_export_rendering'
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 globalScreen ()
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider
ContextCollection $context_collection
 
ILIAS GlobalScreen Scope Layout Factory ModificationFactory $factory
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
Container $dic
 

Detailed Description

LM HTML export view layout provider, hides main and meta bar.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 34 of file class.ilLMHtmlExportViewLayoutProvider.php.

Member Function Documentation

◆ getBreadCrumbsModification()

ilLMHtmlExportViewLayoutProvider::getBreadCrumbsModification ( CalledContexts  $screen_context_stack)

No breadcrumbs in HTML exports.

Implements ILIAS\GlobalScreen\Scope\Layout\Provider\ModificationProvider.

Definition at line 116 of file class.ilLMHtmlExportViewLayoutProvider.php.

References ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current(), and ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen().

117  {
118  $additional_data = $screen_context_stack->current()->getAdditionalData();
119  if ($additional_data->is(self::LM_HTML_EXPORT_RENDERING, true)) {
120  return $this->globalScreen()
121  ->layout()
122  ->factory()
123  ->breadcrumbs()
124  ->withModification(function (?Breadcrumbs $current = null): ?Breadcrumbs {
125  return null;
126  })->withHighPriority();
127  } else {
128  return null;
129  }
130  }
+ Here is the call graph for this function:

◆ getMainBarModification()

ilLMHtmlExportViewLayoutProvider::getMainBarModification ( CalledContexts  $screen_context_stack)

No main bar in HTML exports.

Implements ILIAS\GlobalScreen\Scope\Layout\Provider\ModificationProvider.

Definition at line 67 of file class.ilLMHtmlExportViewLayoutProvider.php.

References $DIC, Vendor\Package\$f, $id, $lng, ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current(), ilUtil\getImagePath(), ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), and ILIAS\UI\Implementation\Component\Button\withEngagedState().

68  {
69  $additional_data = $screen_context_stack->current()->getAdditionalData();
70  if ($additional_data->is(self::LM_HTML_EXPORT_RENDERING, true)) {
71  return $this->globalScreen()
72  ->layout()
73  ->factory()
74  ->mainbar()
75  ->withModification(function (?MainBar $current = null): ?MainBar {
76  if($current === null) {
77  return null;
78  }
79  global $DIC;
80 
81  $lng = $DIC->language();
82  $f = $DIC->ui()->factory();
83 
84  // create an offline main bar
85  $offline_main_bar = new \ILIAS\UI\Implementation\Component\MainControls\MainBar(
86  new \ILIAS\UI\Implementation\Component\SignalGenerator()
87  );
88  $grid_icon = $f->symbol()->icon()->custom(\ilUtil::getImagePath("icon_tool.svg"), $lng->txt("more"));
89  $tools_button = $f->button()->bulky($grid_icon, $lng->txt("tools"), "#")->withEngagedState(true);
90  $offline_main_bar = $offline_main_bar->withToolsButton($tools_button);
91 
92  // get tool ids for offline use from lm tools provider
93  $lm_tools = new ilLMGSToolProvider($DIC);
94  $ids = $lm_tools->getOfflineToolIds();
95 
96  // copy all offline tools from original main bar to offline main bar
97  foreach ($current->getToolEntries() as $id => $te) {
98  if (in_array($id, $ids)) {
99  $offline_main_bar = $offline_main_bar->withAdditionalToolEntry(
100  $id,
101  $te
102  );
103  }
104  }
105 
106  return $offline_main_bar;
107  })->withHighPriority();
108  } else {
109  return null;
110  }
111  }
Class Factory.
This describes the MainBar.
Definition: MainBar.php:33
$lng
Class ChatMainBarProvider .
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ getMetaBarModification()

ilLMHtmlExportViewLayoutProvider::getMetaBarModification ( CalledContexts  $screen_context_stack)

No meta bar in HTML exports.

Implements ILIAS\GlobalScreen\Scope\Layout\Provider\ModificationProvider.

Definition at line 49 of file class.ilLMHtmlExportViewLayoutProvider.php.

References ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current(), and ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen().

50  {
51  $additional_data = $screen_context_stack->current()->getAdditionalData();
52  if ($additional_data->is(self::LM_HTML_EXPORT_RENDERING, true)) {
53  return $this->globalScreen()
54  ->layout()
55  ->factory()
56  ->metabar()
57  ->withModification(function (?MetaBar $current = null): ?MetaBar {
58  return null;
59  })->withHighPriority();
60  }
61  return null;
62  }
This describes the MetaBar.
Definition: MetaBar.php:32
+ Here is the call graph for this function:

◆ isInterestedInContexts()

ilLMHtmlExportViewLayoutProvider::isInterestedInContexts ( )

Field Documentation

◆ LM_HTML_EXPORT_RENDERING

const ilLMHtmlExportViewLayoutProvider::LM_HTML_EXPORT_RENDERING = 'lm_html_export_rendering'

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