ILIAS  release_8 Revision v8.24
Init.php
Go to the documentation of this file.
1<?php
2
20
24class Init
25{
26 protected \ilCtrl $ctrl;
27 protected \ilLanguage $lng;
28
29 public function __construct()
30 {
31 global $DIC;
32
33 $this->ctrl = $DIC->ctrl();
34 $this->lng = $DIC->language();
35 }
36
37 public function initUI(
39 string $openPlaceHolderPcId = ""
40 ): void {
41 $ctrl = $this->ctrl;
43
44 $main_tpl->addOnLoadCode("il.copg.editor.init('" .
45 ILIAS_HTTP_PATH . "/" . $ctrl->getLinkTargetByClass(["ilPageEditorGUI", "ilPageEditorServerAdapterGUI"], "invokeServer") . "','" .
46 $this->ctrl->getFormActionByClass("ilPageEditorGUI")
47 . "', '" . $openPlaceHolderPcId . "');");
48
49 $lang_vars = ["cont_last_update", "cont_error", "cont_sel_el_cut_use_paste", "cont_sel_el_copied_use_paste",
50 "cont_ed_new_col_before", "cont_ed_new_col_after", "cont_ed_col_left", "cont_ed_col_right", "cont_ed_delete_col",
51 "cont_ed_new_row_before", "cont_ed_new_row_after", "cont_ed_row_up", "cont_ed_row_down", "cont_ed_delete_row", "cont_saving"
52 ];
53
54 foreach ($lang_vars as $l) {
55 $lng->toJS($l);
56 }
57
58 if (DEVMODE == 1) {
59 $main_tpl->addJavaScript("./node_modules/tinymce/tinymce.js");
60 } else {
61 $main_tpl->addJavaScript("./node_modules/tinymce/tinymce.min.js");
62 }
63
65 $main_tpl->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js");
66
67 // ensure that form.js is loaded which is needed for file input (js that shows file names)
68 $dummy = new \ilPropertyFormGUI();
69 $dummy->getHTML();
70 }
71}
initUI(\ilGlobalTemplateInterface $main_tpl, string $openPlaceHolderPcId="")
Definition: Init.php:37
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
toJS($a_lang_key, ilGlobalTemplateInterface $a_tpl=null)
Transfer text to Javascript.
static initConnection(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Connection module.
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Init.php:19