ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilObjLearningModuleSubItemListGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
15 {
19  protected $user;
20 
21 
25  public function __construct($a_cmd_class)
26  {
27  global $DIC;
28  parent::__construct($a_cmd_class);
29 
30  $this->user = $DIC->user();
31  }
32 
33 
38  public function getHTML()
39  {
40  $lng = $this->lng;
42 
43  foreach ($this->getSubItemIds(true) as $sub_item) {
44  if (is_object($this->getHighlighter()) and strlen($this->getHighlighter()->getContent($this->getObjId(), $sub_item))) {
45  $this->tpl->setCurrentBlock('sea_fragment');
46  $this->tpl->setVariable('TXT_FRAGMENT', $this->getHighlighter()->getContent($this->getObjId(), $sub_item));
47  $this->tpl->parseCurrentBlock();
48  }
49  $this->tpl->setCurrentBlock('subitem');
50 
51  $this->tpl->setVariable('SEPERATOR', ':');
52 
53 
54  switch (ilLMObject::_lookupType($sub_item, $this->getObjId())) {
55  case 'pg':
56  $this->getItemListGUI()->setChildId($sub_item);
57  $this->tpl->setVariable("SUBITEM_TYPE", $lng->txt('obj_pg'));
58  $link = $this->getItemListGUI()->getCommandLink('page');
59  $link .= ('&srcstring=1');
60  $this->tpl->setVariable('LINK', $link);
61  $this->tpl->setVariable('TARGET', $this->getItemListGUI()->getCommandFrame('page'));
62  $this->tpl->setVariable('TITLE', ilLMObject::_lookupTitle($sub_item));
63  break;
64 
65  case 'st':
66 
67  $this->getItemListGUI()->setChildId($sub_item);
68  $this->tpl->setVariable("SUBITEM_TYPE", $lng->txt('obj_st'));
69  $link = $this->getItemListGUI()->getCommandLink('page');
70  $link .= ('&srcstring=1');
71  $this->tpl->setVariable('LINK', $link);
72  $this->tpl->setVariable('TARGET', $this->getItemListGUI()->getCommandFrame('page'));
73  $this->tpl->setVariable('TITLE', ilLMObject::_lookupTitle($sub_item));
74  break;
75 
76  default:
77 
78  if (ilObject::_lookupType($sub_item) != 'file') {
79  return '';
80  }
81 
82  $this->getItemListGUI()->setChildId('il__file_' . $sub_item);
83  $this->tpl->setVariable('SUBITEM_TYPE', $lng->txt('obj_file'));
84  $link = $this->getItemListGUI()->getCommandLink('downloadFile');
85  $this->tpl->setVariable('LINK', $link);
86  $this->tpl->setVariable('TITLE', ilObject::_lookupTitle($sub_item));
87  break;
88  }
89 
90  if (count($this->getSubItemIds(true)) > 1) {
91  $this->parseRelevance($sub_item);
92  }
93 
94  $this->tpl->parseCurrentBlock();
95  }
96 
97  $this->showDetailsLink();
98 
99  return $this->tpl->get();
100  }
101 }
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
getHighlighter()
get highlighter
Base class for all sub item list gui&#39;s.
static _lookupTitle($a_id)
lookup object title
static _lookupTitle($a_obj_id)
Lookup title.
user()
Definition: user.php:4
showDetailsLink()
show details link
$ilUser
Definition: imgupload.php:18
static _lookupType($a_id, $a_reference=false)
lookup object type
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
getItemListGUI()
get item list gui
getSubItemIds($a_limited=false)
get sub item ids