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;
104 $this->log->debug(
"export styles");
106 include_once
"Services/Style/Content/classes/class.ilObjStyleSheet.php";
111 $cont_stylesheet =
"./Services/COPage/css/content.css";
113 $css = fread(fopen($cont_stylesheet,
'r'),filesize($cont_stylesheet));
114 preg_match_all(
"/url\(([^\)]*)\)/",$css,
$files);
115 foreach (array_unique(
$files[1]) as $fileref)
117 if (is_file(str_replace(
"..",
".", $fileref)))
119 copy(str_replace(
"..",
".", $fileref), $this->content_style_img_dir.
"/".basename($fileref));
121 $css = str_replace($fileref,
"images/".basename($fileref),$css);
123 fwrite(fopen($this->content_style_dir.
"/content.css",
'w'),$css);
128 $style->writeCSSFile($this->content_style_dir.
"/content.css",
"images");
129 $style->copyImagesToDir($this->content_style_img_dir);
134 copy($syn_stylesheet, $this->exp_dir.
"/syntaxhighlight.css");
147 $this->log->debug(
"export scripts");
150 copy(
'./Services/JavaScript/js/Basic.js', $this->js_dir.
'/Basic.js');
152 copy(
'./Services/UIComponent/Overlay/js/ilOverlay.js',$this->js_dir.
'/ilOverlay.js');
155 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
161 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
163 $this->js_yahoo_dir.
'/yahoo-min.js');
165 $this->js_yahoo_dir.
'/yahoo-dom-event.js');
167 $this->js_yahoo_dir.
'/animation-min.js');
169 $this->js_yahoo_dir.
'/container-min.js');
171 $this->css_dir.
'/container.css');
174 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
177 $tfile = $this->exp_dir.
"/".$f;
183 $tfile = $this->exp_dir.
"/".$f;
188 copy(
'./Services/Accordion/js/accordion.js',
189 $this->js_dir.
'/accordion.js');
190 copy(
'./Services/Accordion/css/accordion.css',
191 $this->css_dir.
'/accordion.css');
194 copy(
'./Services/COPage/js/ilCOPagePres.js',
195 $this->js_dir.
'/ilCOPagePres.js');
198 copy(
'./Services/UIComponent/Tooltip/js/ilTooltip.js',
199 $this->js_dir.
'/ilTooltip.js');
202 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
206 copy(
'./Modules/TestQuestionPool/js/ilMatchingQuestion.js',
207 $this->js_dir.
'/ilMatchingQuestion.js');
208 copy(
'./Modules/TestQuestionPool/js/ilAssMultipleChoice.js',
209 $this->js_dir.
'/ilAssMultipleChoice.js');
210 copy(
'./Modules/TestQuestionPool/templates/default/test_javascript.css',
211 $this->css_dir.
'/test_javascript.css');
214 include_once(
"./Services/Link/classes/class.ilLinkifyUtil.php");
217 if (is_int(strpos($p,
"ExtLink")))
219 copy($p, $this->js_dir.
'/ilExtLink.js');
221 if (is_int(strpos($p,
"linkify")))
223 copy($p, $this->js_dir.
'/linkify.js');
244 $this->log->debug(
"get main template");
246 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
259 $scripts =
array(
"./js/yahoo/yahoo-min.js",
"./js/yahoo/yahoo-dom-event.js",
260 "./js/yahoo/animation-min.js",
"./js/yahoo/container-min.js",
"./js/jquery.js",
261 "./js/Basic.js",
"./js/jquery-ui-min.js",
262 "./js/ilOverlay.js",
"./js/ilCOPagePres.js",
263 "./js/ilTooltip.js",
"./js/maphilight.js",
"./js/ilMatchingQuestion.js",
"./js/ilAssMultipleChoice.js",
264 "./js/ilExtLink.js",
"./js/linkify.js");
275 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
281 foreach ($scripts as $script)
283 $tpl->setCurrentBlock(
"js_file");
284 $tpl->setVariable(
"JS_FILE", $script);
285 $tpl->parseCurrentBlock();
289 $style_name = $ilUser->prefs[
"style"].
".css";
290 $css_files =
array(
"./css/container.css",
291 "./content_style/content.css",
"./style/".$style_name,
"./css/test_javascript.css");
295 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
302 foreach ($css_files as $css)
304 $tpl->setCurrentBlock(
"css_file");
305 $tpl->setVariable(
"CSS_FILE", $css);
306 $tpl->parseCurrentBlock();
320 $this->log->debug(
"collect page elements");
324 foreach($pg_mobs as $pg_mob)
326 $this->mobs[$pg_mob] = $pg_mob;
330 include_once(
"./Modules/File/classes/class.ilObjFile.php");
334 $this->
files[$f] = $f;
338 $skill_tree = $ws_tree = null;
341 foreach ($pcs as $pc)
344 if ($pc[
"type"] ==
"skmg")
346 $skill_id = $pc[
"id"];
353 include_once
"Modules/Portfolio/classes/class.ilPortfolioPage.php";
355 $user_id = $page->create_user;
368 include_once
"Services/Skill/classes/class.ilSkillTree.php";
371 include_once
"Services/Skill/classes/class.ilPersonalSkill.php";
373 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
378 include_once(
"./Services/Skill/classes/class.ilVirtualSkillTree.php");
381 $skill_id = (int) $skill_id;
382 include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
385 include_once(
"./Services/Skill/classes/class.ilSkillTemplateReference.php");
386 $tref_id = $skill_id;
389 $b_skills = $vtree->getSubTreeForCSkillId($skill_id.
":".$tref_id,
true);
391 foreach ($b_skills as $bs)
394 $level_data = $skill->getLevelData();
395 foreach ($level_data as $k => $v)
401 foreach($mat as $item)
403 $wsp_id = $item[
"wsp_id"];
404 $obj_id = $ws_tree->lookupObjectId($wsp_id);
410 $this->
files[$obj_id] = $obj_id;
414 include_once
"Modules/Test/classes/class.ilObjTestVerification.php";
416 $this->files_direct[$obj_id] =
array($obj->getFilePath(),
417 $obj->getOfflineFilename());
421 include_once
"Modules/Exercise/classes/class.ilObjExerciseVerification.php";
423 $this->files_direct[$obj_id] =
array($obj->getFilePath(),
424 $obj->getOfflineFilename());
428 include_once
"Modules/Course/classes/Verification/class.ilObjCourseVerification.php";
430 $this->files_direct[$obj_id] =
array($obj->getFilePath(),
431 $obj->getOfflineFilename());
435 include_once
"Modules/ScormAicc/classes/Verification/class.ilObjSCORMVerification.php";
437 $this->files_direct[$obj_id] =
array($obj->getFilePath(),
438 $obj->getOfflineFilename());
459 $this->log->debug(
"export page elements");
461 $total = count($this->mobs) + count($this->
files) + count($this->files_direct);
465 $linked_mobs =
array();
466 foreach ($this->mobs as $mob)
472 if (is_callable($a_update_callback))
475 $a_update_callback(
$total, $cnt);
478 $linked_mobs2 =
array();
479 foreach ($linked_mobs as $mob)
491 if (is_callable($a_update_callback))
494 $a_update_callback(
$total, $cnt);
499 foreach ($this->files_direct as $file_id => $attr)
502 if (is_callable($a_update_callback))
505 $a_update_callback(
$total, $cnt);
517 $this->log->debug(
"export html mobs");
520 if (@is_dir($source_dir))
523 ilUtil::rCopy($source_dir, $this->mobs_dir.
"/mm_".$a_mob_id);
527 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
529 if ($mob_obj->hasFullscreenItem())
544 "/_xsl" => file_get_contents(
"./Services/COPage/xsl/page.xsl")
546 array(
"mode"=>
"fullscreen"));
551 $tpl =
new ilTemplate(
"tpl.fullscreen.html",
true,
true,
"Services/COPage");
553 $tpl->setCurrentBlock(
"ilMedia");
554 $tpl->setVariable(
"MEDIA_CONTENT",
$output);
559 $file = $this->exp_dir.
"/fullscreen_".$a_mob_id.
".html";
560 if(!($fp = @fopen(
$file,
"w+")))
562 die(
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
563 " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
572 $linked_mobs = $mob_obj->getLinkedMediaObjects();
573 $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
581 $file_dir = $this->files_dir.
"/file_".$a_file_id;
584 include_once(
"./Modules/File/classes/class.ilObjFile.php");
585 $file_obj =
new ilObjFile($a_file_id,
false);
586 $source_file = $file_obj->getDirectory($file_obj->getVersion()).
"/".$file_obj->getFileName();
587 if (!is_file($source_file))
589 $source_file = $file_obj->getDirectory().
"/".$file_obj->getFileName();
591 if (is_file($source_file))
593 copy($source_file, $file_dir.
"/".$file_obj->getFileName());
602 $file_dir = $this->files_dir.
"/file_".$a_file_id;
605 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()
Get local path of jQuery UI file.
getContentStyleId()
Get content style id.
static getLocalJsPaths()
Get paths of necessary js files.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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)
Initialisation.
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.
if(strpos($jquery_path, './')===0) else if(strpos($jquery_path, '.')===0) $mathJaxSetting
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(!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()
Get local path of jQuery file.
static getWebspaceDir($mode="filesystem")
get webspace directory
exportPageElements($a_update_callback=null)
Export page elements.