ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilObjExerciseSubItemListGUI.php
Go to the documentation of this file.
1 <?php
2 
26 {
28 
29  public function __construct(string $a_cmd_class)
30  {
31  global $DIC;
32  parent::__construct($a_cmd_class);
33 
34  $this->access = $DIC->access();
35  }
36 
37  protected function isAssignmentVisible(
38  int $a_ass_id
39  ): bool {
40  $ilAccess = $this->access;
41 
42  if ($ilAccess->checkAccess('write', '', $this->getRefId())) {
43  return true;
44  }
45 
47  }
48 
49  public function getHTML(): string
50  {
51  $lng = $this->lng;
52 
53  $lng->loadLanguageModule('exc');
54 
55  $valid = false;
56  foreach ($this->getSubItemIds(true) as $sub_item) {
57  if (!$this->isAssignmentVisible($sub_item)) {
58  continue;
59  }
60  $valid = true;
61 
62  if (is_object($this->getHighlighter()) && strlen($this->getHighlighter()->getContent($this->getObjId(), $sub_item))) {
63  $this->tpl->setCurrentBlock('sea_fragment');
64  $this->tpl->setVariable('TXT_FRAGMENT', $this->getHighlighter()->getContent($this->getObjId(), $sub_item));
65  $this->tpl->parseCurrentBlock();
66  }
67  $this->tpl->setCurrentBlock('subitem');
68  $this->tpl->setVariable('SUBITEM_TYPE', $lng->txt('exc_assignment'));
69  $this->tpl->setVariable('SEPERATOR', ':');
70 
71  $this->tpl->setVariable('LINK', 'ilias.php?baseClass=ilExerciseHandlerGUI&cmd=showOverview&ref_id=' . $this->getRefId() . '&ass_id=' . $sub_item);
72  $this->tpl->setVariable('TITLE', ilExAssignment::lookupTitle($sub_item));
73 
74  if (count($this->getSubItemIds(true)) > 1) {
75  $this->parseRelevance($sub_item);
76  }
77 
78  $this->tpl->parseCurrentBlock();
79  }
80 
81  $this->showDetailsLink();
82 
83  return $valid ? $this->tpl->get() : '';
84  }
85 }
getSubItemIds(bool $limited=false)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
parseRelevance(int $sub_item)
$valid
static lookupTitle(int $a_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
loadLanguageModule(string $a_module)
Load language module.
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
static lookupAssignmentOnline(int $a_ass_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...