5 include_once(
"./Services/Form/classes/class.ilHierarchyFormGUI.php");
6 include_once(
"./Modules/LearningModule/classes/class.ilLMObjTranslation.php");
32 $this->lng = $DIC->language();
33 $this->
user = $DIC->user();
34 $this->ctrl = $DIC->ctrl();
35 $this->lm_type = $a_lm_type;
37 $this->lang = ($a_lang ==
"")
40 parent::__construct();
52 if ($this->lang !=
"-") {
54 return $lmobjtrans->getTitle();
56 return $a_child[
"title"];
67 if ($this->lang !=
"-") {
68 return $a_child[
"title"];
76 public function getMenuItems($a_node, $a_depth, $a_first_child =
false, $a_next_sibling = null, $a_childs = null)
83 if ($a_childs == null) {
87 if (!$a_first_child) {
88 if ($a_node[
"type"] ==
"pg" || ($a_node[
"type"] ==
"st" && count($a_childs) == 0 && $this->
getMaxDepth() != 0)) {
89 if ($a_node[
"type"] ==
"st") {
90 $cmds[] =
array(
"text" =>
$lng->txt(
"cont_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10,
91 "as_subitem" =>
true);
92 if (
$ilUser->clipboardHasObjectsOfType(
"pg")) {
93 $cmds[] =
array(
"text" =>
$lng->txt(
"cont_insert_page_from_clip"),
94 "cmd" =>
"insertPageClip",
"as_subitem" =>
true);
97 $cmds[] =
array(
"text" =>
$lng->txt(
"cont_insert_page"),
"cmd" =>
"insertPage",
"multi" => 10);
98 if (
$ilUser->clipboardHasObjectsOfType(
"pg")) {
99 $cmds[] =
array(
"text" =>
$lng->txt(
"cont_insert_page_from_clip"),
100 "cmd" =>
"insertPageClip");
104 if ($a_node[
"type"] !=
"pg" && $this->
getMaxDepth() != 0) {
105 $cmds[] =
array(
"text" =>
$lng->txt(
"cont_insert_subchapter"),
106 "cmd" =>
"insertSubchapter",
"multi" => 10);
107 if (
$ilUser->clipboardHasObjectsOfType(
"st")) {
108 $cmds[] =
array(
"text" =>
$lng->txt(
"cont_insert_subchapter_from_clip"),
109 "cmd" =>
"insertSubchapterClip");
113 if (($a_next_sibling[
"type"] !=
"pg" && ($a_depth == 0 || $a_next_sibling[
"type"] ==
"st"))
114 || $a_node[
"type"] ==
"st") {
115 $cmds[] =
array(
"text" =>
$lng->txt(
"cont_insert_chapter"),
116 "cmd" =>
"insertChapter",
"multi" => 10);
117 if (
$ilUser->clipboardHasObjectsOfType(
"st")) {
118 $cmds[] =
array(
"text" =>
$lng->txt(
"cont_insert_chapter_from_clip"),
119 "cmd" =>
"insertChapterClip");
123 if ($a_node[
"type"] ==
"st" && $this->
getMaxDepth() != 0) {
124 $cmds[] =
array(
"text" =>
$lng->txt(
"cont_insert_page"),
125 "cmd" =>
"insertPage",
"multi" => 10);
126 if (
$ilUser->clipboardHasObjectsOfType(
"pg")) {
127 $cmds[] =
array(
"text" =>
$lng->txt(
"cont_insert_page_from_clip"),
128 "cmd" =>
"insertPageClip");
131 if ($a_childs[0][
"type"] !=
"pg") {
132 $cmds[] =
array(
"text" =>
$lng->txt(
"cont_insert_chapter"),
133 "cmd" =>
"insertChapter",
"multi" => 10);
134 if (
$ilUser->clipboardHasObjectsOfType(
"st")) {
135 $cmds[] =
array(
"text" =>
$lng->txt(
"cont_insert_chapter_from_clip"),
136 "cmd" =>
"insertChapterClip");
149 if ($a_node[
"type"] ==
"pg") {
160 public function manageDragAndDrop($a_node, $a_depth, $a_first_child_drop_area =
false, $a_next_sibling = null, $a_childs = null)
166 if ($a_childs == null) {
170 if (!$a_first_child_drop_area) {
171 if ($a_node[
"type"] ==
"pg" || ($a_node[
"type"] ==
"st" && count($a_childs) == 0 && $this->
getMaxDepth() != 0)) {
172 if ($a_node[
"type"] ==
"st") {
176 $a_first_child_drop_area,
184 $a_first_child_drop_area,
191 if ($a_node[
"type"] !=
"pg" && $this->
getMaxDepth() != 0) {
195 $a_first_child_drop_area,
197 $lng->txt(
"cont_insert_as_subchapter")
201 if (($a_next_sibling[
"type"] !=
"pg" && ($a_depth == 0 || $a_next_sibling[
"type"] ==
"st"))
202 || $a_node[
"type"] ==
"st") {
206 $a_first_child_drop_area,
208 $lng->txt(
"cont_insert_as_chapter")
212 if ($a_node[
"type"] ==
"st" && $this->
getMaxDepth() != 0) {
216 $a_first_child_drop_area,
220 if ($a_childs[0][
"type"] !=
"pg") {
224 $a_first_child_drop_area,
239 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
241 $img =
"icon_" . $a_item[
"type"] .
".svg";
243 if ($a_item[
"type"] ==
"pg") {
244 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
249 $lm_set->get(
"time_scheduled_page_activation")
253 $img_sc = (
$lm_set->get(
"time_scheduled_page_activation") &&
258 $img =
"icon_pg" . $img_sc .
".svg";
261 $img =
"icon_pg_d" . $img_sc .
".svg";
263 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
269 $img =
"icon_pg_del" . $img_sc .
".svg";
286 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
288 if ($a_item[
"type"] ==
"pg") {
289 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
293 return $lng->txt(
"cont_page_deactivated");
295 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
301 return $lng->txt(
"cont_page_deactivated_elements");
319 $lm_class =
"ilobjlearningmodulegui";
322 switch ($a_item[
"type"]) {
329 $commands[] =
array(
"text" =>
$lng->txt(
"edit"),
330 "link" =>
$ilCtrl->getLinkTargetByClass(
array($lm_class,
"illmpageobjectgui"),
"edit"));
335 "ilstructureobjectgui",
339 $commands[] =
array(
"text" =>
$lng->txt(
"edit"),
340 "link" =>
$ilCtrl->getLinkTargetByClass(
array($lm_class,
"ilstructureobjectgui"),
"view"));
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Create styles array
The data for the language used.
static _lookupContainsDeactivatedElements($a_id, $a_parent_type, $a_lang="-")
lookup whether page contains deactivated elements
static _isScheduledActivation($a_id, $a_parent_type, $a_lang="-")
Check whether page is activated by time schedule.
Translation information on lm object.