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

Public Member Functions

 ilTableOfContentsExplorer ($a_target, &$a_lm_obj, $a_export_format="", $a_lang="-")
 Constructor public. More...
 
 setOfflineMode ($a_offline=true)
 set offline mode More...
 
 offlineMode ()
 get offline mode More...
 
 buildTitle ($a_title, $a_id, $a_type)
 standard implementation for title, maybe overwritten by derived classes More...
 
 buildFrameTarget ($a_type, $a_child=0, $a_obj_id=0)
 get target frame More...
 
 buildLinkTarget ($a_node_id, $a_type)
 build link target More...
 
 isClickable ($a_type, $a_node_id)
 
 getImage ($a_name, $a_type="", $a_id="")
 get image path (may be overwritten by derived classes) 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

 $root_id
 
 $output
 
 $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 35 of file class.ilLMTableOfContentsExplorer.php.

Member Function Documentation

◆ buildFrameTarget()

ilTableOfContentsExplorer::buildFrameTarget (   $a_type,
  $a_child = 0,
  $a_obj_id = 0 
)

get target frame

Definition at line 151 of file class.ilLMTableOfContentsExplorer.php.

References ilFrameTargetInfo\_getFrame(), and offlineMode().

152  {
153  // Determine whether the view of a learning resource should
154  // be shown in the frameset of ilias, or in a separate window.
155  //$showViewInFrameset = $this->ilias->ini->readVariable("layout","view_target") == "frame";
156  $showViewInFrameset = true;
157 
158  if ($this->offlineMode() &&
159  $this->export_format == "scorm")
160  {
161  return "";
162  }
163 
164  if ($showViewInFrameset && !$this->offlineMode())
165  {
166  return ilFrameTargetInfo::_getFrame("MainContent");
167  }
168  else
169  {
170  return "_top";
171  }
172  }
static _getFrame($a_class, $a_type='')
Get content frame name.
+ Here is the call graph for this function:

◆ buildLinkTarget()

ilTableOfContentsExplorer::buildLinkTarget (   $a_node_id,
  $a_type 
)

build link target

Definition at line 177 of file class.ilLMTableOfContentsExplorer.php.

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

178  {
179  if (!$this->offlineMode())
180  {
181  return parent::buildLinkTarget($a_node_id, $a_type);
182  }
183  else
184  {
185  if ($a_node_id < 1)
186  {
187  $a_node_id = $this->tree->getRootId();
188  }
189  if ($a_type != "pg")
190  {
191  // get next activated page
192  $found = false;
193  while (!$found)
194  {
195  $a_node = $this->tree->fetchSuccessorNode($a_node_id, "pg");
196  $a_node_id = $a_node["child"];
197  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
198  $active = ilLMPage::_lookupActive($a_node_id, $this->lm_obj->getType(),
199  $this->lm_set->get("time_scheduled_page_activation"));
200  if ($a_node_id > 0 && !$active)
201  {
202  $found = false;
203  }
204  else
205  {
206  $found = true;
207  }
208  }
209  }
210 
211  if ($nid = ilLMPageObject::getExportId($this->lm_obj->getId(), $a_node_id))
212  {
213  return "lm_pg_".$nid.".html";
214  }
215  else
216  {
217  return "lm_pg_".$a_node_id.".html";
218  }
219  }
220  }
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
static getExportId($a_lm_id, $a_lmobj_id, $a_type="pg")
Get export ID.
+ Here is the call graph for this function:

◆ buildTitle()

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

standard implementation for title, maybe overwritten by derived classes

Definition at line 114 of file class.ilLMTableOfContentsExplorer.php.

References $_GET, $lang, $lng, ilObjContentObject\_checkPreconditionsOfPage(), ilStructureObject\_getPresentationTitle(), ilLMPageObject\_getPresentationTitle(), and ilObject\_lookupObjId().

