87 $this->
user = $DIC->user();
88 $this->global_screen = $DIC->globalScreen();
89 $this->page_linker = is_null($linker)
94 $this->exp_dir = $a_exp_dir;
95 $this->mobs_dir = $a_exp_dir .
"/mobs";
96 $this->files_dir = $a_exp_dir .
"/files";
97 $this->tex_dir = $a_exp_dir .
"/teximg";
98 $this->content_style_dir = $a_exp_dir .
"/content_style";
99 $this->content_style_img_dir = $a_exp_dir .
"/content_style/images";
101 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
102 $this->services_dir = $a_exp_dir .
"/Services";
103 $this->media_service_dir = $this->services_dir .
"/MediaObjects";
105 $this->mp3_dir = $this->media_service_dir .
"/flash_mp3_player";
107 $this->js_dir = $a_exp_dir .
'/js';
108 $this->js_yahoo_dir = $a_exp_dir .
'/js/yahoo';
109 $this->css_dir = $a_exp_dir .
'/css';
119 $this->content_style_id = $a_val;
165 $this->log->debug(
"export styles");
171 copy(
"Services/COPage/css/content.css", $this->exp_dir .
"/Services/COPage/css/content.css");
174 $style->copyImagesToDir($this->exp_dir .
"/" . $style->getImagesDirectory());
196 $this->log->debug(
"export scripts");
200 foreach ($collector->getJavascriptFiles() as $js) {
204 foreach ($collector->getCssFiles() as $css) {
241 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
253 if (is_int(strpos($file,
"?"))) {
254 $file = substr($file, 0, strpos($file,
"?"));
256 if (is_file($file)) {
257 $dir = dirname($file);
259 if (!is_file($target_dir .
"/" . $file)) {
260 copy($file, $target_dir .
"/" . $file);
275 $this->log->debug(
"get main template");
279 $resource_injector = new \ILIAS\COPage\ResourcesInjector($resource_collector);
282 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
309 $resource_injector->inject(
$tpl);
322 $this->log->debug(
"collect page elements");
332 foreach ($pcs as $pc) {
334 if ($pc[
"type"] ==
"incl") {
344 $this->int_links = array_merge($this->int_links, $pg_links);
345 $this->glossary_terms = [];
348 foreach ($this->int_links as $int_link) {
349 if ($int_link[
"type"] ==
"git") {
350 $this->glossary_terms[] = $int_link[
"id"];
353 foreach ($defs as $def) {
356 "id" => $def[
"obj_id"]
363 foreach ($pages as $page) {
364 $page_id = $page[
"id"];
365 $page_type = $page[
"type"];
369 foreach ($pg_mobs as $pg_mob) {
370 $this->mobs[$pg_mob] = $pg_mob;
372 " due to page $page_id, $page_type ).");
376 $files = ilObjFile::_getFilesOfObject($page_type, $page_id, 0,
$lang);
378 $this->files[
$f] =
$f;
383 foreach (
$q_ids as $q_id) {
384 $this->q_ids[$q_id] = $q_id;
389 $skill_tree = $ws_tree = null;
392 foreach ($pcs as $pc) {
393 if ($pc[
"type"] ==
"skmg") {
394 $skill_id = $pc[
"id"];
400 include_once
"Modules/Portfolio/classes/class.ilPortfolioPage.php";
402 $user_id = $page->create_user;
421 $skill_id = (int) $skill_id;
423 $tref_id = $skill_id;
426 $b_skills = $vtree->getSubTreeForCSkillId($skill_id .
":" . $tref_id,
true);
428 foreach ($b_skills as $bs) {
430 $level_data = $skill->getLevelData();
431 foreach ($level_data as $k => $v) {
435 foreach ($mat as $item) {
436 $wsp_id = $item[
"wsp_id"];
437 $obj_id = $ws_tree->lookupObjectId($wsp_id);
442 $this->files[$obj_id] = $obj_id;
446 include_once
"Modules/Test/classes/class.ilObjTestVerification.php";
448 $this->files_direct[$obj_id] = array($obj->getFilePath(),
449 $obj->getOfflineFilename());
453 include_once
"Modules/Exercise/classes/class.ilObjExerciseVerification.php";
455 $this->files_direct[$obj_id] = array($obj->getFilePath(),
456 $obj->getOfflineFilename());
460 include_once
"Modules/Course/classes/Verification/class.ilObjCourseVerification.php";
462 $this->files_direct[$obj_id] = array($obj->getFilePath(),
463 $obj->getOfflineFilename());
468 $this->files_direct[$obj_id] = array($obj->getFilePath(),
469 $obj->getOfflineFilename());
474 $this->files_direct[$obj_id] = array($obj->getFilePath(),
475 $obj->getOfflineFilename());
479 include_once
"Modules/ScormAicc/classes/Verification/class.ilObjSCORMVerification.php";
481 $this->files_direct[$obj_id] = array($obj->getFilePath(),
482 $obj->getOfflineFilename());
502 $this->log->debug(
"export page elements");
504 $total = count($this->mobs) + count($this->files) + count($this->files_direct);
508 $linked_mobs = array();
509 foreach ($this->mobs as $mob) {
513 if (is_callable($a_update_callback)) {
515 $a_update_callback(
$total, $cnt);
518 $linked_mobs2 = array();
519 foreach ($linked_mobs as $mob) {
526 foreach ($this->files as $file) {
528 if (is_callable($a_update_callback)) {
530 $a_update_callback(
$total, $cnt);
535 foreach ($this->files_direct as $file_id => $attr) {
537 if (is_callable($a_update_callback)) {
539 $a_update_callback(
$total, $cnt);
557 $this->global_screen->layout()->meta()->reset();
571 $this->log->debug(
"export html mobs");
574 if (is_dir($source_dir)) {
576 ilUtil::rCopy($source_dir, $this->mobs_dir .
"/mm_" . $a_mob_id);
583 $link_xml = $this->page_linker->getLinkXML($med_links);
588 'fullscreen_link' => $this->page_linker->getFullScreenLink(
"fullscreen")
590 if ($this->ref_id > 0) {
595 $tpl->setVariable(
"MEDIA_CONTENT", $this->
renderMob($mob_obj, $link_xml, $params));
596 $html =
$tpl->printToString();
597 $file = $this->exp_dir .
"/media_" . $a_mob_id .
".html";
598 $fp = fopen($file,
"w+");
603 if ($mob_obj->hasFullscreenItem()) {
605 $params[
"mode"] =
"fullscreen";
606 $tpl->setVariable(
"MEDIA_CONTENT", $this->
renderMob($mob_obj, $link_xml, $params));
607 $html =
$tpl->printToString();
608 $file = $this->exp_dir .
"/fullscreen_" . $a_mob_id .
".html";
609 $fp = fopen($file,
"w+");
615 $linked_mobs = $mob_obj->getLinkedMediaObjects();
616 $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
630 $output = xslt_process(
642 "/_xsl" => file_get_contents(
"./Services/COPage/xsl/page.xsl")
657 $file_dir = $this->files_dir .
"/file_" . $a_file_id;
660 include_once(
"./Modules/File/classes/class.ilObjFile.php");
661 $file_obj =
new ilObjFile($a_file_id,
false);
662 $source_file = $file_obj->getFile($file_obj->getVersion());
663 if (!is_file($source_file)) {
664 $source_file = $file_obj->getFile();
666 if (is_file($source_file)) {
667 copy($source_file, $file_dir .
"/" . $file_obj->getFileName());
676 $file_dir = $this->files_dir .
"/file_" . $a_file_id;
679 if (is_file($a_source_file)) {
693 if (count($this->q_ids) > 0) {
694 foreach ($this->q_ids as $q_id) {
698 $this->exp_dir .
"/assessment/0/" . $q_id .
"/images" 710 foreach ($this->glossary_terms as $term_id) {
714 $term_gui->setPageLinker($this->page_linker);
715 $term_gui->setOfflineDirectory($this->exp_dir);
716 $term_gui->output(
true,
$tpl);
719 $html =
$tpl->printToString();
720 $file = $this->exp_dir .
"/term_" . $term_id .
".html";
721 $fp = fopen($file,
"w+");
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static makeDirParents($a_dir)
Create a new directory and all parent directories.
setContentStyleId($a_val)
Set content style id.
renderMob(\ilObjMediaObject $mob_obj, string $link_xml, array $params)
Render Mob.
static getDefinitionList($a_term_id)
static
static _getQuestionIdsForPage($a_parent_type, $a_page_id, $a_lang="-")
Get all questions of a page.
exportHTMLFile($a_file_id)
Export file object.
special template class to simplify handling of ITX/PEAR
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
HTML export class for pages.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
Class ChatMainBarProvider .
getContentStyleId()
Get content style id.
if(strpos($jquery_path, './')===0) elseif(strpos($jquery_path, '.')===0) $mathJaxSetting
initResourceTemplate($tempalate_file)
Get resource template.
static _lookupTitle($a_id)
lookup object title
exportHTMLFileDirect($a_file_id, $a_source_file, $a_file_name)
Export file from path.
exportHTMLGlossaryTerms()
Export glossary terms.
getPreparedMainTemplate($a_tpl="")
Get prepared main template.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
static getBasicImageDir()
Get basic image dir.
Tree handler for personal workspace.
static _lookupType($a_obj_id)
Lookup Type.
static getJsFilePaths()
Get js file paths.
createDirectories()
Create directories.
static getUsagesOfPage($a_usage_id, $a_usage_type, $a_hist_nr=0, $a_all_hist_nrs=false, $a_lang="-")
Get page content usages for page.
collectPageElements($a_type, $a_id, $lang="")
Collect page elements (that need to be exported separately)
Class ilGlobalPageTemplate.
static getInstance($a_id=0)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
GUI class for glossary terms.
static getFlashVideoPlayerDirectory()
Get flash video player directory.
exportSupportScripts()
Export support scripts.
static _lookupTemplateId($a_obj_id)
Lookup template ID.
static getSyntaxStylePath()
get syntax style path
static _getTargetsOfSource($a_source_type, $a_source_id, $a_source_lang="-")
Get all targets of a source object (e.g., a page)
static _lookupType($a_id, $a_reference=false)
lookup object type
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
exportResourceFile(string $target_dir, string $file)
Export resource file.
static getAssignedMaterial($a_user_id, $a_tref_id, $a_level)
Get assigned material (for a skill level and user)
__construct($a_exp_dir, \ILIAS\COPage\PageLinker $linker=null, $ref_id=0)
ilCOPageHTMLExport constructor.
static copyPlayerFilesToTargetDirectory($a_target_dir)
Copy css files to target dir.
static getLogger($a_component_id)
Get component logger.
exportStyles()
Export content style.
exportQuestionFiles()
Export question images.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
exportHTMLMOB($a_mob_id, &$a_linked_mobs)
Export media object to html.
static getWebspaceDir($mode="filesystem")
get webspace directory
exportPageElements($a_update_callback=null)
Export page elements.