ILIAS  release_4-4 Revision
ilHACPExplorer Class Reference
+ Inheritance diagram for ilHACPExplorer:
+ Collaboration diagram for ilHACPExplorer:

Public Member Functions

 ilHACPExplorer ($a_target, &$a_slm_obj)
 Constructor public. More...
 
 formatObject ($a_node_id, $a_option)
 Creates output recursive method private. More...
 
- Public Member Functions inherited from ilAICCExplorer
 ilAICCExplorer ($a_target, &$a_slm_obj)
 Constructor public. More...
 
 getItem ($a_node_id)
 
 getIconImagePathPrefix ()
 
 getNodesToSkip ()
 
 isClickable ($a_type, $a_id=0)
 
 formatItemTable (&$tpl, $a_id, $a_type)
 
 formatObject ($a_node_id, $a_option)
 Creates output recursive method private. More...
 
- Public Member Functions inherited from ilSCORMExplorer
 ilSCORMExplorer ($a_target, &$a_slm_obj)
 Constructor public. More...
 
 getItem ($a_node_id)
 
 getIconImagePathPrefix ()
 
 getNodesToSkip ()
 
 formatHeader ($a_obj_id, $a_option)
 overwritten method from base class public More...
 
 createTarget ($a_type, $a_child)
 Creates Get Parameter private. More...
 
 setOutput ($a_parent_id, $a_depth=0)
 
 isVisible ($a_id, $a_type)
 
 getOutput ($jsApi=false)
 Creates output recursive method public. More...
 
 isClickable ($a_type, $a_id=0, $a_obj=0)
 
 formatItemTable (&$tpl, $a_id, $a_type)
 
 formatObject ($a_node_id, $a_option, $jsApi)
 Creates output recursive method private. More...
 
 getOutputIcons (&$tpl, $a_option, $a_node_id, $scormtype="sco")
 
