25                $this->portfolio_gui = $a_portfolio_gui;
 
   26                $this->
object = $a_object;
 
   27                $this->export_material = array(); 
 
   41                include_once(
"./Services/Export/classes/class.ilExport.php");
 
   45                $this->subdir = $this->
object->getType().
"_".$this->
object->getId();
 
   46                $this->export_dir = $exp_dir.
"/".$this->subdir;
 
   53                include_once(
"./Services/Style/System/classes/class.ilSystemStyleHTMLExport.php");
 
   56                $this->sys_style_html_export->export();
 
   59                include_once(
"./Services/COPage/classes/class.ilCOPageHTMLExport.php");
 
   61                $this->co_page_html_export->setContentStyleId($this->object->getStyleSheetId()); 
 
   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"))
 
   70                        $banner = $this->
object->getImageFullPath();
 
   73                                copy($banner, $this->export_dir.
"/".basename($banner));
 
   80                        $ppic = array_shift(explode(
"?", $ppic));
 
   81                        copy($ppic, $this->export_dir.
"/".basename($ppic));
 
   87                        $ppic = array_shift(explode(
"?", $ppic));
 
   88                        copy($ppic, $this->export_dir.
"/".basename($ppic));
 
   95                $images = 
$files = $js_files = array();
 
   96                include_once(
"./Services/UICore/classes/class.ilUIFramework.php");
 
   98                foreach($this->export_material as $items)
 
  100                        $images = array_merge($images, $items[
"images"]);
 
  102                        $js_files = array_merge($js_files, $items[
"js"]);
 
  104                foreach(array_unique($images) as $image)
 
  108                                copy($image, $this->export_dir.
"/images/".basename($image));
 
  111                foreach(array_unique($js_files) as $js_file)
 
  113                        if(is_file($js_file))
 
  115                                copy($js_file, $this->export_dir.
"/js/".basename($js_file));
 
  122                                copy(
$file, $this->export_dir.
"/files/".basename(
$file));
 
  132                                "/".$date.
"__".IL_INST_ID.
"__".
 
  133                                $this->
object->getType().
"_".$this->
object->getId().
".zip";
 
  148                require_once 
"Modules/Portfolio/classes/class.ilPortfolioPage.php";
 
  151                $this->tabs = array();
 
  152                foreach($pages as $page)
 
  157                                include_once 
"Modules/Blog/classes/class.ilObjBlog.php";
 
  161                        $this->tabs[$page[
"id"]] = $page[
"title"];
 
  165                $tpl_callback = array($this, 
"buildExportTemplate");
 
  167                include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
 
  168                include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
  169                include_once(
"./Modules/Portfolio/classes/class.ilPortfolioPage.php");
 
  171                foreach ($pages as $page)
 
  175                                $this->active_tab = 
"user_page_".$page[
"id"];
 
  179                                        $link_template = 
"prtf_".$page[
"id"].
"_bl{TYPE}_{ID}.html";
 
  181                                        include_once 
"Modules/Blog/classes/class.ilObjBlogGUI.php";
 
  183                                        $blog->exportHTMLPages($this->export_dir.
"/", $link_template, $tpl_callback, $this->co_page_html_export, 
"prtf_".$page[
"id"].
".html");
 
  188                                        $this->co_page_html_export->collectPageElements(
"prtf:pg", $page[
"id"]);
 
  193                                        if (is_file($this->export_dir.
"/prtf_".$page[
"id"].
".html"))    
 
  195                                                copy($this->export_dir . 
"/prtf_" . $page[
"id"] . 
".html",
 
  196                                                        $this->export_dir . 
"/index.html");
 
  202                $this->co_page_html_export->exportPageElements();
 
  209                $this->tpl = $this->co_page_html_export->getPreparedMainTemplate();             
 
  210                $this->tpl->getStandardTemplate();
 
  211                $this->tpl->addOnLoadCode(
'il.Tooltip.init();', 3);
 
  214                if(is_array($a_js_files))
 
  216                        foreach($a_js_files as $js_file)
 
  218                                $this->tpl->setCurrentBlock(
"js_file");
 
  219                                $this->tpl->setVariable(
"JS_FILE", !stristr($js_file, 
"://")
 
  220                                        ? 
"./js/".basename($js_file)
 
  222                                $this->tpl->parseCurrentBlock();
 
  227                $this->tpl->setVariable(
"MAINMENU", 
"<div style='min-height:40px;'></div>");
 
  228                $this->tpl->setTitle($this->object->getTitle());
 
  230                $ilTabs->clearTargets();
 
  233                        foreach($this->tabs as $id => $caption)
 
  235                                $ilTabs->addTab(
"user_page_".$id, $caption, 
"prtf_".$id.
".html");
 
  238                        $ilTabs->activateTab($this->active_tab);
 
  241                include_once 
"Modules/Portfolio/classes/class.ilObjPortfolioGUI.php";
 
  249                $file = $this->export_dir.
"/".$a_file;
 
  257                $ep_tpl = 
new ilTemplate(
"tpl.export_page.html", 
true, 
true,
 
  258                        "Modules/Portfolio");
 
  259                $ep_tpl->setVariable(
"PAGE_CONTENT", 
$a_content);               
 
  262                $this->tpl->setContent($ep_tpl->get());
 
  264                if(is_array($a_onload))
 
  266                        foreach($a_onload as $item)
 
  268                                $this->tpl->addOnLoadCode($item);
 
  273                $content = $this->tpl->get(
"DEFAULT", 
false, 
false, 
false,
 
  277                if (!file_put_contents(
$file, $content))
 
  279                        die (
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
 
  280                                        " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
 
  297                include_once 
"Modules/Portfolio/classes/class.ilPortfolioPageGUI.php";
 
  299                $pgui->setOutputMode(
"offline");
 
  300                $pgui->setFullscreenLink(
"fullscreen.html"); 
 
  301                $page_content = $pgui->showPage();
 
  303                $material = $pgui->getExportMaterial();
 
  304                $this->export_material[] = $material;
 
  306                include_once(
"./Services/UICore/classes/class.ilUIFramework.php");
 
  309                $this->
writeExportFile(
"prtf_".$a_post_id.
".html", $page_content, $pgui->getJsOnloadCode(), $js_files);
 
An exception for terminatinating execution or to throw for unit testing.
HTML export class for pages.
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
static _createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
static renderFullscreenHeader($a_portfolio, $a_tpl, $a_user_id, $a_export=false)
Render banner, user name.
static _getPersonalPicturePath($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
const WORKSPACE_OBJECT_ID
static _lookupTitle($a_id)
lookup object title
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
Portfolio HTML exporter class.
buildExportFile()
Build export file.
buildExportTemplate(array $a_js_files=null)
__construct($a_portfolio_gui, $a_object)
Constructor.
exportHTMLPages()
Export all pages.
exportPageHTML($a_post_id)
Export page html.
writeExportFile($a_file, $a_content, $a_onload=null, $a_js_files=null)
Portfolio page gui class.
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
HTML export class for system styles.
special template class to simplify handling of ITX/PEAR
static getJSFiles()
Get javascript files.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static zip($a_dir, $a_file, $compress_content=false)
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file