ILIAS  trunk Revision v12.0_alpha-1329-g1094ddb0c33
class.ilCOPageHTMLExport.php
Go to the documentation of this file.
1<?php
2
21
28{
29 protected \ILIAS\MediaObjects\MediaObjectManager $media_manager;
30 protected \ILIAS\Style\Content\InternalDomainService $content_style;
31 protected \ILIAS\COPage\Xsl\XslManager $xsl;
32 protected string $css_dir = "";
33 protected string $js_yahoo_dir = "";
34 protected string $js_dir = "";
35 protected string $media_service_dir = "";
36 protected string $services_dir = "";
37 protected string $content_style_img_dir = "";
38 protected string $content_style_dir = "";
39 protected string $tex_dir = "";
40 protected string $files_dir = "";
41 protected string $mobs_dir = "";
42 protected array $mobs = [];
43 protected array $glossary_terms = [];
44 protected array $files = [];
45 protected array $files_direct = [];
46 protected array $int_links = [];
47 protected array $q_ids = [];
48 protected string $exp_dir = "";
49 protected int $content_style_id = 0;
50 protected ilObjUser $user;
51 protected ilLogger $log;
52 protected \ILIAS\GlobalScreen\Services $global_screen;
53 protected \ILIAS\Skill\Service\SkillTreeService $skill_tree_service;
54 protected \ILIAS\Skill\Service\SkillPersonalService $skill_personal_service;
55 protected \ILIAS\COPage\PageLinker $page_linker;
56 protected int $ref_id;
57
58 public function __construct(
59 string $a_exp_dir,
60 ?\ILIAS\COPage\PageLinker $linker = null,
61 int $ref_id = 0,
62 protected ?ExportCollector $export_collector = null
63 ) {
64 global $DIC;
65 $this->log = ilLoggerFactory::getLogger('copg');
66 $this->user = $DIC->user();
67 $this->global_screen = $DIC->globalScreen();
68 $this->skill_tree_service = $DIC->skills()->tree();
69 $this->skill_personal_service = $DIC->skills()->personal();
70 $this->page_linker = is_null($linker)
71 ? new ilPageLinker("", true)
72 : $linker;
73 $this->ref_id = $ref_id;
74
75 $this->exp_dir = $a_exp_dir;
76 $this->mobs_dir = $a_exp_dir . "/mobs";
77 $this->files_dir = $a_exp_dir . "/files";
78 $this->tex_dir = $a_exp_dir . "/teximg";
79 $this->content_style_dir = $a_exp_dir . "/content_style";
80 $this->content_style_img_dir = $a_exp_dir . "/content_style/images";
81
82 $this->services_dir = $a_exp_dir . "/components/ILIAS";
83 $this->media_service_dir = $this->services_dir . "/MediaObjects";
84
85 $this->js_dir = $a_exp_dir . '/js';
86 $this->js_yahoo_dir = $a_exp_dir . '/js/yahoo';
87 $this->css_dir = $a_exp_dir . '/css';
88 $this->xsl = $DIC->copage()->internal()->domain()->xsl();
89 $this->content_style = $DIC->contentStyle()->internal()->domain();
90 $this->media_manager = $DIC->mediaObjects()->internal()->domain()->mediaObject();
91 }
92
93 public function setContentStyleId(int $a_val): void
94 {
95 $this->content_style_id = $a_val;
96 }
97
98 public function getContentStyleId(): int
99 {
101 }
102
103 public function createDirectories(): void
104 {
105 ilFileUtils::makeDir($this->mobs_dir);
106 ilFileUtils::makeDir($this->files_dir);
107 ilFileUtils::makeDir($this->tex_dir);
108 ilFileUtils::makeDir($this->content_style_dir);
109 ilFileUtils::makeDir($this->content_style_img_dir);
110 ilFileUtils::makeDir($this->services_dir);
111 ilFileUtils::makeDir($this->media_service_dir);
112
113 ilFileUtils::makeDirParents($this->js_dir);
114 ilFileUtils::makeDirParents($this->js_yahoo_dir);
115 ilFileUtils::makeDirParents($this->css_dir);
116 ilFileUtils::makeDirParents($this->css_dir . "/yahoo");
117 }
118
125 public function exportStyles(): void
126 {
127 $this->log->debug("export styles");
128
129 // export content style sheet
130 if ($this->getContentStyleId() < 1) { // basic style
131 if (is_null($this->export_collector)) {
134 $this->exp_dir . "/" . ilObjStyleSheet::getBasicImageDir()
135 );
136 ilFileUtils::makeDirParents($this->exp_dir . "/components/ILIAS/COPage/css");
137 copy(
138 "../components/ILIAS/COPage/resources/content.css",
139 $this->exp_dir . "/components/ILIAS/COPage/css/content.css"
140 );
141 } else {
142 $this->export_collector->addDirectory(
144 "/assets/basic_style/images"
145 );
146 $this->export_collector->addFile(
147 "../components/ILIAS/COPage/css/content.css",
149 );
150 }
151 } else {
152 $style = new ilObjStyleSheet($this->getContentStyleId());
153 if (is_null($this->export_collector)) {
154 $style->copyImagesToDir($this->exp_dir . "/" . $style->getImagesDirectory());
155 $this->exportResourceFile(
156 $this->exp_dir,
158 );
159 } else {
160 $res_id = $this->content_style->style($this->getContentStyleId())->getResourceIdentification();
161 if ($res_id) {
162 $this->export_collector->addContainerDirectory(
163 $res_id->serialize(),
164 "",
165 "assets/content_style"
166 );
167 }
168 }
169 }
170
171 // export syntax highlighting style
172 $syn_stylesheet = ilObjStyleSheet::getSyntaxStylePath();
173 $this->exportResourceFile($this->exp_dir, $syn_stylesheet);
174
175 // export print style
176 $print_stylesheet = ilObjStyleSheet::getContentPrintStyle();
177 $this->exportResourceFile($this->exp_dir, $print_stylesheet);
178 }
179
185 public function exportSupportScripts(): void
186 {
187 $this->log->debug("export scripts");
188
189 $collector = new \ILIAS\COPage\ResourcesCollector(ilPageObjectGUI::OFFLINE);
190
191 foreach ($collector->getJavascriptFiles() as $js) {
192 $this->exportResourceFile($this->exp_dir, $js);
193 }
194
195 foreach ($collector->getCssFiles() as $css) {
196 $this->exportResourceFile($this->exp_dir, $css);
197 }
198
199 // mathjax needs the whole directory to dynamically load resources
200 if (!is_null($this->export_collector)) {
201 $this->export_collector->addDirectory('node_modules/mathjax/es5', 'node_modules/mathjax/es5');
202 }
203 }
204
205 protected function exportResourceFile(
206 string $target_dir,
207 string $file
208 ): void {
209 if (is_int(strpos($file, "?"))) {
210 $file = substr($file, 0, strpos($file, "?"));
211 }
212 if (is_file($file)) {
213 if (is_null($this->export_collector)) {
214 $dir = dirname($file);
215 ilFileUtils::makeDirParents($target_dir . "/" . $dir);
216 if (!is_file($target_dir . "/" . $file)) {
217 copy($file, $target_dir . "/" . $file);
218 }
219 } else {
220 $this->export_collector->addFile($file, $file);
221 }
222 }
223 }
224
225 public function getPreparedMainTemplate(
226 ?ilGlobalTemplateInterface $a_tpl = null
228 global $DIC;
229 $this->log->debug("get main template");
230
231
232 $resource_collector = new \ILIAS\COPage\ResourcesCollector(ilPageObjectGUI::OFFLINE);
233 $resource_injector = new \ILIAS\COPage\ResourcesInjector($resource_collector);
234
235 if (!is_null($a_tpl)) {
236 $tpl = $a_tpl;
237 } else {
238 // template workaround: reset of template
239 $tpl = new ilGlobalPageTemplate($DIC->globalScreen(), $DIC->ui(), $DIC->http());
240 }
241
242 // scripts needed
243 /* @todo check
244 $scripts = [];
245 $scripts = array_merge($scripts, ilPlayerUtil::getJsFilePaths());
246
247 $mathJaxSetting = new ilSetting("MathJax");
248 $use_mathjax = $mathJaxSetting->get("enable");
249 if ($use_mathjax) {
250 $scripts[] = $mathJaxSetting->get("path_to_mathjax");
251 }
252 */
253
254 $tpl->addCss(\ilUtil::getStyleSheetLocation());
255 // important, we pass 0 here, since the export will use the standard directory
258
259 $resource_injector->inject($tpl);
260
261 return $tpl;
262 }
263
267 public function collectPageElements(
268 string $a_type,
269 int $a_id,
270 string $lang = ""
271 ): void {
272 $this->log->debug("collect page elements");
273
274 // collect all dependent pages (only one level deep)
275 $pages[] = [
276 "type" => $a_type,
277 "id" => $a_id
278 ];
279
280 // ... content includes
281 $pcs = ilPageContentUsage::getUsagesOfPage($a_id, $a_type, 0, false, $lang);
282 foreach ($pcs as $pc) {
283 // content includes
284 if ($pc["type"] == "incl") {
285 $pages[] = [
286 "type" => "mep:pg",
287 "id" => $pc["id"]
288 ];
289 }
290 }
291
292 // ... internal links
293 $pg_links = \ilInternalLink::_getTargetsOfSource($a_type, $a_id, $lang);
294 $this->int_links = array_merge($this->int_links, $pg_links);
295 $this->glossary_terms = [];
296
297 // ... glossary pages of internal links
298 foreach ($this->int_links as $int_link) {
299 if ($int_link["type"] == "git") {
300 $this->glossary_terms[] = $int_link["id"];
301 // store linked/embedded media objects of glosssary term
302 $pages[] = [
303 "type" => "term:pg",
304 "id" => $int_link["id"]
305 ];
306 }
307 }
308
309 // resources of pages
310 foreach ($pages as $page) {
311 $page_id = $page["id"];
312 $page_type = $page["type"];
313
314 // collect media objects
315 $pg_mobs = ilObjMediaObject::_getMobsOfObject($page_type, $page_id, 0, $lang);
316 foreach ($pg_mobs as $pg_mob) {
317 $this->mobs[$pg_mob] = $pg_mob;
318 $this->log->debug("HTML Export: Add media object $pg_mob (" . \ilObject::_lookupTitle($pg_mob) . ") " .
319 " due to page $page_id, $page_type ).");
320 }
321
322 // collect all files
323 $files = ilObjFile::_getFilesOfObject($page_type, $page_id, 0, $lang);
324 foreach ($files as $f) {
325 $this->files[$f] = $f;
326 }
327
328 // collect all questions
329 $q_ids = \ilPCQuestion::_getQuestionIdsForPage($a_type, $a_id, $lang);
330 foreach ($q_ids as $q_id) {
331 $this->q_ids[$q_id] = $q_id;
332 }
333 }
334
335 // collect page content items
336 $skill_tree = $ws_tree = null;
337
338 // skills
339 foreach ($pcs as $pc) {
340 if ($pc["type"] == "skmg") {
341 $skill_id = $pc["id"];
342
343 // trying to find user id
344 $user_id = null;
345 switch ($a_type) {
346 case "prtf:pg":
347 $page = new ilPortfolioPage($a_id);
348 $user_id = $page->getCreationUserId();
349 break;
350
351 default:
352 // :TODO:
353 break;
354 }
355
356 if ($user_id) {
357 // we only need 1 instance each
358 if (!$skill_tree) {
359 $skill_tree = $this->skill_tree_service->getGlobalSkillTree();
360
361 $ws_tree = new ilWorkspaceTree($user_id);
362 }
363
364 // walk skill tree
365 $skill_id = (int) $skill_id;
366 $vtree = $this->skill_tree_service->getVirtualSkillTreeForNodeId($skill_id);
367 $tref_id = 0;
368 if (ilSkillTreeNode::_lookupType($skill_id) == "sktr") {
369 $tref_id = $skill_id;
370 $skill_id = ilSkillTemplateReference::_lookupTemplateId($skill_id);
371 }
372 $b_skills = $vtree->getSubTreeForCSkillId($skill_id . ":" . $tref_id, true);
373
374 foreach ($b_skills as $bs) {
375 $skill = ilSkillTreeNodeFactory::getInstance($bs["skill_id"]);
376 $level_data = $skill->getLevelData();
377 foreach ($level_data as $k => $v) {
378 // get assigned materials from personal skill
379 $mat = $this->skill_personal_service->getAssignedMaterials($user_id, $bs["tref_id"], $v["id"]);
380 if (count($mat)) {
381 foreach ($mat as $item) {
382 $wsp_id = $item->getWorkspaceId();
383 $obj_id = $ws_tree->lookupObjectId($wsp_id);
384
385 // all possible material types for now
386 switch (ilObject::_lookupType($obj_id)) {
387 case "file":
388 $this->files[$obj_id] = $obj_id;
389 break;
390
391 case "tstv":
392 $obj = new ilObjTestVerification($obj_id, false);
393 $this->files_direct[$obj_id] = array($obj->getFilePath(),
394 $obj->getOfflineFilename());
395 break;
396
397 case "excv":
398 $obj = new ilObjExerciseVerification($obj_id, false);
399 $this->files_direct[$obj_id] = array($obj->getFilePath(),
400 $obj->getOfflineFilename());
401 break;
402
403 case "crsv":
404 $obj = new ilObjCourseVerification($obj_id, false);
405 $this->files_direct[$obj_id] = array($obj->getFilePath(),
406 $obj->getOfflineFilename());
407 break;
408
409 case "cmxv":
410 $obj = new ilObjCmiXapiVerification($obj_id, false);
411 $this->files_direct[$obj_id] = array($obj->getFilePath(),
412 $obj->getOfflineFilename());
413 break;
414
415 case "ltiv":
416 $obj = new ilObjLTIConsumerVerification($obj_id, false);
417 $this->files_direct[$obj_id] = array($obj->getFilePath(),
418 $obj->getOfflineFilename());
419 break;
420
421 case "scov":
422 $obj = new ilObjSCORMVerification($obj_id, false);
423 $this->files_direct[$obj_id] = array($obj->getFilePath(),
424 $obj->getOfflineFilename());
425 break;
426 }
427 }
428 }
429 }
430 }
431 }
432 }
433 }
434 }
435
439 public function exportPageElements(
440 ?callable $a_update_callback = null
441 ): void {
442 $this->log->debug("export page elements");
443
444 $total = count($this->mobs) + count($this->files) + count($this->files_direct);
445 $cnt = 0;
446 // export all media objects
447 $linked_mobs = array();
448 foreach ($this->mobs as $mob) {
449 if (ilObject::_exists($mob) && ilObject::_lookupType($mob) == "mob") {
450 $this->exportHTMLMOB($mob, $linked_mobs);
451 }
452 if (is_callable($a_update_callback)) {
453 $cnt++;
454 $a_update_callback($total, $cnt);
455 }
456 }
457 $linked_mobs2 = array(); // mobs linked in link areas
458 foreach ($linked_mobs as $mob) {
459 if (ilObject::_exists($mob)) {
460 $this->exportHTMLMOB($mob, $linked_mobs2);
461 }
462 }
463
464 // export all file objects
465 foreach ($this->files as $file) {
466 $this->exportHTMLFile($file);
467 if (is_callable($a_update_callback)) {
468 $cnt++;
469 $a_update_callback($total, $cnt);
470 }
471 }
472
473 // export all files (which are not objects
474 foreach ($this->files_direct as $file_id => $attr) {
475 $this->exportHTMLFileDirect($file_id, $attr[0], $attr[1]);
476 if (is_callable($a_update_callback)) {
477 $cnt++;
478 $a_update_callback($total, $cnt);
479 }
480 }
481
482 $this->exportQuestionFiles();
483
484 // export all glossary terms
485 $this->exportHTMLGlossaryTerms();
486 }
487
491 protected function initResourceTemplate(
492 string $template_file
494 $export_util = new Util("", "", $this->export_collector);
495 $export_util->resetGlobalScreen();
496 $tpl = new ilGlobalTemplate($template_file, true, true, "components/ILIAS/COPage");
497 $this->getPreparedMainTemplate($tpl);
498 $this->global_screen->layout()->meta()->addCss(
500 );
501 $this->global_screen->layout()->meta()->addCss(
503 );
505 return $tpl;
506 }
507
511 public function exportHTMLMOB(
512 int $a_mob_id,
513 array &$a_linked_mobs
514 ): void {
515 $this->log->debug("export html mobs");
516
517 $export_util = new Util("", "", $this->export_collector);
518
519 if (is_null($this->export_collector)) {
520 $source_dir = ilFileUtils::getWebspaceDir() . "/mobs/mm_" . $a_mob_id;
521 if (is_dir($source_dir)) {
522 ilFileUtils::makeDir($this->mobs_dir . "/mm_" . $a_mob_id);
523 ilFileUtils::rCopy($source_dir, $this->mobs_dir . "/mm_" . $a_mob_id);
524 }
525 } else {
526 $mob_res_id = $this->media_manager->getContainerResourceId($a_mob_id);
527 if ($mob_res_id) {
528 $this->export_collector->addContainerDirectory(
529 $mob_res_id->serialize(),
530 "",
531 "/mobs/mm_" . $a_mob_id,
532 );
533 }
534 }
535
536 $mob_obj = new ilObjMediaObject($a_mob_id);
537
538 $tpl = $this->initResourceTemplate("tpl.fullscreen.html");
539 $med_links = ilMediaItem::_getMapAreasIntLinks($a_mob_id);
540 $link_xml = $this->page_linker->getLinkXML($med_links);
541
542 $params = [
543 "mode" => "media",
544 'enlarge_path' => ilUtil::getImagePath("media/enlarge.svg", false, "output", true),
545 'enable_html_mob' => ilObjMediaObject::isTypeAllowed("html") ? "y" : "n",
546 'fullscreen_link' => $this->page_linker->getFullScreenLink()
547 ];
548 if ($this->ref_id > 0) {
549 $params["ref_id"] = $this->ref_id;
550 $params["link_params"] = "ref_id=" . $this->ref_id;
551 }
552
553 $tpl->setVariable("MEDIA_CONTENT", $this->renderMob($mob_obj, $link_xml, $params));
554 $html = $tpl->printToString();
555 if (is_null($this->export_collector)) {
556 $file = $this->exp_dir . "/media_" . $a_mob_id . ".html";
557 $fp = fopen($file, "w+");
558 fwrite($fp, $html);
559 fclose($fp);
560 unset($fp);
561 } else {
562 $this->export_collector->addString($html, "/media_" . $a_mob_id . ".html");
563 $export_util->exportResourceFiles(); // same iteration level as initResourceTemplate which calls reset
564 }
565
566 if ($mob_obj->hasFullscreenItem()) {
567 $tpl = $this->initResourceTemplate("tpl.fullscreen.html");
568 $params["mode"] = "fullscreen";
569 $tpl->setVariable("MEDIA_CONTENT", $this->renderMob($mob_obj, $link_xml, $params));
570 $html = $tpl->printToString();
571 if (is_null($this->export_collector)) {
572 $file = $this->exp_dir . "/fullscreen_" . $a_mob_id . ".html";
573 $fp = fopen($file, "w+");
574 fwrite($fp, $html);
575 fclose($fp);
576 unset($fp);
577 } else {
578 $this->export_collector->addString($html, "/fullscreen_" . $a_mob_id . ".html");
579 $export_util->exportResourceFiles(); // same iteration level as initResourceTemplate which calls reset
580 }
581 }
582
583 $linked_mobs = $mob_obj->getLinkedMediaObjects();
584 $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
585 }
586
590 protected function renderMob(
591 \ilObjMediaObject $mob_obj,
592 string $link_xml,
593 array $params
594 ): string {
595 $xml = "<dummy>" .
596 $mob_obj->getXML(IL_MODE_ALIAS) .
597 $mob_obj->getXML(IL_MODE_OUTPUT) .
598 $link_xml .
599 "</dummy>";
600
601 return $this->xsl->process($xml, $params);
602 }
603
604
608 public function exportHTMLFile(string $a_file_id): void
609 {
610 $file_dir = $this->files_dir . "/file_" . $a_file_id;
611
612 $file_obj = new ilObjFile($a_file_id, false);
613 $source_file = $file_obj->getFile($file_obj->getVersion());
614 if (!is_file($source_file)) {
615 $source_file = $file_obj->getFile();
616 }
617 if (is_file($source_file)) {
618 if (!is_null($this->export_collector)) {
619 $this->export_collector->addFile($source_file, $file_dir . "/" . $file_obj->getFileName());
620 } else {
621 ilFileUtils::makeDir($file_dir);
622 copy($source_file, $file_dir . "/" . $file_obj->getFileName());
623 }
624 }
625 }
626
630 public function exportHTMLFileDirect(
631 string $a_file_id,
632 string $a_source_file,
633 string $a_file_name
634 ): void {
635 $file_dir = $this->files_dir . "/file_" . $a_file_id;
636 ilFileUtils::makeDir($file_dir);
637
638 if (is_file($a_source_file)) {
639 if (is_null($this->export_collector)) {
640 copy(
641 $a_source_file,
642 $file_dir . "/" . ilFileUtils::getASCIIFilename($a_file_name)
643 );
644 } else {
645 $this->export_collector->addFile($a_source_file, $file_dir . "/" . ilFileUtils::getASCIIFilename($a_file_name));
646 }
647 }
648 }
649
653 protected function exportQuestionFiles(): void
654 {
655 // export questions (images)
656 if (count($this->q_ids) > 0) {
657 foreach ($this->q_ids as $q_id) {
658 if (is_null($this->export_collector)) {
659 ilFileUtils::makeDirParents($this->exp_dir . "/assessment/0/" . $q_id . "/images");
661 ilFileUtils::getWebspaceDir() . "/assessment/0/" . $q_id . "/images",
662 $this->exp_dir . "/assessment/0/" . $q_id . "/images"
663 );
664 } else {
665 $source_dir = ilFileUtils::getWebspaceDir() . "/assessment/0/" . $q_id . "/images";
666 if (is_dir($source_dir)) {
667 $this->export_collector->addDirectory(
668 $source_dir,
669 "assessment/0/" . $q_id . "/images"
670 );
671 }
672 }
673 }
674 }
675 }
676
677 public function exportHTMLGlossaryTerms(): void
678 {
679 foreach ($this->glossary_terms as $term_id) {
680 if (!ilGlossaryTerm::_exists($term_id)) {
681 continue;
682 }
683 $tpl = $this->initResourceTemplate("tpl.glossary_term_output.html");
684 $export_util = new Util("", "", $this->export_collector);
685
686 $term_gui = new ilGlossaryTermGUI($term_id);
687 $term_gui->setPageLinker($this->page_linker);
688 $term_gui->setOfflineDirectory($this->exp_dir);
689 $term_gui->output(true, $tpl);
690
691 // write file
692 $html = $tpl->printToString();
693 if (!is_null($this->export_collector)) {
694 $this->export_collector->addString($html, "/term_" . $term_id . ".html");
695 $export_util->exportResourceFiles(); // same iteration level as initResourceTemplate which calls reset
696 } else {
697 $file = $this->exp_dir . "/term_" . $term_id . ".html";
698 $fp = fopen($file, "w+");
699 fwrite($fp, $html);
700 fclose($fp);
701 }
702 }
703 }
704}
Util This class is an interim solution for the HTML export handling with 6.0.
Definition: class.Util.php:33
const IL_MODE_ALIAS
const IL_MODE_OUTPUT
HTML export class for pages.
exportPageElements(?callable $a_update_callback=null)
Export page elements.
ILIAS MediaObjects MediaObjectManager $media_manager
exportHTMLFile(string $a_file_id)
Export file object.
__construct(string $a_exp_dir, ?\ILIAS\COPage\PageLinker $linker=null, int $ref_id=0, protected ?ExportCollector $export_collector=null)
exportStyles()
Export content style.
initResourceTemplate(string $template_file)
Get resource template.
ILIAS Skill Service SkillTreeService $skill_tree_service
renderMob(\ilObjMediaObject $mob_obj, string $link_xml, array $params)
Render Mob.
ILIAS Style Content InternalDomainService $content_style
getPreparedMainTemplate(?ilGlobalTemplateInterface $a_tpl=null)
collectPageElements(string $a_type, int $a_id, string $lang="")
Collect page elements (that need to be exported separately)
exportHTMLFileDirect(string $a_file_id, string $a_source_file, string $a_file_name)
Export file from path.
exportSupportScripts()
Export support scripts.
ILIAS Skill Service SkillPersonalService $skill_personal_service
exportHTMLMOB(int $a_mob_id, array &$a_linked_mobs)
Export media object to html.
ILIAS GlobalScreen Services $global_screen
ILIAS COPage Xsl XslManager $xsl
ILIAS COPage PageLinker $page_linker
exportResourceFile(string $target_dir, string $file)
exportQuestionFiles()
Export question images.
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static getASCIIFilename(string $a_filename)
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
special template class to simplify handling of ITX/PEAR
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _exists(int $a_id)
checks whether a glossary term with specified id exists or not
static getLogger(string $a_component_id)
Get component logger.
Component logger with individual log levels by component id.
static _getMapAreasIntLinks(int $a_mob_id)
get all internal links of map areas of a mob
Class ilObjFile.
static isTypeAllowed(string $a_type)
static _getMobsOfObject(string $a_type, int $a_id, int|false $a_usage_hist_nr=0, string $a_lang="-")
Class ilObjStyleSheet.
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
User class.
static _lookupType(int $id, bool $reference=false)
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static _lookupTitle(int $obj_id)
static _getQuestionIdsForPage(string $a_parent_type, int $a_page_id, string $a_lang="-")
static getUsagesOfPage(int $a_usage_id, string $a_usage_type, int $a_hist_nr=0, bool $a_all_hist_nrs=false, string $a_lang="-")
Get page content usages for page.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $a_obj_id)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ref_id
Definition: ltiauth.php:66
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
if(!file_exists('../ilias.ini.php'))
global $DIC
Definition: shib_login.php:26