39 $this->link_type =
"extern";
40 $this->link_ref_id = null;
45 $this->lm_id = $a_obj_id;
55 $this->entry_id = $a_id;
60 return $this->entry_id;
65 $this->link_type = $a_link_type;
70 return $this->link_type;
75 $this->title = $a_title;
85 $this->target = $a_target;
95 $this->link_ref_id = $a_link_ref_id;
100 return $this->link_ref_id;
107 $id = $ilDB->nextId(
"lm_menu");
108 $q =
"INSERT INTO lm_menu (id, lm_id,link_type,title,target,link_ref_id) ".
111 $ilDB->quote($id,
"integer").
",".
112 $ilDB->quote((
int) $this->
getObjId(),
"integer").
",".
114 $ilDB->quote($this->
getTitle(),
"text").
",".
115 $ilDB->quote($this->
getTarget(),
"text").
",".
116 $ilDB->quote((
int) $this->
getLinkRefId(),
"integer").
")";
117 $r = $ilDB->manipulate($q);
128 if ($a_only_active ===
true)
130 $and =
" AND active = ".$ilDB->quote(
"y",
"text");
133 $q =
"SELECT * FROM lm_menu ".
134 "WHERE lm_id = ".$ilDB->quote($this->lm_id,
"integer").
137 $r = $ilDB->query($q);
139 while(
$row = $ilDB->fetchObject($r))
141 $entries[] = array(
'id' =>
$row->id,
142 'title' =>
$row->title,
143 'link' =>
$row->target,
144 'type' =>
$row->link_type,
145 'ref_id' =>
$row->link_ref_id,
146 'active' =>
$row->active
157 function delete($a_id)
166 $q =
"DELETE FROM lm_menu WHERE id = ".
167 $ilDB->quote($a_id,
"integer");
168 $ilDB->manipulate($q);
181 $q =
"UPDATE lm_menu SET ".
182 " link_type = ".$ilDB->quote($this->
getLinkType(),
"text").
",".
183 " title = ".$ilDB->quote($this->
getTitle(),
"text").
",".
184 " target = ".$ilDB->quote($this->
getTarget(),
"text").
",".
185 " link_ref_id = ".$ilDB->quote((
int) $this->
getLinkRefId(),
"integer").
186 " WHERE id = ".$ilDB->quote($this->
getEntryId(),
"integer");
187 $r = $ilDB->manipulate($q);
201 $q =
"SELECT * FROM lm_menu WHERE id = ".
202 $ilDB->quote($a_id,
"integer");
203 $r = $ilDB->query($q);
205 $row = $ilDB->fetchObject($r);
211 $this->setEntryid($a_id);
223 if (!is_array($a_entries))
225 $q =
"UPDATE lm_menu SET active = ".$ilDB->quote(
"n",
"text").
226 " WHERE lm_id = ".$ilDB->quote($this->lm_id,
"integer");
230 $q =
"UPDATE lm_menu SET " .
232 "WHEN ".$ilDB->in(
"id", $a_entries,
false,
"integer").
" ".
233 "THEN ".$ilDB->quote(
"y",
"text").
" ".
234 "ELSE ".$ilDB->quote(
"n",
"text").
" ".
236 "WHERE lm_id = ".$ilDB->quote($this->lm_id,
"integer");
238 $ilDB->manipulate($q);