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());
194 $this->log->debug(
"export scripts");
198 foreach ($collector->getJavascriptFiles() as $js) {
202 foreach ($collector->getCssFiles() as $css) {
239 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
251 if (is_int(strpos($file,
"?"))) {
252 $file = substr($file, 0, strpos($file,
"?"));
254 if (is_file($file)) {
255 $dir = dirname($file);
257 if (!is_file($target_dir .
"/" . $file)) {
258 copy($file, $target_dir .
"/" . $file);
273 $this->log->debug(
"get main template");
277 $resource_injector = new \ILIAS\COPage\ResourcesInjector($resource_collector);
280 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
307 $resource_injector->inject(
$tpl);
320 $this->log->debug(
"collect page elements");
330 foreach ($pcs as $pc) {
332 if ($pc[
"type"] ==
"incl") {
342 $this->int_links = array_merge($this->int_links, $pg_links);
343 $this->glossary_terms = [];
346 foreach ($this->int_links as $int_link) {
347 if ($int_link[
"type"] ==
"git") {
348 $this->glossary_terms[] = $int_link[
"id"];
351 foreach ($defs as $def) {
354 "id" => $def[
"obj_id"]
361 foreach ($pages as $page) {
362 $page_id = $page[
"id"];
363 $page_type = $page[
"type"];
367 foreach ($pg_mobs as $pg_mob) {
368 $this->mobs[$pg_mob] = $pg_mob;
370 " due to page $page_id, $page_type ).");
376 $this->files[
$f] =
$f;
381 foreach (
$q_ids as $q_id) {
382 $this->q_ids[$q_id] = $q_id;
387 $skill_tree = $ws_tree = null;
390 foreach ($pcs as $pc) {
391 if ($pc[
"type"] ==
"skmg") {
392 $skill_id = $pc[
"id"];
398 include_once
"Modules/Portfolio/classes/class.ilPortfolioPage.php";
400 $user_id = $page->create_user;
411 include_once
"Services/Skill/classes/class.ilSkillTree.php";
414 include_once
"Services/Skill/classes/class.ilPersonalSkill.php";
416 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
421 include_once(
"./Services/Skill/classes/class.ilVirtualSkillTree.php");
424 $skill_id = (int) $skill_id;
425 include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
427 include_once(
"./Services/Skill/classes/class.ilSkillTemplateReference.php");
428 $tref_id = $skill_id;
431 $b_skills = $vtree->getSubTreeForCSkillId($skill_id .
":" . $tref_id,
true);
433 foreach ($b_skills as $bs) {
435 $level_data = $skill->getLevelData();
436 foreach ($level_data as $k => $v) {
440 foreach ($mat as $item) {
441 $wsp_id = $item[
"wsp_id"];
442 $obj_id = $ws_tree->lookupObjectId($wsp_id);
447 $this->files[$obj_id] = $obj_id;
451 include_once
"Modules/Test/classes/class.ilObjTestVerification.php";
453 $this->files_direct[$obj_id] = array($obj->getFilePath(),
454 $obj->getOfflineFilename());
458 include_once
"Modules/Exercise/classes/class.ilObjExerciseVerification.php";
460 $this->files_direct[$obj_id] = array($obj->getFilePath(),
461 $obj->getOfflineFilename());
465 include_once
"Modules/Course/classes/Verification/class.ilObjCourseVerification.php";
467 $this->files_direct[$obj_id] = array($obj->getFilePath(),
468 $obj->getOfflineFilename());
473 $this->files_direct[$obj_id] = array($obj->getFilePath(),
474 $obj->getOfflineFilename());
479 $this->files_direct[$obj_id] = array($obj->getFilePath(),
480 $obj->getOfflineFilename());
484 include_once
"Modules/ScormAicc/classes/Verification/class.ilObjSCORMVerification.php";
486 $this->files_direct[$obj_id] = array($obj->getFilePath(),
487 $obj->getOfflineFilename());
507 $this->log->debug(
"export page elements");
509 $total = count($this->mobs) + count($this->files) + count($this->files_direct);
513 $linked_mobs = array();
514 foreach ($this->mobs as $mob) {
518 if (is_callable($a_update_callback)) {
520 $a_update_callback(
$total, $cnt);
523 $linked_mobs2 = array();
524 foreach ($linked_mobs as $mob) {
531 foreach ($this->files as $file) {
533 if (is_callable($a_update_callback)) {
535 $a_update_callback(
$total, $cnt);
540 foreach ($this->files_direct as $file_id => $attr) {
542 if (is_callable($a_update_callback)) {
544 $a_update_callback(
$total, $cnt);
560 $this->global_screen->layout()->meta()->reset();
574 $this->log->debug(
"export html mobs");
577 if (is_dir($source_dir)) {
579 ilUtil::rCopy($source_dir, $this->mobs_dir .
"/mm_" . $a_mob_id);
586 $link_xml = $this->page_linker->getLinkXML($med_links);
591 'fullscreen_link' => $this->page_linker->getFullScreenLink(
"fullscreen")
593 if ($this->ref_id > 0) {
598 $tpl->setVariable(
"MEDIA_CONTENT", $this->
renderMob($mob_obj, $link_xml, $params));
599 $html =
$tpl->printToString();
600 $file = $this->exp_dir .
"/media_" . $a_mob_id .
".html";
601 $fp = fopen($file,
"w+");
606 if ($mob_obj->hasFullscreenItem()) {
608 $params[
"mode"] =
"fullscreen";
609 $tpl->setVariable(
"MEDIA_CONTENT", $this->
renderMob($mob_obj, $link_xml, $params));
610 $html =
$tpl->printToString();
611 $file = $this->exp_dir .
"/fullscreen_" . $a_mob_id .
".html";
612 $fp = fopen($file,
"w+");
618 $linked_mobs = $mob_obj->getLinkedMediaObjects();
619 $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
633 $output = xslt_process(
645 "/_xsl" => file_get_contents(
"./Services/COPage/xsl/page.xsl")
660 $file_dir = $this->files_dir .
"/file_" . $a_file_id;
663 include_once(
"./Modules/File/classes/class.ilObjFile.php");
664 $file_obj =
new ilObjFile($a_file_id,
false);
665 $source_file = $file_obj->getDirectory($file_obj->getVersion()) .
"/" . $file_obj->getFileName();
666 if (!is_file($source_file)) {
667 $source_file = $file_obj->getDirectory() .
"/" . $file_obj->getFileName();
669 if (is_file($source_file)) {
670 copy($source_file, $file_dir .
"/" . $file_obj->getFileName());
679 $file_dir = $this->files_dir .
"/file_" . $a_file_id;
682 if (is_file($a_source_file)) {
696 if (count($this->q_ids) > 0) {
697 foreach ($this->q_ids as $q_id) {
701 $this->exp_dir .
"/assessment/0/" . $q_id .
"/images" 713 foreach ($this->glossary_terms as $term_id) {
717 $term_gui->setPageLinker($this->page_linker);
718 $term_gui->setOfflineDirectory($this->exp_dir);
719 $term_gui->output(
true,
$tpl);
722 $html =
$tpl->printToString();
723 $file = $this->exp_dir .
"/term_" . $term_id .
".html";
724 $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.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
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 _getFilesOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_usage_lang="-")
get all files of an object
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.
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.