ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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
6include_once "Services/Object/classes/class.ilObjectListGUI.php";
7include_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 switch($a_cmd)
98 {
99 case "":
101 {
102 $frame = '_blank';
103 }
104 else
105 {
106 $frame = ilFrameTargetInfo::_getFrame("RepositoryContent");
107 }
108 break;
109
110 default:
111 }
112
113 return $frame;
114 }
115
116
117
126 function getProperties()
127 {
128 global $lng, $ilUser;
129
130 $props = array();
131
132 return $props;
133 }
134
135
143 function getCommandLink($a_cmd)
144 {
145 if($_REQUEST["wsp_id"] || $_REQUEST["cmdClass"] == "ilpersonalworkspacegui")
146 {
147 if(ilObjLinkResourceAccess::_checkDirectLink($this->obj_id) && $a_cmd == '')
148 {
149 $a_cmd = "calldirectlink";
150 }
151 $this->ctrl->setParameterByClass($this->gui_class_name, "ref_id", "");
152 $this->ctrl->setParameterByClass($this->gui_class_name, "wsp_id", $this->ref_id);
153 return $this->ctrl->getLinkTargetByClass(array("ilpersonalworkspacegui", $this->gui_class_name), $a_cmd);
154 }
155 else
156 {
157 // separate method for this line
158 switch($a_cmd)
159 {
160 case '':
162 {
163 $this->__readLink();
164 // $cmd_link = $this->link_data['target'];
165 $cmd_link = "ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=".$this->ref_id."&cmd=calldirectlink";
166 }
167 else
168 {
169 $cmd_link = "ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=".$this->ref_id."&cmd=$a_cmd";
170 }
171 break;
172
173 default:
174 $cmd_link = "ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=".$this->ref_id."&cmd=$a_cmd";
175 }
176 }
177 return $cmd_link;
178 }
179
185 function __readLink()
186 {
187 include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
188 include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
189
191 {
192 return $this->link_data = ilParameterAppender::_append($tmp =& ilLinkResourceItems::_getFirstLink($this->obj_id));
193 }
194 return $this->link_data = ilLinkResourceItems::_getFirstLink($this->obj_id);
195 }
196} // END class.ilObjTestListGUI
197?>
static _getFrame($a_class, $a_type='')
Get content frame name.
static _getFirstLink($a_webr_id)
Get first link item Check before with _isSingular() if there is more or less than one.
static _checkDirectLink($a_obj_id)
Check whether there is only one active link in the web resource.
Class ilObjLinkResourceListGUI.
getCommandFrame($a_cmd)
Get command target frame.
getDescription()
overwritten from base class
__readLink()
Get data of first active link resource.
getCommandLink($a_cmd)
Get command link url.
getTitle()
overwritten from base class
Class ilObjectListGUI.
ilObjectListGUI()
constructor
static _append($a_link_data)
static _isEnabled()
Check if dynamic parameters are enabled.
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
global $lng
Definition: privfeed.php:40
global $ilSetting
Definition: privfeed.php:40
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
global $ilUser
Definition: imgupload.php:15