Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00035 include_once "classes/class.ilObjectListGUI.php";
00036
00037 class ilObjLinkResourceListGUI extends ilObjectListGUI
00038 {
00039 var $single_link = null;
00040 var $link_data = array();
00041
00046 function ilObjLinkResourceListGUI()
00047 {
00048 $this->ilObjectListGUI();
00049
00050 }
00051
00055 function getTitle()
00056 {
00057 if($this->__checkDirectLink())
00058 {
00059 $this->__readLink();
00060
00061 return $this->link_data['title'];
00062 }
00063 return parent::getTitle();
00064 }
00068 function getDescription()
00069 {
00070 if($this->__checkDirectLink())
00071 {
00072 $this->__readLink();
00073
00074 return $this->link_data['description'];
00075 }
00076 return parent::getDescription();
00077 }
00078
00082 function init()
00083 {
00084 $this->delete_enabled = true;
00085 $this->cut_enabled = true;
00086 $this->subscribe_enabled = true;
00087 $this->link_enabled = true;
00088 $this->payment_enabled = false;
00089 $this->type = "webr";
00090 $this->gui_class_name = "ilobjlinkresourcegui";
00091 $this->info_screen_enabled = true;
00092
00093
00094 include_once('class.ilObjLinkResourceAccess.php');
00095 $this->commands = ilObjLinkResourceAccess::_getCommands();
00096 }
00097
00098
00107 function initItem($a_ref_id, $a_obj_id, $a_title = "", $a_description = "")
00108 {
00109 parent::initItem($a_ref_id, $a_obj_id, $a_title, $a_description);
00110 }
00111
00112
00120 function getCommandFrame($a_cmd)
00121 {
00122 switch($a_cmd)
00123 {
00124 case "":
00125 if($this->__checkDirectLink())
00126 {
00127 $frame = '_blank';
00128 }
00129 else
00130 {
00131 $frame = ilFrameTargetInfo::_getFrame("RepositoryContent");
00132 }
00133 break;
00134
00135 default:
00136 }
00137
00138 return $frame;
00139 }
00140
00141
00142
00151 function getProperties()
00152 {
00153 global $lng, $ilUser;
00154
00155 $props = array();
00156
00157 return $props;
00158 }
00159
00160
00168 function getCommandLink($a_cmd)
00169 {
00170
00171
00172 switch($a_cmd)
00173 {
00174 case '':
00175 if($this->__checkDirectLink())
00176 {
00177 $this->__readLink();
00178 $cmd_link = $this->link_data['target'];
00179 }
00180 else
00181 {
00182 $cmd_link = "link/link_resources.php?ref_id=".$this->ref_id."&cmd=$a_cmd";
00183 }
00184 break;
00185
00186 default:
00187 $cmd_link = "link/link_resources.php?ref_id=".$this->ref_id."&cmd=$a_cmd";
00188 }
00189 return $cmd_link;
00190 }
00191
00192
00198 function __checkDirectLink()
00199 {
00200 if(isset($this->single_link[$this->obj_id]))
00201 {
00202 return $this->single_link[$this->obj_id];
00203 }
00204
00205 include_once './link/classes/class.ilLinkResourceItems.php';
00206 return $this->single_link[$this->obj_id] = ilLinkResourceItems::_isSingular($this->obj_id);
00207 }
00208
00214 function __readLink()
00215 {
00216 include_once './link/classes/class.ilLinkResourceItems.php';
00217 include_once './link/classes/class.ilParameterAppender.php';
00218
00219 if(ilParameterAppender::_isEnabled())
00220 {
00221 return $this->link_data = ilParameterAppender::_append($tmp =& ilLinkResourceItems::_getFirstLink($this->obj_id));
00222 }
00223 return $this->link_data = ilLinkResourceItems::_getFirstLink($this->obj_id);
00224 }
00225 }
00226 ?>