ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilObjLinkResourceListGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 
6 include_once "Services/Object/classes/class.ilObjectListGUI.php";
7 include_once('./Modules/WebResource/classes/class.ilObjLinkResourceAccess.php');
8 
18 {
19  var $link_data = array();
20 
26  {
27  $this->ilObjectListGUI();
28 
29  }
30 
34  function getTitle()
35  {
37  {
38  $this->__readLink();
39 
40  return $this->link_data['title'];
41  }
42  return parent::getTitle();
43  }
47  function getDescription()
48  {
49  global $ilSetting;
50 
52  {
53  $this->__readLink();
54 
55  $desc = $this->link_data['description'];
56 
57  // #10682
58  if($ilSetting->get("rep_shorten_description"))
59  {
60  $desc = ilUtil::shortenText($desc,
61  $ilSetting->get("rep_shorten_description_length"), true);
62  }
63 
64  return $desc;
65  }
66  return parent::getDescription();
67  }
68 
72  function init()
73  {
74  $this->delete_enabled = true;
75  $this->cut_enabled = true;
76  $this->copy_enabled = true;
77  $this->subscribe_enabled = true;
78  $this->link_enabled = true;
79  $this->payment_enabled = false;
80  $this->type = "webr";
81  $this->gui_class_name = "ilobjlinkresourcegui";
82  $this->info_screen_enabled = true;
83 
84  // general commands array
85  $this->commands = ilObjLinkResourceAccess::_getCommands();
86  }
87 
95  function getCommandFrame($a_cmd)
96  {
97  // #16820 / #18419 / #18622
98  if($a_cmd == "" &&
100  {
101  $link = ilObjLinkResourceAccess::_getFirstLink($this->obj_id);
102 
103  include_once "Services/Form/classes/class.ilFormPropertyGUI.php";
104  include_once "Services/Form/classes/class.ilLinkInputGUI.php";
105  if(!ilLinkInputGUI::isInternalLink($link["target"]))
106  {
107  return '_blank';
108  }
109  }
110  }
111 
112 
113 
122  function getProperties()
123  {
124  global $lng, $ilUser;
125 
126  $props = array();
127 
128  return $props;
129  }
130 
131 
139  function getCommandLink($a_cmd)
140  {
141  if($_REQUEST["wsp_id"] || $_REQUEST["cmdClass"] == "ilpersonalworkspacegui")
142  {
143  if(ilObjLinkResourceAccess::_checkDirectLink($this->obj_id) && $a_cmd == '')
144  {
145  $a_cmd = "calldirectlink";
146  }
147  $this->ctrl->setParameterByClass($this->gui_class_name, "ref_id", "");
148  $this->ctrl->setParameterByClass($this->gui_class_name, "wsp_id", $this->ref_id);
149  return $this->ctrl->getLinkTargetByClass(array("ilpersonalworkspacegui", $this->gui_class_name), $a_cmd);
150  }
151  else
152  {
153  // separate method for this line
154  switch($a_cmd)
155  {
156  case '':
158  {
159  $this->__readLink();
160  // $cmd_link = $this->link_data['target'];
161  $cmd_link = "ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=".$this->ref_id."&cmd=calldirectlink";
162  }
163  else
164  {
165  $cmd_link = "ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=".$this->ref_id."&cmd=$a_cmd";
166  }
167  break;
168 
169  default:
170  $cmd_link = "ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=".$this->ref_id."&cmd=$a_cmd";
171  }
172  }
173  return $cmd_link;
174  }
175 
181  function __readLink()
182  {
183  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
184  include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
185 
187  {
188  return $this->link_data = ilParameterAppender::_append($tmp =& ilLinkResourceItems::_getFirstLink($this->obj_id));
189  }
190  return $this->link_data = ilLinkResourceItems::_getFirstLink($this->obj_id);
191  }
192 } // END class.ilObjTestListGUI
193 ?>
__readLink()
Get data of first active link resource.
ilObjectListGUI()
constructor
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
getCommandFrame($a_cmd)
Get command target frame.
static _checkDirectLink($a_obj_id)
Check whether there is only one active link in the web resource.
static _append($a_link_data)
Class ilObjectListGUI.
static isInternalLink($a_value)
static _getFirstLink($a_webr_id)
Get first link item Check before with _isSingular() if there is more or less than one...
getDescription()
overwritten from base class
static _getFirstLink($a_webr_id)
Get first link item Check before with _isSingular() if there is more or less than one...
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
Class ilObjLinkResourceListGUI.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
getCommandLink($a_cmd)
Get command link url.
static _isEnabled()
Check if dynamic parameters are enabled.
getTitle()
overwritten from base class