ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilObjWikiListGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 
6 include_once "Services/Object/classes/class.ilObjectListGUI.php";
7 
17 {
21  public function init()
22  {
23  $this->copy_enabled = true;
24  $this->delete_enabled = true;
25  $this->cut_enabled = true;
26  $this->subscribe_enabled = true;
27  $this->link_enabled = true;
28  $this->info_screen_enabled = true;
29  $this->type = "wiki";
30  $this->gui_class_name = "ilobjwikigui";
31 
32  // general commands array
33  include_once('./Modules/Wiki/classes/class.ilObjWikiAccess.php');
34  $this->commands = ilObjWikiAccess::_getCommands();
35  }
36 
37 
46  public function initItem($a_ref_id, $a_obj_id, $a_title = "", $a_description = "")
47  {
48  parent::initItem($a_ref_id, $a_obj_id, $a_title, $a_description);
49  }
50 
51 
59  public function getCommandFrame($a_cmd)
60  {
61  switch ($a_cmd) {
62  default:
63  $frame = ilFrameTargetInfo::_getFrame("MainContent");
64  break;
65  }
66 
67  return $frame;
68  }
69 
70 
71 
80  public function getProperties()
81  {
82  $lng = $this->lng;
83 
84  $props = array();
85 
86  include_once("./Modules/Wiki/classes/class.ilObjWikiAccess.php");
87 
88  if (!ilObjWikiAccess::_lookupOnline($this->obj_id)) {
89  $props[] = array("alert" => true, "property" => $lng->txt("status"),
90  "value" => $lng->txt("offline"));
91  }
92 
93  $lng->loadLanguageModule("wiki");
94  include_once("./Modules/Exercise/RepoObjectAssignment/classes/class.ilExcRepoObjAssignment.php");
95  $info = ilExcRepoObjAssignment::getInstance()->getAssignmentInfoOfObj($this->ref_id, $this->user->getId());
96  if (count($info) > 0) {
98  foreach ($sub as $s) {
99  $team = new ilExAssignmentTeam($s["team_id"]);
100  $mem = array_map(function ($id) {
102  return $name["firstname"] . " " . $name["lastname"];
103  }, $team->getMembers());
104  $props[] = array("alert" => false, "property" => $lng->txt("wiki_team_members"),
105  "value" => implode(", ", $mem));
106  }
107  }
108 
109 
110  return $props;
111  }
112 
113 
121  public function getCommandLink($a_cmd)
122  {
123  switch ($a_cmd) {
124  case 'downloadFile':
125  $cmd_link = "ilias.php?baseClass=ilWikiHandlerGUI" .
126  "&amp;cmdClass=ilwikipagegui&amp;ref_id=" . $this->ref_id .
127  "&amp;cmd=downloadFile&amp;file_id=" . $this->getChildId();
128  break;
129 
130  default:
131  // separate method for this line
132  $cmd_link = "ilias.php?baseClass=ilWikiHandlerGUI&ref_id=" . $this->ref_id . "&cmd=$a_cmd";
133  break;
134 
135  }
136 
137 
138  return $cmd_link;
139  }
140 
141  public function setChildId($a_child_id)
142  {
143  $this->child_id = $a_child_id;
144  }
145  public function getChildId()
146  {
147  return $this->child_id;
148  }
149 } // END class.ilObjWikiListGUI
static _lookupName($a_user_id)
lookup user name
getCommandLink($a_cmd)
Get command link url.
static getInstance()
Get instance.
if(!array_key_exists('StateId', $_REQUEST)) $id
Exercise assignment team.
$s
Definition: pwgen.php:45
getProperties()
Get item properties.
static _getCommands()
get commands
user()
Definition: user.php:4
Class ilObjectListGUI.
ListGUI class for wiki objects.
static getSubmissionsForFilename($a_filename, $a_assignment_types=array())
Get assignment return entries for a filename.
initItem($a_ref_id, $a_obj_id, $a_title="", $a_description="")
inititialize new item
static _getFrame($a_class, $a_type='')
Get content frame name.
static _lookupOnline($a_id)
Check wether wiki cast is online.
getCommandFrame($a_cmd)
Get command target frame.
$info
Definition: index.php:5