32 $this->exp_dir = $a_exp_dir;
33 $this->mobs_dir = $a_exp_dir.
"/mobs";
34 $this->files_dir = $a_exp_dir.
"/files";
35 $this->tex_dir = $a_exp_dir.
"/teximg";
36 $this->content_style_dir = $a_exp_dir.
"/content_style";
37 $this->content_style_img_dir = $a_exp_dir.
"/content_style/images";
39 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
40 $this->services_dir = $a_exp_dir.
"/Services";
41 $this->media_service_dir = $this->services_dir.
"/MediaObjects";
43 $this->mp3_dir = $this->media_service_dir.
"/flash_mp3_player";
45 $this->js_dir = $a_exp_dir.
'/js';
46 $this->js_yahoo_dir = $a_exp_dir.
'/js/yahoo';
47 $this->css_dir = $a_exp_dir.
'/css';
59 $this->content_style_id = $a_val;
103 include_once
"Services/Style/classes/class.ilObjStyleSheet.php";
104 $this->log->debug(
"export styles");
109 $cont_stylesheet =
"./Services/COPage/css/content.css";
111 $css = fread(fopen($cont_stylesheet,
'r'),filesize($cont_stylesheet));
112 preg_match_all(
"/url\(([^\)]*)\)/",$css,
$files);
113 foreach (array_unique(
$files[1]) as $fileref)
115 if (is_file(str_replace(
"..",
".", $fileref)))
117 copy(str_replace(
"..",
".", $fileref), $this->content_style_img_dir.
"/".basename($fileref));
119 $css = str_replace($fileref,
"images/".basename($fileref),$css);
121 fwrite(fopen($this->content_style_dir.
"/content.css",
'w'),$css);
126 $style->writeCSSFile($this->content_style_dir.
"/content.css",
"images");
127 $style->copyImagesToDir($this->content_style_img_dir);
132 copy($syn_stylesheet, $this->exp_dir.
"/syntaxhighlight.css");
145 $this->log->debug(
"export scripts");
148 copy(
'./Services/JavaScript/js/Basic.js', $this->js_dir.
'/Basic.js');
150 copy(
'./Services/UIComponent/Overlay/js/ilOverlay.js',$this->js_dir.
'/ilOverlay.js');
153 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
159 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
161 $this->js_yahoo_dir.
'/yahoo-min.js');
163 $this->js_yahoo_dir.
'/yahoo-dom-event.js');
165 $this->js_yahoo_dir.
'/animation-min.js');
167 $this->js_yahoo_dir.
'/container-min.js');
169 $this->css_dir.
'/container.css');
172 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
175 $tfile = $this->exp_dir.
"/".$f;
181 $tfile = $this->exp_dir.
"/".$f;
186 copy(
'./Services/Accordion/js/accordion.js',
187 $this->js_dir.
'/accordion.js');
188 copy(
'./Services/Accordion/css/accordion.css',
189 $this->css_dir.
'/accordion.css');
192 copy(
'./Services/COPage/js/ilCOPagePres.js',
193 $this->js_dir.
'/ilCOPagePres.js');
196 copy(
'./Services/UIComponent/Tooltip/js/ilTooltip.js',
197 $this->js_dir.
'/ilTooltip.js');
200 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
204 copy(
'./Modules/TestQuestionPool/js/ilMatchingQuestion.js',
205 $this->js_dir.
'/ilMatchingQuestion.js');
206 copy(
'./Modules/TestQuestionPool/templates/default/test_javascript.css',
207 $this->css_dir.
'/test_javascript.css');
210 include_once(
"./Services/Link/classes/class.ilLinkifyUtil.php");
213 if (is_int(strpos($p,
"ExtLink")))
215 copy($p, $this->js_dir.
'/ilExtLink.js');
217 if (is_int(strpos($p,
"linkify")))
219 copy($p, $this->js_dir.
'/linkify.js');
240 $this->log->debug(
"get main template");
242 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
255 $scripts = array(
"./js/yahoo/yahoo-min.js",
"./js/yahoo/yahoo-dom-event.js",
256 "./js/yahoo/animation-min.js",
"./js/yahoo/container-min.js",
"./js/jquery.js",
257 "./js/Basic.js",
"./js/jquery-ui-min.js",
258 "./js/ilOverlay.js",
"./js/ilCOPagePres.js",
259 "./js/ilTooltip.js",
"./js/maphilight.js",
"./js/ilMatchingQuestion.js",
260 "./js/ilExtLink.js",
"./js/linkify.js");
271 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
277 foreach ($scripts as $script)
279 $tpl->setCurrentBlock(
"js_file");
280 $tpl->setVariable(
"JS_FILE", $script);
281 $tpl->parseCurrentBlock();
285 $style_name = $ilUser->prefs[
"style"].
".css";
286 $css_files = array(
"./css/container.css",
287 "./content_style/content.css",
"./style/".$style_name,
"./css/test_javascript.css");
291 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
298 foreach ($css_files as $css)
300 $tpl->setCurrentBlock(
"css_file");
301 $tpl->setVariable(
"CSS_FILE", $css);
302 $tpl->parseCurrentBlock();
316 $this->log->debug(
"collect page elements");
320 foreach($pg_mobs as $pg_mob)
322 $this->mobs[$pg_mob] = $pg_mob;
326 include_once(
"./Modules/File/classes/class.ilObjFile.php");
330 $this->files[$f] = $f;
334 $skill_tree = $ws_tree = null;
337 foreach ($pcs as $pc)
340 if ($pc[
"type"] ==
"skmg")
342 $skill_id = $pc[
"id"];
349 include_once
"Modules/Portfolio/classes/class.ilPortfolioPage.php";
351 $user_id = $page->create_user;
364 include_once
"Services/Skill/classes/class.ilSkillTree.php";
367 include_once
"Services/Skill/classes/class.ilPersonalSkill.php";
369 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
374 include_once(
"./Services/Skill/classes/class.ilVirtualSkillTree.php");
377 $skill_id = (int) $skill_id;
378 include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
381 include_once(
"./Services/Skill/classes/class.ilSkillTemplateReference.php");
382 $tref_id = $skill_id;
385 $b_skills = $vtree->getSubTreeForCSkillId($skill_id.
":".$tref_id,
true);
387 foreach ($b_skills as $bs)
390 $level_data = $skill->getLevelData();
391 foreach ($level_data as $k => $v)
397 foreach($mat as $item)
399 $wsp_id = $item[
"wsp_id"];
400 $obj_id = $ws_tree->lookupObjectId($wsp_id);
406 $this->files[$obj_id] = $obj_id;
410 include_once
"Modules/Test/classes/class.ilObjTestVerification.php";
412 $this->files_direct[$obj_id] = array($obj->getFilePath(),
413 $obj->getOfflineFilename());
417 include_once
"Modules/Exercise/classes/class.ilObjExerciseVerification.php";
419 $this->files_direct[$obj_id] = array($obj->getFilePath(),
420 $obj->getOfflineFilename());
424 include_once
"Modules/Course/classes/Verification/class.ilObjCourseVerification.php";
426 $this->files_direct[$obj_id] = array($obj->getFilePath(),
427 $obj->getOfflineFilename());
431 include_once
"Modules/ScormAicc/classes/Verification/class.ilObjSCORMVerification.php";
433 $this->files_direct[$obj_id] = array($obj->getFilePath(),
434 $obj->getOfflineFilename());
455 $this->log->debug(
"export page elements");
457 $total = count($this->mobs) + count($this->files) + count($this->files_direct);
461 $linked_mobs = array();
462 foreach ($this->mobs as $mob)
468 if (is_callable($a_update_callback))
471 $a_update_callback(
$total, $cnt);
474 $linked_mobs2 = array();
475 foreach ($linked_mobs as $mob)
484 foreach ($this->files as
$file)
487 if (is_callable($a_update_callback))
490 $a_update_callback(
$total, $cnt);
495 foreach ($this->files_direct as $file_id => $attr)
498 if (is_callable($a_update_callback))
501 $a_update_callback(
$total, $cnt);
513 $this->log->debug(
"export html mobs");
516 if (@is_dir($source_dir))
519 ilUtil::rCopy($source_dir, $this->mobs_dir.
"/mm_".$a_mob_id);
523 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
525 if ($mob_obj->hasFullscreenItem())
529 $output = xslt_process(
540 "/_xsl" => file_get_contents(
"./Services/COPage/xsl/page.xsl")
542 array(
"mode"=>
"fullscreen"));
547 $tpl =
new ilTemplate(
"tpl.fullscreen.html",
true,
true,
"Services/COPage");
549 $tpl->setCurrentBlock(
"ilMedia");
550 $tpl->setVariable(
"MEDIA_CONTENT", $output);
551 $output = $tpl->get();
555 $file = $this->exp_dir.
"/fullscreen_".$a_mob_id.
".html";
556 if(!($fp = @fopen(
$file,
"w+")))
558 die(
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
559 " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
562 fwrite($fp, $output);
568 $linked_mobs = $mob_obj->getLinkedMediaObjects();
569 $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
577 $file_dir = $this->files_dir.
"/file_".$a_file_id;
580 include_once(
"./Modules/File/classes/class.ilObjFile.php");
581 $file_obj =
new ilObjFile($a_file_id,
false);
582 $source_file = $file_obj->getDirectory($file_obj->getVersion()).
"/".$file_obj->getFileName();
583 if (!is_file($source_file))
585 $source_file = $file_obj->getDirectory().
"/".$file_obj->getFileName();
587 if (is_file($source_file))
589 copy($source_file, $file_dir.
"/".$file_obj->getFileName());
598 $file_dir = $this->files_dir.
"/file_".$a_file_id;
601 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
copyPlayerFilesToTargetDirectory($a_target_dir)
Copy css files to target dir.
if(strpos($jquery_path, './')===0) else if(strpos($jquery_path, '.')===0) $mathJaxSetting
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
getSyntaxStylePath()
get syntax style path
Tree handler for personal workspace.
static getLocalJavascriptFiles()
static _lookupType($a_obj_id)
Lookup Type.
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 getJsFilePaths()
Get js file paths.
__construct($a_exp_dir)
Initialisation.
createDirectories()
Create directories.
getLocaljQueryPath()
Get local path of jQuery file.
static getInstance($a_id=0)
getLocalMaphilightPath()
Get local path of maphilight file.
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 _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)
collectPageElements($a_type, $a_id)
Collect page elements (that need to be exported separately)
getLocaljQueryUIPath()
Get local path of jQuery UI file.
static getLogger($a_component_id)
Get component logger.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
exportStyles()
Export content style.
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.