57 $this->
user = $DIC->user();
59 $this->exp_dir = $a_exp_dir;
60 $this->mobs_dir = $a_exp_dir .
"/mobs";
61 $this->files_dir = $a_exp_dir .
"/files";
62 $this->tex_dir = $a_exp_dir .
"/teximg";
63 $this->content_style_dir = $a_exp_dir .
"/content_style";
64 $this->content_style_img_dir = $a_exp_dir .
"/content_style/images";
66 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
67 $this->services_dir = $a_exp_dir .
"/Services";
68 $this->media_service_dir = $this->services_dir .
"/MediaObjects";
70 $this->mp3_dir = $this->media_service_dir .
"/flash_mp3_player";
72 $this->js_dir = $a_exp_dir .
'/js';
73 $this->js_yahoo_dir = $a_exp_dir .
'/js/yahoo';
74 $this->css_dir = $a_exp_dir .
'/css';
84 $this->content_style_id = $a_val;
129 $this->log->debug(
"export styles");
131 include_once
"Services/Style/Content/classes/class.ilObjStyleSheet.php";
135 $cont_stylesheet =
"./Services/COPage/css/content.css";
137 $css = fread(fopen($cont_stylesheet,
'r'), filesize($cont_stylesheet));
138 preg_match_all(
"/url\(([^\)]*)\)/", $css,
$files);
139 foreach (array_unique(
$files[1]) as $fileref) {
140 if (is_file(str_replace(
"..",
".", $fileref))) {
141 copy(str_replace(
"..",
".", $fileref), $this->content_style_img_dir .
"/" . basename($fileref));
143 $css = str_replace($fileref,
"images/" . basename($fileref), $css);
145 fwrite(fopen($this->content_style_dir .
"/content.css",
'w'), $css);
148 $style->writeCSSFile($this->content_style_dir .
"/content.css",
"images");
149 $style->copyImagesToDir($this->content_style_img_dir);
154 copy($syn_stylesheet, $this->exp_dir .
"/syntaxhighlight.css");
167 $this->log->debug(
"export scripts");
170 copy(
'./Services/JavaScript/js/Basic.js', $this->js_dir .
'/Basic.js');
172 copy(
'./Services/UIComponent/Overlay/js/ilOverlay.js', $this->js_dir .
'/ilOverlay.js');
175 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
181 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
184 $this->js_yahoo_dir .
'/yahoo-min.js' 188 $this->js_yahoo_dir .
'/yahoo-dom-event.js' 192 $this->js_yahoo_dir .
'/animation-min.js' 196 $this->js_yahoo_dir .
'/container-min.js' 200 $this->css_dir .
'/container.css' 204 $this->css_dir .
'/yahoo/container.css' 208 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
210 $tfile = $this->exp_dir .
"/" . $f;
215 $tfile = $this->exp_dir .
"/" . $f;
221 './Services/Accordion/js/accordion.js',
222 $this->js_dir .
'/accordion.js' 225 './Services/Accordion/css/accordion.css',
226 $this->css_dir .
'/accordion.css' 231 './Services/COPage/js/ilCOPagePres.js',
232 $this->js_dir .
'/ilCOPagePres.js' 237 './Services/UIComponent/Tooltip/js/ilTooltip.js',
238 $this->js_dir .
'/ilTooltip.js' 242 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
247 './Modules/TestQuestionPool/js/ilMatchingQuestion.js',
248 $this->js_dir .
'/ilMatchingQuestion.js' 251 './Modules/TestQuestionPool/js/ilAssMultipleChoice.js',
252 $this->js_dir .
'/ilAssMultipleChoice.js' 255 './Modules/TestQuestionPool/templates/default/test_javascript.css',
256 $this->css_dir .
'/test_javascript.css' 260 include_once(
"./Services/Link/classes/class.ilLinkifyUtil.php");
262 if (is_int(strpos($p,
"ExtLink"))) {
263 copy($p, $this->js_dir .
'/ilExtLink.js');
265 if (is_int(strpos($p,
"linkify"))) {
266 copy($p, $this->js_dir .
'/linkify.js');
285 $this->log->debug(
"get main template");
287 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
297 $scripts =
array(
"./js/yahoo/yahoo-min.js",
"./js/yahoo/yahoo-dom-event.js",
298 "./js/yahoo/animation-min.js",
"./js/yahoo/container-min.js",
"./js/jquery.js",
299 "./js/Basic.js",
"./js/jquery-ui-min.js",
300 "./js/ilOverlay.js",
"./js/ilCOPagePres.js",
301 "./js/ilTooltip.js",
"./js/maphilight.js",
"./js/ilMatchingQuestion.js",
"./js/ilAssMultipleChoice.js",
302 "./js/ilExtLink.js",
"./js/linkify.js");
312 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
317 foreach ($scripts as $script) {
318 $tpl->setCurrentBlock(
"js_file");
319 $tpl->setVariable(
"JS_FILE", $script);
320 $tpl->parseCurrentBlock();
324 $style_name = $this->
user->prefs[
"style"] .
".css";
325 $css_files =
array(
"./css/container.css",
326 "./content_style/content.css",
"./style/" . $style_name,
"./css/test_javascript.css");
330 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
336 foreach ($css_files as $css) {
337 $tpl->setCurrentBlock(
"css_file");
338 $tpl->setVariable(
"CSS_FILE", $css);
339 $tpl->parseCurrentBlock();
353 $this->log->debug(
"collect page elements");
357 foreach ($pg_mobs as $pg_mob) {
358 $this->mobs[$pg_mob] = $pg_mob;
362 include_once(
"./Modules/File/classes/class.ilObjFile.php");
365 $this->
files[$f] = $f;
369 $skill_tree = $ws_tree = null;
372 foreach ($pcs as $pc) {
374 if ($pc[
"type"] ==
"skmg") {
375 $skill_id = $pc[
"id"];
381 include_once
"Modules/Portfolio/classes/class.ilPortfolioPage.php";
383 $user_id = $page->create_user;
394 include_once
"Services/Skill/classes/class.ilSkillTree.php";
397 include_once
"Services/Skill/classes/class.ilPersonalSkill.php";
399 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
404 include_once(
"./Services/Skill/classes/class.ilVirtualSkillTree.php");
407 $skill_id = (int) $skill_id;
408 include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
410 include_once(
"./Services/Skill/classes/class.ilSkillTemplateReference.php");
411 $tref_id = $skill_id;
414 $b_skills = $vtree->getSubTreeForCSkillId($skill_id .
":" . $tref_id,
true);
416 foreach ($b_skills as $bs) {
418 $level_data = $skill->getLevelData();
419 foreach ($level_data as $k => $v) {
423 foreach ($mat as $item) {
424 $wsp_id = $item[
"wsp_id"];
425 $obj_id = $ws_tree->lookupObjectId($wsp_id);
430 $this->
files[$obj_id] = $obj_id;
434 include_once
"Modules/Test/classes/class.ilObjTestVerification.php";
436 $this->files_direct[$obj_id] =
array($obj->getFilePath(),
437 $obj->getOfflineFilename());
441 include_once
"Modules/Exercise/classes/class.ilObjExerciseVerification.php";
443 $this->files_direct[$obj_id] =
array($obj->getFilePath(),
444 $obj->getOfflineFilename());
448 include_once
"Modules/Course/classes/Verification/class.ilObjCourseVerification.php";
450 $this->files_direct[$obj_id] =
array($obj->getFilePath(),
451 $obj->getOfflineFilename());
455 include_once
"Modules/ScormAicc/classes/Verification/class.ilObjSCORMVerification.php";
457 $this->files_direct[$obj_id] =
array($obj->getFilePath(),
458 $obj->getOfflineFilename());
478 $this->log->debug(
"export page elements");
480 $total = count($this->mobs) + count($this->
files) + count($this->files_direct);
484 $linked_mobs =
array();
485 foreach ($this->mobs as $mob) {
489 if (is_callable($a_update_callback)) {
491 $a_update_callback(
$total, $cnt);
494 $linked_mobs2 =
array();
495 foreach ($linked_mobs as $mob) {
504 if (is_callable($a_update_callback)) {
506 $a_update_callback(
$total, $cnt);
511 foreach ($this->files_direct as $file_id => $attr) {
513 if (is_callable($a_update_callback)) {
515 $a_update_callback(
$total, $cnt);
525 $this->log->debug(
"export html mobs");
528 if (@is_dir($source_dir)) {
530 ilUtil::rCopy($source_dir, $this->mobs_dir .
"/mm_" . $a_mob_id);
534 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
536 if ($mob_obj->hasFullscreenItem()) {
550 "/_xsl" => file_get_contents(
"./Services/COPage/xsl/page.xsl")
552 array(
"mode"=>
"fullscreen")
558 $tpl =
new ilTemplate(
"tpl.fullscreen.html",
true,
true,
"Services/COPage");
560 $tpl->setCurrentBlock(
"ilMedia");
566 $file = $this->exp_dir .
"/fullscreen_" . $a_mob_id .
".html";
567 if (!($fp = @fopen(
$file,
"w+"))) {
568 die(
"<b>Error</b>: Could not open \"" .
$file .
"\" for writing" .
569 " in <b>" . __FILE__ .
"</b> on line <b>" . __LINE__ .
"</b><br />");
578 $linked_mobs = $mob_obj->getLinkedMediaObjects();
579 $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
587 $file_dir = $this->files_dir .
"/file_" . $a_file_id;
590 include_once(
"./Modules/File/classes/class.ilObjFile.php");
591 $file_obj =
new ilObjFile($a_file_id,
false);
592 $source_file = $file_obj->getDirectory($file_obj->getVersion()) .
"/" . $file_obj->getFileName();
593 if (!is_file($source_file)) {
594 $source_file = $file_obj->getDirectory() .
"/" . $file_obj->getFileName();
596 if (is_file($source_file)) {
597 copy($source_file, $file_dir .
"/" . $file_obj->getFileName());
606 $file_dir = $this->files_dir .
"/file_" . $a_file_id;
609 if (is_file($a_source_file)) {
static getLocalCssFiles()
static getCssFilePaths()
Get css file paths.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
setContentStyleId($a_val)
Set content style id.
exportHTMLFile($a_file_id)
Export file object.
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 getLocaljQueryUIPath()
getContentStyleId()
Get content style id.
static getLocalJsPaths()
Get paths of necessary js files.
exportHTMLFileDirect($a_file_id, $a_source_file, $a_file_name)
Export file from path.
getPreparedMainTemplate($a_tpl="")
Get prepared main template.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
Tree handler for personal workspace.
static getLocalJavascriptFiles()
static _lookupType($a_obj_id)
Lookup Type.
static getJsFilePaths()
Get js file paths.
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
__construct($a_exp_dir)
ilCOPageHTMLExport constructor.
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.
static getInstance($a_id=0)
special template class to simplify handling of ITX/PEAR
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 _getFilesOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_usage_lang="-")
get all files of an object
Create styles array
The data for the language used.
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 ...
static getLocalPath($a_name="")
Get local path of a YUI js file.
static getAssignedMaterial($a_user_id, $a_tref_id, $a_level)
Get assigned material (for a skill level and user)
static copyPlayerFilesToTargetDirectory($a_target_dir)
Copy css files to target dir.
collectPageElements($a_type, $a_id)
Collect page elements (that need to be exported separately)
static getLocalMaphilightPath()
Get local path of maphilight file.
static getLogger($a_component_id)
Get component logger.
if(strpos($jquery_path, './')===0) elseif(strpos($jquery_path, '.')===0) $mathJaxSetting
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
exportStyles()
Export content style.
exportHTMLMOB($a_mob_id, &$a_linked_mobs)
Export media object to html.
static getLocaljQueryPath()
static getWebspaceDir($mode="filesystem")
get webspace directory
exportPageElements($a_update_callback=null)
Export page elements.