24 $this->exp_dir = $a_exp_dir;
25 $this->mobs_dir = $a_exp_dir.
"/mobs";
26 $this->files_dir = $a_exp_dir.
"/files";
27 $this->tex_dir = $a_exp_dir.
"/teximg";
28 $this->content_style_dir = $a_exp_dir.
"/content_style";
29 $this->content_style_img_dir = $a_exp_dir.
"/content_style/images";
31 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
32 $this->services_dir = $a_exp_dir.
"/Services";
33 $this->media_service_dir = $this->services_dir.
"/MediaObjects";
35 $this->mp3_dir = $this->media_service_dir.
"/flash_mp3_player";
37 $this->js_dir = $a_exp_dir.
'/js';
38 $this->js_yahoo_dir = $a_exp_dir.
'/js/yahoo';
39 $this->css_dir = $a_exp_dir.
'/css';
51 $this->content_style_id = $a_val;
95 include_once
"Services/Style/classes/class.ilObjStyleSheet.php";
100 $cont_stylesheet =
"./Services/COPage/css/content.css";
102 $css = fread(fopen($cont_stylesheet,
'r'),filesize($cont_stylesheet));
103 preg_match_all(
"/url\(([^\)]*)\)/",$css,
$files);
104 foreach (array_unique(
$files[1]) as $fileref)
106 if (is_file(str_replace(
"..",
".", $fileref)))
108 copy(str_replace(
"..",
".", $fileref), $this->content_style_img_dir.
"/".basename($fileref));
110 $css = str_replace($fileref,
"images/".basename($fileref),$css);
112 fwrite(fopen($this->content_style_dir.
"/content.css",
'w'),$css);
117 $style->writeCSSFile($this->content_style_dir.
"/content.css",
"images");
118 $style->copyImagesToDir($this->content_style_img_dir);
123 copy($syn_stylesheet, $this->exp_dir.
"/syntaxhighlight.css");
141 copy(
'./Services/JavaScript/js/Basic.js', $this->js_dir.
'/Basic.js');
143 copy(
'./Services/UIComponent/Overlay/js/ilOverlay.js',$this->js_dir.
'/ilOverlay.js');
146 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
152 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
154 $this->js_yahoo_dir.
'/yahoo-min.js');
156 $this->js_yahoo_dir.
'/yahoo-dom-event.js');
158 $this->js_yahoo_dir.
'/animation-min.js');
160 $this->js_yahoo_dir.
'/container-min.js');
162 $this->css_dir.
'/container.css');
165 copy(
'./Services/Accordion/js/accordion.js',
166 $this->js_dir.
'/accordion.js');
167 copy(
'./Services/Accordion/css/accordion.css',
168 $this->css_dir.
'/accordion.css');
171 copy(
'./Services/COPage/js/ilCOPagePres.js',
172 $this->js_dir.
'/ilCOPagePres.js');
175 copy(
'./Services/UIComponent/Tooltip/js/ilTooltip.js',
176 $this->js_dir.
'/ilTooltip.js');
179 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
198 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
211 $scripts = array(
"./js/yahoo/yahoo-min.js",
"./js/yahoo/yahoo-dom-event.js",
212 "./js/yahoo/animation-min.js",
"./js/yahoo/container-min.js",
213 "./js/Basic.js",
"./js/jquery.js",
"./js/jquery-ui-min.js",
214 "./js/ilOverlay.js",
"./js/accordion.js",
"./js/ilCOPagePres.js",
215 "./js/ilTooltip.js",
"./js/maphilight.js");
225 foreach ($scripts as $script)
227 $tpl->setCurrentBlock(
"js_file");
228 $tpl->setVariable(
"JS_FILE", $script);
229 $tpl->parseCurrentBlock();
233 $style_name = $ilUser->prefs[
"style"].
".css";
234 $css_files = array(
"./css/accordion.css",
"./css/container.css",
235 "./content_style/content.css",
"./style/".$style_name);
238 foreach ($css_files as $css)
240 $tpl->setCurrentBlock(
"css_file");
241 $tpl->setVariable(
"CSS_FILE", $css);
242 $tpl->parseCurrentBlock();
258 foreach($pg_mobs as $pg_mob)
260 $this->mobs[$pg_mob] = $pg_mob;
264 include_once(
"./Modules/File/classes/class.ilObjFile.php");
268 $this->files[$f] = $f;
272 $skill_tree = $ws_tree = null;
275 foreach ($pcs as $pc)
278 if ($pc[
"type"] ==
"skmg")
280 $skill_id = $pc[
"id"];
283 include_once
"Services/Portfolio/classes/class.ilPortfolioPage.php";
285 $user_id = $page->create_user;
290 include_once
"Services/Skill/classes/class.ilSkillTree.php";
293 include_once
"Services/Skill/classes/class.ilPersonalSkill.php";
295 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
301 foreach ($b_skills as $bs)
304 $level_data = $skill->getLevelData();
305 foreach ($level_data as $k => $v)
311 foreach($mat as $item)
313 $wsp_id = $item[
"wsp_id"];
314 $obj_id = $ws_tree->lookupObjectId($wsp_id);
320 $this->files[$obj_id] = $obj_id;
324 include_once
"Modules/Test/classes/class.ilObjTestVerification.php";
326 $this->files_direct[$obj_id] = array($obj->getFilePath(),
327 $obj->getOfflineFilename());
331 include_once
"Modules/Exercise/classes/class.ilObjExerciseVerification.php";
333 $this->files_direct[$obj_id] = array($obj->getFilePath(),
334 $obj->getOfflineFilename());
356 $linked_mobs = array();
357 foreach ($this->mobs as $mob)
364 $linked_mobs2 = array();
365 foreach ($linked_mobs as $mob)
374 foreach ($this->files as
$file)
380 foreach ($this->files_direct as $file_id => $attr)
394 if (@is_dir($source_dir))
397 ilUtil::rCopy($source_dir, $this->mobs_dir.
"/mm_".$a_mob_id);
401 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
403 if ($mob_obj->hasFullscreenItem())
418 "/_xsl" => file_get_contents(
"./Services/COPage/xsl/page.xsl")
420 array(
"mode"=>
"fullscreen"));
425 $tpl =
new ilTemplate(
"tpl.fullscreen.html",
true,
true,
"Services/COPage");
427 $tpl->setCurrentBlock(
"ilMedia");
428 $tpl->setVariable(
"MEDIA_CONTENT", $output);
429 $output = $tpl->get();
433 $file = $this->exp_dir.
"/fullscreen_".$a_mob_id.
".html";
434 if(!($fp = @fopen(
$file,
"w+")))
436 die(
"<b>Error</b>: Could not open \"".
$file.
"\" for writing".
437 " in <b>".__FILE__.
"</b> on line <b>".__LINE__.
"</b><br />");
440 fwrite($fp, $output);
446 $linked_mobs = $mob_obj->getLinkedMediaObjects();
447 $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
455 $file_dir = $this->files_dir.
"/file_".$a_file_id;
458 include_once(
"./Modules/File/classes/class.ilObjFile.php");
459 $file_obj =
new ilObjFile($a_file_id,
false);
460 $source_file = $file_obj->getDirectory($file_obj->getVersion()).
"/".$file_obj->getFileName();
461 if (!is_file($source_file))
463 $source_file = $file_obj->getDirectory().
"/".$file_obj->getFileName();
465 if (is_file($source_file))
467 copy($source_file, $file_dir.
"/".$file_obj->getFileName());
476 $file_dir = $this->files_dir.
"/file_".$a_file_id;
479 if (is_file($a_source_file))