90 $this->portfolio = $portfolio_gui->object;
93 $this->sub_dir = $this->portfolio->getType() .
"_" . $this->portfolio->getId();
96 $this->global_screen = $DIC->globalScreen();
97 $this->export_util = new \ILIAS\Services\Export\HTML\Util($this->export_dir, $this->sub_dir);
98 $this->co_page_html_export = new \ilCOPageHTMLExport($this->target_dir);
99 $this->tabs = $DIC->tabs();
100 $this->lng = $DIC->language();
102 $this->global_screen->tool()->context()->current()->addAdditionalData(
114 $this->include_comments = $a_include_comments;
136 $prfa_set = new \ilSetting(
"prfa");
137 if ($prfa_set->get(
"banner")) {
138 $banner = $this->portfolio->getImageFullPath();
140 copy($banner, $this->target_dir .
"/" . basename($banner));
167 $this->export_util->exportSystemStyle();
168 $this->export_util->exportCOPageFiles(
169 $this->portfolio->getStyleSheetId(),
170 $this->portfolio->getType()
182 $images = $files = $js_files = [];
183 foreach ($this->export_material as $items) {
184 $images = array_merge($images, $items[
"images"]);
185 $files = array_merge($files, $items[
"files"]);
186 $js_files = array_merge($js_files, $items[
"js"]);
188 foreach (array_unique($files) as $file) {
189 if (is_file($file)) {
190 copy($file, $this->target_dir .
"/files/" . basename($file));
194 $this->export_util->exportResourceFiles();
195 $this->co_page_html_export->exportPageElements();
205 if ($this->include_comments) {
206 $user_export = new \ILIAS\Notes\Export\UserImageExporter();
207 $user_export->exportUserImagesForRepObjId($this->target_dir, $this->portfolio->getId());
222 $this->portfolio->getType() .
"_" . $this->portfolio->getId() .
".zip";
241 foreach ($pages as $page) {
247 $this->tabs[$page[
"id"]] = $page[
"title"];
251 $tpl_callback = [$this,
"getInitialisedTemplate"];
254 foreach ($pages as $page) {
256 $this->active_tab =
"user_page_" . $page[
"id"];
259 $link_template =
"prtf_" . $page[
"id"] .
"_bl{TYPE}_{ID}.html";
262 $blog_export =
new BlogHtmlExport($blog_gui, $this->export_dir, $this->sub_dir,
false);
263 $blog_export->exportHTMLPages($link_template, $tpl_callback, $this->co_page_html_export,
"prtf_" . $page[
"id"] .
".html");
268 $this->co_page_html_export->collectPageElements(
"prtf:pg", $page[
"id"]);
272 if (is_file($this->target_dir .
"/prtf_" . $page[
"id"] .
".html")) {
274 $this->target_dir .
"/prtf_" . $page[
"id"] .
".html",
275 $this->target_dir .
"/index.html" 292 $this->global_screen->layout()->meta()->reset();
295 $this->global_screen->layout()->meta()->addCss($location_stylesheet);
296 $this->global_screen->layout()->meta()->addCss(
302 foreach ($a_js_files as $js_file) {
303 $this->global_screen->layout()->meta()->addJs($js_file);
306 $tabs = $DIC->tabs();
307 $tabs->clearTargets();
308 $tabs->clearSubTabs();
309 if (is_array($this->tabs)) {
310 foreach ($this->tabs as $id => $caption) {
311 $tabs->addTab(
"user_page_" . $id, $caption,
"prtf_" . $id .
".html");
314 $tabs->activateTab($this->active_tab);
318 $tpl = new \ilGlobalPageTemplate($DIC->globalScreen(), $DIC->ui(), $DIC->http());
320 $this->co_page_html_export->getPreparedMainTemplate(
$tpl);
322 $tpl->setTitle($this->portfolio->getTitle());
332 $file = $this->target_dir .
"/" . $a_file;
334 if (@is_file($file)) {
338 file_put_contents($file, $content);
352 $pgui = new \ilPortfolioPageGUI($this->portfolio->getId(), $a_post_id);
353 $pgui->setOutputMode(
"offline");
354 $pgui->setFullscreenLink(
"fullscreen.html");
355 $page_content = $pgui->showPage();
357 $ep_tpl = new \ilTemplate(
358 "tpl.export_page.html",
365 ? $pgui->getCommentsHTMLExport()
367 $ep_tpl->setVariable(
"PAGE_CONTENT", $page_content);
368 $ep_tpl->setVariable(
"COMMENTS", $comments);
370 $material = $pgui->getExportMaterial();
371 $this->export_material[] = $material;
373 return $ep_tpl->get();
static _createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
writeExportFile($a_file, $content)
Write export file.
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
static _lookupTitle($a_id)
initDirectories()
Initialize directories.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
exportBanner()
Export banner.
renderPage(string $a_post_id)
Render page.
exportHtml()
Build export file.
__construct(\ilObjPortfolioBaseGUI $portfolio_gui)
constructor
Class ilGlobalPageTemplate.
static copyProfilePicturesToDirectory($a_user_id, $a_dir)
Get profile picture direcotory.
exportUserImages()
Export user images.
exportHTMLPages()
Export all pages.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
const WORKSPACE_OBJECT_ID
Portfolio view gui base class.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static resetInitialState()
Reset initial state (for exports)
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
const HTML_EXPORT_RENDERING
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
includeComments($a_include_comments)
Include comments.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
getInitialisedTemplate(array $a_js_files=[])
Get initialised template.