24 define(
"LINKS_USER_ID",1);
25 define(
"LINKS_SESSION_ID",2);
26 define(
"LINKS_LOGIN",3);
29 define(
"LINKS_ERR_NO_NAME",1);
30 define(
"LINKS_ERR_NO_VALUE",2);
31 define(
"LINKS_ERR_NO_NAME_VALUE",3);
74 $this->name = $a_name;
82 $this->value = $a_value;
123 $query =
"INSERT INTO webr_params ".
124 "SET webr_id = ".$ilDB->quote($this->
getObjId()).
", ".
125 "link_id = ".$ilDB->quote($a_link_id).
", ".
126 "name = ".$ilDB->quote($this->
getName()).
", ".
127 "value = ".$ilDB->quote($this->
getValue());
129 $this->db->query($query);
131 return $this->db->getLastInsertId();
134 function delete($a_param_id)
138 $this->db->query(
"DELETE FROM webr_params WHERE param_id = ".
139 $ilDB->quote((
int) $a_param_id).
" AND webr_id = ".$ilDB->quote($this->
getObjId()));
149 return $ilias->getSetting(
'links_dynamic',
false) ?
true :
false;
156 if(!is_array($a_link_data))
163 foreach($params as $param_data)
165 if(!strpos($a_link_data[
'target'],
'?'))
167 $a_link_data[
'target'] .=
"?";
171 $a_link_data[
'target'] .=
"&";
173 $a_link_data[
'target'] .= ($param_data[
'name'].
"=");
174 switch($param_data[
'value'])
177 $a_link_data[
'target'] .= (urlencode($ilUser->getLogin()));
181 $a_link_data[
'target'] .= (session_id());
185 $a_link_data[
'target'] .= ($ilUser->getId());
197 $res = $ilDB->query(
"SELECT * FROM webr_params WHERE link_id = ".
198 $ilDB->quote((
int) $a_link_id));
201 $params[$row->param_id][
'name'] = $row->name;
202 $params[$row->param_id][
'value'] = $row->value;
205 return count($params) ? $params : array();
212 $ilDB->query(
"DELETE FROM webr_params WHERE webr_id = ".
213 $ilDB->quote((
int) $a_webr_id));
222 return array(0 => $lng->txt(
'links_select_one'),