ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
 getMenuItems ($a_node, $a_depth, $a_first_child=false, $a_next_sibling=null, $a_childs)
 Get menu items.
 nodeAllowsChilds ($a_node)
 Which nodes allow child nodes?
 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.
 getChildCommands ($a_item)
 Get item commands.
- Public Member Functions inherited from ilHierarchyFormGUI
 setParentCommand ($a_parent_obj, $a_parent_cmd)
 Set parent gui object/cmd.
 getParentObject ()
 Get Parent object.
 getParentCommand ()
 Get parent command.
 setId ($a_id)
 Set Id.
 getId ()
 Get Id.
 setTree ($a_tree)
 Set Tree Object.
 getTree ()
 Get Tree Object.
 setCurrentTopNodeId ($a_currenttopnodeid)
 Set Current Top Node ID.
 getCurrentTopNodeId ()
 Get Current Top Node ID.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setIcon ($a_icon)
 Set Icon.
 getIcon ()
 Get Icon.
 setCheckboxName ($a_checkboxname)
 Set Checkbox Name.
 getCheckboxName ()
 Get Checkbox Name.
 setDragIcon ($a_dragicon)
 Set Drag Icon Path.
 getDragIcon ()
 Get Drag Icon Path.
 setMaxDepth ($a_maxdepth)
 Set Maximum Depth.
 getMaxDepth ()
 Get Maximum Depth.
 setExplorerUpdater ($a_exp_frame, $a_exp_id, $a_exp_target_script)
 Set Explorer Updater.
 setTriggeredUpdateCommand ($a_triggered_update_command)
 Set Explorer Updater.
 addHelpItem ($a_text, $a_image="")
 Get all help items.
 getHelpItems ()
 Get all help items.
 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.
 makeDragContent ($a_id, $a_group)
 Makes a node a drag content.
 addMultiCommand ($a_txt, $a_cmd)
 Add a multi command (for selection of items)
 addCommand ($a_txt, $a_cmd)
 Add a command.
 setHighlightedNodes ($a_val)
 Set highlighted nodes.
 getHighlightedNodes ()
 Get highlighted nodes.
 setFocusId ($a_val)
 Set focus if.
 getFocusId ()
 Get focus id.
 setExpandVariable ($a_val)
 Set expand variable.
 getExpandVariable ()
 Get expand variable.
 setExpanded ($a_val)
 Set expanded Array.
 getExpanded ()
 Get expanded array.
 updateExpanded ()
 Update expand information in session.
 getChilds ($a_node_id=false)
 Get all childs of current node.
 getContent ()
 Get Form Content.
 getLevelHTML ($a_par_node, $a_depth, &$a_childs)
 Get Form HTML.
 renderChild ($a_tpl, $a_child, $a_depth, $next_sibling=null)
 Render a single child (including grandchilds)
 getChildIcon ($a_item)
 Get icon path for an item.
 getChildIconAlt ($a_item)
 Get icon alt text for an item.
- Public Member Functions inherited from ilFormGUI
 ilFormGUI ()
 Constructor.
 setFormAction ($a_formaction)
 Set FormAction.
 getFormAction ()
 Get FormAction.
 setTarget ($a_target)
 Set Target.
 getTarget ()
 Get Target.
 setMultipart ($a_multipart)
 Set Enctype Multipart/Formdata true/false.
 getMultipart ()
 Get Enctype Multipart/Formdata true/false.
 setKeepOpen ($a_keepopen)
 Set Keep Form Tag Open.
 getKeepOpen ()
 Get Keep Form Tag Open.
 setOpenTag ($a_open)
 Enable/Disable Open Form Tag.
 getOpenTag ()
 Get Open Form Tag Enabled.
 setCloseTag ($a_val)
 Set close tag.
 getCloseTag ()
 Get close tag.
 getHTML ()
 Get HTML.

Additional Inherited Members

- Static Public Member Functions inherited from ilHierarchyFormGUI
static getPostMulti ()
 Get multi number of _POST input.
static getPostNodeId ()
 Get node ID of _POST input.
static getPostFirstChild ()
 Should node be inserted as first child of target node (true) or as successor (false)
- Protected Attributes inherited from ilFormGUI
 $formaction
 $multipart = false
 $keepopen = false
 $opentag = true

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 33 of file class.ilSCORM2004OrganizationHFormGUI.php.

Constructor & Destructor Documentation

ilSCORM2004OrganizationHFormGUI::__construct ( )

Constructor.

Parameters

Reimplemented from ilHierarchyFormGUI.

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

References $lng, ilHierarchyFormGUI\setCheckboxName(), and ilHierarchyFormGUI\setExpandVariable().

{
global $lng;
$this->setCheckboxName("id");
$lng->loadLanguageModule("sahs");
$this->setExpandVariable("scexpand");
}

