ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCOPageHTMLExport Class Reference

HTML export class for pages. More...

+ Collaboration diagram for ilCOPageHTMLExport:

Public Member Functions

 __construct ($a_exp_dir)
 ilCOPageHTMLExport constructor. More...
 
 setContentStyleId ($a_val)
 Set content style id. More...
 
 getContentStyleId ()
 Get content style id. More...
 
 createDirectories ()
 Create directories. More...
 
 exportStyles ()
 Export content style. More...
 
 exportSupportScripts ()
 Export support scripts. More...
 
 getPreparedMainTemplate ($a_tpl="")
 Get prepared main template. More...
 
 collectPageElements ($a_type, $a_id)
 Collect page elements (that need to be exported separately) More...
 
 exportPageElements ($a_update_callback=null)
 Export page elements. More...
 
 exportHTMLMOB ($a_mob_id, &$a_linked_mobs)
 Export media object to html. More...
 
 exportHTMLFile ($a_file_id)
 Export file object. More...
 
 exportHTMLFileDirect ($a_file_id, $a_source_file, $a_file_name)
 Export file from path. More...
 

Protected Attributes

 $mobs = array()
 
 $files = array()
 
 $files_direct = array()
 
 $exp_dir = ""
 
 $content_style_id = 0
 
 $user
 
 $log
 

Detailed Description

HTML export class for pages.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id

Definition at line 11 of file class.ilCOPageHTMLExport.php.

Constructor & Destructor Documentation

◆ __construct()

ilCOPageHTMLExport::__construct (   $a_exp_dir)

ilCOPageHTMLExport constructor.

Parameters
$a_exp_dir

Definition at line 52 of file class.ilCOPageHTMLExport.php.

53 {
54 global $DIC;
55
56 $this->log = ilLoggerFactory::getLogger('copg');
57 $this->user = $DIC->user();
58
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";
65
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";
69 $this->flv_dir = $a_exp_dir . "/" . ilPlayerUtil::getFlashVideoPlayerDirectory();
70 $this->mp3_dir = $this->media_service_dir . "/flash_mp3_player";
71
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';
75 }
user()
Definition: user.php:4
static getLogger($a_component_id)
Get component logger.
static getFlashVideoPlayerDirectory()
Get flash video player directory.
global $DIC
Definition: saml.php:7

