ILIAS  release_7 Revision v7.30-3-g800a261c036
ilSCORM2004OrganizationHFormGUI Class Reference

This class allows quick editing of a chapter/sco/page hierarchy. More...

+ Inheritance diagram for ilSCORM2004OrganizationHFormGUI:
+ Collaboration diagram for ilSCORM2004OrganizationHFormGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getMenuItems ($a_node, $a_depth, $a_first_child=false, $a_next_sibling=null, $a_childs=null)
 Get menu items. More...
 
 nodeAllowsChilds ($a_node)
 Which nodes allow child nodes? More...
 
 manageDragAndDrop ($a_node, $a_depth, $a_first_child_drop_area=false, $a_next_sibling=null, $a_childs=null)
 Makes nodes drag and drop content and targets. More...
 
 getChildCommands ($a_item)
 Get item commands. More...
 
 getChildIconAlt ($a_item)
 Get icon alt text for an item. More...
 
- Public Member Functions inherited from ilHierarchyFormGUI
 __construct ()
 Constructor. More...
 
 setParentCommand ($a_parent_obj, $a_parent_cmd)
 Set parent gui object/cmd. More...
 
 getParentObject ()
 Get Parent object. More...
 
 getParentCommand ()
 Get parent command. More...
 
 setId ($a_id)
 Set Id. More...
 
 getId ()
 Get Id. More...
 
 setTree ($a_tree)
 Set Tree Object. More...
 
 getTree ()
 Get Tree Object. More...
 
 setCurrentTopNodeId ($a_currenttopnodeid)
 Set Current Top Node ID. More...
 
 getCurrentTopNodeId ()
 Get Current Top Node ID. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setIcon ($a_icon)
 Set Icon. More...
 
 getIcon ()
 Get Icon. More...
 
 setCheckboxName ($a_checkboxname)
 Set Checkbox Name. More...
 
 getCheckboxName ()
 Get Checkbox Name. More...
 
 setDragIcon ($a_dragicon)
 Set Drag Icon Path. More...
 
 getDragIcon ()
 Get Drag Icon Path. More...
 
 setMaxDepth ($a_maxdepth)
 Set Maximum Depth. More...
 
 getMaxDepth ()
 Get Maximum Depth. More...
 
 setExplorerUpdater ($a_exp_frame, $a_exp_id, $a_exp_target_script)
 Set Explorer Updater. More...
 
 setTriggeredUpdateCommand ($a_triggered_update_command)
 Set Explorer Updater. More...
 
 addHelpItem ($a_text, $a_image="")
 Get all help items. More...
 
 getHelpItems ()
 Get all help items. More...
 
 makeDragTarget ($a_id, $a_group, $a_first_child_drop_area=false, $a_as_subitem=false, $a_diss_text="")
 Makes a nodes (following droparea) a drag target. More...
 
 makeDragContent ($a_id, $a_group)
 Makes a node a drag content. More...
 
 addMultiCommand ($a_txt, $a_cmd)
 Add a multi command (for selection of items) More...
 
 addCommand ($a_txt, $a_cmd)
 Add a command. More...
 
 setHighlightedNodes ($a_val)
 Set highlighted nodes. More...
 
 getHighlightedNodes ()
 Get highlighted nodes. More...
 
 setFocusId ($a_val)
 Set focus if. More...
 
 getFocusId ()
 Get focus id. More...
 
 setExpandVariable ($a_val)
 Set expand variable. More...
 
 getExpandVariable ()
 Get expand variable. More...
 
 setExpanded ($a_val)
 Set expanded Array. More...
 
 getExpanded ()
 Get expanded array. More...
 
 updateExpanded ()
 Update expand information in session. More...
 
 setTypeWhiteList ($a_val)
 Set type whitelist. More...
 
 getTypeWhiteList ()
 Get type whitelist. More...
 
 getChilds ($a_node_id=false)
 Get all childs of current node. More...
 
 getContent ()
 Get Form Content. More...
 
 getLegend ()
 Get Legend. More...
 
 getLevelHTML ($a_par_node, $a_depth, &$a_childs)
 Get Form HTML. More...
 
 renderChild ($a_tpl, $a_child, $a_depth, $next_sibling=null)
 Render a single child (including grandchilds) More...
 
 getChildIcon ($a_item)
 Get icon path for an item. More...
 
 getChildIconAlt ($a_item)
 Get icon alt text for an item. More...
 
 getChildCommands ($a_item)
 Get item commands. More...
 
 getChildTitle ($a_child)
 Get child title. More...
 
 getChildInfo ($a_child)
 Get child info. More...
 
 getMenuItems ($a_node, $a_depth, $a_first_child=false, $a_next_sibling=null, $a_childs=null)
 Get menu items for drop area of node. More...
 
 nodeAllowsChilds ($a_node)
 Checks, whether current nodes allows childs at all. More...
 
 manageDragAndDrop ($a_node, $a_depth, $a_first_child=false, $a_next_sibling=null, $a_childs=null)
 Makes nodes drag and drop content and targets. More...
 
 getHTML ()
 Get HTML. More...
 
