ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilAICCExplorer Class Reference

Explorer View for AICC Learning Modules. More...

+ Inheritance diagram for ilAICCExplorer:
+ Collaboration diagram for ilAICCExplorer:

Public Member Functions

 __construct ($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...
 
 setOutput ($a_parent_id, $a_depth=0)
 
- Public Member Functions inherited from ilSCORMExplorer
 __construct ($a_target, &$a_slm_obj)
 Constructor public. More...
 
 getItem ($a_node_id)
 
 getIconImagePathPrefix ()
 
 getNodesToSkip ()
 
 formatHeader ($tpl, $a_obj_id, $a_option)
 overwritten method from base class public More...
 
 createTarget ($a_type, $a_child, $a_highlighted_subtree=false, $a_append_anch=true)
 Creates Get Parameter private. More...
 
 setOutput ($parent_id, $a_depth=1, $a_obj_id=0, $a_highlighted_subtree=false)
 possible output array is set More...
 
 isVisible ($a_id, $a_type)
 
 getOutput ($jsApi=false)
 Creates output template. More...
 
 createOutput ($option, $jsApi)
 recursive creation of output templates More...
 
 isClickable ($a_type, $a_id=0, $a_obj=0)
 can i click on the module name More...
 
 getOutputIcons (&$tpl, $a_option, $a_node_id, $scormtype="sco")
 tpl is filled with option state More...
 
- Public Member Functions inherited from ilExplorer
 __construct ($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...
 

Protected Member Functions

 createPrefixArray ($counter, $tab)
 
 addObjectToOutputArray ($counter, $tab, $object)
 
 makeObjectNodeExpandable ($c_type, $obj_id)
 
 getParentIndex ($child)
 
 setParentExpanded ($parent)
 
 shouldHideCurrentNode ($child, $parent_index, $parent)
 
- Protected Member Functions inherited from ilSCORMExplorer
 createOutputArray ($a_parent_id, $options=array())
 recursivi creating of outputs More...
 
 insertObject ($option, ilTemplate $tpl, $jsApi)
 insert the option data in $tpl 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

Explorer View for AICC Learning Modules.

Version
$Id$

Definition at line 36 of file class.ilAICCExplorer.php.

Constructor & Destructor Documentation

◆ __construct()

ilAICCExplorer::__construct (   $a_target,
$a_slm_obj 
)

Constructor public.

Parameters
stringscriptname
intuser_id

Definition at line 45 of file class.ilAICCExplorer.php.

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

46  {
47  parent::__construct($a_target);
48  $this->slm_obj = $a_slm_obj;
49  $this->tree = new ilAICCTree($a_slm_obj->getId());
50  $this->root_id = $this->tree->readRootId();
51  $this->checkPermissions(false);
52  $this->outputIcons(false);
53  $this->setOrderColumn("");
54  }
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:

Member Function Documentation

◆ addObjectToOutputArray()

ilAICCExplorer::addObjectToOutputArray (   $counter,
  $tab,
  $object 
)
protected

Definition at line 263 of file class.ilAICCExplorer.php.

References $tab.

Referenced by setOutput().

263  {
264  $this->format_options["$counter"]["parent"] = $object["parent"];
265  $this->format_options["$counter"]["child"] = $object["child"];
266  $this->format_options["$counter"]["title"] = $object["title"];
267  $this->format_options["$counter"]["c_type"] = $object["c_type"];
268  $this->format_options["$counter"]["obj_id"] = $object["obj_id"];
269  $this->format_options["$counter"]["desc"] = "obj_".$object["c_type"];
270  $this->format_options["$counter"]["depth"] = $tab;
271  $this->format_options["$counter"]["container"] = false;
272  $this->format_options["$counter"]["visible"] = true;
273  }
+ Here is the caller graph for this function:

◆ createPrefixArray()

ilAICCExplorer::createPrefixArray (   $counter,
  $tab 
)
protected

Definition at line 257 of file class.ilAICCExplorer.php.

References $tab.

Referenced by setOutput().

257  {
258  for ($i = 0; $i < $tab; ++$i) {
259  $this->format_options["$counter"]["tab"][] = 'blank';
260  }
261  }
+ Here is the caller graph for this function:

◆ formatItemTable()

ilAICCExplorer::formatItemTable ( $tpl,
  $a_id,
  $a_type 
)

Definition at line 87 of file class.ilAICCExplorer.php.

References $lng.

Referenced by formatObject().

88  {
89  global $lng;
90  }
global $lng
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ formatObject()

ilAICCExplorer::formatObject (   $a_node_id,
  $a_option 
)

Creates output recursive method private.

Parameters
integer
array
Returns
string

Definition at line 102 of file class.ilAICCExplorer.php.

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

103  {
104  global $lng;
105 
106  if (!isset($a_node_id) or !is_array($a_option))
107  {
108  $this->ilias->raiseError(get_class($this)."::formatObject(): Missing parameter or wrong datatype! ".
109  "node_id: ".$a_node_id." options:".var_dump($a_option),$this->ilias->error_obj->WARNING);
110  }
111 
112  $tpl = new ilTemplate("tpl.sahs_tree.html", true, true, "Modules/ScormAicc");
113 
114  if ($a_option["c_type"]=="sos")
115  return;
116 
117  if ($a_option["c_type"]=="srs")
118  return;
119 
120  if (is_array($a_option["tab"])) { //test if there are any tabs
121  foreach ($a_option["tab"] as $picture)
122  {
123  $pic = false;
124  if ($picture == 'plus')
125  {
126  $target = $this->createTarget('+',$a_node_id);
127  $tpl->setCurrentBlock("expander");
128  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
129  $tpl->setVariable("IMGPATH", ilUtil::getImagePath("browser/plus.png"));
130  $tpl->parseCurrentBlock();
131  $pic = true;
132  }
133 
134  if ($picture == 'minus' && $this->show_minus)
135  {
136  $target = $this->createTarget('-',$a_node_id);
137  $tpl->setCurrentBlock("expander");
138  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
139  $tpl->setVariable("IMGPATH", ilUtil::getImagePath("browser/minus.png"));
140  $tpl->parseCurrentBlock();
141  $pic = true;
142  }
143 
144  if (!$pic)
145  {
146  $picture = 'blank';
147  $tpl->setCurrentBlock("lines");
148  $tpl->setVariable("IMGPATH_LINES", ilUtil::getImagePath("browser/".$picture.".png"));
149  $tpl->parseCurrentBlock();
150  }
151  }
152  }
153 
154  if ($this->output_icons) {
155  if ($this->isClickable($a_option["c_type"], $a_node_id) && !$a_option["c_type"]=="sbl")
156  $this->getOutputIcons($tpl, $a_option, $a_node_id);
157  }
158 
159  if ($this->isClickable($a_option["c_type"], $a_node_id)) // output link
160  {
161  $tpl->setCurrentBlock("link");
162 
163  $frame_target = $this->buildFrameTarget($a_option["c_type"], $a_node_id, $a_option["obj_id"]);
164  if ($frame_target != "")
165  {
166  if ($a_option["c_type"]=="sbl") {
167  $tpl->setVariable("TITLE", ilUtil::shortenText($a_option["title"]." ($a_node_id)", $this->textwidth, true));
168  $tpl->setVariable("TARGET", " target=\"".$frame_target."\"");
169  $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($a_node_id, $a_option["c_type"]));
170  } else {
171  $tpl->setVariable("TITLE", ilUtil::shortenText($a_option["title"]." ($a_node_id)", $this->textwidth, true));
172  $tpl->setVariable("LINK_TARGET", "javascript:void(0);");
173  $tpl->setVariable("ONCLICK", " onclick=\"parent.APIFRAME.setupApi();parent.APIFRAME.API.IliasLaunchSahs('".$a_node_id."');return false;\"");
174  }
175  }
176  $tpl->parseCurrentBlock();
177  }
178  else // output text only
179  {
180  $tpl->setCurrentBlock("text");
181  $tpl->setVariable("OBJ_TITLE", ilUtil::shortenText($a_option["title"], $this->textwidth, true));
182  $tpl->parseCurrentBlock();
183  }
184  $this->formatItemTable($tpl, $a_node_id, $a_option["c_type"]);
185 
186  $tpl->setCurrentBlock("row");
187  $tpl->parseCurrentBlock();
188 
189  $this->output[] = $tpl->get();
190  }
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
get frame target (may be overwritten by derived classes)
createTarget($a_type, $a_child, $a_highlighted_subtree=false, $a_append_anch=true)
Creates Get Parameter private.
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")
tpl is filled with option state
global $tpl
Definition: ilias.php:8
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)
special template class to simplify handling of ITX/PEAR
redirection script todo: (a better solution should control the processing via a xml file) ...
global $lng
Definition: privfeed.php:17
isClickable($a_type, $a_id=0)
+ Here is the call graph for this function:

◆ getIconImagePathPrefix()

ilAICCExplorer::getIconImagePathPrefix ( )

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

60  {
61  return "scorm/";
62  }

◆ getItem()

ilAICCExplorer::getItem (   $a_node_id)

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

56  {
57  return new ilAICCUnit($a_node_id);
58  }

◆ getNodesToSkip()

ilAICCExplorer::getNodesToSkip ( )

Definition at line 64 of file class.ilAICCExplorer.php.

Referenced by setOutput().

64  {
65  return 1;
66  }
+ Here is the caller graph for this function:

◆ getParentIndex()

ilAICCExplorer::getParentIndex (   $child)
protected

Definition at line 281 of file class.ilAICCExplorer.php.

References ilExplorer\getIndex().

Referenced by setOutput().

281  {
282  if ($child != $this->tree->getRootId()) {
283  return $this->getIndex($object);
284  }
285  }
getIndex($a_data)
get index of format_options array from specific ref_id,parent_id private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isClickable()

ilAICCExplorer::isClickable (   $a_type,
  $a_id = 0 
)

Definition at line 68 of file class.ilAICCExplorer.php.

References $a_type.

Referenced by formatObject().

69  {
70  if ($a_type=="sbl") {
71  $block_object = new ilAICCBlock($a_id);
72  return (strlen($block_object->getDescription())>0);
73  }
74 
75  if ($a_type != "sau")
76  {
77  return false;
78  }
79  else
80  {
81  $sc_object = new ilAICCUnit($a_id);
82  return true;
83  }
84  return false;
85  }
AICC Block.
$a_type
Definition: workflow.php:93
+ Here is the caller graph for this function:

◆ makeObjectNodeExpandable()

ilAICCExplorer::makeObjectNodeExpandable (   $c_type,
  $obj_id 
)
protected

Definition at line 275 of file class.ilAICCExplorer.php.

References ilExplorer\setExpand().

Referenced by setOutput().

275  {
276  if ($c_type =="sos") {
277  $this->setExpand($obj_id);
278  }
279  }
setExpand($a_node_id)
set the expand option this value is stored in a SESSION variable to save it different view (lo view...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setOutput()

ilAICCExplorer::setOutput (   $a_parent_id,
  $a_depth = 0 
)

Definition at line 192 of file class.ilAICCExplorer.php.

References $counter, $tab, addObjectToOutputArray(), array, ilExplorer\checkFilter(), createPrefixArray(), getNodesToSkip(), getParentIndex(), ilSCORMExplorer\isVisible(), makeObjectNodeExpandable(), setParentExpanded(), shouldHideCurrentNode(), and ilExplorer\showChilds().

193  {
194  global $rbacadmin, $rbacsystem;
195  static $counter = 0;
196 
197  if (!isset($a_parent_id))
198  {
199  $this->ilias->raiseError(get_class($this)."::setOutput(): No node_id given!",$this->ilias->error_obj->WARNING);
200  }
201  if ($this->showChilds($a_parent_id))
202  {
203  $objects = $this->tree->getChilds($a_parent_id, $this->order_column);
204  }
205  else
206  {
207  $objects = array();
208  }
209  if (count($objects) > 0)
210  {
211 
212  //moved the scorm-only constant parameter to a function
213  //to be able to reuse the code
214  //$tab = ++$a_depth - 2;
215  $tab = ++$a_depth - $this->getNodesToSkip();
216 
217  foreach ($objects as $key => $object) {
218  //ask for FILTER
219  if ($this->filtered == false or $this->checkFilter($object["c_type"]) == false) {
220  if ($this->isVisible($object["obj_id"], $object["c_type"])) {
221  $this->addObjectToOutputArray($counter, $tab, $object);
222 
224 
225  $this->makeObjectNodeExpandable($object["c_type"], $object["obj_id"]);
226 
227  $parent_index = $this->getParentIndex($object["child"]);
228 
229  if ($parent_index == 0) {
230  $this->setParentExpanded($object["parent"]);
231  }
232 
233  $this->format_options["$counter"]["visible"] = !$this->shouldHideCurrentNode($object["child"], $parent_index, $object["parent"]);
234 
235  // if object exists parent is container
236  if ($object["child"] != $this->tree->getRootId()) {
237  $this->format_options["$parent_index"]["container"] = true;
238 
239  if ($this->expand_all or in_array($object["parent"],$this->expanded)) {
240  $this->format_options["$parent_index"]["tab"][($tab-2)] = 'minus';
241  } else {
242  $this->format_options["$parent_index"]["tab"][($tab-2)] = 'plus';
243  }
244  }
245  ++$counter;
246  // stop recursion if 2. level beyond expanded nodes is reached
247  if ($this->expand_all or in_array($object["parent"],$this->expanded) or ($object["parent"] == 0)) {
248  // recursive
249  $this->setOutput($object["child"],$a_depth);
250  }
251  } //if
252  } //if FILTER
253  } //foreach
254  } //if
255  } //function
makeObjectNodeExpandable($c_type, $obj_id)
$counter
shouldHideCurrentNode($child, $parent_index, $parent)
showChilds($a_parent_id)
determines wether the childs of an object should be shown or not note: this standard implementation a...
redirection script todo: (a better solution should control the processing via a xml file) ...
isVisible($a_id, $a_type)
Create styles array
The data for the language used.
setOutput($a_parent_id, $a_depth=0)
checkFilter($a_item)
check if item is in filter private
addObjectToOutputArray($counter, $tab, $object)
createPrefixArray($counter, $tab)
+ Here is the call graph for this function:

◆ setParentExpanded()

ilAICCExplorer::setParentExpanded (   $parent)
protected

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

Referenced by setOutput().

287  {
288  if (!$this->expand_all && !in_array($parent, $this->expanded)) {
289  $this->expanded[] = $parent;
290  }
291  }
+ Here is the caller graph for this function:

◆ shouldHideCurrentNode()

ilAICCExplorer::shouldHideCurrentNode (   $child,
  $parent_index,
  $parent 
)
protected

Definition at line 293 of file class.ilAICCExplorer.php.

Referenced by setOutput().

293  {
294  if ($child != $this->tree->getRootId()
295  && (!$this->expand_all and !in_array($parent, $this->expanded)
296  or !$this->format_options["$parent_index"]["visible"]))
297  {
298  return true;
299  }
300 
301  return false;
302  }
+ Here is the caller graph for this function:

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