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

Public Member Functions

 ilLMTOCExplorer ($a_target, $a_lm_obj, $a_lang="-")
 Constructor public. More...
 
 setOfflineMode ($a_offline=true)
 set offline mode More...
 
 offlineMode ()
 get offline mode More...
 
 setForceOpenPath ($a_path)
 set force open path More...
 
 buildTitle ($a_title, $a_id, $a_type)
 standard implementation for title, maybe overwritten by derived classes More...
 
 getImage ($a_name, $a_type="", $a_id="")
 get image path (may be overwritten by derived classes) More...
 
 isClickable ($a_type, $a_node_id)
 
 buildLinkTarget ($a_node_id, $a_type)
 build link target More...
 
 forceExpanded ($a_obj_id)
 force expansion of node More...
 
 isVisible ($a_id, $a_type)
 
- Public Member Functions inherited from ilLMExplorer
 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

 $offline
 
- Data Fields inherited from ilLMExplorer
 $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
 

Additional Inherited Members

- Protected Member Functions inherited from ilLMExplorer
 checkLPIcon ($a_id)
 
- Protected Attributes inherited from ilLMExplorer
 $lp_cache
 

Detailed Description

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

Member Function Documentation

◆ buildLinkTarget()

ilLMTOCExplorer::buildLinkTarget (   $a_node_id,
  $a_type 
)

build link target

Definition at line 207 of file class.ilLMTOCExplorer.php.

References ilPageObject\_lookupActive(), and offlineMode().

208  {
209  if (!$this->offlineMode())
210  {
211  return parent::buildLinkTarget($a_node_id, $a_type);
212  }
213  else
214  {
215  if ($a_node_id < 1)
216  {
217  $a_node_id = $this->tree->getRootId();
218  }
219  if ($a_type != "pg")
220  {
221  // get next activated page
222  $found = false;
223  while (!$found)
224  {
225  $a_node = $this->tree->fetchSuccessorNode($a_node_id, "pg");
226  $a_node_id = $a_node["child"];
227  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
228  $active = ilLMPage::_lookupActive($a_node_id, $this->lm_obj->getType(),
229  $this->lm_set->get("time_scheduled_page_activation"));
230 
231  if ($a_node_id > 0 && !$active)
232  {
233  $found = false;
234  }
235  else
236  {
237  $found = true;
238  }
239  }
240  }
241  if (!$this->lm_obj->cleanFrames())
242  {
243  return "frame_".$a_node_id."_maincontent.html";
244  }
245  else
246  {
247  return "lm_pg_".$a_node_id.".html";
248  }
249  }
250  }
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
offlineMode()
get offline mode
+ Here is the call graph for this function:

◆ buildTitle()

ilLMTOCExplorer::buildTitle (   $a_title,
  $a_id,
  $a_type 
)

standard implementation for title, maybe overwritten by derived classes

Definition at line 61 of file class.ilLMTOCExplorer.php.

References $lang, ilStructureObject\_getPresentationTitle(), and ilLMPageObject\_getPresentationTitle().