- Public Member Functions inherited from ilFormGUI
 setFormAction ($a_formaction)
 Set FormAction. More...
 
 getFormAction ()
 Get FormAction. More...
 
 setTarget ($a_target)
 Set Target. More...
 
 getTarget ()
 Get Target. More...
 
 setMultipart ($a_multipart)
 Set Enctype Multipart/Formdata true/false. More...
 
 getMultipart ()
 Get Enctype Multipart/Formdata true/false. More...
 
 setId ($a_id)
 Set Id. More...
 
 getId ()
 Get Id. More...
 
 setName ($a_name)
 Set Name. More...
 
 getName ()
 Get Name. More...
 
 setKeepOpen ($a_keepopen)
 Set Keep Form Tag Open. More...
 
 getKeepOpen ()
 Get Keep Form Tag Open. More...
 
 setOpenTag ($a_open)
 Enable/Disable Open Form Tag. More...
 
 getOpenTag ()
 Get Open Form Tag Enabled. More...
 
 setCloseTag ($a_val)
 Set close tag. More...
 
 getCloseTag ()
 Get close tag. More...
 
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission. More...
 
 getPreventDoubleSubmission ()
 Get prevent double submission. More...
 
 getHTML ()
 Get HTML. More...
 
 getContent ()
 Get Content. More...
 

Protected Attributes

 $user
 
- Protected Attributes inherited from ilHierarchyFormGUI
 $lng
 
 $tpl
 
 $ctrl
 
- Protected Attributes inherited from ilFormGUI
 $formaction
 
 $multipart = false
 
 $keepopen = false
 
 $opentag = true
 
 $id
 
 $name
 
 $prevent_double_submission = false
 

Additional Inherited Members

- Static Public Member Functions inherited from ilHierarchyFormGUI
static getPostMulti ()
 Get multi number of _POST input. More...
 
static getPostNodeId ()
 Get node ID of _POST input. More...
 
static getPostFirstChild ()
 Should node be inserted as first child of target node (true) or as successor (false) More...
 
static getPostFields ()
 Get all post fields. More...
 

Detailed Description

This class allows quick editing of a chapter/sco/page hierarchy.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 13 of file class.ilSCORM2004OrganizationHFormGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSCORM2004OrganizationHFormGUI::__construct ( )

Constructor.

Parameters

Reimplemented from ilHierarchyFormGUI.

Definition at line 25 of file class.ilSCORM2004OrganizationHFormGUI.php.

