ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilAICCExplorer Class Reference
+ Inheritance diagram for ilAICCExplorer:
+ Collaboration diagram for ilAICCExplorer:

Public Member Functions

 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 36 of file class.ilAICCExplorer.php.

Member Function Documentation

◆ formatItemTable()

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

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

References $lng.

Referenced by ilHACPExplorer\formatObject(), and formatObject().

91  {
92  global $lng;
93 /*
94  if ($a_type != "sau")
95  {
96  return;
97  }
98  else
99  {
100  $sc_object =& new ilAICCUnit($a_id);
101  //if ($sc_object->getIdentifierRef() != "")
102  //{
103  $trdata = $sc_object->getTrackingDataOfUser();
104 
105  // status
106  $status = ($trdata["lesson_status"] == "")
107  ? "not attempted"
108  : $trdata["lesson_status"];
109  $tpl->setCurrentBlock("item_row");
110  $tpl->setVariable("TXT_KEY", $lng->txt("cont_status"));
111  $tpl->setVariable("TXT_VALUE",
112  $lng->txt("cont_sc_stat_".str_replace(" ", "_", $status)));
113  $tpl->parseCurrentBlock();
114 
115  // credits
116  if ($trdata["mastery_score"] != "")
117  {
118  $tpl->setCurrentBlock("item_row");
119  $tpl->setVariable("TXT_KEY", $lng->txt("cont_credits"));
120  $tpl->setVariable("TXT_VALUE", $trdata["mastery_score"]);
121  $tpl->parseCurrentBlock();
122  }
123 
124  // total time
125  if ($trdata["total_time"] != "")
126  {
127  $tpl->setCurrentBlock("item_row");
128  $tpl->setVariable("TXT_KEY", $lng->txt("cont_total_time"));
129  $tpl->setVariable("TXT_VALUE", $trdata["total_time"]);
130  $tpl->parseCurrentBlock();
131  }
132 
133  $tpl->setCurrentBlock("item_table");
134  $tpl->parseCurrentBlock();
135  //}
136  }
137 */
138  }
global $lng
Definition: privfeed.php:40
+ 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 150 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().

151  {
152  global $lng;
153 
154  if (!isset($a_node_id) or !is_array($a_option))
155  {
156  $this->ilias->raiseError(get_class($this)."::formatObject(): Missing parameter or wrong datatype! ".
157  "node_id: ".$a_node_id." options:".var_dump($a_option),$this->ilias->error_obj->WARNING);
158  }
159 
160  $tpl = new ilTemplate("tpl.sahs_tree.html", true, true, "Modules/ScormAicc");
161 
162  if ($a_option["c_type"]=="sos")
163  return;
164 
165  if ($a_option["c_type"]=="srs")
166  return;
167 
168  if (is_array($a_option["tab"])) { //test if there are any tabs
169  foreach ($a_option["tab"] as $picture)
170  {
171  $pic = false;
172  if ($picture == 'plus')
173  {
174  $target = $this->createTarget('+',$a_node_id);
175  $tpl->setCurrentBlock("expander");
176  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
177  $tpl->setVariable("IMGPATH", ilUtil::getImagePath("browser/plus.png"));
178  $tpl->parseCurrentBlock();
179  $pic = true;
180  }
181 
182  if ($picture == 'minus' && $this->show_minus)
183  {
184  $target = $this->createTarget('-',$a_node_id);
185  $tpl->setCurrentBlock("expander");
186  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
187  $tpl->setVariable("IMGPATH", ilUtil::getImagePath("browser/minus.png"));
188  $tpl->parseCurrentBlock();
189  $pic = true;
190  }
191 
192  if (!$pic)
193  {
194  $picture = 'blank';
195  $tpl->setCurrentBlock("lines");
196  $tpl->setVariable("IMGPATH_LINES", ilUtil::getImagePath("browser/".$picture.".png"));
197  $tpl->parseCurrentBlock();
198  }
199  }
200  }
201 
202  if ($this->output_icons) {
203  if ($this->isClickable($a_option["c_type"], $a_node_id) && !$a_option["c_type"]=="sbl")
204  $this->getOutputIcons($tpl, $a_option, $a_node_id);
205  }
206 
207  if ($this->isClickable($a_option["c_type"], $a_node_id)) // output link
208  {
209  $tpl->setCurrentBlock("link");
210  //$target = (strpos($this->target, "?") === false) ?
211  // $this->target."?" : $this->target."&";
212  //$tpl->setVariable("LINK_TARGET", $target.$this->target_get."=".$a_node_id.$this->params_get);
213  //$tpl->setVariable("TITLE", ilUtil::shortenText($a_option["title"], $this->textwidth, true));
214  $frame_target = $this->buildFrameTarget($a_option["c_type"], $a_node_id, $a_option["obj_id"]);
215  if ($frame_target != "")
216  {
217 // if ($this->api == 1)
218 // {
219 // $tpl->setVariable("TITLE", ilUtil::shortenText($a_option["title"], $this->textwidth, true));
220 // $tpl->setVariable("TARGET", " target=\"".$frame_target."\"");
221 // //$tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($a_node_id, $a_option["c_type"]));
222 // $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($a_node_id, $a_option["c_type"]));
223 // }
224 // else
225 // {
226  if ($a_option["c_type"]=="sbl") {
227  $tpl->setVariable("TITLE", ilUtil::shortenText($a_option["title"]." ($a_node_id)", $this->textwidth, true));
228  $tpl->setVariable("TARGET", " target=\"".$frame_target."\"");
229  $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($a_node_id, $a_option["c_type"]));
230 
231  } else {
232 
233  $tpl->setVariable("TITLE", ilUtil::shortenText($a_option["title"]." ($a_node_id)", $this->textwidth, true));
234  $tpl->setVariable("LINK_TARGET", "javascript:void(0);");
235  $tpl->setVariable("ONCLICK", " onclick=\"parent.APIFRAME.setupApi();parent.APIFRAME.API.IliasLaunchSahs('".$a_node_id."');return false;\"");
236 
237 // }
238  }
239 
240  }
241  $tpl->parseCurrentBlock();
242  }
243  else // output text only
244  {
245  $tpl->setCurrentBlock("text");
246  $tpl->setVariable("OBJ_TITLE", ilUtil::shortenText($a_option["title"], $this->textwidth, true));
247  $tpl->parseCurrentBlock();
248  }
249  $this->formatItemTable($tpl, $a_node_id, $a_option["c_type"]);
250 
251  $tpl->setCurrentBlock("row");
252  $tpl->parseCurrentBlock();
253 
254  $this->output[] = $tpl->get();
255  }
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")
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)
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) ...
global $lng
Definition: privfeed.php:40
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.

64  {
65  return 1;
66  }

◆ ilAICCExplorer()

ilAICCExplorer::ilAICCExplorer (   $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::ilExplorer($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:

◆ isClickable()

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

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

Referenced by ilHACPExplorer\formatObject(), and 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  //if ($sc_object->getIdentifierRef() != "")
83  //{
84  return true;
85  //}
86  }
87  return false;
88  }
AICC Block.
+ Here is the caller graph for this function:

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