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);
119 $this->entry_id = $id;
130 if ($a_only_active ===
true)
132 $and =
" AND active = ".$ilDB->quote(
"y",
"text");
135 $q =
"SELECT * FROM lm_menu ".
136 "WHERE lm_id = ".$ilDB->quote($this->lm_id,
"integer").
139 $r = $ilDB->query($q);
141 while(
$row = $ilDB->fetchObject(
$r))
144 'title' =>
$row->title,
145 'link' =>
$row->target,
146 'type' =>
$row->link_type,
147 'ref_id' =>
$row->link_ref_id,
148 'active' =>
$row->active
159 function delete($a_id)
168 $q =
"DELETE FROM lm_menu WHERE id = ".
169 $ilDB->quote($a_id,
"integer");
170 $ilDB->manipulate($q);
183 $q =
"UPDATE lm_menu SET ".
184 " link_type = ".$ilDB->quote($this->
getLinkType(),
"text").
",".
185 " title = ".$ilDB->quote($this->
getTitle(),
"text").
",".
186 " target = ".$ilDB->quote($this->
getTarget(),
"text").
",".
187 " link_ref_id = ".$ilDB->quote((
int) $this->
getLinkRefId(),
"integer").
188 " WHERE id = ".$ilDB->quote($this->
getEntryId(),
"integer");
189 $r = $ilDB->manipulate($q);
203 $q =
"SELECT * FROM lm_menu WHERE id = ".
204 $ilDB->quote($a_id,
"integer");
205 $r = $ilDB->query($q);
207 $row = $ilDB->fetchObject(
$r);
213 $this->setEntryid($a_id);
225 if (!is_array($a_entries))
227 $q =
"UPDATE lm_menu SET active = ".$ilDB->quote(
"n",
"text").
228 " WHERE lm_id = ".$ilDB->quote($this->lm_id,
"integer");
232 $q =
"UPDATE lm_menu SET " .
234 "WHEN ".$ilDB->in(
"id", $a_entries,
false,
"integer").
" ".
235 "THEN ".$ilDB->quote(
"y",
"text").
" ".
236 "ELSE ".$ilDB->quote(
"n",
"text").
" ".
238 "WHERE lm_id = ".$ilDB->quote($this->lm_id,
"integer");
240 $ilDB->manipulate($q);
253 $db = $DIC->database();
255 $db->update(
"lm_menu",
array(
256 "active" =>
array(
"text", ($active ?
"y" :
"n"))
258 "id" =>
array(
"", $entry_id)
Create styles array
The data for the language used.