73 $q =
"SELECT * FROM glossary_term WHERE id = ".$ilDB->quote($this->
id);
74 $term_set = $this->ilias->db->query($q);
77 $this->
setTerm($term_rec[
"term"]);
95 $q =
"SELECT * FROM glossary_term WHERE import_id = ".$ilDB->quote($a_import_id).
96 " ORDER BY create_date DESC LIMIT 1";
97 $term_set = $ilDB->query($q);
104 return $term_rec[
"id"];
123 include_once(
"./Services/COPage/classes/class.ilInternalLink.php");
124 if (is_int(strpos($a_id,
"_")))
129 $q =
"SELECT * FROM glossary_term WHERE id = ".$ilDB->quote($a_id);
130 $obj_set = $ilDB->query($q);
171 $this->glossary =& $a_glossary;
183 $this->glo_id = $a_glo_id;
205 $this->term = $a_term;
227 $this->language = $a_language;
245 $this->import_id = $a_import_id;
265 $q =
"INSERT INTO glossary_term (glo_id, term, language, import_id, create_date, last_update)".
267 $ilDB->quote($this->term).
268 ", ".$ilDB->quote($this->language).
",".$ilDB->quote($this->
getImportId()).
",now(), now())";
269 $this->ilias->db->query($q);
270 $this->
setId($this->ilias->db->getLastInsertId());
281 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
283 foreach($defs as $def)
288 $q =
"DELETE FROM glossary_term ".
289 " WHERE id = ".$ilDB->quote($this->
getId());
290 $this->ilias->db->query($q);
301 $q =
"UPDATE glossary_term SET ".
303 " term = ".$ilDB->quote($this->
getTerm()).
", ".
304 " import_id = ".$ilDB->quote($this->
getImportId()).
", ".
305 " language = ".$ilDB->quote($this->
getLanguage()).
", ".
306 " last_update = now() ".
307 " WHERE id = ".$ilDB->quote($this->
getId());
308 $this->ilias->db->query($q);
318 $query =
"SELECT * FROM glossary_term WHERE id = ".$ilDB->quote($term_id);
319 $obj_set = $ilDB->query($query);
322 return $obj_rec[
"glo_id"];
332 $query =
"SELECT * FROM glossary_term WHERE id = ".$ilDB->quote($term_id);
333 $obj_set = $ilDB->query($query);
336 return $obj_rec[
"term"];
346 $query =
"SELECT * FROM glossary_term WHERE id = ".$ilDB->quote($term_id);
347 $obj_set = $ilDB->query($query);
350 return $obj_rec[
"language"];
366 $searchterm = (!empty ($searchterm))
367 ?
" AND term like ".$ilDB->quote(
"%".$searchterm.
"%").
" "
371 if (is_array($a_glo_id))
373 $where =
"IN(".implode(
",",$a_glo_id).
") ";
377 $where =
"= ".$ilDB->quote($a_glo_id).
" ";
380 $q =
"SELECT * FROM glossary_term WHERE glo_id ".$where.$searchterm.
" ORDER BY language, term";
381 $term_set = $ilDB->query($q);
385 $terms[] = array(
"term" => $term_rec[
"term"],
386 "language" => $term_rec[
"language"],
"id" => $term_rec[
"id"],
"glo_id" => $term_rec[
"glo_id"]);
399 $attrs[
"Id"] =
"il_".IL_INST_ID.
"_git_".$this->
getId();
400 $a_xml_writer->xmlStartTag(
"GlossaryItem", $attrs);
403 $a_xml_writer->xmlElement(
"GlossaryTerm", $attrs, $this->
getTerm());
407 foreach($defs as $def)
410 $definition->exportXML($a_xml_writer, $a_inst);
413 $a_xml_writer->xmlEndTag(
"GlossaryItem");