References $DIC, ilPlayerUtil\getFlashVideoPlayerDirectory(), ilLoggerFactory\getLogger(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ collectPageElements()

ilCOPageHTMLExport::collectPageElements (   $a_type,
  $a_id 
)

Collect page elements (that need to be exported separately)

Parameters
string$a_pg_typepage type
int$a_pg_idpage id

Definition at line 354 of file class.ilCOPageHTMLExport.php.

355 {
356 $this->log->debug("collect page elements");
357
358 // collect media objects
360 foreach ($pg_mobs as $pg_mob) {
361 $this->mobs[$pg_mob] = $pg_mob;
362 }
363
364 // collect all files
365 include_once("./Modules/File/classes/class.ilObjFile.php");
367 foreach ($files as $f) {
368 $this->files[$f] = $f;
369 }
370
371
372 $skill_tree = $ws_tree = null;
373
375 foreach ($pcs as $pc) {
376 // skils
377 if ($pc["type"] == "skmg") {
378 $skill_id = $pc["id"];
379
380 // trying to find user id
381 $user_id = null;
382 switch ($a_type) {
383 case "prtf:pg":
384 include_once "Modules/Portfolio/classes/class.ilPortfolioPage.php";
385 $page = new ilPortfolioPage($a_id);
386 $user_id = $page->create_user;
387 break;
388
389 default:
390 // :TODO:
391 break;
392 }
393
394 if ($user_id) {
395 // we only need 1 instance each
396 if (!$skill_tree) {
397 include_once "Services/Skill/classes/class.ilSkillTree.php";
398 $skill_tree = new ilSkillTree();
399
400 include_once "Services/Skill/classes/class.ilPersonalSkill.php";
401
402 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
403 $ws_tree = new ilWorkspaceTree($user_id);
404 }
405
406 // walk skill tree
407 include_once("./Services/Skill/classes/class.ilVirtualSkillTree.php");
408 $vtree = new ilVirtualSkillTree();
409 $tref_id = 0;
410 $skill_id = (int) $skill_id;
411 include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
412 if (ilSkillTreeNode::_lookupType($skill_id) == "sktr") {
413 include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
414 $tref_id = $skill_id;
415 $skill_id = ilSkillTemplateReference::_lookupTemplateId($skill_id);
416 }
417 $b_skills = $vtree->getSubTreeForCSkillId($skill_id . ":" . $tref_id, true);
418
419 foreach ($b_skills as $bs) {
420 $skill = ilSkillTreeNodeFactory::getInstance($bs["skill_id"]);
421 $level_data = $skill->getLevelData();
422 foreach ($level_data as $k => $v) {
423 // get assigned materials from personal skill
424 $mat = ilPersonalSkill::getAssignedMaterial($user_id, $bs["tref_id"], $v["id"]);
425 if (sizeof($mat)) {
426 foreach ($mat as $item) {
427 $wsp_id = $item["wsp_id"];
428 $obj_id = $ws_tree->lookupObjectId($wsp_id);
429
430 // all possible material types for now
431 switch (ilObject::_lookupType($obj_id)) {
432 case "file":
433 $this->files[$obj_id] = $obj_id;
434 break;
435
436 case "tstv":
437 include_once "Modules/Test/classes/class.ilObjTestVerification.php";
438 $obj = new ilObjTestVerification($obj_id, false);
439 $this->files_direct[$obj_id] = array($obj->getFilePath(),
440 $obj->getOfflineFilename());
441 break;
442
443 case "excv":
444 include_once "Modules/Exercise/classes/class.ilObjExerciseVerification.php";
445 $obj = new ilObjExerciseVerification($obj_id, false);
446 $this->files_direct[$obj_id] = array($obj->getFilePath(),
447 $obj->getOfflineFilename());
448 break;
449
450 case "crsv":
451 include_once "Modules/Course/classes/Verification/class.ilObjCourseVerification.php";
452 $obj = new ilObjCourseVerification($obj_id, false);
453 $this->files_direct[$obj_id] = array($obj->getFilePath(),
454 $obj->getOfflineFilename());
455 break;
456
457 case "scov":
458 include_once "Modules/ScormAicc/classes/Verification/class.ilObjSCORMVerification.php";
459 $obj = new ilObjSCORMVerification($obj_id, false);
460 $this->files_direct[$obj_id] = array($obj->getFilePath(),
461 $obj->getOfflineFilename());
462 break;
463 }
464 }
465 }
466 }
467 }
468 }
469 }
470 }
471 }
static _getFilesOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_usage_lang="-")
get all files of an object
static _getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
static _lookupType($a_id, $a_reference=false)
lookup object type
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 getAssignedMaterial($a_user_id, $a_tref_id, $a_level)
Get assigned material (for a skill level and user)
Page for user portfolio.
static _lookupTemplateId($a_obj_id)
Lookup template ID.
static _lookupType($a_obj_id)
Lookup Type.
Tree handler for personal workspace.
$a_type
Definition: workflow.php:92

References $a_type, $f, $files, ilObjFile\_getFilesOfObject(), ilObjMediaObject\_getMobsOfObject(), ilSkillTemplateReference\_lookupTemplateId(), ilObject\_lookupType(), ilSkillTreeNode\_lookupType(), ilPersonalSkill\getAssignedMaterial(), ilSkillTreeNodeFactory\getInstance(), and ilPageContentUsage\getUsagesOfPage().

+ Here is the call graph for this function:

◆ createDirectories()

ilCOPageHTMLExport::createDirectories ( )

Create directories.

Parameters

return

Definition at line 103 of file class.ilCOPageHTMLExport.php.

104 {
105 ilUtil::makeDir($this->mobs_dir);
106 ilUtil::makeDir($this->files_dir);
107 ilUtil::makeDir($this->tex_dir);
108 ilUtil::makeDir($this->content_style_dir);
109 ilUtil::makeDir($this->content_style_img_dir);
110 ilUtil::makeDir($this->services_dir);
111 ilUtil::makeDir($this->media_service_dir);
112 ilUtil::makeDir($this->flv_dir);
113 ilUtil::makeDir($this->mp3_dir);
114
115 ilUtil::makeDir($this->js_dir);
116 ilUtil::makeDir($this->js_yahoo_dir);
117 ilUtil::makeDir($this->css_dir);
118 ilUtil::makeDir($this->css_dir . "/yahoo");
119 }
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...

