ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjLinkResourceListGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 include_once "Services/Object/classes/class.ilObjectListGUI.php";
25 
35 {
36  var $single_link = null;
37  var $link_data = array();
38 
44  {
45  $this->ilObjectListGUI();
46 
47  }
48 
52  function getTitle()
53  {
54  if($this->__checkDirectLink())
55  {
56  $this->__readLink();
57 
58  return $this->link_data['title'];
59  }
60  return parent::getTitle();
61  }
65  function getDescription()
66  {
67  if($this->__checkDirectLink())
68  {
69  $this->__readLink();
70 
71  return $this->link_data['description'];
72  }
73  return parent::getDescription();
74  }
75 
79  function init()
80  {
81  $this->delete_enabled = true;
82  $this->cut_enabled = true;
83  $this->copy_enabled = true;
84  $this->subscribe_enabled = true;
85  $this->link_enabled = true;
86  $this->payment_enabled = false;
87  $this->type = "webr";
88  $this->gui_class_name = "ilobjlinkresourcegui";
89  $this->info_screen_enabled = true;
90 
91  // general commands array
92  include_once('class.ilObjLinkResourceAccess.php');
93  $this->commands = ilObjLinkResourceAccess::_getCommands();
94  }
95 
96 
105  function initItem($a_ref_id, $a_obj_id, $a_title = "", $a_description = "")
106  {
107  parent::initItem($a_ref_id, $a_obj_id, $a_title, $a_description);
108  }
109 
110 
118  function getCommandFrame($a_cmd)
119  {
120  switch($a_cmd)
121  {
122  case "":
123  if($this->__checkDirectLink())
124  {
125  $frame = '_blank';
126  }
127  else
128  {
129  $frame = ilFrameTargetInfo::_getFrame("RepositoryContent");
130  }
131  break;
132 
133  default:
134  }
135 
136  return $frame;
137  }
138 
139 
140 
149  function getProperties()
150  {
151  global $lng, $ilUser;
152 
153  $props = array();
154 
155  return $props;
156  }
157 
158 
166  function getCommandLink($a_cmd)
167  {
168 
169  // separate method for this line
170  switch($a_cmd)
171  {
172  case '':
173  if($this->__checkDirectLink())
174  {
175  $this->__readLink();
176  $cmd_link = $this->link_data['target'];
177  }
178  else
179  {
180  $cmd_link = "ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=".$this->ref_id."&cmd=$a_cmd";
181  }
182  break;
183 
184  default:
185  $cmd_link = "ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=".$this->ref_id."&cmd=$a_cmd";
186  }
187  return $cmd_link;
188  }
189 
190 
196  function __checkDirectLink()
197  {
198  if(isset($this->single_link[$this->obj_id]))
199  {
200  return $this->single_link[$this->obj_id];
201  }
202  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
203  return $this->single_link[$this->obj_id] = ilLinkResourceItems::_isSingular($this->obj_id);
204  }
205 
211  function __readLink()
212  {
213  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
214  include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
215 
217  {
218  return $this->link_data = ilParameterAppender::_append($tmp =& ilLinkResourceItems::_getFirstLink($this->obj_id));
219  }
220  return $this->link_data = ilLinkResourceItems::_getFirstLink($this->obj_id);
221  }
222 } // END class.ilObjTestListGUI
223 ?>