26 {
27 global $DIC;
28
29 $this->lng = $DIC->language();
30 $this->user = $DIC->user();
31 $this->ctrl = $DIC->ctrl();
32 $lng = $DIC->language();
33
35 $this->setCheckboxName("id");
36 $lng->loadLanguageModule("sahs");
37 $this->setExpandVariable("scexpand");
38 }
user()
Definition: user.php:4
setCheckboxName($a_checkboxname)
Set Checkbox Name.
setExpandVariable($a_val)
Set expand variable.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ilHierarchyFormGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ilHierarchyFormGUI\setCheckboxName(), ilHierarchyFormGUI\setExpandVariable(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ getChildCommands()

ilSCORM2004OrganizationHFormGUI::getChildCommands (   $a_item)

Get item commands.

Parameters
arrayitem array
Returns
array array of arrays("text", "link")

Reimplemented from ilHierarchyFormGUI.

Definition at line 399 of file class.ilSCORM2004OrganizationHFormGUI.php.

400 {
402 $ilCtrl = $this->ctrl;
403
404 $commands = array();
405 //echo "-".$a_item["type"]."-";
406 switch ($a_item["type"]) {
407 case "sco":
408 $ilCtrl->setParameterByClass(
409 "ilscorm2004scogui",
410 "obj_id",
411 $a_item["node_id"]
412 );
413 $commands[] = array("text" => $lng->txt("edit"),
414 "link" => $ilCtrl->getLinkTargetByClass(array("ilobjscorm2004learningmodulegui",
415 "ilscorm2004scogui"), "showOrganization"));
416 break;
417
418 case "ass":
419 $ilCtrl->setParameterByClass(
420 "ilscorm2004assetgui",
421 "obj_id",
422 $a_item["node_id"]
423 );
424 $commands[] = array("text" => $lng->txt("edit"),
425 "link" => $ilCtrl->getLinkTargetByClass(array("ilobjscorm2004learningmodulegui",
426 "ilscorm2004assetgui"), "showOrganization"));
427 break;
428
429 case "chap":
430 $ilCtrl->setParameterByClass(
431 "ilscorm2004chaptergui",
432 "obj_id",
433 $a_item["node_id"]
434 );
435 $commands[] = array("text" => $lng->txt("edit"),
436 "link" => $ilCtrl->getLinkTargetByClass(array("ilobjscorm2004learningmodulegui",
437 "ilscorm2004chaptergui"), "showOrganization"));
438 break;
439
440 case "seqc":
441 $ilCtrl->setParameterByClass(
442 "ilscorm2004seqchaptergui",
443 "obj_id",
444 $a_item["node_id"]
445 );
446 $commands[] = array("text" => $lng->txt("edit"),
447 "link" => $ilCtrl->getLinkTargetByClass(array("ilobjscorm2004learningmodulegui",
448 "ilscorm2004seqchaptergui"), "showOrganization"));
449 break;
450
451 case "page":
452 $ilCtrl->setParameterByClass(
453 "ilscorm2004pagenodegui",
454 "obj_id",
455 $a_item["node_id"]
456 );
457 $commands[] = array("text" => $lng->txt("edit"),
458 "link" => $ilCtrl->getLinkTargetByClass(array("ilobjscorm2004learningmodulegui",
459 "ilscorm2004pagenodegui"), "edit"));
460 break;
461 }
462
463 return $commands;
464 }

References ilHierarchyFormGUI\$ctrl, and ilHierarchyFormGUI\$lng.

◆ getChildIconAlt()

ilSCORM2004OrganizationHFormGUI::getChildIconAlt (   $a_item)

Get icon alt text for an item.

Parameters
arrayitem array
Returns
string icon alt text

Reimplemented from ilHierarchyFormGUI.

Definition at line 472 of file class.ilSCORM2004OrganizationHFormGUI.php.

473 {
475
476 return $lng->txt("icon") . " " . $lng->txt("obj_" . $a_item["type"]);
477 }

References ilHierarchyFormGUI\$lng.

◆ getMenuItems()

ilSCORM2004OrganizationHFormGUI::getMenuItems (   $a_node,
  $a_depth,
  $a_first_child = false,
  $a_next_sibling = null,
  $a_childs = null 
)

Get menu items.

Reimplemented from ilHierarchyFormGUI.

Definition at line 43 of file class.ilSCORM2004OrganizationHFormGUI.php.

44 {
47
48 // @todo: move this to a service since it can be used here, too
49 include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
50
51 include_once("./Services/COPage/Layout/classes/class.ilPageLayout.php");
52 $page_layouts = (count(ilPageLayout::activeLayouts()) > 0);
53 $special_pages = (count(ilPageLayout::activeLayouts(true)) > 0);
54
55 $cmds = array();
56 //echo "+".$a_depth."-";
57 if (!$a_first_child) { // drop area of node
58 // page inserts
59 if ($a_node["type"] == "page" || ($a_node["type"] == "sco" && count($a_childs) == 0) ||
60 ($a_node["type"] == "ass" && count($a_childs) == 0)) {
61 if ($a_node["type"] == "sco" || $a_node["type"] == "ass") {
62 $cmds[] = array("text" => $lng->txt("sahs_insert_page"), "cmd" => "insertPage", "multi" => 10,
63 "as_subitem" => true);
64 if ($page_layouts > 0) {
65 $cmds[] = array("text" => $lng->txt("sahs_insert_pagelayout"), "cmd" => "insertTemplateGUI", "multi" => 10,
66 "as_subitem" => true);
67 }
68 if ($special_pages > 0) {
69 $cmds[] = array("text" => $lng->txt("sahs_insert_special_page"), "cmd" => "insertSpecialPage", "multi" => 10,
70 "as_subitem" => true);
71 }
72 if ($ilUser->clipboardHasObjectsOfType("page")) {
73 $cmds[] = array("text" => $lng->txt("sahs_insert_page_from_clip"),
74 "cmd" => "insertPageClip", "as_subitem" => true);
75 }
76 if (($ilUser->clipboardHasObjectsOfType("pg") && ilEditClipboard::getAction() == "copy")) {
77 $cmds[] = array("text" => $lng->txt("sahs_insert_pg_from_clip"),
78 "cmd" => "insertPageClip", "as_subitem" => true);
79 }
80 } else {
81 $cmds[] = array("text" => $lng->txt("sahs_insert_page"), "cmd" => "insertPage", "multi" => 10);
82 if ($page_layouts > 0) {
83 $cmds[] = array("text" => $lng->txt("sahs_insert_pagelayout"), "cmd" => "insertTemplateGUI", "multi" => 10);
84 }
85 if ($special_pages > 0) {
86 $cmds[] = array("text" => $lng->txt("sahs_insert_special_page"), "cmd" => "insertSpecialPage", "multi" => 10);
87 }
88
89 if ($ilUser->clipboardHasObjectsOfType("page")) {
90 $cmds[] = array("text" => $lng->txt("sahs_insert_page_from_clip"),
91 "cmd" => "insertPageClip");
92 }
93 if (($ilUser->clipboardHasObjectsOfType("pg") && ilEditClipboard::getAction() == "copy")) {
94 $cmds[] = array("text" => $lng->txt("sahs_insert_pg_from_clip"),
95 "cmd" => "insertPageClip");
96 }
97 }
98 }
99
100 // sco/asset inserts... in/after chapters
101 if ($a_node["type"] == "chap" || $a_node["type"] == "seqc") {
102 $cmds[] = array("text" => $lng->txt("sahs_insert_ass"), "cmd" => "insertAsset", "multi" => 10);
103 if (count($a_childs) == 0) {
104 $cmds[] = array("text" => $lng->txt("sahs_insert_ass_inside_chap"), "cmd" => "insertAsset", "multi" => 10,
105 "as_subitem" => true);
106 }
107 $cmds[] = array("text" => $lng->txt("sahs_insert_sco"), "cmd" => "insertSco", "multi" => 10);
108 if (count($a_childs) == 0) {
109 $cmds[] = array("text" => $lng->txt("sahs_insert_sco_inside_chap"), "cmd" => "insertSco", "multi" => 10,
110 "as_subitem" => true);
111 }
112 if ($ilUser->clipboardHasObjectsOfType("sco")) {
113 $cmds[] = array("text" => $lng->txt("sahs_insert_sco_from_clip"),
114 "cmd" => "insertScoClip", "as_subitem" => false);
115 if (count($a_childs) == 0) {
116 $cmds[] = array("text" => $lng->txt("sahs_insert_sco_from_clip_inside_chap"),
117 "cmd" => "insertScoClip", "as_subitem" => true);
118 }
119 }
120 if ($ilUser->clipboardHasObjectsOfType("ass")) {
121 $cmds[] = array("text" => $lng->txt("sahs_insert_ass_from_clip"),
122 "cmd" => "insertAssetClip", "as_subitem" => false);
123 if (count($a_childs) == 0) {
124 $cmds[] = array("text" => $lng->txt("sahs_insert_ass_from_clip_inside_chap"),
125 "cmd" => "insertAssetClip", "as_subitem" => true);
126 }
127 }
128
129 // insert chapter from learning module
130 if ($ilUser->clipboardHasObjectsOfType("st") && ilEditClipboard::getAction() == "copy") {
131 $cmds[] = array("text" => $lng->txt("sahs_insert_st_from_clip"),
132 "cmd" => "insertLMChapterClip", "as_subitem" => false);
133 if (count($a_childs) == 0) {
134 $cmds[] = array("text" => $lng->txt("sahs_insert_st_from_clip_inside_chap"),
135 "cmd" => "insertLMChapterClip", "as_subitem" => true);
136 }
137 }
138 }
139
140 // sco/asset inserts... after sco/assets
141 if ($a_node["type"] == "sco" || $a_node["type"] == "ass") {
142 // scos
143 $cmds[] = array("text" => $lng->txt("sahs_insert_sco"), "cmd" => "insertSco", "multi" => 10);
144 if ($ilUser->clipboardHasObjectsOfType("sco")) {
145 $cmds[] = array("text" => $lng->txt("sahs_insert_sco_from_clip"),
146 "cmd" => "insertScoClip");
147 }
148
149 // assets
150 $cmds[] = array("text" => $lng->txt("sahs_insert_ass"), "cmd" => "insertAsset", "multi" => 10);
151 if ($ilUser->clipboardHasObjectsOfType("ass")) {
152 $cmds[] = array("text" => $lng->txt("sahs_insert_ass_from_clip"),
153 "cmd" => "insertAssetClip");
154 }
155
156 // chapters
157 if ($a_node["depth"] == 2) {
158 $cmds[] = array("text" => $lng->txt("sahs_insert_chapter"), "cmd" => "insertChapter", "multi" => 10);
159 if ($ilUser->clipboardHasObjectsOfType("chap")) {
160 $cmds[] = array("text" => $lng->txt("sahs_insert_chap_from_clip"),
161 "cmd" => "insertChapterClip");
162 }
163 }
164
165 // insert chapter from learning module
166 if ($ilUser->clipboardHasObjectsOfType("st") && ilEditClipboard::getAction() == "copy") {
167 $cmds[] = array("text" => $lng->txt("sahs_insert_st_from_clip"),
168 "cmd" => "insertLMChapterClip");
169 }
170 }
171 //if ($a_node["type"] == "chap")
172 //{
173 // $cmds[] = array("text" => $lng->txt("sahs_insert_sub_chapter"), "cmd" => "insertSubchapter", "multi" => 10);
174 //}
175
176 // chapter inserts
177 if ($a_node["type"] == "chap" || $a_node["type"] == "seqc") {
178 $cmds[] = array("text" => $lng->txt("sahs_insert_chapter"), "cmd" => "insertChapter", "multi" => 10);
179 if ($ilUser->clipboardHasObjectsOfType("chap")) {
180 $cmds[] = array("text" => $lng->txt("sahs_insert_chap_from_clip"),
181 "cmd" => "insertChapterClip");
182 }
183
184 // insert chapter from learning module
185 /*
186 if ($ilUser->clipboardHasObjectsOfType("st") && ilEditClipboard::getAction() == "copy")
187 {
188 $cmds[] = array("text" => $lng->txt("sahs_insert_st_from_clip"),
189 "cmd" => "insertLMChapterClip");
190 }*/
191
192 //check if parent chaper has sequencing scenario
193 // $cmds[] = array("text" => $lng->txt("sahs_insert_scenario"), "cmd" => "insertScenarioGUI", "multi" => 0);
194 }
195 } else { // drop area before first child of node
196 if ($a_node["type"] == "" && $a_node["node_id"] == 1) { // top node
197 // scos
198 $cmds[] = array("text" => $lng->txt("sahs_insert_sco"), "cmd" => "insertSco", "multi" => 10);
199 if ($ilUser->clipboardHasObjectsOfType("sco")) {
200 $cmds[] = array("text" => $lng->txt("sahs_insert_sco_from_clip"),
201 "cmd" => "insertScoClip");
202 }
203
204 // assets
205 $cmds[] = array("text" => $lng->txt("sahs_insert_ass"), "cmd" => "insertAsset", "multi" => 10);
206 if ($ilUser->clipboardHasObjectsOfType("ass")) {
207 $cmds[] = array("text" => $lng->txt("sahs_insert_ass_from_clip"),
208 "cmd" => "insertAssetClip");
209 }
210
211 // chapters
212 $cmds[] = array("text" => $lng->txt("sahs_insert_chapter"), "cmd" => "insertChapter", "multi" => 10);
213 if ($ilUser->clipboardHasObjectsOfType("chap")) {
214 $cmds[] = array("text" => $lng->txt("sahs_insert_chap_from_clip"),
215 "cmd" => "insertChapterClip");
216 }
217
218 // insert chapter from learning module
219 if ($ilUser->clipboardHasObjectsOfType("st") && ilEditClipboard::getAction() == "copy") {
220 $cmds[] = array("text" => $lng->txt("sahs_insert_st_from_clip"),
221 "cmd" => "insertLMChapterClip");
222 }
223
224 // $cmds[] = array("text" => $lng->txt("sahs_insert_scenario"), "cmd" => "insertScenarioGUI", "multi" => 0);
225 }
226 if ($a_node["type"] == "chap" || $a_node["type"] == "seqc") {
227 $cmds[] = array("text" => $lng->txt("sahs_insert_sco"), "cmd" => "insertSco", "multi" => 10);
228 $cmds[] = array("text" => $lng->txt("sahs_insert_ass"), "cmd" => "insertAsset", "multi" => 10);
229 if ($ilUser->clipboardHasObjectsOfType("sco")) {
230 $cmds[] = array("text" => $lng->txt("sahs_insert_sco_from_clip"),
231 "cmd" => "insertScoClip");
232 }
233 if ($ilUser->clipboardHasObjectsOfType("ass")) {
234 $cmds[] = array("text" => $lng->txt("sahs_insert_ass_from_clip"),
235 "cmd" => "insertAssetClip");
236 }
237 // insert chapter from learning module
238 if ($ilUser->clipboardHasObjectsOfType("st") && ilEditClipboard::getAction() == "copy") {
239 $cmds[] = array("text" => $lng->txt("sahs_insert_st_from_clip"),
240 "cmd" => "insertLMChapterClip");
241 }
242 }
243 if ($a_node["type"] == "sco" || $a_node["type"] == "ass") {
244 $cmds[] = array("text" => $lng->txt("sahs_insert_page"), "cmd" => "insertPage", "multi" => 10);
245 if ($page_layouts > 0) {
246 $cmds[] = array("text" => $lng->txt("sahs_insert_pagelayout"), "cmd" => "insertTemplateGUI", "multi" => 10);
247 }
248 if ($special_pages > 0) {
249 $cmds[] = array("text" => $lng->txt("sahs_insert_special_page"), "cmd" => "insertSpecialPage", "multi" => 10);
250 }
251
252 if ($ilUser->clipboardHasObjectsOfType("page")) {
253 $cmds[] = array("text" => $lng->txt("sahs_insert_page_from_clip"),
254 "cmd" => "insertPageClip");
255 }
256 if (($ilUser->clipboardHasObjectsOfType("pg") && ilEditClipboard::getAction() == "copy")) {
257 $cmds[] = array("text" => $lng->txt("sahs_insert_pg_from_clip"),
258 "cmd" => "insertPageClip");
259 }
260 }
261
262 /* if ($a_childs["type"] == "")
263 {
264 $cmds[] = array("text" => "insert Chapter", "cmd" => "insertChapter", "multi" => 10);
265 }*/
266 }
267
268 return $cmds;
269 }
static activeLayouts($a_special_page=false, $a_module=null)
Get active layouts.
$ilUser
Definition: imgupload.php:18

References $ilUser, ilHierarchyFormGUI\$lng, $user, ilPageLayout\activeLayouts(), and ilEditClipboard\getAction().

+ Here is the call graph for this function:

◆ manageDragAndDrop()

ilSCORM2004OrganizationHFormGUI::manageDragAndDrop (   $a_node,
  $a_depth,
  $a_first_child_drop_area = false,
  $a_next_sibling = null,
  $a_childs = null 
)

Makes nodes drag and drop content and targets.

Parameters
object$a_nodenode array

Reimplemented from ilHierarchyFormGUI.

Definition at line 287 of file class.ilSCORM2004OrganizationHFormGUI.php.

288 {
290
291 if ($a_node["type"] == "ass") {
292 $this->makeDragContent($a_node["node_id"], "grp_sco");
293 } else {
294 $this->makeDragContent($a_node["node_id"], "grp_" . $a_node["type"]);
295 }
296
297 if (!$a_first_child_drop_area) {
298 // page targets
299 if ($a_node["type"] == "page" || ($a_node["type"] == "sco" && count($a_childs) == 0)
300 || ($a_node["type"] == "ass" && count($a_childs) == 0)) {
301 if ($a_node["type"] == "sco" || $a_node["type"] == "ass") {
302 $this->makeDragTarget(
303 $a_node["node_id"],
304 "grp_page",
305 $a_first_child_drop_area,
306 true,
307 ""
308 );
309 } else {
310 $this->makeDragTarget(
311 $a_node["node_id"],
312 "grp_page",
313 $a_first_child_drop_area,
314 false,
315 ""
316 );
317 }
318 }
319
320 if ($a_node["type"] == "chap" && count($a_childs) == 0) {
321 $this->makeDragTarget(
322 $a_node["node_id"],
323 "grp_sco",
324 $a_first_child_drop_area,
325 true,
326 $lng->txt("cont_insert_into_chap")
327 );
328 }
329
330 // sco targets
331 if ($a_node["type"] == "sco" || $a_node["type"] == "ass" || $a_node["type"] == "chap") {
332 $this->makeDragTarget(
333 $a_node["node_id"],
334 "grp_sco",
335 $a_first_child_drop_area,
336 false,
337 $lng->txt("cont_insert_after_" . $a_node["type"])
338 );
339 }
340
341 //if ($a_node["type"] != "pg")
342 //{
343 // $this->makeDragTarget($a_node["node_id"], "grp_st", $a_first_child_drop_area,
344 // true, $lng->txt("cont_insert_as_subchapter"));
345 //}
346
347 // chapter targets // chapters
348 if ($a_node["depth"] == 2) {
349 $this->makeDragTarget(
350 $a_node["node_id"],
351 "grp_chap",
352 $a_first_child_drop_area,
353 false,
354 $lng->txt("sahs_insert_as_chapter")
355 );
356 // $this->makeDragTarget($a_node["node_id"], "grp_sco", $a_first_child_drop_area,
357// false, $lng->txt("cont_insert_after_chap"));
358 }
359 } else {
360 if ($a_node["type"] == "" && $a_node["node_id"] == 1) { // top node
361 $this->makeDragTarget(
362 $a_node["node_id"],
363 "grp_chap",
364 $a_first_child_drop_area,
365 true
366 );
367 $this->makeDragTarget(
368 $a_node["node_id"],
369 "grp_sco",
370 $a_first_child_drop_area,
371 true
372 );
373 }
374 if ($a_node["type"] == "chap") {
375 $this->makeDragTarget(
376 $a_node["node_id"],
377 "grp_sco",
378 $a_first_child_drop_area,
379 true
380 );
381 }
382 if ($a_node["type"] == "sco" || $a_node["type"] == "ass") {
383 $this->makeDragTarget(
384 $a_node["node_id"],
385 "grp_page",
386 $a_first_child_drop_area,
387 true
388 );
389 }
390 }
391 }
makeDragContent($a_id, $a_group)
Makes a node a drag content.
makeDragTarget($a_id, $a_group, $a_first_child_drop_area=false, $a_as_subitem=false, $a_diss_text="")
Makes a nodes (following droparea) a drag target.

References ilHierarchyFormGUI\$lng, ilHierarchyFormGUI\makeDragContent(), and ilHierarchyFormGUI\makeDragTarget().

+ Here is the call graph for this function:

◆ nodeAllowsChilds()

ilSCORM2004OrganizationHFormGUI::nodeAllowsChilds (   $a_node)

Which nodes allow child nodes?

Reimplemented from ilHierarchyFormGUI.

Definition at line 274 of file class.ilSCORM2004OrganizationHFormGUI.php.

275 {
276 if ($a_node["type"] == "pg" || $a_node["type"] == "page") {
277 return false;
278 }
279 return true;
280 }

Field Documentation

◆ $user

ilSCORM2004OrganizationHFormGUI::$user
protected

Definition at line 18 of file class.ilSCORM2004OrganizationHFormGUI.php.

Referenced by getMenuItems().


The documentation for this class was generated from the following file: