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

Public Member Functions

 ilLMExplorer ($a_target, $a_lm_obj, $a_lang="-")
 Constructor public. More...
 
 formatHeader (&$tpl, $a_obj_id, $a_option)
 overwritten method from base class public More...
 
 isClickable ($a_type, $a_obj_id=0)
 check if links for certain object type are activated More...
 
- 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...
 

Data Fields

 $root_id
 
 $lm_obj
 
 $output
 
- 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
 

Protected Member Functions

 checkLPIcon ($a_id)
 

Protected Attributes

 $lp_cache
 

Detailed Description

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

Member Function Documentation

◆ checkLPIcon()

ilLMExplorer::checkLPIcon (   $a_id)
protected

Definition at line 107 of file class.ilLMExplorer.php.

References $ilUser, ilLPStatusFactory\_getClassById(), ilLearningProgressBaseGUI\_getImagePathForStatus(), ilLearningProgressAccess\checkAccess(), ilObjectLP\getInstance(), ilLPObjSettings\LP_MODE_COLLECTION_MANUAL, ilLPObjSettings\LP_MODE_COLLECTION_TLT, ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, and ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM.

Referenced by ilLMTOCExplorer\getImage(), and ilTableOfContentsExplorer\getImage().

108  {
109  global $ilUser;
110 
111  // do it once for all chapters
112  if($this->lp_cache[$this->lm_obj->getId()] === null)
113  {
114  $this->lp_cache[$this->lm_obj->getId()] = false;
115 
116  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
117  if(ilLearningProgressAccess::checkAccess($this->lm_obj->getRefId()))
118  {
119  $info = null;
120 
121  include_once './Services/Object/classes/class.ilObjectLP.php';
122  $olp = ilObjectLP::getInstance($this->lm_obj->getId());
123  if($olp->getCurrentMode() == ilLPObjSettings::LP_MODE_COLLECTION_MANUAL ||
124  $olp->getCurrentMode() == ilLPObjSettings::LP_MODE_COLLECTION_TLT)
125  {
126  include_once "Services/Tracking/classes/class.ilLPStatusFactory.php";
127  $class = ilLPStatusFactory::_getClassById($this->lm_obj->getId(), $olp->getCurrentMode());
128  $info = $class::_getStatusInfo($this->lm_obj->getId());
129  }
130 
131  // parse collection items
132  if(is_array($info["items"]))
133  {
134  foreach($info["items"] as $item_id)
135  {
137  if(is_array($info["in_progress"][$item_id]) &&
138  in_array($ilUser->getId(), $info["in_progress"][$item_id]))
139  {
141  }
142  else if(is_array($info["completed"][$item_id]) &&
143  in_array($ilUser->getId(), $info["completed"][$item_id]))
144  {
146  }
147  $this->lp_cache[$this->lm_obj->getId()][$item_id] =$status;
148  }
149  }
150  }
151 
152  include_once './Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
153  }
154 
155  if(is_array($this->lp_cache[$this->lm_obj->getId()]) &&
156  isset($this->lp_cache[$this->lm_obj->getId()][$a_id]))
157  {
158  return ilLearningProgressBaseGUI::_getImagePathForStatus($this->lp_cache[$this->lm_obj->getId()][$a_id]);
159  }
160  }
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
_getImagePathForStatus($a_status)
Get image path for status.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
const LP_STATUS_NOT_ATTEMPTED_NUM
global $ilUser
Definition: imgupload.php:15
static getInstance($a_obj_id)
_getClassById($a_obj_id, $a_mode=NULL)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ formatHeader()

ilLMExplorer::formatHeader ( $tpl,
  $a_obj_id,
  $a_option 
)

overwritten method from base class public

Parameters
integerobj_id
integerarray options
Returns
string

Definition at line 58 of file class.ilLMExplorer.php.

References ilExplorer\$ilias, $lng, $tpl, ilExplorer\buildLinkTarget(), ilUtil\getImagePath(), and ilUtil\shortenText().

