ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 
38 
46  public function getCommandFrame($a_cmd)
47  {
48  switch ($a_cmd) {
49  default:
50  $frame = ilFrameTargetInfo::_getFrame("MainContent");
51  break;
52  }
53 
54  return $frame;
55  }
56 
57 
58 
67  public function getProperties()
68  {
69  $lng = $this->lng;
70 
71  $props = array();
72 
73  include_once("./Modules/Wiki/classes/class.ilObjWikiAccess.php");
74 
75  if (!ilObjWikiAccess::_lookupOnline($this->obj_id)) {
76  $props[] = array("alert" => true, "property" => $lng->txt("status"),
77  "value" => $lng->txt("offline"));
78  }
79 
80  $lng->loadLanguageModule("wiki");
81  include_once("./Modules/Exercise/RepoObjectAssignment/classes/class.ilExcRepoObjAssignment.php");
82  $info = ilExcRepoObjAssignment::getInstance()->getAssignmentInfoOfObj($this->ref_id, $this->user->getId());
83  if (count($info) > 0) {
85  foreach ($sub as $s) {
86  $team = new ilExAssignmentTeam($s["team_id"]);
87  $mem = array_map(function ($id) {
89  return $name["firstname"] . " " . $name["lastname"];
90  }, $team->getMembers());
91  $props[] = array("alert" => false, "property" => $lng->txt("wiki_team_members"),
92  "value" => implode(", ", $mem));
93  }
94  }
95 
96 
97  return $props;
98  }
99 
100 
108  public function getCommandLink($a_cmd)
109  {
110  switch ($a_cmd) {
111  case 'downloadFile':
112  $cmd_link = "ilias.php?baseClass=ilWikiHandlerGUI" .
113  "&amp;cmdClass=ilwikipagegui&amp;ref_id=" . $this->ref_id .
114  "&amp;cmd=downloadFile&amp;file_id=" . $this->getChildId();
115  break;
116 
117  default:
118  // separate method for this line
119  $cmd_link = "ilias.php?baseClass=ilWikiHandlerGUI&ref_id=" . $this->ref_id . "&cmd=$a_cmd";
120  break;
121 
122  }
123 
124 
125  return $cmd_link;
126  }
127 
128  public function setChildId($a_child_id)
129  {
130  $this->child_id = $a_child_id;
131  }
132  public function getChildId()
133  {
134  return $this->child_id;
135  }
136 } // END class.ilObjWikiListGUI
static _lookupName($a_user_id)
lookup user name
getCommandLink($a_cmd)
Get command link url.
static getInstance()
Get instance.
Exercise assignment team.
getProperties()
Get item properties.
static _getCommands()
get commands
user()
Definition: user.php:4
if($format !==null) $name
Definition: metadata.php:230
Class ilObjectListGUI.
ListGUI class for wiki objects.
static getSubmissionsForFilename($a_filename, $a_assignment_types=array())
Get assignment return entries for a filename.
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.