ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjWikiSubItemListGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 protected ilObjUser $user;
27
28 public function __construct(
29 string $a_cmd_class
30 ) {
31 global $DIC;
32
33 parent::__construct($a_cmd_class);
34 $this->lng = $DIC->language();
35 $this->user = $DIC->user();
36 }
37
38 public function getHTML(): string
39 {
41
42 $lng->loadLanguageModule('content');
43 foreach ($this->getSubItemIds(true) as $sub_item) {
44 if (is_object($this->getHighlighter()) &&
45 $this->getHighlighter()->getContent($this->getObjId(), $sub_item) !== '') {
46 $this->tpl->setCurrentBlock('sea_fragment');
47 $this->tpl->setVariable('TXT_FRAGMENT', $this->getHighlighter()->getContent($this->getObjId(), $sub_item));
48 $this->tpl->parseCurrentBlock();
49 }
50
51 $this->tpl->setCurrentBlock('subitem');
52
53 // TODO: subitem type must returned from lucene
54 $title = (string) ilWikiPage::lookupTitle($sub_item);
55 if ($title !== '') {
56 // Page
57 $this->tpl->setVariable('SUBITEM_TYPE', $lng->txt('obj_pg'));
58 $this->tpl->setVariable('SEPERATOR', ':');
59
60 $link = '&srcstring=1';
61 $link = ilObjWikiGUI::getGotoLink($this->getRefId(), $title) . $link;
62
63 $this->tpl->setVariable('LINK', $link);
64 $this->tpl->setVariable('TARGET', $this->getItemListGUI()->getCommandFrame(''));
65 $this->tpl->setVariable('TITLE', $title);
66 } else {
67 $this->tpl->setVariable('SUBITEM_TYPE', $lng->txt('obj_file'));
68 $this->tpl->setVariable('SEPERATOR', ':');
69
70 // File
71 $this->getItemListGUI()->setChildId('il__file_' . $sub_item);
72 $link = $this->getItemListGUI()->getCommandLink('downloadFile');
73 $this->tpl->setVariable('LINK', $link);
74 $this->tpl->setVariable('TITLE', ilObject::_lookupTitle($sub_item));
75 }
76 $this->tpl->parseCurrentBlock();
77 $this->tpl->parseCurrentBlock();
78 }
79
80 $this->showDetailsLink();
81
82 return $this->tpl->get();
83 }
84}
loadLanguageModule(string $a_module)
Load language module.
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...
User class.
static getGotoLink(int $a_ref_id, string $a_page="", string $lang="-")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupTitle(int $obj_id)
Base class for all sub item list gui's.
getSubItemIds(bool $limited=false)
static lookupTitle(int $a_page_id, string $lang="-")
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26