59  {
60  global $lng, $ilias;
61 
62  $tpl->setCurrentBlock("icon");
63  $tpl->setVariable("ICON_IMAGE" , ilUtil::getImagePath("icon_lm_s.png",false, "output", $this->offlineMode()));
64  $tpl->setVariable("TXT_ALT_IMG", $lng->txt("obj_".$this->lm_obj->getType()));
65  $tpl->parseCurrentBlock();
66 
67  $tpl->setCurrentBlock("link");
68  $tpl->setVariable("TITLE", ilUtil::shortenText($this->lm_obj->getTitle(), $this->textwidth, true));
69  $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget("",""));
70  $tpl->setVariable("TARGET", " target=\"".$this->frame_target."\"");
71  $tpl->parseCurrentBlock();
72 
73  $tpl->touchBlock("element");
74  }
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.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ ilLMExplorer()

ilLMExplorer::ilLMExplorer (   $a_target,
  $a_lm_obj,
  $a_lang = "-" 
)

Constructor public.

Parameters
stringscriptname
intuser_id

Definition at line 35 of file class.ilLMExplorer.php.

References ilExplorer\checkPermissions(), ilExplorer\setPostSort(), ilExplorer\setSessionExpandVariable(), and ilTree\setTableNames().

36  {
37  parent::ilExplorer($a_target);
38  $this->lang = $a_lang;
39  $this->tree = new ilTree($a_lm_obj->getId());
40  $this->tree->setTableNames('lm_tree','lm_data');
41  $this->tree->setTreeTablePK("lm_id");
42  $this->root_id = $this->tree->readRootId();
43  $this->lm_obj =& $a_lm_obj;
44  $this->order_column = "";
45  $this->setSessionExpandVariable("lmexpand");
46  $this->checkPermissions(false);
47  $this->setPostSort(false);
48  $this->textwidth = 200;
49  }
setPostSort($a_sort)
process post sorting
checkPermissions($a_check)
check permissions via rbac
setTableNames($a_table_tree, $a_table_obj_data, $a_table_obj_reference="")
set table names The primary key of the table containing your object_data must be 'obj_id' You may use...
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
setSessionExpandVariable($a_var_name="expand")
set name of expand session variable
+ Here is the call graph for this function:

◆ isClickable()

ilLMExplorer::isClickable (   $a_type,
  $a_obj_id = 0 
)

check if links for certain object type are activated

Parameters
string$a_typeobject type
Returns
boolean true if linking is activated

Definition at line 83 of file class.ilLMExplorer.php.

References $ilUser, ilLMObject\_isPagePublic(), and ilPaymentObject\_requiresPurchaseToAccess().

84  {
85  global $ilUser;
86  // in this standard implementation
87  // only the type determines, wether an object should be clickable or not
88  // but this method can be overwritten and make use of the ref id
89  // (this happens e.g. in class ilRepositoryExplorerGUI)
90  if ($this->is_clickable[$a_type] == "n")
91  {
92  return false;
93  }
94 
95  // check public access
96  include_once 'Services/Payment/classes/class.ilPaymentObject.php';
97  if (($ilUser->getId() == ANONYMOUS_USER_ID ||
98  ilPaymentObject::_requiresPurchaseToAccess((int)$this->lm_obj->getRefId())) &&
99  !ilLMObject::_isPagePublic($a_obj_id, true))
100  {
101  return false;
102  }
103 
104  return true;
105  }
static _requiresPurchaseToAccess($a_ref_id, $a_purchasetype='')
this function should be used by all buyable repository objects !!
global $ilUser
Definition: imgupload.php:15
static _isPagePublic($a_node_id, $a_check_public_mode=false)
+ Here is the call graph for this function:

Field Documentation

◆ $lm_obj

ilLMExplorer::$lm_obj

Definition at line 24 of file class.ilLMExplorer.php.

◆ $lp_cache

ilLMExplorer::$lp_cache
protected

Definition at line 27 of file class.ilLMExplorer.php.

◆ $output

ilLMExplorer::$output

Definition at line 25 of file class.ilLMExplorer.php.

◆ $root_id

ilLMExplorer::$root_id

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


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