References ilUtil\makeDir().

+ Here is the call graph for this function:

◆ exportHTMLFile()

ilCOPageHTMLExport::exportHTMLFile (   $a_file_id)

Export file object.

Definition at line 588 of file class.ilCOPageHTMLExport.php.

589 {
590 $file_dir = $this->files_dir . "/file_" . $a_file_id;
591 ilUtil::makeDir($file_dir);
592
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();
598 }
599 if (is_file($source_file)) {
600 copy($source_file, $file_dir . "/" . $file_obj->getFileName());
601 }
602 }
Class ilObjFile.

References ilUtil\makeDir().

Referenced by exportPageElements().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportHTMLFileDirect()

ilCOPageHTMLExport::exportHTMLFileDirect (   $a_file_id,
  $a_source_file,
  $a_file_name 
)

Export file from path.

Definition at line 607 of file class.ilCOPageHTMLExport.php.

608 {
609 $file_dir = $this->files_dir . "/file_" . $a_file_id;
610 ilUtil::makeDir($file_dir);
611
612 if (is_file($a_source_file)) {
613 copy(
614 $a_source_file,
615 $file_dir . "/" . ilUtil::getASCIIFilename($a_file_name)
616 );
617 }
618 }
static getASCIIFilename($a_filename)
convert utf8 to ascii filename

References ilUtil\getASCIIFilename(), and ilUtil\makeDir().

Referenced by exportPageElements().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportHTMLMOB()

ilCOPageHTMLExport::exportHTMLMOB (   $a_mob_id,
$a_linked_mobs 
)

Export media object to html.

Definition at line 526 of file class.ilCOPageHTMLExport.php.

527 {
528 $this->log->debug("export html mobs");
529
530 $source_dir = ilUtil::getWebspaceDir() . "/mobs/mm_" . $a_mob_id;
531 if (is_dir($source_dir)) {
532 ilUtil::makeDir($this->mobs_dir . "/mm_" . $a_mob_id);
533 ilUtil::rCopy($source_dir, $this->mobs_dir . "/mm_" . $a_mob_id);
534 }
535
536 // #12930 - fullscreen
537 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
538 $mob_obj = new ilObjMediaObject($a_mob_id);
539 if ($mob_obj->hasFullscreenItem()) {
540 // render media object html
541 $xh = xslt_create();
542 $output = xslt_process(
543 $xh,
544 "arg:/_xml",
545 "arg:/_xsl",
546 null,
547 array(
548 "/_xml" =>
549 "<dummy>" .
550 $mob_obj->getXML(IL_MODE_ALIAS) .
551 $mob_obj->getXML(IL_MODE_OUTPUT) .
552 "</dummy>",
553 "/_xsl" => file_get_contents("./Services/COPage/xsl/page.xsl")
554 ),
555 array("mode" => "fullscreen")
556 );
557 xslt_free($xh);
558 unset($xh);
559
560 // render fullscreen html
561 $tpl = new ilTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
562 $tpl = $this->getPreparedMainTemplate($tpl); // adds js/css
563 $tpl->setCurrentBlock("ilMedia");
564 $tpl->setVariable("MEDIA_CONTENT", $output);
565 $output = $tpl->get();
566 unset($tpl);
567
568 // write file
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 />");
573 }
574 chmod($file, 0770);
575 fwrite($fp, $output);
576 fclose($fp);
577 unset($fp);
578 unset($output);
579 }
580
581 $linked_mobs = $mob_obj->getLinkedMediaObjects();
582 $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
583 }
$tpl
Definition: ilias.php:10
const IL_MODE_ALIAS
const IL_MODE_OUTPUT
getPreparedMainTemplate($a_tpl="")
Get prepared main template.
Class ilObjMediaObject.
special template class to simplify handling of ITX/PEAR
static getWebspaceDir($mode="filesystem")
get webspace directory
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
xslt_free(&$proc)
xslt_create()

References Sabre\VObject\$output, $tpl, getPreparedMainTemplate(), ilUtil\getWebspaceDir(), IL_MODE_ALIAS, IL_MODE_OUTPUT, ilUtil\makeDir(), ilUtil\rCopy(), xslt_create(), and xslt_free().

Referenced by exportPageElements().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportPageElements()

ilCOPageHTMLExport::exportPageElements (   $a_update_callback = null)

Export page elements.

Parameters

return

