52 $q =
"SELECT * FROM glossary_term WHERE id = ".
53 $ilDB->quote($this->
id,
"integer");
54 $term_set = $ilDB->query(
$q);
55 $term_rec = $ilDB->fetchAssoc($term_set);
57 $this->
setTerm($term_rec[
"term"]);
75 if ($a_import_id ==
"")
80 $q =
"SELECT * FROM glossary_term WHERE import_id = ".
81 $ilDB->quote($a_import_id,
"text").
82 " ORDER BY create_date DESC";
83 $term_set = $ilDB->query(
$q);
84 while ($term_rec = $ilDB->fetchAssoc($term_set))
90 return $term_rec[
"id"];
109 include_once(
"./Services/COPage/classes/class.ilInternalLink.php");
110 if (is_int(strpos($a_id,
"_")))
115 $q =
"SELECT * FROM glossary_term WHERE id = ".
116 $ilDB->quote($a_id,
"integer");
117 $obj_set = $ilDB->query(
$q);
118 if ($obj_rec = $ilDB->fetchAssoc($obj_set))
158 $this->glossary =& $a_glossary;
170 $this->glo_id = $a_glo_id;
192 $this->term = $a_term;
214 $this->language = $a_language;
232 $this->import_id = $a_import_id;
252 $this->
setId($ilDB->nextId(
"glossary_term"));
253 $ilDB->manipulate(
"INSERT INTO glossary_term (id, glo_id, term, language, import_id, create_date, last_update)".
255 $ilDB->quote($this->getId(),
"integer").
", ".
256 $ilDB->quote($this->getGlossaryId(),
"integer").
", ".
257 $ilDB->quote($this->term,
"text").
", ".
258 $ilDB->quote($this->language,
"text").
",".
272 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
274 foreach($defs as $def)
279 $ilDB->manipulate(
"DELETE FROM glossary_term ".
280 " WHERE id = ".$ilDB->quote($this->getId(),
"integer"));
291 $ilDB->manipulate(
"UPDATE glossary_term SET ".
292 " glo_id = ".$ilDB->quote($this->getGlossaryId(),
"integer").
", ".
293 " term = ".$ilDB->quote($this->getTerm(),
"text").
", ".
294 " import_id = ".$ilDB->quote($this->getImportId(),
"text").
", ".
295 " language = ".$ilDB->quote($this->getLanguage(),
"text").
", ".
296 " last_update = ".$ilDB->now().
" ".
297 " WHERE id = ".$ilDB->quote($this->
getId(),
"integer"));
307 $query =
"SELECT * FROM glossary_term WHERE id = ".
308 $ilDB->quote($term_id,
"integer");
309 $obj_set = $ilDB->query(
$query);
310 $obj_rec = $ilDB->fetchAssoc($obj_set);
312 return $obj_rec[
"glo_id"];
322 $query =
"SELECT * FROM glossary_term WHERE id = ".
323 $ilDB->quote($term_id,
"integer");
324 $obj_set = $ilDB->query(
$query);
325 $obj_rec = $ilDB->fetchAssoc($obj_set);
327 return $obj_rec[
"term"];
337 $query =
"SELECT * FROM glossary_term WHERE id = ".
338 $ilDB->quote($term_id,
"integer");
339 $obj_set = $ilDB->query(
$query);
340 $obj_rec = $ilDB->fetchAssoc($obj_set);
342 return $obj_rec[
"language"];
358 $searchterm = (!empty ($searchterm))
359 ?
" AND ".$ilDB->like(
"term",
"text",
"%".$searchterm.
"%").
" "
363 if (is_array($a_glo_id))
365 $where = $ilDB->in(
"glo_id", $a_glo_id,
false,
"integer");
369 $where =
" glo_id = ".$ilDB->quote($a_glo_id,
"integer").
" ";
372 $q =
"SELECT * FROM glossary_term WHERE ".$where.$searchterm.
" ORDER BY term";
373 $term_set = $ilDB->query(
$q);
375 while ($term_rec = $ilDB->fetchAssoc($term_set))
377 $terms[] = array(
"term" => $term_rec[
"term"],
378 "language" => $term_rec[
"language"],
"id" => $term_rec[
"id"],
"glo_id" => $term_rec[
"glo_id"]);
391 $attrs[
"Id"] =
"il_".IL_INST_ID.
"_git_".$this->
getId();
392 $a_xml_writer->xmlStartTag(
"GlossaryItem", $attrs);
395 $a_xml_writer->xmlElement(
"GlossaryTerm", $attrs, $this->
getTerm());
399 foreach($defs as $def)
402 $definition->exportXML($a_xml_writer, $a_inst);
405 $a_xml_writer->xmlEndTag(
"GlossaryItem");