ILIAS  release_7 Revision v7.30-3-g800a261c036
Init.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2020 ILIAS open source, Extended GPL, see docs/LICENSE */
4
6
10class Init
11{
15 protected $ctrl;
16
20 protected $lng;
21
25 public function __construct()
26 {
27 global $DIC;
28
29 $this->ctrl = $DIC->ctrl();
30 $this->lng = $DIC->language();
31 }
32
33 public function initUI(\ilGlobalPageTemplate $main_tpl, string $openPlaceHolderPcId = "")
34 {
37
38 $main_tpl->addOnloadCode("il.copg.editor.init('" .
39 ILIAS_HTTP_PATH . "/" . $ctrl->getLinkTargetByClass(["ilPageEditorGUI", "ilPageEditorServerAdapterGUI"], "invokeServer") . "','" .
40 $this->ctrl->getFormActionByClass("ilPageEditorGUI")
41 . "', '".$openPlaceHolderPcId."');");
42
43 $lang_vars = ["cont_last_update", "cont_error", "cont_sel_el_cut_use_paste", "cont_sel_el_copied_use_paste",
44 "cont_ed_new_col_before", "cont_ed_new_col_after", "cont_ed_col_left", "cont_ed_col_right", "cont_ed_delete_col",
45 "cont_ed_new_row_before", "cont_ed_new_row_after", "cont_ed_row_up", "cont_ed_row_down", "cont_ed_delete_row", "cont_saving"
46 ];
47
48 foreach ($lang_vars as $l) {
49 $lng->toJS($l);
50 }
51
52 if (DEVMODE == 1) {
53 $main_tpl->addJavascript("./node_modules/tinymce/tinymce.js");
54 } else {
55 $main_tpl->addJavascript("./node_modules/tinymce/tinymce.min.js");
56 }
57
58 include_once("./Services/YUI/classes/class.ilYuiUtil.php");
60 $main_tpl->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js");
61
62 // ensure that form.js is loaded which is needed for file input (js that shows file names)
63 $dummy = new \ilPropertyFormGUI();
64 $dummy->getHTML();
65 }
66}
An exception for terminatinating execution or to throw for unit testing.
initUI(\ilGlobalPageTemplate $main_tpl, string $openPlaceHolderPcId="")
Definition: Init.php:33
__construct()
Constructor.
Definition: Init.php:25
Class ilGlobalPageTemplate.
addJavaScript($a_js_file, $a_add_version_parameter=true, $a_batch=2)
@inheritDoc
static initConnection(ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Connection module.
global $DIC
Definition: goto.php:24