19 declare(strict_types=1);
29 protected \ILIAS\components\Export\HTML\ExportCollector
$collector;
39 protected \ilLanguage
$lng;
58 $this->global_screen = $DIC->globalScreen();
59 $this->
lng = $DIC->language();
61 if (!self::$gs_initialized) {
62 $this->global_screen->tool()->context()->current()->addAdditionalData(
66 self::$gs_initialized =
true;
69 $this->content_style_domain = $DIC
71 ->domain()->styleForObjId($this->portfolio->getId());
72 $this->domain = $DIC->portfolio()->internal()->domain();
75 protected function init(): void
79 $this->collector = $DIC->export()->domain()->html()->collector($this->portfolio->getId());
80 $this->collector->init();
81 $this->export_util =
new Util(
"",
"", $this->collector);
83 $this->co_page_html_export = new \ilCOPageHTMLExport($this->target_dir,
null, 0, $this->collector);
88 $this->include_comments = $a_include_comments;
103 $this->export_util->exportSystemStyle(
108 $this->export_util->exportCOPageFiles(
109 $this->content_style_domain->getEffectiveStyleId(),
110 $this->portfolio->getType()
114 if ($this->print_version) {
125 $images = $files = $js_files = [];
126 foreach ($this->export_material as $items) {
127 $images = array_merge($images, $items[
"images"]);
128 $files = array_merge($files, $items[
"files"]);
129 $js_files = array_merge($js_files, $items[
"js"]);
131 foreach (array_unique($files) as $file) {
132 if (is_file($file)) {
137 $this->export_util->exportResourceFiles();
138 $this->co_page_html_export->exportPageElements();
154 foreach ($pages as $page) {
155 $this->tabs[$page[
"id"]] = $page[
"title"];
159 foreach ($pages as $page) {
161 $this->active_tab =
"user_page_" . $page[
"id"];
164 $tpl->setContent($this->
renderPage((
int) $page[
"id"]));
165 $this->
writeExportFile(
"prtf_" . $page[
"id"] .
".html", $tpl->printToString());
166 $this->co_page_html_export->collectPageElements(
"prtf:pg", $page[
"id"]);
169 $this->collector->addString($tpl->printToString(),
"index.html");
183 foreach ($pages as $page) {
185 $this->co_page_html_export->collectPageElements(
"prtf:pg", $page[
"id"]);
190 $print_view = $this->portfolio_gui->getPrintView();
191 $print_view->setOffline(
true);
192 $html = $print_view->renderPrintView();
194 $this->collector->addString($html,
"index.html");
201 array $a_js_files = []
205 $this->global_screen->layout()->meta()->reset();
208 $this->global_screen->layout()->meta()->addCss($location_stylesheet);
209 $this->global_screen->layout()->meta()->addCss(
215 foreach ($a_js_files as $js_file) {
216 $this->global_screen->layout()->meta()->addJs($js_file);
219 $tabs = $DIC->tabs();
220 $tabs->clearTargets();
221 $tabs->clearSubTabs();
222 if (is_array($this->
tabs)) {
223 foreach ($this->
tabs as
$id => $caption) {
224 $tabs->addTab(
"user_page_" .
$id, $caption,
"prtf_" .
$id .
".html");
227 $tabs->activateTab($this->active_tab);
231 $tpl = new \ilGlobalPageTemplate($DIC->globalScreen(), $DIC->ui(), $DIC->http());
233 $this->co_page_html_export->getPreparedMainTemplate($tpl);
235 $tpl->setTitle($this->portfolio->getTitle());
247 $file = $this->target_dir .
"/" . $a_file;
255 $this->collector->addString($content, $a_file);
267 $pgui = new \ilPortfolioPageGUI($this->portfolio->getId(), $a_post_id);
268 $pgui->setOutputMode(
"offline");
269 $pgui->setFullscreenLink(
"fullscreen.html");
270 $page_content = $pgui->showPage();
272 $ep_tpl = new \ilTemplate(
273 "tpl.export_page.html",
276 "components/ILIAS/Portfolio" 280 ? $pgui->getCommentsHTMLExport()
282 $ep_tpl->setVariable(
"PAGE_CONTENT", $page_content);
283 $ep_tpl->setVariable(
"COMMENTS",
$comments);
285 $material = $pgui->getExportMaterial();
286 $this->export_material[] = $material;
288 return $ep_tpl->get();
293 $this->collector->deliver($filename);
297 public function delete():
void 299 $this->collector->delete();
304 return $this->collector->getFilePath();
renderPage(int $a_post_id)
Render page.
static getAllPortfolioPages(int $a_portfolio_id)
Get pages of portfolio.
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
writeExportFile(string $a_file, string $content)
Write export file.
ILIAS GlobalScreen Services $global_screen
setPrintVersion(bool $print_version)
deliver(string $filename, bool $remove=false)
ILIAS Style Content Object ObjectFacade $content_style_domain
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
exportHtml()
Build export file.
includeComments(bool $a_include_comments)
__construct()
Constructor setup ILIAS global object public.
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
ILIAS components Export HTML ExportCollector $collector
ilCOPageHTMLExport $co_page_html_export
exportHTMLPages()
Export all pages.
InternalDomainService $domain
Portfolio view gui base class.
Util This class is an interim solution for the HTML export handling with 6.0.
static resetInitialState()
Reset initial state (for exports)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static getExportContentStylePath()
ilObjPortfolio $portfolio
static bool $gs_initialized
const HTML_EXPORT_RENDERING
exportHTMLPagesPrint()
Export all pages as one print version.
getInitialisedTemplate(array $a_js_files=[])
Get initialised template.
ilObjPortfolioBaseGUI $portfolio_gui