+ Here is the call graph for this function:

Member Function Documentation

ilSCORM2004OrganizationHFormGUI::getChildCommands (   $a_item)

Get item commands.

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

Reimplemented from ilHierarchyFormGUI.

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

References $ilCtrl, and $lng.

{
global $lng, $ilCtrl;
$commands = array();
//echo "-".$a_item["type"]."-";
switch ($a_item["type"])
{
case "sco":
$ilCtrl->setParameterByClass("ilscorm2004scogui", "obj_id",
$a_item["node_id"]);
$commands[] = array("text" => $lng->txt("edit"),
"link" => $ilCtrl->getLinkTargetByClass(array("ilobjscorm2004learningmodulegui",
"ilscorm2004scogui"), "showOrganization"));
break;
case "chap":
$ilCtrl->setParameterByClass("ilscorm2004chaptergui", "obj_id",
$a_item["node_id"]);
$commands[] = array("text" => $lng->txt("edit"),
"link" => $ilCtrl->getLinkTargetByClass(array("ilobjscorm2004learningmodulegui",
"ilscorm2004chaptergui"), "showOrganization"));
break;
case "seqc":
$ilCtrl->setParameterByClass("ilscorm2004seqchaptergui", "obj_id",
$a_item["node_id"]);
$commands[] = array("text" => $lng->txt("edit"),
"link" => $ilCtrl->getLinkTargetByClass(array("ilobjscorm2004learningmodulegui",
"ilscorm2004seqchaptergui"), "showOrganization"));
break;
case "page":
$ilCtrl->setParameterByClass("ilscorm2004pagenodegui", "obj_id",
$a_item["node_id"]);
$commands[] = array("text" => $lng->txt("edit"),
"link" => $ilCtrl->getLinkTargetByClass(array("ilobjscorm2004learningmodulegui",
"ilscorm2004pagenodegui"), "edit"));
break;
}
return $commands;
}
ilSCORM2004OrganizationHFormGUI::getMenuItems (   $a_node,
  $a_depth,
  $a_first_child = false,
  $a_next_sibling = null,
  $a_childs 
)

Get menu items.

Reimplemented from ilHierarchyFormGUI.

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

References $lng.

{
global $lng, $ilUser;
$cmds = array();
if (!$a_first_child) // drop area of node
{
// page inserts
if ($a_node["type"] == "page" || ($a_node["type"] == "sco" && count($a_childs) == 0))
{
if ($a_node["type"] == "sco")
{
$cmds[] = array("text" => $lng->txt("sahs_insert_page"), "cmd" => "insertPage", "multi" => 10,
"as_subitem" => true);
$cmds[] = array("text" => $lng->txt("sahs_insert_pagelayout"), "cmd" => "insertTemplateGUI", "multi" => 10,
"as_subitem" => true);
if ($ilUser->clipboardHasObjectsOfType("page"))
{
$cmds[] = array("text" => $lng->txt("sahs_insert_page_from_clip"),
"cmd" => "insertPageClip", "as_subitem" => true);
}
}
else
{
$cmds[] = array("text" => $lng->txt("sahs_insert_page"), "cmd" => "insertPage", "multi" => 10);
$cmds[] = array("text" => $lng->txt("sahs_insert_pagelayout"), "cmd" => "insertTemplateGUI", "multi" => 10);
if ($ilUser->clipboardHasObjectsOfType("page"))
{
$cmds[] = array("text" => $lng->txt("sahs_insert_page_from_clip"),
"cmd" => "insertPageClip");
}
}
}
// sco inserts
if ($a_node["type"] == "sco" || (($a_node["type"] == "chap" || $a_node["type"] == "seqc") && count($a_childs) == 0))
{
if ($a_node["type"] == "chap" || $a_node["type"] == "seqc")
{
$cmds[] = array("text" => $lng->txt("sahs_insert_sco"), "cmd" => "insertSco", "multi" => 10,
"as_subitem" => true);
if ($ilUser->clipboardHasObjectsOfType("sco"))
{
$cmds[] = array("text" => $lng->txt("sahs_insert_sco_from_clip"),
"cmd" => "insertScoClip", "as_subitem" => true);
}
}
else
{
$cmds[] = array("text" => $lng->txt("sahs_insert_sco"), "cmd" => "insertSco", "multi" => 10);
if ($ilUser->clipboardHasObjectsOfType("sco"))
{
$cmds[] = array("text" => $lng->txt("sahs_insert_sco_from_clip"),
"cmd" => "insertScoClip");
}
}
}
//if ($a_node["type"] == "chap")
//{
// $cmds[] = array("text" => $lng->txt("sahs_insert_sub_chapter"), "cmd" => "insertSubchapter", "multi" => 10);
//}
// chapter inserts
if ($a_node["type"] == "chap" || $a_node["type"] == "seqc")
{
$cmds[] = array("text" => $lng->txt("sahs_insert_chapter"), "cmd" => "insertChapter", "multi" => 10);
if ($ilUser->clipboardHasObjectsOfType("chap"))
{
$cmds[] = array("text" => $lng->txt("sahs_insert_chap_from_clip"),
"cmd" => "insertChapterClip");
}
//check if parent chaper has sequencing scenario
// $cmds[] = array("text" => $lng->txt("sahs_insert_scenario"), "cmd" => "insertScenarioGUI", "multi" => 0);
}
}
else // drop area before first child of node
{
if ($a_node["type"] == "" && $a_node["node_id"] == 1) // top node
{
// chapters
$cmds[] = array("text" => $lng->txt("sahs_insert_chapter"), "cmd" => "insertChapter", "multi" => 10);
if ($ilUser->clipboardHasObjectsOfType("chap"))
{
$cmds[] = array("text" => $lng->txt("sahs_insert_chap_from_clip"),
"cmd" => "insertChapterClip");
}
// $cmds[] = array("text" => $lng->txt("sahs_insert_scenario"), "cmd" => "insertScenarioGUI", "multi" => 0);
}
if ($a_node["type"] == "chap" || $a_node["type"] == "seqc")
{
$cmds[] = array("text" => $lng->txt("sahs_insert_sco"), "cmd" => "insertSco", "multi" => 10);
if ($ilUser->clipboardHasObjectsOfType("sco"))
{
$cmds[] = array("text" => $lng->txt("sahs_insert_sco_from_clip"),
"cmd" => "insertScoClip");
}
}
if ($a_node["type"] == "sco")
{
$cmds[] = array("text" => $lng->txt("sahs_insert_page"), "cmd" => "insertPage", "multi" => 10);
$cmds[] = array("text" => $lng->txt("sahs_insert_pagelayout"), "cmd" => "insertTemplateGUI", "multi" => 10);
if ($ilUser->clipboardHasObjectsOfType("page"))
{
$cmds[] = array("text" => $lng->txt("sahs_insert_page_from_clip"),
"cmd" => "insertPageClip");
}
}
/* if ($a_childs["type"] == "")
{
$cmds[] = array("text" => "insert Chapter", "cmd" => "insertChapter", "multi" => 10);
}*/
}
return $cmds;
}
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 191 of file class.ilSCORM2004OrganizationHFormGUI.php.

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

{
global $lng;
$this->makeDragContent($a_node["node_id"], "grp_".$a_node["type"]);
if (!$a_first_child_drop_area)
{
// page targets
if ($a_node["type"] == "page" || ($a_node["type"] == "sco" && count($a_childs) == 0))
{
if ($a_node["type"] == "sco")
{
$this->makeDragTarget($a_node["node_id"], "grp_page", $a_first_child_drop_area,
true, "");
}
else
{
$this->makeDragTarget($a_node["node_id"], "grp_page", $a_first_child_drop_area,
false, "");
}
}
// sco targets
if ($a_node["type"] == "sco" || ($a_node["type"] == "chap" && count($a_childs) == 0))
{
if ($a_node["type"] == "chap")
{
$this->makeDragTarget($a_node["node_id"], "grp_sco", $a_first_child_drop_area,
true, "");
}
else
{
$this->makeDragTarget($a_node["node_id"], "grp_sco", $a_first_child_drop_area,
false, "");
}
}
//if ($a_node["type"] != "pg")
//{
// $this->makeDragTarget($a_node["node_id"], "grp_st", $a_first_child_drop_area,
// true, $lng->txt("cont_insert_as_subchapter"));
//}
// chapter targets
if ($a_node["type"] == "chap")
{
$this->makeDragTarget($a_node["node_id"], "grp_chap", $a_first_child_drop_area,
false, $lng->txt("sahs_insert_as_chapter"));
}
}
else
{
if ($a_node["type"] == "" && $a_node["node_id"] == 1) // top node
{
$this->makeDragTarget($a_node["node_id"], "grp_chap", $a_first_child_drop_area,
true);
}
if ($a_node["type"] == "chap")
{
$this->makeDragTarget($a_node["node_id"], "grp_sco", $a_first_child_drop_area,
true);
}
if ($a_node["type"] == "sco")
{
$this->makeDragTarget($a_node["node_id"], "grp_page", $a_first_child_drop_area,
true);
}
}
}

+ Here is the call graph for this function:

ilSCORM2004OrganizationHFormGUI::nodeAllowsChilds (   $a_node)

Which nodes allow child nodes?

Reimplemented from ilHierarchyFormGUI.

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

{
if ($a_node["type"] == "pg")
{
return false;
}
return true;
}

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