ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjLearningModuleSubItemListGUI Class Reference
+ Inheritance diagram for ilObjLearningModuleSubItemListGUI:
+ Collaboration diagram for ilObjLearningModuleSubItemListGUI:

Public Member Functions

 __construct ($a_cmd_class)
 Constructor. More...
 
 getHTML ()
 get html More...
 
- Public Member Functions inherited from ilSubItemListGUI
 __construct ($a_cmd_class)
 Constructor. More...
 
 getCmdClass ()
 get cmd class More...
 
 setHighlighter ($a_highlighter)
 set highlighter More...
 
 getHighlighter ()
 get highlighter More...
 
 getRefId ()
 get ref id More...
 
 getObjId ()
 get obj id More...
 
 getType ()
 get type More...
 
 getSubItemIds ($a_limited=false)
 get sub item ids More...
 
 getItemListGUI ()
 get item list gui More...
 
 init ($item_list_gui, $a_ref_id, $a_subitem_ids)
 init More...
 
 getHTML ()
 

Protected Attributes

 $user
 
- Protected Attributes inherited from ilSubItemListGUI
 $ctrl
 
 $lng
 
 $cmdClass = null
 
 $tpl
 

Additional Inherited Members

- Static Public Member Functions inherited from ilSubItemListGUI
static setShowDetails ($a_obj_id)
 set show details. More...
 
static resetDetails ()
 reset details As long as static::resetDetails is not possible this method is final More...
 
static enabledDetails ($a_obj_id)
 enabled show details As long as static::enableDetails is not possible this method is final More...
 
- Protected Member Functions inherited from ilSubItemListGUI
 showDetailsLink ()
 show details link More...
 
 parseRelevance ($sub_item)
 
- Static Protected Attributes inherited from ilSubItemListGUI
static $MAX_SUBITEMS = 5
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 14 of file class.ilObjLearningModuleSubItemListGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjLearningModuleSubItemListGUI::__construct (   $a_cmd_class)

Constructor.

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and user().

26  {
27  global $DIC;
28  parent::__construct($a_cmd_class);
29 
30  $this->user = $DIC->user();
31  }
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getHTML()

ilObjLearningModuleSubItemListGUI::getHTML ( )

get html

Returns

Definition at line 38 of file class.ilObjLearningModuleSubItemListGUI.php.

References $ilUser, ilSubItemListGUI\$lng, $user, ilLMObject\_lookupTitle(), ilObject\_lookupTitle(), ilLMObject\_lookupType(), ilObject\_lookupType(), ilSubItemListGUI\getHighlighter(), ilSubItemListGUI\getItemListGUI(), ilSubItemListGUI\getObjId(), ilSubItemListGUI\getSubItemIds(), ilSubItemListGUI\parseRelevance(), and ilSubItemListGUI\showDetailsLink().

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  }
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
getHighlighter()
get highlighter
static _lookupTitle($a_id)
lookup object title
static _lookupTitle($a_obj_id)
Lookup title.
showDetailsLink()
show details link
static _lookupType($a_id, $a_reference=false)
lookup object type
$ilUser
Definition: imgupload.php:18
getItemListGUI()
get item list gui
getSubItemIds($a_limited=false)
get sub item ids
+ Here is the call graph for this function:

Field Documentation

◆ $user

ilObjLearningModuleSubItemListGUI::$user
protected

Definition at line 19 of file class.ilObjLearningModuleSubItemListGUI.php.

Referenced by getHTML().


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