62  {
63  if ($a_type == "st")
64  {
66  $this->lm_obj->isActiveNumbering(), false, $this->lm_obj->getId(), $this->lang);
67  }
68 
69  if ($this->lm_obj->getTOCMode() == "chapters" || $a_type != "pg")
70  {
71  return $a_title;
72  }
73  else
74  {
75  if ($a_type == "pg")
76  {
78  $this->lm_obj->getPageHeader(), $this->lm_obj->isActiveNumbering(),
79  $this->lm_set->get("time_scheduled_page_activation"), true, $this->lm_obj->getId(), $this->lang);
80  }
81  }
82  }
static _getPresentationTitle($a_st_id, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_lm_id=0, $a_lang="-")
get presentation title
static _getPresentationTitle($a_pg_id, $a_mode=IL_CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-")
presentation title doesn&#39;t have to be page title, it may be chapter title + page title or chapter tit...
+ Here is the call graph for this function:

◆ forceExpanded()

ilLMTOCExplorer::forceExpanded (   $a_obj_id)

force expansion of node

Definition at line 255 of file class.ilLMTOCExplorer.php.

References offlineMode().

256  {
257  if ($this->offlineMode())
258  {
259  return true;
260  }
261  else
262  {
263  if (in_array($a_obj_id, $this->force_open_path))
264  {
265  return true;
266  }
267  return false;
268  }
269  }
offlineMode()
get offline mode
+ Here is the call graph for this function:

◆ getImage()

ilLMTOCExplorer::getImage (   $a_name,
  $a_type = "",
  $a_id = "" 
)

get image path (may be overwritten by derived classes)

Definition at line 88 of file class.ilLMTOCExplorer.php.

References $lm_set, ilPageObject\_isScheduledActivation(), ilPageObject\_lookupActive(), ilPageObject\_lookupContainsDeactivatedElements(), ilLMExplorer\checkLPIcon(), ilUtil\getImagePath(), and offlineMode().

89  {
90  // overwrite chapter icons with lp info?
91  if(!$this->offlineMode() && $a_type == "st")
92  {
93  $icon = $this->checkLPIcon($a_id);
94  if($icon)
95  {
96  return $icon;
97  }
98  }
99 
100  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
101 
102  if ($a_type == "pg")
103  {
104  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
105  $lm_set = new ilSetting("lm");
106  $active = ilLMPage::_lookupActive($a_id, $this->lm_obj->getType(),
107  $lm_set->get("time_scheduled_page_activation"));
108 
109  // is page scheduled?
110  $img_sc = ($lm_set->get("time_scheduled_page_activation") &&
111  ilLMPage::_isScheduledActivation($a_id, $this->lm_obj->getType()))
112  ? "_sc"
113  : "";
114 
115  $a_name = "icon_pg".$img_sc."_s.png";
116 
117  if (!$active)
118  {
119  $a_name = "icon_pg_d".$img_sc."_s.png";
120  }
121  else
122  {
123  $contains_dis = ilLMPage::_lookupContainsDeactivatedElements($a_id,
124  $this->lm_obj->getType());
125  if ($contains_dis)
126  {
127  $a_name = "icon_pg_del".$img_sc."_s.png";
128  }
129  }
130  }
131  return ilUtil::getImagePath($a_name, false, "output", $this->offlineMode());
132  }
ILIAS Setting Class.
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupContainsDeactivatedElements($a_id, $a_parent_type, $a_lang="-")
lookup whether page contains deactivated elements
static _isScheduledActivation($a_id, $a_parent_type, $a_lang="-")
Check whether page is activated by time schedule.
$lm_set
offlineMode()
get offline mode
+ Here is the call graph for this function:

◆ ilLMTOCExplorer()

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

Constructor public.

Parameters
stringscriptname
intuser_id

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

26  {
27  $this->offline = false;
28  $this->force_open_path = array();
29  parent::ilLMExplorer($a_target, $a_lm_obj, $a_lang);
30  $this->lm_set = new ilSetting("lm");
31  }
ILIAS Setting Class.

◆ isClickable()

ilLMTOCExplorer::isClickable (   $a_type,
  $a_node_id 
)

Definition at line 135 of file class.ilLMTOCExplorer.php.

References $ilUser, $path, ilLMObject\_isPagePublic(), ilPageObject\_lookupActive(), ilPaymentObject\_requiresPurchaseToAccess(), and offlineMode().

136  {
137  global $ilUser;
138 
139  $orig_node_id = $a_node_id;
140 
141  if ($a_type == "st")
142  {
143  if (!$this->offlineMode())
144  {
145  $a_node = $this->tree->fetchSuccessorNode($a_node_id, "pg");
146  $a_node_id = $a_node["child"];
147  if ($a_node_id == 0)
148  {
149  return false;
150  }
151  }
152  else
153  {
154  // get next activated page
155  $found = false;
156  while (!$found)
157  {
158  $a_node = $this->tree->fetchSuccessorNode($a_node_id, "pg");
159  $a_node_id = $a_node["child"];
160  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
161  $active = ilLMPage::_lookupActive($a_node_id, $this->lm_obj->getType(),
162  $this->lm_set->get("time_scheduled_page_activation"));
163 
164  if ($a_node_id > 0 && !$active)
165  {
166  $found = false;
167  }
168  else
169  {
170  $found = true;
171  }
172  }
173  if ($a_node_id <= 0)
174  {
175  return false;
176  }
177  else
178  {
179  $path = $this->tree->getPathId($a_node_id);
180  if (!in_array($orig_node_id, $path))
181  {
182  return false;
183  }
184  }
185  }
186  }
187 
188  if ($a_type == "pg")
189  {
190  // check public area mode
191  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
192  include_once 'Services/Payment/classes/class.ilPaymentObject.php';
193  if (($ilUser->getId() == ANONYMOUS_USER_ID ||
194  ilPaymentObject::_requiresPurchaseToAccess((int)$this->lm_obj->getRefId())) &&
195  !ilLMObject::_isPagePublic($a_node_id, true))
196  {
197  return false;
198  }
199  }
200 
201  return true;
202  }
static _requiresPurchaseToAccess($a_ref_id, $a_purchasetype='')
this function should be used by all buyable repository objects !!
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
global $ilUser
Definition: imgupload.php:15
offlineMode()
get offline mode
$path
Definition: index.php:22
static _isPagePublic($a_node_id, $a_check_public_mode=false)
+ Here is the call graph for this function:

◆ isVisible()

ilLMTOCExplorer::isVisible (   $a_id,
  $a_type 
)

Definition at line 271 of file class.ilLMTOCExplorer.php.

References ilPageObject\_lookupActivationData(), ilPageObject\_lookupActive(), and ilUtil\now().

272  {
273  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
274  $active = ilLMPage::_lookupActive($a_id, $this->lm_obj->getType(),
275  $this->lm_set->get("time_scheduled_page_activation"));
276 
277  if(!$active && $a_type == "pg")
278  {
279  $act_data = ilLMPage::_lookupActivationData((int) $a_id, $this->lm_obj->getType());
280  if ($act_data["show_activation_info"] &&
281  (ilUtil::now() < $act_data["activation_start"]))
282  {
283  return true;
284  }
285  else
286  {
287  return false;
288  }
289  }
290  else
291  {
292  return true;
293  }
294  }
static now()
Return current timestamp in Y-m-d H:i:s format.
_lookupActivationData($a_id, $a_parent_type, $a_lang="-")
Lookup activation data.
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
+ Here is the call graph for this function:

◆ offlineMode()

ilLMTOCExplorer::offlineMode ( )

get offline mode

Definition at line 44 of file class.ilLMTOCExplorer.php.

References $offline.

Referenced by ilShopPublicSectionSelector\buildLinkTarget(), buildLinkTarget(), forceExpanded(), getImage(), and isClickable().

45  {
46  return $this->offline;
47  }
+ Here is the caller graph for this function:

◆ setForceOpenPath()

ilLMTOCExplorer::setForceOpenPath (   $a_path)

set force open path

Definition at line 53 of file class.ilLMTOCExplorer.php.

54  {
55  $this->force_open_path = $a_path;
56  }

◆ setOfflineMode()

ilLMTOCExplorer::setOfflineMode (   $a_offline = true)

set offline mode

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

37  {
38  $this->offline = $a_offline;
39  }

Field Documentation

◆ $offline

ilLMTOCExplorer::$offline

Definition at line 17 of file class.ilLMTOCExplorer.php.

Referenced by offlineMode().


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