39 protected \ilLanguage
$lng;
58 $this->global_screen = $DIC->globalScreen();
59 $this->
lng = $DIC->language();
61 $this->global_screen->tool()->context()->current()->addAdditionalData(
66 $this->content_style_domain = $DIC
68 ->domain()->styleForObjId($this->portfolio->getId());
71 protected function init(): void
74 $this->sub_dir = $this->portfolio->getType() .
"_" . $this->portfolio->getId();
75 if ($this->print_version) {
76 $this->sub_dir .=
"print";
79 $this->export_util = new \ILIAS\Services\Export\HTML\Util($this->export_dir, $this->sub_dir);
80 $this->co_page_html_export = new \ilCOPageHTMLExport($this->target_dir);
85 $this->include_comments = $a_include_comments;
112 $prfa_set = new \ilSetting(
"prfa");
113 if ($prfa_set->get(
"banner")) {
114 $banner = $this->portfolio->getImageFullPath();
116 copy($banner, $this->target_dir .
"/" . basename($banner));
144 $this->export_util->exportSystemStyle();
145 $this->export_util->exportCOPageFiles(
146 $this->content_style_domain->getEffectiveStyleId(),
147 $this->portfolio->getType()
153 if ($this->print_version) {
163 $images = $files = $js_files = [];
164 foreach ($this->export_material as $items) {
165 $images = array_merge($images, $items[
"images"]);
166 $files = array_merge($files, $items[
"files"]);
167 $js_files = array_merge($js_files, $items[
"js"]);
169 foreach (array_unique($files) as $file) {
170 if (is_file($file)) {
171 copy($file, $this->target_dir .
"/files/" . basename($file));
175 $this->export_util->exportResourceFiles();
176 $this->co_page_html_export->exportPageElements();
186 if ($this->include_comments) {
187 $user_export = new \ILIAS\Notes\Export\UserImageExporter();
188 $user_export->exportUserImagesForRepObjId($this->target_dir, $this->portfolio->getId());
203 $this->portfolio->getType() .
"_" . $this->portfolio->getId() .
".zip";
222 foreach ($pages as $page) {
228 $this->tabs[$page[
"id"]] = $page[
"title"];
237 foreach ($pages as $page) {
239 $this->active_tab =
"user_page_" . $page[
"id"];
242 $link_template =
"prtf_" . $page[
"id"] .
"_bl{TYPE}_{ID}.html";
245 $blog_export =
new BlogHtmlExport($blog_gui, $this->export_dir, $this->sub_dir,
false);
246 $blog_export->exportHTMLPages($link_template, $tpl_callback, $this->co_page_html_export,
"prtf_" . $page[
"id"] .
".html");
251 $this->co_page_html_export->collectPageElements(
"prtf:pg", $page[
"id"]);
254 if (!$has_index && is_file($this->target_dir .
"/prtf_" . $page[
"id"] .
".html")) {
256 $this->target_dir .
"/prtf_" . $page[
"id"] .
".html",
257 $this->target_dir .
"/index.html" 272 foreach ($pages as $page) {
276 $blog_export =
new BlogHtmlExport($blog_gui, $this->export_dir, $this->sub_dir,
false);
277 $blog_export->collectAllPagesPageElements($this->co_page_html_export);
279 $this->co_page_html_export->collectPageElements(
"prtf:pg", $page[
"id"]);
285 $print_view = $this->portfolio_gui->getPrintView();
286 $print_view->setOffline(
true);
287 $html = $print_view->renderPrintView();
288 file_put_contents($this->target_dir .
"/index.html", $html);
295 array $a_js_files = []
299 $this->global_screen->layout()->meta()->reset();
302 $this->global_screen->layout()->meta()->addCss($location_stylesheet);
303 $this->global_screen->layout()->meta()->addCss(
305 $this->content_style_domain->getEffectiveStyleId()
311 foreach ($a_js_files as $js_file) {
312 $this->global_screen->layout()->meta()->addJs($js_file);
315 $tabs = $DIC->tabs();
316 $tabs->clearTargets();
317 $tabs->clearSubTabs();
318 if (is_array($this->
tabs)) {
319 foreach ($this->
tabs as
$id => $caption) {
320 $tabs->addTab(
"user_page_" .
$id, $caption,
"prtf_" .
$id .
".html");
323 $tabs->activateTab($this->active_tab);
327 $tpl = new \ilGlobalPageTemplate($DIC->globalScreen(), $DIC->ui(), $DIC->http());
329 $this->co_page_html_export->getPreparedMainTemplate(
$tpl);
331 $tpl->setTitle($this->portfolio->getTitle());
343 $file = $this->target_dir .
"/" . $a_file;
345 if (is_file($file)) {
349 file_put_contents($file, $content);
361 $pgui = new \ilPortfolioPageGUI($this->portfolio->getId(), $a_post_id);
362 $pgui->setOutputMode(
"offline");
363 $pgui->setFullscreenLink(
"fullscreen.html");
364 $page_content = $pgui->showPage();
366 $ep_tpl = new \ilTemplate(
367 "tpl.export_page.html",
374 ? $pgui->getCommentsHTMLExport()
376 $ep_tpl->setVariable(
"PAGE_CONTENT", $page_content);
377 $ep_tpl->setVariable(
"COMMENTS",
$comments);
379 $material = $pgui->getExportMaterial();
380 $this->export_material[] = $material;
382 return $ep_tpl->get();
static getAllPortfolioPages(int $a_portfolio_id)
Get pages of portfolio.
static copyProfilePicturesToDirectory(int $a_user_id, string $a_dir)
initDirectories()
Initialize directories.
exportBanner()
Export banner.
writeExportFile(string $a_file, string $content)
Write export file.
renderPage(string $a_post_id)
Render page.
ILIAS GlobalScreen Services $global_screen
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object.
setPrintVersion(bool $print_version)
ILIAS Style Content Object ObjectFacade $content_style_domain
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
exportHtml()
Build export file.
static _lookupTitle(int $obj_id)
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.
static _createExportDirectory(int $a_obj_id, string $a_export_type="xml", string $a_obj_type="")
ilCOPageHTMLExport $co_page_html_export
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
exportUserImages()
Export user images.
ILIAS Services Export HTML Util $export_util
exportHTMLPages()
Export all pages.
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
const WORKSPACE_OBJECT_ID
Portfolio view gui base class.
static resetInitialState()
Reset initial state (for exports)
static zip(string $a_dir, string $a_file, bool $compress_content=false)
zips given directory/file into given zip.file
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
ilObjPortfolio $portfolio
const HTML_EXPORT_RENDERING
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
exportHTMLPagesPrint()
Export all pages as one print version.
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
getInitialisedTemplate(array $a_js_files=[])
Get initialised template.
ilObjPortfolioBaseGUI $portfolio_gui