85 $this->portfolio = $portfolio_gui->object;
88 $this->sub_dir = $this->portfolio->getType() .
"_" . $this->portfolio->getId();
91 $this->global_screen = $DIC->globalScreen();
92 $this->export_util = new \ILIAS\Services\Export\HTML\Util($this->export_dir, $this->sub_dir);
93 $this->co_page_html_export = new \ilCOPageHTMLExport($this->target_dir);
94 $this->tabs = $DIC->tabs();
95 $this->lng = $DIC->language();
97 $this->global_screen->tool()->context()->current()->addAdditionalData(
122 $prfa_set = new \ilSetting(
"prfa");
123 if ($prfa_set->get(
"banner")) {
124 $banner = $this->portfolio->getImageFullPath();
126 copy($banner, $this->target_dir .
"/" . basename($banner));
153 $this->export_util->exportSystemStyle();
154 $this->export_util->exportCOPageFiles(
155 $this->portfolio->getStyleSheetId(),
156 $this->portfolio->getType()
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();
194 "/" . $date .
"__" . IL_INST_ID .
"__" .
195 $this->portfolio->getType() .
"_" . $this->portfolio->getId() .
".zip";
214 foreach ($pages as $page) {
220 $this->tabs[$page[
"id"]] = $page[
"title"];
224 $tpl_callback = [$this,
"getInitialisedTemplate"];
227 foreach ($pages as $page) {
229 $this->active_tab =
"user_page_" . $page[
"id"];
232 $link_template =
"prtf_" . $page[
"id"] .
"_bl{TYPE}_{ID}.html";
235 $blog_export =
new BlogHtmlExport($blog_gui, $this->export_dir, $this->sub_dir,
false);
236 $blog_export->exportHTMLPages($link_template, $tpl_callback, $this->co_page_html_export,
"prtf_" . $page[
"id"] .
".html");
241 $this->co_page_html_export->collectPageElements(
"prtf:pg", $page[
"id"]);
245 if (is_file($this->target_dir .
"/prtf_" . $page[
"id"] .
".html")) {
247 $this->target_dir .
"/prtf_" . $page[
"id"] .
".html",
248 $this->target_dir .
"/index.html" 265 $this->global_screen->layout()->meta()->reset();
268 $this->global_screen->layout()->meta()->addCss($location_stylesheet);
269 $this->global_screen->layout()->meta()->addCss(
275 foreach ($a_js_files as $js_file) {
276 $this->global_screen->layout()->meta()->addJs($js_file);
279 $tabs = $DIC->tabs();
280 $tabs->clearTargets();
281 $tabs->clearSubTabs();
282 if (is_array($this->tabs)) {
283 foreach ($this->tabs as $id => $caption) {
284 $tabs->addTab(
"user_page_" . $id, $caption,
"prtf_" . $id .
".html");
287 $tabs->activateTab($this->active_tab);
291 $tpl = new \ilGlobalPageTemplate($DIC->globalScreen(), $DIC->ui(), $DIC->http());
293 $this->co_page_html_export->getPreparedMainTemplate(
$tpl);
295 $tpl->setTitle($this->portfolio->getTitle());
305 $file = $this->target_dir .
"/" . $a_file;
307 if (@is_file($file)) {
311 file_put_contents($file, $content);
325 $pgui = new \ilPortfolioPageGUI($this->portfolio->getId(), $a_post_id);
326 $pgui->setOutputMode(
"offline");
327 $pgui->setFullscreenLink(
"fullscreen.html");
328 $page_content = $pgui->showPage();
330 $ep_tpl = new \ilTemplate(
331 "tpl.export_page.html",
336 $ep_tpl->setVariable(
"PAGE_CONTENT", $page_content);
338 $material = $pgui->getExportMaterial();
339 $this->export_material[] = $material;
341 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.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
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.
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
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.