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');
90 $this->webr_id = $a_obj_id;
100 $this->name = $a_name;
108 $this->value = $a_value;
121 if (!strlen($this->
getName())) {
133 public function add($a_link_id)
144 $next_id = $ilDB->nextId(
'webr_params');
145 $query =
"INSERT INTO webr_params (param_id,webr_id,link_id,name,value) " .
147 $ilDB->quote($next_id,
'integer') .
", " .
148 $ilDB->quote($this->
getObjId(),
'integer') .
", " .
149 $ilDB->quote($a_link_id,
'integer') .
", " .
150 $ilDB->quote($this->
getName(),
'text') .
", " .
151 $ilDB->quote($this->
getValue(),
'integer') .
158 public function delete($a_param_id)
162 $query =
"DELETE FROM webr_params " .
163 "WHERE param_id = " . $ilDB->quote($a_param_id,
'integer') .
" " .
164 "AND webr_id = " . $ilDB->quote($this->
getObjId(),
'integer');
177 return $ilSetting->get(
'links_dynamic',
false) ? true :
false;
184 if (!is_array($a_link_data)) {
189 foreach (
$params as $param_data) {
190 if (!strpos($a_link_data[
'target'],
'?')) {
191 $a_link_data[
'target'] .=
"?";
193 $a_link_data[
'target'] .=
"&";
195 $a_link_data[
'target'] .= ($param_data[
'name'] .
"=");
196 switch ($param_data[
'value']) {
198 $a_link_data[
'target'] .= (urlencode($ilUser->getLogin()));
202 $a_link_data[
'target'] .= (session_id());
206 $a_link_data[
'target'] .= ($ilUser->getId());
210 $a_link_data[
'target'] .= ($ilUser->getMatriculation());
229 $res = $ilDB->query(
"SELECT * FROM webr_params WHERE link_id = " .
230 $ilDB->quote((
int) $a_link_id,
'integer'));
251 return $info .
'=USER_ID';
254 return $info .
'=SESSION_ID';
257 return $info .
'=LOGIN';
260 return $info .
'=MATRICULATION';
269 $query =
"DELETE FROM webr_params WHERE webr_id = " .
270 $ilDB->quote((
int) $a_webr_id,
'integer');
284 return array(0 => $lng->txt(
'links_select_one'),
static getParameterIds($a_webr_id, $a_link_id)
Get Parameter ids of link.
static _getOptionSelect()
Get options as array.
const LINKS_MATRICULATION
static _append($a_link_data)
static _deleteAll($a_webr_id)
static parameterToInfo($a_name, $a_value)
Get info text describing an existing dynamic link.
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
__construct($webr_id)
Constructor public.
Class ilParameterAppender.
const LINKS_ERR_NO_NAME_VALUE
static _getParams($a_link_id)
Get dynamic parameter definitions.
static _isEnabled()
Check if dynamic parameters are enabled.