115  {
116  global $lng;
117 
118  include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
119  $access_str = "";
121  $_GET['ref_id'],ilObject::_lookupObjId($_GET["ref_id"]), $a_id))
122  {
123  $access_str = " (".$lng->txt("cont_no_access").")";
124  }
125 
126  if ($a_type == "st")
127  {
129  $this->lm_obj->isActiveNumbering(), false, $this->lm_obj->getId(), $this->lang).$access_str;
130  }
131 
132  if ($this->lm_obj->getTOCMode() == "chapters" || $a_type != "pg")
133  {
134  return $a_title.$access_str;
135  }
136  else
137  {
138  if ($a_type == "pg")
139  {
141  $this->lm_obj->getPageHeader(), $this->lm_obj->isActiveNumbering(),
142  $this->lm_set->get("time_scheduled_page_activation"), true, $this->lm_obj->getId(), $this->lang).$access_str;
143  }
144  }
145 
146  }
_checkPreconditionsOfPage($cont_ref_id, $cont_obj_id, $page_id)
checks wether the preconditions of a page are fulfilled or not
static _getPresentationTitle($a_st_id, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_lm_id=0, $a_lang="-")
get presentation title
$_GET["client_id"]
static _lookupObjId($a_id)
global $lng
Definition: privfeed.php:40
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()

ilTableOfContentsExplorer::forceExpanded (   $a_obj_id)

force expansion of node

Definition at line 343 of file class.ilLMTableOfContentsExplorer.php.

References offlineMode().

344  {
345  if ($this->offlineMode())
346  {
347  return true;
348  }
349  else
350  {
351  return true;
352  }
353  }
+ Here is the call graph for this function:

◆ getImage()

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

get image path (may be overwritten by derived classes)

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

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

294  {
295  // overwrite chapter icons with lp info?
296  if(!$this->offlineMode() && $a_type == "st")
297  {
298  $icon = $this->checkLPIcon($a_id);
299  if($icon)
300  {
301  return $icon;
302  }
303  }
304 
305  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
306 
307  if ($a_type == "pg")
308  {
309  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
310  $lm_set = new ilSetting("lm");
311  $active = ilLMPage::_lookupActive($a_id, $this->lm_obj->getType(),
312  $lm_set->get("time_scheduled_page_activation"));
313 
314  // is page scheduled?
315  $img_sc = ($lm_set->get("time_scheduled_page_activation") &&
316  ilLMPage::_isScheduledActivation($a_id, $this->lm_obj->getType()))
317  ? "_sc"
318  : "";
319 
320  $a_name = "icon_pg".$img_sc."_s.png";
321 
322  if (!$active)
323  {
324  $a_name = "icon_pg_d".$img_sc."_s.png";
325  }
326  else
327  {
328  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
329  $contains_dis = ilLMPage::_lookupContainsDeactivatedElements($a_id,
330  $this->lm_obj->getType());
331  if ($contains_dis)
332  {
333  $a_name = "icon_pg_del".$img_sc."_s.png";
334  }
335  }
336  }
337  return ilUtil::getImagePath($a_name, false, "output", $this->offlineMode());
338  }
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
+ Here is the call graph for this function:

◆ ilTableOfContentsExplorer()

ilTableOfContentsExplorer::ilTableOfContentsExplorer (   $a_target,
$a_lm_obj,
  $a_export_format = "",
  $a_lang = "-" 
)

Constructor public.

Parameters
stringscriptname
intuser_id

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

References ilFrameTargetInfo\_getFrame(), ilExplorer\addFilter(), IL_FM_POSITIVE, ilExplorer\setFiltered(), ilExplorer\setFilterMode(), ilExplorer\setFrameTarget(), and ilExplorer\setSessionExpandVariable().

54  {
55  parent::ilLMExplorer($a_target, $a_lm_obj, $a_lang);
56  $this->setSessionExpandVariable("lmtocexpand");
57  $this->export_format = $a_export_format;
58  $this->lm_obj =& $a_lm_obj;
59 
60  $this->addFilter("du");
61  $this->addFilter("st");
62  if ($a_lm_obj->getTOCMode() == "pages")
63  {
64  $this->addFilter("pg");
65  }
66  $this->setFiltered(true);
68  $this->lm_set = new ilSetting("lm");
69 
70  // Determine whether the view of a learning resource should
71  // be shown in the frameset of ilias, or in a separate window.
72  //$showViewInFrameset = $this->ilias->ini->readVariable("layout","view_target") == "frame";
73  $showViewInFrameset = true;
74 
75  if ($showViewInFrameset)
76  {
77  $this->setFrameTarget(ilFrameTargetInfo::_getFrame("MainContent"));
78  }
79  else
80  {
81  $this->setFrameTarget("_top");
82  }
83 
84  }
ILIAS Setting Class.
setFilterMode($a_mode=IL_FM_NEGATIVE)
set filter mode
const IL_FM_POSITIVE
setFiltered($a_bool)
active/deactivate the filter public
setFrameTarget($a_target)
set target frame or not frame?
static _getFrame($a_class, $a_type='')
Get content frame name.
setSessionExpandVariable($a_var_name="expand")
set name of expand session variable
addFilter($a_item)
adds item to the filter public
+ Here is the call graph for this function:

