24 define(
"LINKS_USER_ID",1);
25 define(
"LINKS_SESSION_ID",2);
26 define(
"LINKS_LOGIN",3);
27 define(
'LINKS_MATRICULATION',4);
30 define(
"LINKS_ERR_NO_NAME",1);
31 define(
"LINKS_ERR_NO_VALUE",2);
32 define(
"LINKS_ERR_NO_NAME_VALUE",3);
72 $query =
"SELECT * FROM webr_params ".
73 "WHERE webr_id = ".$ilDB->quote($a_webr_id,
'integer').
" ".
74 "AND link_id = ".$ilDB->quote($a_link_id,
'integer');
78 $params[] =
$row[
'param_id'];
80 return (array) $params;
91 $this->webr_id = $a_obj_id;
101 $this->name = $a_name;
109 $this->value = $a_value;
150 $next_id = $ilDB->nextId(
'webr_params');
151 $query =
"INSERT INTO webr_params (param_id,webr_id,link_id,name,value) ".
153 $ilDB->quote($next_id,
'integer').
", ".
154 $ilDB->quote($this->
getObjId() ,
'integer').
", ".
155 $ilDB->quote($a_link_id ,
'integer').
", ".
156 $ilDB->quote($this->
getName() ,
'text').
", ".
157 $ilDB->quote($this->
getValue() ,
'integer').
164 function delete($a_param_id)
168 $query =
"DELETE FROM webr_params ".
169 "WHERE param_id = ".$ilDB->quote($a_param_id ,
'integer').
" ".
170 "AND webr_id = ".$ilDB->quote($this->
getObjId(),
'integer');
183 return $ilSetting->get(
'links_dynamic',
false) ?
true :
false;
190 if(!is_array($a_link_data))
197 foreach($params as $param_data)
199 if(!strpos($a_link_data[
'target'],
'?'))
201 $a_link_data[
'target'] .=
"?";
205 $a_link_data[
'target'] .=
"&";
207 $a_link_data[
'target'] .= ($param_data[
'name'].
"=");
208 switch($param_data[
'value'])
211 $a_link_data[
'target'] .= (urlencode($ilUser->getLogin()));
215 $a_link_data[
'target'] .= (session_id());
219 $a_link_data[
'target'] .= ($ilUser->getId());
223 $a_link_data[
'target'] .= ($ilUser->getMatriculation());
240 $res = $ilDB->query(
"SELECT * FROM webr_params WHERE link_id = ".
241 $ilDB->quote((
int) $a_link_id ,
'integer'));
244 $params[
$row->param_id][
'name'] =
$row->name;
245 $params[
$row->param_id][
'value'] =
$row->value;
248 return count($params) ? $params : array();
264 return $info.
'=USER_ID';
267 return $info.
'=SESSION_ID';
270 return $info.
'=LOGIN';
273 return $info.
'=MATRICULATION';
282 $query =
"DELETE FROM webr_params WHERE webr_id = ".
283 $ilDB->quote((
int) $a_webr_id ,
'integer');
297 return array(0 => $lng->txt(
'links_select_one'),