24 $this->portfolio_gui = $a_portfolio_gui;
25 $this->
object = $a_object;
26 $this->export_material =
array();
38 include_once(
"./Services/Export/classes/class.ilExport.php");
42 $this->subdir = $this->
object->getType() .
"_" . $this->
object->getId();
43 $this->export_dir = $exp_dir .
"/" . $this->subdir;
50 include_once(
"./Services/Style/System/classes/class.ilSystemStyleHTMLExport.php");
53 $this->sys_style_html_export->export();
56 include_once(
"./Services/COPage/classes/class.ilCOPageHTMLExport.php");
59 $this->
object->getStyleSheetId(),
60 $this->
object->getType()
62 $this->co_page_html_export->createDirectories();
63 $this->co_page_html_export->exportStyles();
64 $this->co_page_html_export->exportSupportScripts();
68 if ($prfa_set->get(
"banner")) {
69 $banner = $this->
object->getImageFullPath();
71 copy($banner, $this->export_dir .
"/" . basename($banner));
75 $ppic = ilObjUser::_getPersonalPicturePath($this->
object->getOwner(),
"big",
true,
true);
77 $ppic = array_shift(explode(
"?", $ppic));
78 copy($ppic, $this->export_dir .
"/" . basename($ppic));
81 $ppic = ilObjUser::_getPersonalPicturePath($this->
object->getOwner(),
"xsmall",
true,
true);
83 $ppic = array_shift(explode(
"?", $ppic));
84 copy($ppic, $this->export_dir .
"/" . basename($ppic));
92 include_once(
"./Services/UICore/classes/class.ilUIFramework.php");
94 foreach ($this->export_material as $items) {
95 $images = array_merge($images, $items[
"images"]);
97 $js_files = array_merge($js_files, $items[
"js"]);
99 foreach (array_unique($images) as $image) {
100 if (is_file($image)) {
101 copy($image, $this->export_dir .
"/images/" . basename($image));
104 foreach (array_unique($js_files) as $js_file) {
105 if (is_file($js_file)) {
106 copy($js_file, $this->export_dir .
"/js/" . basename($js_file));
110 if (is_file($file)) {
111 copy($file, $this->export_dir .
"/files/" . basename($file));
120 "/" . $date .
"__" . IL_INST_ID .
"__" .
121 $this->
object->getType() .
"_" . $this->
object->getId() .
".zip";
134 require_once
"Modules/Portfolio/classes/class.ilPortfolioPage.php";
137 $this->tabs =
array();
138 foreach ($pages as $page) {
141 include_once
"Modules/Blog/classes/class.ilObjBlog.php";
145 $this->tabs[$page[
"id"]] = $page[
"title"];
149 $tpl_callback =
array($this,
"buildExportTemplate");
151 include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
152 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
153 include_once(
"./Modules/Portfolio/classes/class.ilPortfolioPage.php");
155 foreach ($pages as $page) {
157 $this->active_tab =
"user_page_" . $page[
"id"];
160 $link_template =
"prtf_" . $page[
"id"] .
"_bl{TYPE}_{ID}.html";
162 include_once
"Modules/Blog/classes/class.ilObjBlogGUI.php";
164 $blog->exportHTMLPages($this->export_dir .
"/", $link_template, $tpl_callback, $this->co_page_html_export,
"prtf_" . $page[
"id"] .
".html");
167 $this->co_page_html_export->collectPageElements(
"prtf:pg", $page[
"id"]);
171 if (is_file($this->export_dir .
"/prtf_" . $page[
"id"] .
".html")) {
173 $this->export_dir .
"/prtf_" . $page[
"id"] .
".html",
174 $this->export_dir .
"/index.html" 181 $this->co_page_html_export->exportPageElements();
188 $ilTabs = $DIC->tabs();
190 $this->tpl = $this->co_page_html_export->getPreparedMainTemplate();
191 $this->tpl->getStandardTemplate();
192 $this->tpl->addOnLoadCode(
'il.Tooltip.init();', 3);
195 if (is_array($a_js_files)) {
196 foreach ($a_js_files as $js_file) {
197 $this->tpl->setCurrentBlock(
"js_file");
198 $this->tpl->setVariable(
"JS_FILE", !stristr($js_file,
"://")
199 ?
"./js/" . basename($js_file)
201 $this->tpl->parseCurrentBlock();
206 $this->tpl->setVariable(
"MAINMENU",
"<div style='min-height:40px;'></div>");
207 $this->tpl->setTitle($this->
object->getTitle());
209 $ilTabs->clearTargets();
211 foreach ($this->tabs as
$id => $caption) {
212 $ilTabs->addTab(
"user_page_" .
$id, $caption,
"prtf_" .
$id .
".html");
215 $ilTabs->activateTab($this->active_tab);
218 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioGUI.php";
226 $file = $this->export_dir .
"/" . $a_file;
228 if (@is_file(
$file)) {
234 "tpl.export_page.html",
239 $ep_tpl->setVariable(
"PAGE_CONTENT",
$a_content);
242 $this->tpl->setContent($ep_tpl->get());
244 if (is_array($a_onload)) {
245 foreach ($a_onload as $item) {
246 $this->tpl->addOnLoadCode($item);
251 $content = $this->tpl->get(
262 if (!file_put_contents(
$file, $content)) {
263 die(
"<b>Error</b>: Could not open \"" .
$file .
"\" for writing" .
264 " in <b>" . __FILE__ .
"</b> on line <b>" . __LINE__ .
"</b><br />");
279 include_once
"Modules/Portfolio/classes/class.ilPortfolioPageGUI.php";
282 $pgui->setFullscreenLink(
"fullscreen.html");
283 $page_content = $pgui->showPage();
285 $material = $pgui->getExportMaterial();
286 $this->export_material[] = $material;
288 include_once(
"./Services/UICore/classes/class.ilUIFramework.php");
291 $this->
writeExportFile(
"prtf_" . $a_post_id .
".html", $page_content, $pgui->getJsOnloadCode(), $js_files);
static _createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
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)
Portfolio HTML exporter class.
exportHTMLPages()
Export all pages.
HTML export class for pages.
static getJSFiles()
Get javascript files.
HTML export class for system styles.
if(!array_key_exists('StateId', $_REQUEST)) $id
__construct($a_portfolio_gui, $a_object)
Constructor.
Portfolio page gui class.
writeExportFile($a_file, $a_content, $a_onload=null, $a_js_files=null)
buildExportFile()
Build export file.
special template class to simplify handling of ITX/PEAR
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
Create styles array
The data for the language used.
const WORKSPACE_OBJECT_ID
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
exportPageHTML($a_post_id)
Export page html.
static renderFullscreenHeader($a_portfolio, $a_tpl, $a_user_id, $a_export=false)
Render banner, user name.
Create new PHPExcel object
obj_idprivate
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
buildExportTemplate(array $a_js_files=null)
setOutputMode($a_mode=IL_PAGE_PRESENTATION)
Set Output Mode.