Definition at line 479 of file class.ilCOPageHTMLExport.php.

480 {
481 $this->log->debug("export page elements");
482
483 $total = count($this->mobs) + count($this->files) + count($this->files_direct);
484 $cnt = 0;
485
486 // export all media objects
487 $linked_mobs = array();
488 foreach ($this->mobs as $mob) {
489 if (ilObject::_exists($mob) && ilObject::_lookupType($mob) == "mob") {
490 $this->exportHTMLMOB($mob, $linked_mobs);
491 }
492 if (is_callable($a_update_callback)) {
493 $cnt++;
494 $a_update_callback($total, $cnt);
495 }
496 }
497 $linked_mobs2 = array(); // mobs linked in link areas
498 foreach ($linked_mobs as $mob) {
499 if (ilObject::_exists($mob)) {
500 $this->exportHTMLMOB($mob, $linked_mobs2);
501 }
502 }
503
504 // export all file objects
505 foreach ($this->files as $file) {
506 $this->exportHTMLFile($file);
507 if (is_callable($a_update_callback)) {
508 $cnt++;
509 $a_update_callback($total, $cnt);
510 }
511 }
512
513 // export all files (which are not objects
514 foreach ($this->files_direct as $file_id => $attr) {
515 $this->exportHTMLFileDirect($file_id, $attr[0], $attr[1]);
516 if (is_callable($a_update_callback)) {
517 $cnt++;
518 $a_update_callback($total, $cnt);
519 }
520 }
521 }
$total
Definition: Utf8Test.php:87
exportHTMLFile($a_file_id)
Export file object.
exportHTMLMOB($a_mob_id, &$a_linked_mobs)
Export media object to html.
exportHTMLFileDirect($a_file_id, $a_source_file, $a_file_name)
Export file from path.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public

References $total, ilObject\_exists(), ilObject\_lookupType(), exportHTMLFile(), exportHTMLFileDirect(), and exportHTMLMOB().

+ Here is the call graph for this function:

◆ exportStyles()

ilCOPageHTMLExport::exportStyles ( )

Export content style.

Parameters

return

Definition at line 127 of file class.ilCOPageHTMLExport.php.

128 {
129 $this->log->debug("export styles");
130
131 include_once "Services/Style/Content/classes/class.ilObjStyleSheet.php";
132
133 // export content style sheet
134 if ($this->getContentStyleId() < 1) {
135 $cont_stylesheet = "./Services/COPage/css/content.css";
136
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));
142 }
143 $css = str_replace($fileref, "images/" . basename($fileref), $css);
144 }
145 fwrite(fopen($this->content_style_dir . "/content.css", 'w'), $css);
146 } else {
148 $style->writeCSSFile($this->content_style_dir . "/content.css", "images");
149 $style->copyImagesToDir($this->content_style_img_dir);
150 }
151
152 // export syntax highlighting style
153 $syn_stylesheet = ilObjStyleSheet::getSyntaxStylePath();
154 copy($syn_stylesheet, $this->exp_dir . "/syntaxhighlight.css");
155 }
getContentStyleId()
Get content style id.
Class ilObjStyleSheet.
static getSyntaxStylePath()
get syntax style path
$style
Definition: example_012.php:70

References $files, $style, getContentStyleId(), and ilObjStyleSheet\getSyntaxStylePath().

+ Here is the call graph for this function:

◆ exportSupportScripts()

ilCOPageHTMLExport::exportSupportScripts ( )

Export support scripts.

Todo:
: use ilPageContent js/css functions here (problem: currently they need a page object for init)
Parameters

return

Definition at line 165 of file class.ilCOPageHTMLExport.php.

