41 protected \ilLanguage
$lng;
60 $this->global_screen = $DIC->globalScreen();
61 $this->
lng = $DIC->language();
63 $this->global_screen->tool()->context()->current()->addAdditionalData(
68 $this->content_style_domain = $DIC
70 ->domain()->styleForObjId($this->portfolio->getId());
71 $this->domain = $DIC->portfolio()->internal()->domain();
74 protected function init(): void
77 $this->sub_dir = $this->portfolio->getType() .
"_" . $this->portfolio->getId();
78 if ($this->print_version) {
79 $this->sub_dir .=
"print";
82 $this->export_util = new \ILIAS\Services\Export\HTML\Util($this->export_dir, $this->sub_dir);
83 $this->co_page_html_export = new \ilCOPageHTMLExport($this->target_dir);
88 $this->include_comments = $a_include_comments;
115 $prfa_set = new \ilSetting(
"prfa");
116 if ($prfa_set->get(
"banner")) {
117 $banner = $this->portfolio->getImageFullPath();
119 copy($banner, $this->target_dir .
"/" . basename($banner));
147 $this->export_util->exportSystemStyle();
148 $this->export_util->exportCOPageFiles(
149 $this->content_style_domain->getEffectiveStyleId(),
150 $this->portfolio->getType()
156 if ($this->print_version) {
166 $images = $files = $js_files = [];
167 foreach ($this->export_material as $items) {
168 $images = array_merge($images, $items[
"images"]);
169 $files = array_merge($files, $items[
"files"]);
170 $js_files = array_merge($js_files, $items[
"js"]);
172 foreach (array_unique($files) as $file) {
173 if (is_file($file)) {
174 copy($file, $this->target_dir .
"/files/" . basename($file));
178 $this->export_util->exportResourceFiles();
179 $this->co_page_html_export->exportPageElements();
189 if ($this->include_comments) {
190 $user_export = new \ILIAS\Notes\Export\UserImageExporter();
191 $user_export->exportUserImagesForRepObjId($this->target_dir, $this->portfolio->getId());
206 $this->portfolio->getType() .
"_" . $this->portfolio->getId() .
".zip";
207 $this->domain->resources()->zip()->zipDirectoryToFile($this->target_dir, $zip_file);
225 foreach ($pages as $page) {
231 $this->tabs[$page[
"id"]] = $page[
"title"];
240 foreach ($pages as $page) {
242 $this->active_tab =
"user_page_" . $page[
"id"];
245 $link_template =
"prtf_" . $page[
"id"] .
"_bl{TYPE}_{ID}.html";
248 $blog_export =
new BlogHtmlExport($blog_gui, $this->export_dir, $this->sub_dir,
false);
249 $blog_export->exportHTMLPages($link_template, $tpl_callback, $this->co_page_html_export,
"prtf_" . $page[
"id"] .
".html");
252 $tpl->setContent($this->
renderPage($page[
"id"]));
253 $this->
writeExportFile(
"prtf_" . $page[
"id"] .
".html", $tpl->printToString());
254 $this->co_page_html_export->collectPageElements(
"prtf:pg", $page[
"id"]);
257 if (!$has_index && is_file($this->target_dir .
"/prtf_" . $page[
"id"] .
".html")) {
259 $this->target_dir .
"/prtf_" . $page[
"id"] .
".html",
260 $this->target_dir .
"/index.html" 275 foreach ($pages as $page) {
279 $blog_export =
new BlogHtmlExport($blog_gui, $this->export_dir, $this->sub_dir,
false);
280 $blog_export->collectAllPagesPageElements($this->co_page_html_export);
282 $this->co_page_html_export->collectPageElements(
"prtf:pg", $page[
"id"]);
288 $print_view = $this->portfolio_gui->getPrintView();
289 $print_view->setOffline(
true);
290 $html = $print_view->renderPrintView();
291 file_put_contents($this->target_dir .
"/index.html", $html);
298 array $a_js_files = []
302 $this->global_screen->layout()->meta()->reset();
305 $this->global_screen->layout()->meta()->addCss($location_stylesheet);
306 $this->global_screen->layout()->meta()->addCss(
308 $this->content_style_domain->getEffectiveStyleId()
314 foreach ($a_js_files as $js_file) {
315 $this->global_screen->layout()->meta()->addJs($js_file);
318 $tabs = $DIC->tabs();
319 $tabs->clearTargets();
320 $tabs->clearSubTabs();
321 if (is_array($this->
tabs)) {
322 foreach ($this->
tabs as
$id => $caption) {
323 $tabs->addTab(
"user_page_" .
$id, $caption,
"prtf_" .
$id .
".html");
326 $tabs->activateTab($this->active_tab);
330 $tpl = new \ilGlobalPageTemplate($DIC->globalScreen(), $DIC->ui(), $DIC->http());
332 $this->co_page_html_export->getPreparedMainTemplate($tpl);
334 $tpl->setTitle($this->portfolio->getTitle());
346 $file = $this->target_dir .
"/" . $a_file;
348 if (is_file($file)) {
352 file_put_contents($file, $content);
364 $pgui = new \ilPortfolioPageGUI($this->portfolio->getId(), $a_post_id);
365 $pgui->setOutputMode(
"offline");
366 $pgui->setFullscreenLink(
"fullscreen.html");
367 $page_content = $pgui->showPage();
369 $ep_tpl = new \ilTemplate(
370 "tpl.export_page.html",
377 ? $pgui->getCommentsHTMLExport()
379 $ep_tpl->setVariable(
"PAGE_CONTENT", $page_content);
380 $ep_tpl->setVariable(
"COMMENTS",
$comments);
382 $material = $pgui->getExportMaterial();
383 $this->export_material[] = $material;
385 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.
InternalDomainService $domain
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)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
ilObjPortfolio $portfolio
const HTML_EXPORT_RENDERING
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