ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilObjExerciseSubItemListGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 
13 {
17  protected $access;
18 
19 
23  public function __construct($a_cmd_class)
24  {
25  global $DIC;
26  parent::__construct($a_cmd_class);
27 
28  $this->access = $DIC->access();
29  }
30 
36  protected function isAssignmentVisible($a_ass_id)
37  {
38  $ilAccess = $this->access;
39 
40  if ($ilAccess->checkAccess('write', '', $this->getRefId())) {
41  return true;
42  }
43 
45  }
46 
47 
51  public function getHTML()
52  {
53  $lng = $this->lng;
54 
55  $lng->loadLanguageModule('exc');
56 
57  $valid = false;
58  foreach ($this->getSubItemIds(true) as $sub_item) {
59  if (!$this->isAssignmentVisible($sub_item)) {
60  continue;
61  }
62  $valid = true;
63 
64  if (is_object($this->getHighlighter()) and strlen($this->getHighlighter()->getContent($this->getObjId(), $sub_item))) {
65  $this->tpl->setCurrentBlock('sea_fragment');
66  $this->tpl->setVariable('TXT_FRAGMENT', $this->getHighlighter()->getContent($this->getObjId(), $sub_item));
67  $this->tpl->parseCurrentBlock();
68  }
69  $this->tpl->setCurrentBlock('subitem');
70  $this->tpl->setVariable('SUBITEM_TYPE', $lng->txt('exc_assignment'));
71  $this->tpl->setVariable('SEPERATOR', ':');
72 
73  #$link_data = ilLinkResourceItems::lookupItem($this->getObjId(),$sub_item);
74  #$link_data = ilParameterAppender::_append($link_data);
75 
76  #$this->getItemListGUI()->setChildId($sub_item);
77  $this->tpl->setVariable('LINK', 'ilias.php?baseClass=ilExerciseHandlerGUI&cmd=showOverview&ref_id=' . $this->getRefId() . '&ass_id=' . $sub_item);
78  $this->tpl->setVariable('TITLE', ilExAssignment::lookupTitle($sub_item));
79 
80  if (count($this->getSubItemIds(true)) > 1) {
81  $this->parseRelevance($sub_item);
82  }
83 
84  $this->tpl->parseCurrentBlock();
85  }
86 
87  $this->showDetailsLink();
88 
89  return $valid ? $this->tpl->get() : '';
90  }
91 }
getHighlighter()
get highlighter
$valid
Base class for all sub item list gui&#39;s.
showDetailsLink()
show details link
static lookupAssignmentOnline($a_ass_id)
Check if assignment is online.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
static lookupTitle($a_id)
Lookup title.
Represents search sub item lists.
isAssignmentVisible($a_ass_id)
Check if read access to assignments is granted.
getSubItemIds($a_limited=false)
get sub item ids