166 {
167 $this->log->debug("export scripts");
168
169 // basic js
170 copy('./Services/JavaScript/js/Basic.js', $this->js_dir . '/Basic.js');
171
172 copy('./Services/UIComponent/Overlay/js/ilOverlay.js', $this->js_dir . '/ilOverlay.js');
173
174 // jquery
175 include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
176 copy(iljQueryUtil::getLocaljQueryPath(), $this->js_dir . '/jquery.js');
177 copy(iljQueryUtil::getLocaljQueryUIPath(), $this->js_dir . '/jquery-ui-min.js');
178 copy(iljQueryUtil::getLocalMaphilightPath(), $this->js_dir . '/maphilight.js');
179
180 // yui stuff we use
181 include_once("./Services/YUI/classes/class.ilYuiUtil.php");
182 copy(
183 ilYuiUtil::getLocalPath('yahoo/yahoo-min.js'),
184 $this->js_yahoo_dir . '/yahoo-min.js'
185 );
186 copy(
187 ilYuiUtil::getLocalPath('yahoo-dom-event/yahoo-dom-event.js'),
188 $this->js_yahoo_dir . '/yahoo-dom-event.js'
189 );
190 copy(
191 ilYuiUtil::getLocalPath('animation/animation-min.js'),
192 $this->js_yahoo_dir . '/animation-min.js'
193 );
194 copy(
195 ilYuiUtil::getLocalPath('container/container-min.js'),
196 $this->js_yahoo_dir . '/container-min.js'
197 );
198 copy(
199 ilYuiUtil::getLocalPath('container/assets/skins/sam/container.css'),
200 $this->css_dir . '/container.css'
201 );
202 copy(
203 ilYuiUtil::getLocalPath('container/assets/skins/sam/container.css'),
204 $this->css_dir . '/yahoo/container.css'
205 ); // see #23083
206
207 // accordion
208 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
210 $tfile = $this->exp_dir . "/" . $f;
211 ilUtil::makeDirParents(dirname($tfile));
212 copy($f, $tfile);
213 }
214 foreach (ilAccordionGUI::getLocalCssFiles() as $f) {
215 $tfile = $this->exp_dir . "/" . $f;
216 ilUtil::makeDirParents(dirname($tfile));
217 copy($f, $tfile);
218 }
219
220 copy(
221 './Services/Accordion/js/accordion.js',
222 $this->js_dir . '/accordion.js'
223 );
224 copy(
225 './Services/Accordion/css/accordion.css',
226 $this->css_dir . '/accordion.css'
227 );
228
229 // page presentation js
230 copy(
231 './Services/COPage/js/ilCOPagePres.js',
232 $this->js_dir . '/ilCOPagePres.js'
233 );
234
235 // tooltip
236 copy(
237 './Services/UIComponent/Tooltip/js/ilTooltip.js',
238 $this->js_dir . '/ilTooltip.js'
239 );
240
241 // mediaelement.js
242 include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
244
245 // matching / multiple choice - question
246 copy(
247 './Modules/TestQuestionPool/js/ilMatchingQuestion.js',
248 $this->js_dir . '/ilMatchingQuestion.js'
249 );
250 copy(
251 './Modules/TestQuestionPool/js/ilAssMultipleChoice.js',
252 $this->js_dir . '/ilAssMultipleChoice.js'
253 );
254 copy(
255 './Modules/TestQuestionPool/templates/default/test_javascript.css',
256 $this->css_dir . '/test_javascript.css'
257 );
258
259 // auto linking js
260 include_once("./Services/Link/classes/class.ilLinkifyUtil.php");
261 foreach (ilLinkifyUtil::getLocalJsPaths() as $p) {
262 if (is_int(strpos($p, "ExtLink"))) {
263 copy($p, $this->js_dir . '/ilExtLink.js');
264 }
265 if (is_int(strpos($p, "linkify.min.js"))) {
266 copy($p, $this->js_dir . '/linkify.min.js');
267 }
268 if (is_int(strpos($p, "linkify-jquery.min.js"))) {
269 copy($p, $this->js_dir . '/linkify-jquery.min.js');
270 }
271 }
272
273
274 // copy(ilPlayerUtil::getLocalMediaElementCssPath(),
275// $this->css_dir.'/mediaelementplayer.css');
276// copy(ilPlayerUtil::getLocalMediaElementJsPath(),
277// $this->js_dir.'/mediaelement-and-player.js');
278 }
static getLocalJavascriptFiles()
static getLocalJsPaths()
Get paths of necessary js files.
static copyPlayerFilesToTargetDirectory($a_target_dir)
Copy css files to target dir.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
static getLocalPath($a_name="")
Get local path of a YUI js file.
static getLocaljQueryUIPath()
static getLocaljQueryPath()
static getLocalMaphilightPath()
Get local path of maphilight file.

