ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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.

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

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  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
static getFlashVideoPlayerDirectory()
Get flash video player directory.
static getLogger($a_component_id)
Get component logger.
+ 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 351 of file class.ilCOPageHTMLExport.php.

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

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

◆ createDirectories()

ilCOPageHTMLExport::createDirectories ( )

Create directories.

Parameters

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

References ilUtil\makeDir().

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 ...
+ Here is the call graph for this function:

◆ exportHTMLFile()

ilCOPageHTMLExport::exportHTMLFile (   $a_file_id)

Export file object.

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

References ilUtil\makeDir().

Referenced by exportPageElements().

586  {
587  $file_dir = $this->files_dir . "/file_" . $a_file_id;
588  ilUtil::makeDir($file_dir);
589 
590  include_once("./Modules/File/classes/class.ilObjFile.php");
591  $file_obj = new ilObjFile($a_file_id, false);
592  $source_file = $file_obj->getDirectory($file_obj->getVersion()) . "/" . $file_obj->getFileName();
593  if (!is_file($source_file)) {
594  $source_file = $file_obj->getDirectory() . "/" . $file_obj->getFileName();
595  }
596  if (is_file($source_file)) {
597  copy($source_file, $file_dir . "/" . $file_obj->getFileName());
598  }
599  }
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
+ 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 604 of file class.ilCOPageHTMLExport.php.

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

Referenced by exportPageElements().

605  {
606  $file_dir = $this->files_dir . "/file_" . $a_file_id;
607  ilUtil::makeDir($file_dir);
608 
609  if (is_file($a_source_file)) {
610  copy(
611  $a_source_file,
612  $file_dir . "/" . ilUtil::getASCIIFilename($a_file_name)
613  );
614  }
615  }
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
+ 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 523 of file class.ilCOPageHTMLExport.php.

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

Referenced by exportPageElements().

524  {
525  $this->log->debug("export html mobs");
526 
527  $source_dir = ilUtil::getWebspaceDir() . "/mobs/mm_" . $a_mob_id;
528  if (@is_dir($source_dir)) {
529  ilUtil::makeDir($this->mobs_dir . "/mm_" . $a_mob_id);
530  ilUtil::rCopy($source_dir, $this->mobs_dir . "/mm_" . $a_mob_id);
531  }
532 
533  // #12930 - fullscreen
534  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
535  $mob_obj = new ilObjMediaObject($a_mob_id);
536  if ($mob_obj->hasFullscreenItem()) {
537  // render media object html
538  $xh = xslt_create();
539  $output = xslt_process(
540  $xh,
541  "arg:/_xml",
542  "arg:/_xsl",
543  null,
544  array(
545  "/_xml" =>
546  "<dummy>" .
547  $mob_obj->getXML(IL_MODE_ALIAS) .
548  $mob_obj->getXML(IL_MODE_OUTPUT) .
549  "</dummy>",
550  "/_xsl" => file_get_contents("./Services/COPage/xsl/page.xsl")
551  ),
552  array("mode"=>"fullscreen")
553  );
554  xslt_free($xh);
555  unset($xh);
556 
557  // render fullscreen html
558  $tpl = new ilTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
559  $tpl = $this->getPreparedMainTemplate($tpl); // adds js/css
560  $tpl->setCurrentBlock("ilMedia");
561  $tpl->setVariable("MEDIA_CONTENT", $output);
562  $output = $tpl->get();
563  unset($tpl);
564 
565  // write file
566  $file = $this->exp_dir . "/fullscreen_" . $a_mob_id . ".html";
567  if (!($fp = @fopen($file, "w+"))) {
568  die("<b>Error</b>: Could not open \"" . $file . "\" for writing" .
569  " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />");
570  }
571  chmod($file, 0770);
572  fwrite($fp, $output);
573  fclose($fp);
574  unset($fp);
575  unset($output);
576  }
577 
578  $linked_mobs = $mob_obj->getLinkedMediaObjects();
579  $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
580  }
xslt_create()
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
$tpl
Definition: ilias.php:10
xslt_free(&$proc)
getPreparedMainTemplate($a_tpl="")
Get prepared main template.
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
special template class to simplify handling of ITX/PEAR
Class ilObjMediaObject.
const IL_MODE_ALIAS
Create styles array
The data for the language used.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
const IL_MODE_OUTPUT
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static getWebspaceDir($mode="filesystem")
get webspace directory
+ 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

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

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

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

◆ exportStyles()

ilCOPageHTMLExport::exportStyles ( )

Export content style.

Parameters

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

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

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 {
147  $style = new ilObjStyleSheet($this->getContentStyleId());
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  }
$style
Definition: example_012.php:70
getContentStyleId()
Get content style id.
static getSyntaxStylePath()
get syntax style path
Class ilObjStyleSheet.
+ 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

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

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

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");
209  foreach (ilAccordionGUI::getLocalJavascriptFiles() as $f) {
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"))) {
266  copy($p, $this->js_dir . '/linkify.js');
267  }
268  }
269 
270 
271  // copy(ilPlayerUtil::getLocalMediaElementCssPath(),
272 // $this->css_dir.'/mediaelementplayer.css');
273 // copy(ilPlayerUtil::getLocalMediaElementJsPath(),
274 // $this->js_dir.'/mediaelement-and-player.js');
275  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
static getLocaljQueryUIPath()
static getLocalJsPaths()
Get paths of necessary js files.
static getLocalJavascriptFiles()
static getLocalPath($a_name="")
Get local path of a YUI js file.
static copyPlayerFilesToTargetDirectory($a_target_dir)
Copy css files to target dir.
static getLocalMaphilightPath()
Get local path of maphilight file.
static getLocaljQueryPath()
+ 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

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

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

Referenced by exportHTMLMOB().

284  {
285  $this->log->debug("get main template");
286 
287  include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
288 
289  if ($a_tpl != "") {
290  $tpl = $a_tpl;
291  } else {
292  // template workaround: reset of template
293  $tpl = new ilTemplate("tpl.main.html", true, true);
294  }
295 
296  // scripts needed
297  $scripts = array("./js/yahoo/yahoo-min.js", "./js/yahoo/yahoo-dom-event.js",
298  "./js/yahoo/animation-min.js", "./js/yahoo/container-min.js", "./js/jquery.js",
299  "./js/Basic.js", "./js/jquery-ui-min.js",
300  "./js/ilOverlay.js", "./js/ilCOPagePres.js",
301  "./js/ilTooltip.js", "./js/maphilight.js", "./js/ilMatchingQuestion.js", "./js/ilAssMultipleChoice.js",
302  "./js/ilExtLink.js", "./js/linkify.js");
303  $scripts = array_merge($scripts, ilPlayerUtil::getJsFilePaths());
304 
305  $mathJaxSetting = new ilSetting("MathJax");
306  $use_mathjax = $mathJaxSetting->get("enable");
307  if ($use_mathjax) {
308  $scripts[] = $mathJaxSetting->get("path_to_mathjax");
309  }
310 
311  // accordion
312  include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
313  foreach (ilAccordionGUI::getLocalJavascriptFiles() as $f) {
314  $scripts[] = $f;
315  }
316 
317  foreach ($scripts as $script) {
318  $tpl->setCurrentBlock("js_file");
319  $tpl->setVariable("JS_FILE", $script);
320  $tpl->parseCurrentBlock();
321  }
322 
323  // css files needed
324  $style_name = $this->user->prefs["style"] . ".css";
325  $css_files = array("./css/container.css",
326  "./content_style/content.css", "./style/" . $style_name, "./css/test_javascript.css");
327  $css_files = array_merge($css_files, ilPlayerUtil::getCssFilePaths());
328 
329  // accordion
330  include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
331  foreach (ilAccordionGUI::getLocalCssFiles() as $f) {
332  $css_files[] = $f;
333  }
334 
335 
336  foreach ($css_files as $css) {
337  $tpl->setCurrentBlock("css_file");
338  $tpl->setVariable("CSS_FILE", $css);
339  $tpl->parseCurrentBlock();
340  }
341 
342  return $tpl;
343  }
static getCssFilePaths()
Get css file paths.
$tpl
Definition: ilias.php:10
user()
Definition: user.php:4
static getLocalJavascriptFiles()
static getJsFilePaths()
Get js file paths.
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
if(strpos($jquery_path, './')===0) elseif(strpos($jquery_path, '.')===0) $mathJaxSetting
Definition: latex.php:32
+ 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: