ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilChapterHierarchyFormGUI Class Reference

This class represents a hierarchical form. More...

+ Inheritance diagram for ilChapterHierarchyFormGUI:
+ Collaboration diagram for ilChapterHierarchyFormGUI:

Public Member Functions

 __construct ($a_lm_type)
 Constructor.
 getMenuItems ($a_node, $a_depth, $a_first_child=false, $a_next_sibling=null, $a_childs=null)
 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.
 getChildIcon ($a_item)
 Get icon path for an item.
 getChildIconAlt ($a_item)
 Get icon alt text.
 getChildCommands ($a_item)
 Get item commands.
- Public Member Functions inherited from ilHierarchyFormGUI
 __construct ()
 Constructor.
 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.
 setTypeWhiteList ($a_val)
 Set type whitelist.
 getTypeWhiteList ()
 Get type whitelist.
 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)
- 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.
 setName ($a_name)
 Set Name.
 getName ()
 Get Name.
 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
 $id
 $name

Detailed Description

This class represents a hierarchical form.

These forms are used for quick editing, where each node is represented by it's title.

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

Definition at line 15 of file class.ilChapterHierarchyFormGUI.php.

Constructor & Destructor Documentation

ilChapterHierarchyFormGUI::__construct (   $a_lm_type)

Constructor.

Parameters

Definition at line 22 of file class.ilChapterHierarchyFormGUI.php.

References ilHierarchyFormGUI\__construct(), and ilHierarchyFormGUI\setCheckboxName().

{
$this->lm_type = $a_lm_type;
$this->setCheckboxName("id");
}

+ Here is the call graph for this function:

Member Function Documentation

ilChapterHierarchyFormGUI::getChildCommands (   $a_item)

Get item commands.

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

Reimplemented from ilHierarchyFormGUI.

Definition at line 266 of file class.ilChapterHierarchyFormGUI.php.

References $ilCtrl, and $lng.

{
global $lng, $ilCtrl;
$lm_class = ($this->lm_type == "lm")
? "ilobjlearningmodulegui"
: "ilobjdlbookgui";
$commands = array();
switch ($a_item["type"])
{
case "pg":
$ilCtrl->setParameterByClass("illmpageobjectgui", "obj_id",
$a_item["node_id"]);
$commands[] = array("text" => $lng->txt("edit"),
"link" => $ilCtrl->getLinkTargetByClass(array($lm_class, "illmpageobjectgui"), "edit"));
break;
case "st":
$ilCtrl->setParameterByClass("ilstructureobjectgui", "obj_id",
$a_item["node_id"]);
$commands[] = array("text" => $lng->txt("edit"),
"link" => $ilCtrl->getLinkTargetByClass(array($lm_class, "ilstructureobjectgui"), "view"));
break;
}
return $commands;
}
ilChapterHierarchyFormGUI::getChildIcon (   $a_item)

Get icon path for an item.

Parameters
arrayitema array
Returns
string icon path

Reimplemented from ilHierarchyFormGUI.

Definition at line 186 of file class.ilChapterHierarchyFormGUI.php.

References $img, ilPageObject\_isScheduledActivation(), ilPageObject\_lookupActive(), ilPageObject\_lookupContainsDeactivatedElements(), and ilUtil\getImagePath().

{
include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
$img = "icon_".$a_item["type"].".png";
if ($a_item["type"] == "pg")
{
include_once("./Services/COPage/classes/class.ilPageObject.php");
$lm_set = new ilSetting("lm");
$active = ilPageObject::_lookupActive($a_item["node_id"], $this->lm_type,
$lm_set->get("time_scheduled_page_activation"));
// is page scheduled?
$img_sc = ($lm_set->get("time_scheduled_page_activation") &&
ilPageObject::_isScheduledActivation($a_item["node_id"], $this->lm_type))
? "_sc"
: "";
$img = "icon_pg".$img_sc.".png";
if (!$active)
{
$img = "icon_pg_d".$img_sc.".png";
}
else
{
include_once("./Services/COPage/classes/class.ilPageObject.php");
$contains_dis = ilPageObject::_lookupContainsDeactivatedElements($a_item["node_id"],
$this->lm_type);
if ($contains_dis)
{
$img = "icon_pg_del".$img_sc.".png";
}
}
}
}

+ Here is the call graph for this function:

ilChapterHierarchyFormGUI::getChildIconAlt (   $a_item)

Get icon alt text.

Parameters
arrayitema array
Returns
string icon alt text

Reimplemented from ilHierarchyFormGUI.

Definition at line 231 of file class.ilChapterHierarchyFormGUI.php.

References $lng, ilPageObject\_lookupActive(), ilPageObject\_lookupContainsDeactivatedElements(), and ilUtil\getImagePath().

{
global $lng;
include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
if ($a_item["type"] == "pg")
{
include_once("./Services/COPage/classes/class.ilPageObject.php");
$active = ilPageObject::_lookupActive($a_item["node_id"], $this->lm_type);
if (!$active)
{
return $lng->txt("cont_page_deactivated");
}
else
{
include_once("./Services/COPage/classes/class.ilPageObject.php");
$contains_dis = ilPageObject::_lookupContainsDeactivatedElements($a_item["node_id"],
$this->lm_type);
if ($contains_dis)
{
return $lng->txt("cont_page_deactivated_elements");
}
}
}
return ilUtil::getImagePath("icon_".$a_item["type"].".png");
}

+ Here is the call graph for this function:

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

References $ilUser, $lng, and ilHierarchyFormGUI\getMaxDepth().

{
global $lng, $ilUser;
$cmds = array();
if (!$a_first_child) // drop area of node
{
if ($a_node["type"] == "pg" || ($a_node["type"] == "st" && count($a_childs) == 0 && $this->getMaxDepth() != 0))
{
if ($a_node["type"] == "st")
{
$cmds[] = array("text" => $lng->txt("cont_insert_page"), "cmd" => "insertPage", "multi" => 10,
"as_subitem" => true);
if ($ilUser->clipboardHasObjectsOfType("pg"))
{
$cmds[] = array("text" => $lng->txt("cont_insert_page_from_clip"),
"cmd" => "insertPageClip", "as_subitem" => true);
}
}
else
{
$cmds[] = array("text" => $lng->txt("cont_insert_page"), "cmd" => "insertPage", "multi" => 10);
if ($ilUser->clipboardHasObjectsOfType("pg"))
{
$cmds[] = array("text" => $lng->txt("cont_insert_page_from_clip"),
"cmd" => "insertPageClip");
}
}
}
if ($a_node["type"] != "pg" && $this->getMaxDepth() != 0)
{
$cmds[] = array("text" => $lng->txt("cont_insert_subchapter"),
"cmd" => "insertSubchapter", "multi" => 10);
if ($ilUser->clipboardHasObjectsOfType("st"))
{
$cmds[] = array("text" => $lng->txt("cont_insert_subchapter_from_clip"),
"cmd" => "insertSubchapterClip");
}
}
if (($a_next_sibling["type"] != "pg" && ($a_depth == 0 || $a_next_sibling["type"] == "st"))
|| $a_node["type"] == "st")
{
$cmds[] = array("text" => $lng->txt("cont_insert_chapter"),
"cmd" => "insertChapter", "multi" => 10);
if ($ilUser->clipboardHasObjectsOfType("st"))
{
$cmds[] = array("text" => $lng->txt("cont_insert_chapter_from_clip"),
"cmd" => "insertChapterClip");
}
}
}
else // drop area before first child of node
{
if ($a_node["type"] == "st" && $this->getMaxDepth() != 0)
{
$cmds[] = array("text" => $lng->txt("cont_insert_page"),
"cmd" => "insertPage", "multi" => 10);
if ($ilUser->clipboardHasObjectsOfType("pg"))
{
$cmds[] = array("text" => $lng->txt("cont_insert_page_from_clip"),
"cmd" => "insertPageClip");
}
}
if ($a_childs[0]["type"] != "pg")
{
$cmds[] = array("text" => $lng->txt("cont_insert_chapter"),
"cmd" => "insertChapter", "multi" => 10);
if ($ilUser->clipboardHasObjectsOfType("st"))
{
$cmds[] = array("text" => $lng->txt("cont_insert_chapter_from_clip"),
"cmd" => "insertChapterClip");
}
}
}
return $cmds;
}

+ Here is the call graph for this function:

ilChapterHierarchyFormGUI::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 130 of file class.ilChapterHierarchyFormGUI.php.

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

{
global $lng;
$this->makeDragContent($a_node["node_id"], "grp_".$a_node["type"]);
if (!$a_first_child_drop_area)
{
if ($a_node["type"] == "pg" || ($a_node["type"] == "st" && count($a_childs) == 0 && $this->getMaxDepth() != 0))
{
if ($a_node["type"] == "st")
{
$this->makeDragTarget($a_node["node_id"], "grp_pg", $a_first_child_drop_area,
true, "");
}
else
{
$this->makeDragTarget($a_node["node_id"], "grp_pg", $a_first_child_drop_area,
false, "");
}
}
if ($a_node["type"] != "pg" && $this->getMaxDepth() != 0)
{
$this->makeDragTarget($a_node["node_id"], "grp_st", $a_first_child_drop_area,
true, $lng->txt("cont_insert_as_subchapter"));
}
if (($a_next_sibling["type"] != "pg" && ($a_depth == 0 || $a_next_sibling["type"] == "st"))
|| $a_node["type"] == "st")
{
$this->makeDragTarget($a_node["node_id"], "grp_st", $a_first_child_drop_area,
false, $lng->txt("cont_insert_as_chapter"));
}
}
else
{
if ($a_node["type"] == "st" && $this->getMaxDepth() != 0)
{
$this->makeDragTarget($a_node["node_id"], "grp_pg", $a_first_child_drop_area,
true);
}
if ($a_childs[0]["type"] != "pg")
{
$this->makeDragTarget($a_node["node_id"], "grp_st", $a_first_child_drop_area,
true);
}
}
}

+ Here is the call graph for this function:

ilChapterHierarchyFormGUI::nodeAllowsChilds (   $a_node)

Which nodes allow child nodes?

Reimplemented from ilHierarchyFormGUI.

Definition at line 116 of file class.ilChapterHierarchyFormGUI.php.

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

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