ILIAS  Release_5_0_x_branch Revision 61816
 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, $a_lang="-")
 Constructor.
 getChildTitle ($a_child)
 Get child title.
 getChildInfo ($a_child)
 Get child info.
 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.
 getLegend ()
 Get Legend.
 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)
 getHTML ()
 Get HTML.
- 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.
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission.
 getPreventDoubleSubmission ()
 Get prevent double submission.

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
 $prevent_double_submission = false

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

Constructor & Destructor Documentation

ilChapterHierarchyFormGUI::__construct (   $a_lm_type,
  $a_lang = "-" 
)

Constructor.

Parameters

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

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

{
$this->lm_type = $a_lm_type;
$this->lang = ($a_lang == "")
? "-"
: $a_lang;
$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 301 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 221 of file class.ilChapterHierarchyFormGUI.php.

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

{
include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
$img = "icon_".$a_item["type"].".svg";
if ($a_item["type"] == "pg")
{
include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
$lm_set = new ilSetting("lm");
$active = ilLMPage::_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") &&
ilLMPage::_isScheduledActivation($a_item["node_id"], $this->lm_type))
? "_sc"
: "";
$img = "icon_pg".$img_sc.".svg";
if (!$active)
{
$img = "icon_pg_d".$img_sc.".svg";
}
else
{
include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
$contains_dis = ilLMPage::_lookupContainsDeactivatedElements($a_item["node_id"],
$this->lm_type);
if ($contains_dis)
{
$img = "icon_pg_del".$img_sc.".svg";
}
}
}
}

+ 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 266 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("./Modules/LearningModule/classes/class.ilLMPage.php");
$active = ilLMPage::_lookupActive($a_item["node_id"], $this->lm_type);
if (!$active)
{
return $lng->txt("cont_page_deactivated");
}
else
{
include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
$contains_dis = ilLMPage::_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"].".svg");
}

+ Here is the call graph for this function:

ilChapterHierarchyFormGUI::getChildInfo (   $a_child)

Get child info.

Parameters
array$a_childnode array
Returns
string node title

Reimplemented from ilHierarchyFormGUI.

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

{
if ($this->lang != "-")
{
return $a_child["title"];
}
return "";
}
ilChapterHierarchyFormGUI::getChildTitle (   $a_child)

Get child title.

Parameters
@return

Reimplemented from ilHierarchyFormGUI.

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

{
if ($this->lang != "-")
{
$lmobjtrans = new ilLMObjTranslation($a_child["node_id"], $this->lang);
return $lmobjtrans->getTitle();
}
return $a_child["title"];
}
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 68 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 165 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 151 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: