ILIAS  release_8 Revision v8.24
class.ilObjWikiListGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 protected string $child_id;
27
31 public function init(): void
32 {
33 $this->copy_enabled = true;
34 $this->delete_enabled = true;
35 $this->cut_enabled = true;
36 $this->subscribe_enabled = true;
37 $this->link_enabled = true;
38 $this->info_screen_enabled = true;
39 $this->type = "wiki";
40 $this->gui_class_name = "ilobjwikigui";
41
42 // general commands array
43 $this->commands = ilObjWikiAccess::_getCommands();
44 }
45
46 public function getCommandFrame(string $cmd): string
47 {
48 switch ($cmd) {
49 default:
50 $frame = ilFrameTargetInfo::_getFrame("MainContent");
51 break;
52 }
53
54 return $frame;
55 }
56
57 public function getProperties(): array
58 {
60
61 $props = array();
62
63 if (!ilObjWikiAccess::_lookupOnline($this->obj_id)) {
64 $props[] = array("alert" => true, "property" => $lng->txt("status"),
65 "value" => $lng->txt("offline"));
66 }
67
68 $lng->loadLanguageModule("wiki");
69 $info = ilExcRepoObjAssignment::getInstance()->getAssignmentInfoOfObj($this->ref_id, $this->user->getId());
70 if (count($info) > 0) {
72 foreach ($sub as $s) {
73 $team = new ilExAssignmentTeam($s["team_id"]);
74 $mem = array_map(static function ($id): string {
76 return $name["firstname"] . " " . $name["lastname"];
77 }, $team->getMembers());
78 $props[] = array("alert" => false, "property" => $lng->txt("wiki_team_members"),
79 "value" => implode(", ", $mem));
80 }
81 }
82
83
84 return $props;
85 }
86
87 public function getCommandLink(string $cmd): string
88 {
89 switch ($cmd) {
90 case 'downloadFile':
91 $cmd_link = "ilias.php?baseClass=ilWikiHandlerGUI" .
92 "&amp;cmdClass=ilwikipagegui&amp;ref_id=" . $this->ref_id .
93 "&amp;cmd=downloadFile&amp;file_id=" . $this->getChildId();
94 break;
95
96 default:
97 // separate method for this line
98 $cmd_link = "ilias.php?baseClass=ilWikiHandlerGUI&ref_id=" . $this->ref_id . "&cmd=$cmd";
99 break;
100 }
101 return $cmd_link;
102 }
103
104 public function setChildId(string $a_child_id): void
105 {
106 $this->child_id = $a_child_id;
107 }
108
109 public function getChildId(): string
110 {
111 return $this->child_id;
112 }
113}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getSubmissionsForFilename(string $a_filename, array $a_assignment_types=array())
Get assignment return entries for a filename.
static _getFrame(string $a_class)
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...
static _lookupName(int $a_user_id)
lookup user name
static _lookupOnline(int $a_id)
static _getCommands()
get commands
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getCommandFrame(string $cmd)
Get command target frame.
getCommandLink(string $cmd)
Get command link url.
getProperties()
Get item properties.
setChildId(string $a_child_id)
if($format !==null) $name
Definition: metadata.php:247