◆ isClickable()

ilTableOfContentsExplorer::isClickable (   $a_type,
  $a_node_id 
)

Definition at line 222 of file class.ilLMTableOfContentsExplorer.php.

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

223  {
224  global $ilUser;
225 
226  $orig_node_id = $a_node_id;
227 
228  if ($a_type == "st")
229  {
230  if (!$this->offlineMode())
231  {
232  $a_node = $this->tree->fetchSuccessorNode($a_node_id, "pg");
233  $a_node_id = $a_node["child"];
234  if ($a_node_id == 0)
235  {
236  return false;
237  }
238  }
239  else
240  {
241  // get next activated page
242  $found = false;
243  while (!$found)
244  {
245  $a_node = $this->tree->fetchSuccessorNode($a_node_id, "pg");
246  $a_node_id = $a_node["child"];
247  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
248  $active = ilLMPage::_lookupActive($a_node_id, $this->lm_obj->getType(),
249  $this->lm_set->get("time_scheduled_page_activation"));
250  if ($a_node_id > 0 && !$active)
251  {
252  $found = false;
253  }
254  else
255  {
256  $found = true;
257  }
258  }
259  if ($a_node_id <= 0)
260  {
261  return false;
262  }
263  else
264  {
265  $path = $this->tree->getPathId($a_node_id);
266  if (!in_array($orig_node_id, $path))
267  {
268  return false;
269  }
270  }
271  }
272  }
273 
274  if ($a_type == "pg")
275  {
276  // check public area mode
277  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
278  include_once 'Services/Payment/classes/class.ilPaymentObject.php';
279  if (($ilUser->getId() == ANONYMOUS_USER_ID ||
280  ilPaymentObject::_requiresPurchaseToAccess((int)$this->lm_obj->getRefId())) &&
281  !ilLMObject::_isPagePublic($a_node_id, true))
282  {
283  return false;
284  }
285  }
286 
287  return true;
288  }
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
$path
Definition: index.php:22
static _isPagePublic($a_node_id, $a_check_public_mode=false)
+ Here is the call graph for this function:

◆ isVisible()

ilTableOfContentsExplorer::isVisible (   $a_id,
  $a_type 
)

Definition at line 355 of file class.ilLMTableOfContentsExplorer.php.

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

356  {
357  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
358  $active = ilLMPage::_lookupActive($a_id, $this->lm_obj->getType(),
359  $this->lm_set->get("time_scheduled_page_activation"));
360 
361  if(!$active && $a_type == "pg")
362  {
363  $act_data = ilLMPage::_lookupActivationData((int) $a_id, $this->lm_obj->getType());
364  if ($act_data["show_activation_info"] &&
365  (ilUtil::now() < $act_data["activation_start"]))
366  {
367  return true;
368  }
369  else
370  {
371  return false;
372  }
373  }
374  else
375  {
376  return true;
377  }
378  }
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()

ilTableOfContentsExplorer::offlineMode ( )

get offline mode

Definition at line 106 of file class.ilLMTableOfContentsExplorer.php.

References $offline.

Referenced by buildFrameTarget(), buildLinkTarget(), forceExpanded(), getImage(), and isClickable().

+ Here is the caller graph for this function:

◆ setOfflineMode()

ilTableOfContentsExplorer::setOfflineMode (   $a_offline = true)

set offline mode

Definition at line 89 of file class.ilLMTableOfContentsExplorer.php.

References ilExplorer\setFrameTarget().

90  {
91  $this->offline = $a_offline;
92 
93  if ($a_offline)
94  {
95  if ($this->export_format == "scorm")
96  {
97  $this->setFrameTarget("");
98  }
99  }
100 
101  }
setFrameTarget($a_target)
set target frame or not frame?
+ Here is the call graph for this function:

Field Documentation

◆ $offline

ilTableOfContentsExplorer::$offline

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

Referenced by offlineMode().

◆ $output

ilTableOfContentsExplorer::$output

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

◆ $root_id

ilTableOfContentsExplorer::$root_id

Definition at line 43 of file class.ilLMTableOfContentsExplorer.php.


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