- Public Member Functions inherited from ilExplorer
 ilExplorer ($a_target)
 Constructor public. More...
 
 setId ($a_val)
 Set id. More...
 
 getId ()
 Get id. More...
 
 setAsynchExpanding ($a_val)
 Set asynch expanding. More...
 
 getAsynchExpanding ()
 Get asynch expanding. More...
 
 initItemCounter ($a_number)
 Init item counter. More...
 
 setTitle ($a_val)
 Set title. More...
 
 setTitleLength ($a_length)
 Set max title length. More...
 
 getTitleLength ()
 Get max title length. More...
 
 getTitle ()
 Get title. More...
 
 setRoot ($a_root_id)
 Set root node. More...
 
 getRoot ()
 get root id More...
 
 setOrderColumn ($a_column)
 set the order column public More...
 
 setOrderDirection ($a_direction)
 set the order direction public More...
 
 setTargetGet ($a_target_get)
 set the varname in Get-string public More...
 
 setParamsGet ($a_params_get)
 set additional params to be passed in Get-string public More...
 
 setExpandTarget ($a_exp_target)
 target script for expand icons More...
 
 setFrameUpdater ($a_up_frame, $a_up_script, $a_params="")
 Set Explorer Updater. More...
 
 highlightNode ($a_id)
 set highlighted node More...
 
 checkPermissions ($a_check)
 check permissions via rbac More...
 
 setSessionExpandVariable ($a_var_name="expand")
 set name of expand session variable More...
 
 outputIcons ($a_icons)
 output icons More...
 
 setClickable ($a_type, $a_clickable)
 (de-)activates links for a certain object type More...
 
 isVisible ($a_ref_id, $a_type)
 
 setTreeLead ($a_val)
 Set tree leading content. More...
 
 getTreeLead ()
 Get tree leading content. More...
 
 isClickable ($a_type, $a_ref_id=0)
 check if links for certain object type are activated More...
 
 setPostSort ($a_sort)
 process post sorting More...
 
 setFilterMode ($a_mode=IL_FM_NEGATIVE)
 set filter mode More...
 
 getFilterMode ()
 get filter mode More...
 
 setUseStandardFrame ($a_val)
 Set use standard frame. More...
 
 getUseStandardFrame ()
 Get use standard explorer frame. More...
 
 getChildsOfNode ($a_parent_id)
 Get childs of node. More...
 
 setOutput ($a_parent_id, $a_depth=1, $a_obj_id=0, $a_highlighted_subtree=false)
 Creates output for explorer view in admin menue recursive method public. More...
 
 modifyChilds ($a_parent_id, $a_objects)
 
 showChilds ($a_parent_id)
 determines wether the childs of an object should be shown or not note: this standard implementation always returns true but it could be overwritten by derived classes (e.g. More...
 
 forceExpanded ($a_obj_id)
 force expansion of node More...
 
 getMaximumTreeDepth ()
 Get maximum tree depth. More...
 
 getOutput ()
 Creates output recursive method public. More...
 
 handleListEndTags (&$a_tpl_tree, $a_cur_depth, $a_item_depth)
 handle list end tags ( and ) More...
 
 handleListStartTags (&$a_tpl_tree, $a_cur_depth, $a_item_depth)
 handle list start tags ( More...
 
 formatHeader (&$tpl, $a_obj_id, $a_option)
 Creates output for header (is empty here but can be overwritten in derived classes) More...
 
 formatObject (&$tpl, $a_node_id, $a_option, $a_obj_id=0)
 Creates output recursive method private. More...
 
 getImage ($a_name, $a_type="", $a_obj_id="")
 get image path (may be overwritten by derived classes) More...
 
 getImageAlt ($a_default_text, $a_type="", $a_obj_id="")
 get image alt text More...
 
 getNodeStyleClass ($a_id, $a_type)
 get style class for node More...
 
 buildLinkTarget ($a_node_id, $a_type)
 get link target (may be overwritten by derived classes) More...
 
 buildOnClick ($a_node_id, $a_type, $a_title)
 get onclick event handling (may be overwritten by derived classes) More...
 
 buildTitle ($a_title, $a_id, $a_type)
 standard implementation for title, may be overwritten by derived classes More...
 
 buildDescription ($a_desc, $a_id, $a_type)
 standard implementation for description, may be overwritten by derived classes More...
 
 buildSelect ($a_node_id, $a_type)
 standard implementation for adding an option select box between image and title More...
 
 buildFrameTarget ($a_type, $a_child=0, $a_obj_id=0)
 get frame target (may be overwritten by derived classes) More...
 
 createTarget ($a_type, $a_node_id, $a_highlighted_subtree=false, $a_append_anch=true)
 Creates Get Parameter private. More...
 
 setFrameTarget ($a_target)
 set target frame or not frame? More...
 
 createLines ($a_depth)
 Creates lines for explorer view private. More...
 
 is_in_array ($a_start, $a_depth)
 DESCRIPTION MISSING private. More...
 
 getIndex ($a_data)
 get index of format_options array from specific ref_id,parent_id private More...
 
 addFilter ($a_item)
 adds item to the filter public More...
 
 delFilter ($a_item)
 removes item from the filter public More...
 
 setExpand ($a_node_id)
 set the expand option this value is stored in a SESSION variable to save it different view (lo view, frm view,...) private More...
 
 forceExpandAll ($a_mode, $a_show_minus=true)
 force expandAll. More...
 
 setFiltered ($a_bool)
 active/deactivate the filter public More...
 
 checkFilter ($a_item)
 check if item is in filter private More...
 
 sortNodes ($a_nodes, $a_parent_obj_id)
 sort nodes and put adm object to the end of sorted array private More...
 

Additional Inherited Members

- Data Fields inherited from ilSCORMExplorer
 $slm_obj
 
- Data Fields inherited from ilExplorer
 $id
 
 $ilias
 
 $output
 
 $format_options
 
 $tree
 
 $target
 
 $target_get
 
 $params_get
 
 $expanded
 
 $order_column
 
 $order_direction = "asc"
 
 $expand_target
 
 $rbac_check
 
 $output_icons
 
 $expand_variable
 
 $is_clickable
 
 $post_sort
 
 $filtered = false
 
 $filter_mode
 
 $expand_all = false
 
 $root_id = null
 
 $use_standard_frame = false
 

Detailed Description

Definition at line 32 of file class.ilHACPExplorer.php.

Member Function Documentation

◆ formatObject()

ilHACPExplorer::formatObject (   $a_node_id,
  $a_option 
)

Creates output recursive method private.

Parameters
integer
array
Returns
string

Definition at line 60 of file class.ilHACPExplorer.php.

References $lng, ilExplorer\$target, $tpl, ilExplorer\buildFrameTarget(), ilExplorer\buildLinkTarget(), ilSCORMExplorer\createTarget(), ilAICCExplorer\formatItemTable(), ilUtil\getImagePath(), ilSCORMExplorer\getOutputIcons(), ilAICCExplorer\isClickable(), and ilUtil\shortenText().

61  {
62  global $lng;
63  //echo "hacp: ".$a_option["title"]." >> ".implode(", ",$a_option["tab"])."<br>";
64 
65  if (!isset($a_node_id) or !is_array($a_option))
66  {
67  $this->ilias->raiseError(get_class($this)."::formatObject(): Missing parameter or wrong datatype! ".
68  "node_id: ".$a_node_id." options:".var_dump($a_option),$this->ilias->error_obj->WARNING);
69  }
70 
71  $tpl = new ilTemplate("tpl.sahs_tree.html", true, true, "Modules/ScormAicc");
72 
73  if ($a_option["c_type"]=="sos")
74  return;
75 
76  if ($a_option["c_type"]=="srs")
77  return;
78 
79  if (is_array($a_option["tab"])) { //test if there are any tabs
80  foreach ($a_option["tab"] as $picture)
81  {
82  if ($picture == 'plus')
83  {
84  $target = $this->createTarget('+',$a_node_id);
85  $tpl->setCurrentBlock("expander");
86  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
87  $tpl->setVariable("IMGPATH", ilUtil::getImagePath("browser/plus.png"));
88  $tpl->parseCurrentBlock();
89  }
90 
91  if ($picture == 'minus' && $this->show_minus)
92  {
93  $target = $this->createTarget('-',$a_node_id);
94  $tpl->setCurrentBlock("expander");
95  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
96  $tpl->setVariable("IMGPATH", ilUtil::getImagePath("browser/minus.png"));
97  $tpl->parseCurrentBlock();
98  }
99 
100  if ($picture == 'blank' or $picture == 'winkel'
101  or $picture == 'hoch' or $picture == 'quer' or $picture == 'ecke'
102  or ($picture == 'minus' && !$this->show_minus))
103  {
104  $picture = 'blank';
105  $tpl->setCurrentBlock("lines");
106  $tpl->setVariable("IMGPATH_LINES", ilUtil::getImagePath("browser/".$picture.".png"));
107  $tpl->parseCurrentBlock();
108  }
109  }
110  }
111 
112  if ($this->output_icons) {
113  if ($this->isClickable($a_option["c_type"], $a_node_id) && $a_option["c_type"]!="sbl")
114  $this->getOutputIcons($tpl, $a_option, $a_node_id);
115  }
116 
117 
118  if ($this->isClickable($a_option["c_type"], $a_node_id)) // output link
119  {
120  $tpl->setCurrentBlock("link");
121  //$target = (strpos($this->target, "?") === false) ?
122  // $this->target."?" : $this->target."&";
123  //$tpl->setVariable("LINK_TARGET", $target.$this->target_get."=".$a_node_id.$this->params_get);
124  //$tpl->setVariable("TITLE", ilUtil::shortenText($a_option["title"], $this->textwidth, true));
125  $frame_target = $this->buildFrameTarget($a_option["c_type"], $a_node_id, $a_option["obj_id"]);
126  if ($frame_target != "")
127  {
128 // if ($this->api == 1)
129 // {
130 // $tpl->setVariable("TITLE", ilUtil::shortenText($a_option["title"], $this->textwidth, true));
131 // $tpl->setVariable("TARGET", " target=\"".$frame_target."\"");
132 // //$tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($a_node_id, $a_option["c_type"]));
133 // $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($a_node_id, $a_option["c_type"]));
134 // }
135 // else
136 // {
137  if ($a_option["c_type"]=="sbl") {
138  $tpl->setVariable("TITLE", ilUtil::shortenText($a_option["title"]." ($a_node_id)", $this->textwidth, true));
139  $tpl->setVariable("TARGET", " target=\"".$frame_target."\"");
140  $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($a_node_id, $a_option["c_type"]));
141 
142  } else {
143  include_once("./Modules/ScormAicc/classes/AICC/class.ilAICCUnit.php");
144  $unit =& new ilAICCUnit($a_node_id);
145 
146  //guess the url to be able to launch most contents
147  $url=$unit->getCommand_line();
148  if (strlen($url)==0)
149  $url=$unit->getFilename();
150 
151 
152  //relative path?
153  if (substr($url,0,7)!="http://")
154  $url=$this->slm_obj->getDataDirectory("output")."/".$url;
155 
156  if (strlen($unit->getWebLaunch())>0)
157  $url.="?".$unit->getWebLaunch();
158 
159  $hacpURL=ILIAS_HTTP_PATH."/Modules/ScormAicc/sahs_server.php";
160 
161  //$url.="?aicc_url=$hacpURL&aicc_sid=".$this->slm_obj->ref_id;
162  //$aicc_sid=$this->slm_obj->ref_id."%20".session_id();
163  $aicc_sid=implode("_", array(session_id(), CLIENT_ID, $this->slm_obj->ref_id, $a_node_id));
164  if (strlen($unit->getWebLaunch())>0)
165  $url.="&";
166  else
167  $url.="?";
168  $url.="aicc_url=$hacpURL&aicc_sid=$aicc_sid";
169 
170 /*
171  foreach ($this->slm_obj as $key=>$value)
172  $output.="key=$key value=$value<br>";
173  $tpl->setVariable("TITLE", $output);
174 */
175  $tpl->setVariable("TITLE", ilUtil::shortenText($a_option["title"]." ($a_node_id)", $this->textwidth, true));
176  $tpl->setVariable("LINK_TARGET", "javascript:void(0);");
177  $tpl->setVariable("ONCLICK", " onclick=\"parent.$frame_target.location.href='$url'\"");
178 
179 
180 // }
181  }
182 
183  }
184  $tpl->parseCurrentBlock();
185  }
186  else // output text only
187  {
188  $tpl->setCurrentBlock("text");
189  $tpl->setVariable("OBJ_TITLE", ilUtil::shortenText($a_option["title"], $this->textwidth, true));
190  $tpl->parseCurrentBlock();
191  }
192  $this->formatItemTable($tpl, $a_node_id, $a_option["c_type"]);
193 
194  $tpl->setCurrentBlock("row");
195  $tpl->parseCurrentBlock();
196 
197  $this->output[] = $tpl->get();
198  }
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
get frame target (may be overwritten by derived classes)
buildLinkTarget($a_node_id, $a_type)
get link target (may be overwritten by derived classes)
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
getOutputIcons(&$tpl, $a_option, $a_node_id, $scormtype="sco")
formatItemTable(&$tpl, $a_id, $a_type)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
createTarget($a_type, $a_child)
Creates Get Parameter private.
special template class to simplify handling of ITX/PEAR
redirection script todo: (a better solution should control the processing via a xml file) ...
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $lng
Definition: privfeed.php:40
isClickable($a_type, $a_id=0)
+ Here is the call graph for this function:

◆ ilHACPExplorer()

ilHACPExplorer::ilHACPExplorer (   $a_target,
$a_slm_obj 
)

Constructor public.

Parameters
stringscriptname
intuser_id

Definition at line 41 of file class.ilHACPExplorer.php.

References ilExplorer\checkPermissions(), ilExplorer\outputIcons(), ilTree\readRootId(), and ilExplorer\setOrderColumn().

42  {
43  parent::ilExplorer($a_target);
44  $this->slm_obj =& $a_slm_obj;
45  $this->tree = new ilAICCTree($a_slm_obj->getId());
46  $this->root_id = $this->tree->readRootId();
47  $this->checkPermissions(false);
48  $this->outputIcons(true);
49  $this->setOrderColumn("");
50  }
checkPermissions($a_check)
check permissions via rbac
setOrderColumn($a_column)
set the order column public
AICC Object Tree.
outputIcons($a_icons)
output icons
readRootId()
read root id from database
+ Here is the call graph for this function:

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