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.min.js"))) {
266 copy($p, $this->js_dir .
'/linkify.min.js');
268 if (is_int(strpos($p,
"linkify-jquery.min.js"))) {
269 copy($p, $this->js_dir .
'/linkify-jquery.min.js');
288 $this->log->debug(
"get main template");
290 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
300 $scripts = array(
"./js/yahoo/yahoo-min.js",
"./js/yahoo/yahoo-dom-event.js",
301 "./js/yahoo/animation-min.js",
"./js/yahoo/container-min.js",
"./js/jquery.js",
302 "./js/Basic.js",
"./js/jquery-ui-min.js",
303 "./js/ilOverlay.js",
"./js/ilCOPagePres.js",
304 "./js/ilTooltip.js",
"./js/maphilight.js",
"./js/ilMatchingQuestion.js",
"./js/ilAssMultipleChoice.js",
305 "./js/ilExtLink.js",
"./js/linkify.js");
315 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
320 foreach ($scripts as $script) {
321 $tpl->setCurrentBlock(
"js_file");
322 $tpl->setVariable(
"JS_FILE", $script);
323 $tpl->parseCurrentBlock();
327 $style_name = $this->
user->prefs[
"style"] .
".css";
328 $css_files = array(
"./css/container.css",
329 "./content_style/content.css",
"./style/" . $style_name,
"./css/test_javascript.css");
333 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
339 foreach ($css_files as $css) {
340 $tpl->setCurrentBlock(
"css_file");
341 $tpl->setVariable(
"CSS_FILE", $css);
342 $tpl->parseCurrentBlock();
356 $this->log->debug(
"collect page elements");
360 foreach ($pg_mobs as $pg_mob) {
361 $this->mobs[$pg_mob] = $pg_mob;
365 include_once(
"./Modules/File/classes/class.ilObjFile.php");
372 $skill_tree = $ws_tree = null;
375 foreach ($pcs as $pc) {
377 if ($pc[
"type"] ==
"skmg") {
378 $skill_id = $pc[
"id"];
384 include_once
"Modules/Portfolio/classes/class.ilPortfolioPage.php";
386 $user_id = $page->create_user;
397 include_once
"Services/Skill/classes/class.ilSkillTree.php";
400 include_once
"Services/Skill/classes/class.ilPersonalSkill.php";
402 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
407 include_once(
"./Services/Skill/classes/class.ilVirtualSkillTree.php");
410 $skill_id = (int) $skill_id;
411 include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
413 include_once(
"./Services/Skill/classes/class.ilSkillTemplateReference.php");
414 $tref_id = $skill_id;
417 $b_skills = $vtree->getSubTreeForCSkillId($skill_id .
":" . $tref_id,
true);
419 foreach ($b_skills as $bs) {
421 $level_data = $skill->getLevelData();
422 foreach ($level_data as $k => $v) {
426 foreach ($mat as $item) {
427 $wsp_id = $item[
"wsp_id"];
428 $obj_id = $ws_tree->lookupObjectId($wsp_id);
433 $this->
files[$obj_id] = $obj_id;
437 include_once
"Modules/Test/classes/class.ilObjTestVerification.php";
439 $this->files_direct[$obj_id] = array($obj->getFilePath(),
440 $obj->getOfflineFilename());
444 include_once
"Modules/Exercise/classes/class.ilObjExerciseVerification.php";
446 $this->files_direct[$obj_id] = array($obj->getFilePath(),
447 $obj->getOfflineFilename());
451 include_once
"Modules/Course/classes/Verification/class.ilObjCourseVerification.php";
453 $this->files_direct[$obj_id] = array($obj->getFilePath(),
454 $obj->getOfflineFilename());
458 include_once
"Modules/ScormAicc/classes/Verification/class.ilObjSCORMVerification.php";
460 $this->files_direct[$obj_id] = array($obj->getFilePath(),
461 $obj->getOfflineFilename());
481 $this->log->debug(
"export page elements");
483 $total = count($this->mobs) + count($this->
files) + count($this->files_direct);
487 $linked_mobs = array();
488 foreach ($this->mobs as $mob) {
492 if (is_callable($a_update_callback)) {
494 $a_update_callback(
$total, $cnt);
497 $linked_mobs2 = array();
498 foreach ($linked_mobs as $mob) {
505 foreach ($this->
files as $file) {
507 if (is_callable($a_update_callback)) {
509 $a_update_callback(
$total, $cnt);
514 foreach ($this->files_direct as $file_id => $attr) {
516 if (is_callable($a_update_callback)) {
518 $a_update_callback(
$total, $cnt);
528 $this->log->debug(
"export html mobs");
531 if (is_dir($source_dir)) {
533 ilUtil::rCopy($source_dir, $this->mobs_dir .
"/mm_" . $a_mob_id);
537 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
539 if ($mob_obj->hasFullscreenItem()) {
553 "/_xsl" => file_get_contents(
"./Services/COPage/xsl/page.xsl")
555 array(
"mode" =>
"fullscreen")
561 $tpl =
new ilTemplate(
"tpl.fullscreen.html",
true,
true,
"Services/COPage");
563 $tpl->setCurrentBlock(
"ilMedia");
569 $file = $this->exp_dir .
"/fullscreen_" . $a_mob_id .
".html";
570 if (!($fp = @
fopen($file,
"w+"))) {
571 die(
"<b>Error</b>: Could not open \"" . $file .
"\" for writing" .
572 " in <b>" . __FILE__ .
"</b> on line <b>" . __LINE__ .
"</b><br />");
581 $linked_mobs = $mob_obj->getLinkedMediaObjects();
582 $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
590 $file_dir = $this->files_dir .
"/file_" . $a_file_id;
593 include_once(
"./Modules/File/classes/class.ilObjFile.php");
594 $file_obj =
new ilObjFile($a_file_id,
false);
595 $source_file = $file_obj->getDirectory($file_obj->getVersion()) .
"/" . $file_obj->getFileName();
596 if (!is_file($source_file)) {
597 $source_file = $file_obj->getDirectory() .
"/" . $file_obj->getFileName();
599 if (is_file($source_file)) {
600 copy($source_file, $file_dir .
"/" . $file_obj->getFileName());
609 $file_dir = $this->files_dir .
"/file_" . $a_file_id;
612 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.
__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
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
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.