References $f, ilPlayerUtil\copyPlayerFilesToTargetDirectory(), ilAccordionGUI\getLocalCssFiles(), ilAccordionGUI\getLocalJavascriptFiles(), iljQueryUtil\getLocaljQueryPath(), iljQueryUtil\getLocaljQueryUIPath(), ilLinkifyUtil\getLocalJsPaths(), iljQueryUtil\getLocalMaphilightPath(), ilYuiUtil\getLocalPath(), and ilUtil\makeDirParents().

+ Here is the call graph for this function:

◆ getContentStyleId()

ilCOPageHTMLExport::getContentStyleId ( )

Get content style id.

Returns
int content style id

Definition at line 92 of file class.ilCOPageHTMLExport.php.

References $content_style_id.

Referenced by exportStyles().

+ Here is the caller graph for this function:

◆ getPreparedMainTemplate()

ilCOPageHTMLExport::getPreparedMainTemplate (   $a_tpl = "")

Get prepared main template.

Parameters

return

Definition at line 286 of file class.ilCOPageHTMLExport.php.

287 {
288 $this->log->debug("get main template");
289
290 include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
291
292 if ($a_tpl != "") {
293 $tpl = $a_tpl;
294 } else {
295 // template workaround: reset of template
296 $tpl = new ilTemplate("tpl.main.html", true, true);
297 }
298
299 // scripts needed
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");
306 $scripts = array_merge($scripts, ilPlayerUtil::getJsFilePaths());
307
308 $mathJaxSetting = new ilSetting("MathJax");
309 $use_mathjax = $mathJaxSetting->get("enable");
310 if ($use_mathjax) {
311 $scripts[] = $mathJaxSetting->get("path_to_mathjax");
312 }
313
314 // accordion
315 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
317 $scripts[] = $f;
318 }
319
320 foreach ($scripts as $script) {
321 $tpl->setCurrentBlock("js_file");
322 $tpl->setVariable("JS_FILE", $script);
323 $tpl->parseCurrentBlock();
324 }
325
326 // css files needed
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");
330 $css_files = array_merge($css_files, ilPlayerUtil::getCssFilePaths());
331
332 // accordion
333 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
334 foreach (ilAccordionGUI::getLocalCssFiles() as $f) {
335 $css_files[] = $f;
336 }
337
338
339 foreach ($css_files as $css) {
340 $tpl->setCurrentBlock("css_file");
341 $tpl->setVariable("CSS_FILE", $css);
342 $tpl->parseCurrentBlock();
343 }
344
345 return $tpl;
346 }
if(strpos( $jquery_path, './')===0) elseif(strpos($jquery_path, '.')===0) $mathJaxSetting
Definition: latex.php:32
static getJsFilePaths()
Get js file paths.
static getCssFilePaths()
Get css file paths.
ILIAS Setting Class.

References $f, $mathJaxSetting, $tpl, ilPlayerUtil\getCssFilePaths(), ilPlayerUtil\getJsFilePaths(), ilAccordionGUI\getLocalCssFiles(), ilAccordionGUI\getLocalJavascriptFiles(), and user().

Referenced by exportHTMLMOB().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setContentStyleId()

ilCOPageHTMLExport::setContentStyleId (   $a_val)

Set content style id.

Parameters
int$a_valcontent style id

Definition at line 82 of file class.ilCOPageHTMLExport.php.

83 {
84 $this->content_style_id = $a_val;
85 }

Field Documentation

◆ $content_style_id

ilCOPageHTMLExport::$content_style_id = 0
protected

Definition at line 36 of file class.ilCOPageHTMLExport.php.

Referenced by getContentStyleId().

◆ $exp_dir

ilCOPageHTMLExport::$exp_dir = ""
protected

Definition at line 31 of file class.ilCOPageHTMLExport.php.

◆ $files

ilCOPageHTMLExport::$files = array()
protected

Definition at line 21 of file class.ilCOPageHTMLExport.php.

Referenced by collectPageElements(), and exportStyles().

◆ $files_direct

ilCOPageHTMLExport::$files_direct = array()
protected

Definition at line 26 of file class.ilCOPageHTMLExport.php.

◆ $log

ilCOPageHTMLExport::$log
protected

Definition at line 46 of file class.ilCOPageHTMLExport.php.

◆ $mobs

ilCOPageHTMLExport::$mobs = array()
protected

Definition at line 16 of file class.ilCOPageHTMLExport.php.

◆ $user

ilCOPageHTMLExport::$user
protected

Definition at line 41 of file class.ilCOPageHTMLExport.php.


The documentation for this class was generated from the following file: