ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilGlossaryTerm.php
Go to the documentation of this file.
1 <?php
2 
24 {
25  protected string $type;
26  protected ilDBInterface $db;
27  public ilLanguage $lng;
29  public int $id = 0;
31  public string $term = "";
32  public string $language = "";
33  public int $glo_id = 0;
34  public string $import_id = "";
35  public string $short_text = "";
36  public int $short_text_dirty = 0;
39 
40  public function __construct(int $a_id = 0)
41  {
42  global $DIC;
43 
44  $this->db = $DIC->database();
45  $lng = $DIC->language();
46  $tpl = $DIC["tpl"];
47 
48  $this->lng = $lng;
49  $this->tpl = $tpl;
50 
51  $this->id = $a_id;
52  $this->type = "term";
53  if ($a_id != 0) {
54  $this->read();
55  }
56  $this->event_handler = $DIC->event();
57  }
58 
59  public function read(): void
60  {
61  $ilDB = $this->db;
62 
63  $q = "SELECT * FROM glossary_term WHERE id = " .
64  $ilDB->quote($this->getId(), "integer");
65  $term_set = $ilDB->query($q);
66  $term_rec = $ilDB->fetchAssoc($term_set);
67 
68  $this->setTerm((string) $term_rec["term"]);
69  $this->setImportId((string) $term_rec["import_id"]);
70  $this->setLanguage((string) $term_rec["language"]);
71  $this->setGlossaryId((int) $term_rec["glo_id"]);
72  $this->setShortText((string) $term_rec["short_text"]);
73  $this->setShortTextDirty((int) $term_rec["short_text_dirty"]);
74 
75  $this->page_object = new ilGlossaryDefPage($this->getId());
76  }
77 
78  public static function _getIdForImportId(
79  string $a_import_id
80  ): int {
81  global $DIC;
82 
83  $ilDB = $DIC->database();
84 
85  if ($a_import_id == "") {
86  return 0;
87  }
88 
89  $q = "SELECT * FROM glossary_term WHERE import_id = " .
90  $ilDB->quote($a_import_id, "text") .
91  " ORDER BY create_date DESC";
92  $term_set = $ilDB->query($q);
93  while ($term_rec = $ilDB->fetchAssoc($term_set)) {
94  $glo_id = self::_lookGlossaryID($term_rec["id"]);
95 
96  $ref_ids = ilObject::_getAllReferences($glo_id); // will be 0 if import of lm is in progress (new import)
97  if (count($ref_ids) == 0 || ilObject::_hasUntrashedReference($glo_id)) {
98  return (int) $term_rec["id"];
99  }
100  }
101 
102  return 0;
103  }
104 
105 
109  public static function _exists(int $a_id): bool
110  {
111  global $DIC;
112 
113  $ilDB = $DIC->database();
114 
115  if (is_int(strpos($a_id, "_"))) {
117  }
118 
119  $q = "SELECT * FROM glossary_term WHERE id = " .
120  $ilDB->quote($a_id, "integer");
121  $obj_set = $ilDB->query($q);
122  if ($obj_rec = $ilDB->fetchAssoc($obj_set)) {
123  return true;
124  } else {
125  return false;
126  }
127  }
128 
129 
133  public function setId(int $a_id): void
134  {
135  $this->id = $a_id;
136  }
137 
138  public function getId(): int
139  {
140  return $this->id;
141  }
142 
143  public function setGlossary(
144  ilObjGlossary $a_glossary
145  ): void {
146  $this->glossary = $a_glossary;
147  $this->setGlossaryId($a_glossary->getId());
148  }
149 
150  public function setGlossaryId(
151  int $a_glo_id
152  ): void {
153  $this->glo_id = $a_glo_id;
154  }
155 
156  public function getGlossaryId(): int
157  {
158  return $this->glo_id;
159  }
160 
161  public function setTerm(string $a_term): void
162  {
163  $this->term = $a_term;
164  }
165 
166  public function getTerm(): string
167  {
168  return $this->term;
169  }
170 
171  public function setLanguage(
172  string $a_language
173  ): void {
174  $this->language = $a_language;
175  }
176 
177  public function getLanguage(): string
178  {
179  return $this->language;
180  }
181 
182  public function setImportId(string $a_import_id): void
183  {
184  $this->import_id = $a_import_id;
185  }
186 
187  public function getImportId(): string
188  {
189  return $this->import_id;
190  }
191 
192  public function setShortText(string $a_text): void
193  {
194  $this->short_text = $this->shortenShortText($a_text);
195  }
196 
197  public function getShortText(): string
198  {
199  return $this->short_text;
200  }
201 
202  public function setShortTextDirty(int $a_val): void
203  {
204  $this->short_text_dirty = $a_val;
205  }
206 
207  public function getShortTextDirty(): int
208  {
210  }
211 
212  public function assignPageObject(ilGlossaryDefPage $a_page_object): void
213  {
214  $this->page_object = $a_page_object;
215  }
216 
217  public function getPageObject(): ilGlossaryDefPage
218  {
219  return $this->page_object;
220  }
221 
222  public function create(bool $a_omit_page_creation = false): void
223  {
224  $ilDB = $this->db;
225 
226  $this->setId($ilDB->nextId("glossary_term"));
227  $ilDB->manipulate("INSERT INTO glossary_term" .
228  " (id, glo_id, term, language, import_id, create_date, last_update, short_text, short_text_dirty)" .
229  " VALUES (" .
230  $ilDB->quote($this->getId(), "integer") . ", " .
231  $ilDB->quote($this->getGlossaryId(), "integer") . ", " .
232  $ilDB->quote($this->getTerm(), "text") . ", " .
233  $ilDB->quote($this->getLanguage(), "text") . ", " .
234  $ilDB->quote($this->getImportId(), "text") . ", " .
235  $ilDB->now() . ", " .
236  $ilDB->now() . ", " .
237  $ilDB->quote($this->getShortText(), "text") . ", " .
238  $ilDB->quote($this->getShortTextDirty(), "integer") . ")");
239 
240  if (!$a_omit_page_creation) {
241  $this->page_object = new ilGlossaryDefPage();
242  $this->page_object->setId($this->getId());
243  $this->page_object->setParentId($this->getGlossaryId());
244  $this->page_object->create(false);
245  }
246  }
247 
251  public function delete(): void
252  {
253  $ilDB = $this->db;
254 
255  // delete term references
257 
258  // delete glossary_term record
259  $ilDB->manipulate("DELETE FROM glossary_term " .
260  " WHERE id = " . $ilDB->quote($this->getId(), "integer"));
261 
262  $this->page_object->delete();
263 
264  // delete flashcard entries
265  $this->event_handler->raise("components/ILIAS/Glossary", "deleteTerm", ["term_id" => $this->getId()]);
266  }
267 
268  public function update(): void
269  {
270  $ilDB = $this->db;
271 
272  $ilDB->manipulate("UPDATE glossary_term SET " .
273  " glo_id = " . $ilDB->quote($this->getGlossaryId(), "integer") . ", " .
274  " term = " . $ilDB->quote($this->getTerm(), "text") . ", " .
275  " import_id = " . $ilDB->quote($this->getImportId(), "text") . ", " .
276  " language = " . $ilDB->quote($this->getLanguage(), "text") . ", " .
277  " last_update = " . $ilDB->now() . ", " .
278  " short_text = " . $ilDB->quote($this->getShortText(), "text") . ", " .
279  " short_text_dirty = " . $ilDB->quote($this->getShortTextDirty(), "integer") . " " .
280  " WHERE id = " . $ilDB->quote($this->getId(), "integer"));
281  }
282 
286  public function shortenShortText(string $text): string
287  {
288  $a_length = 196;
289 
290  if ($this->getId() > 0) {
291  $glo_id = self::_lookGlossaryID($this->getId());
292  $snippet_length = ilObjGlossary::lookupSnippetLength($glo_id);
293  if ($snippet_length > 0) {
294  $a_length = $snippet_length;
295  }
296  }
297 
298  $text = str_replace("<br/>", "<br>", $text);
299  $text = strip_tags($text, "<br>");
300  $offset = 0;
301  if (is_int(strpos(substr($text, $a_length - 16 - 5, 10), "[tex]"))) {
302  $offset = 5;
303  }
304  $short = ilStr::shortenTextExtended($text, $a_length - 16 + $offset, true);
305 
306  // make short text longer, if tex end tag is missing
307  $ltexs = strrpos($short, "[tex]");
308  $ltexe = strrpos($short, "[/tex]");
309  if ($ltexs > $ltexe) {
310  $ltexe = strpos($text, "[/tex]", $ltexs);
311  if ($ltexe > 0) {
312  $text = ilStr::shortenTextExtended($text, $ltexe + 6, true);
313  }
314  }
315 
316  $short = ilStr::shortenTextExtended($text, $a_length, true);
317 
318  return $short;
319  }
320 
321  public function updateShortText(): void
322  {
323  $this->page_object->buildDom();
324  $text = $this->page_object->getFirstParagraphText();
325  $short = $this->shortenShortText($text);
326 
327  $this->setShortText($short);
328  $this->setShortTextDirty(0);
329  $this->update();
330  }
331 
338  public static function setShortTextsDirty(int $a_glo_id): void
339  {
340  global $DIC;
341 
342  $ilDB = $DIC->database();
343 
344  $term_ids = self::getTermsOfGlossary($a_glo_id);
345 
346  foreach ($term_ids as $term_id) {
347  $ilDB->manipulate(
348  "UPDATE glossary_term SET " .
349  " short_text_dirty = " . $ilDB->quote(1, "integer") .
350  " WHERE id = " . $ilDB->quote($term_id, "integer")
351  );
352  }
353  }
354 
358  public static function setShortTextsDirtyGlobally(): void
359  {
360  global $DIC;
361 
362  $ilDB = $DIC->database();
363 
364  $ilDB->manipulate(
365  "UPDATE glossary_term SET " .
366  " short_text_dirty = " . $ilDB->quote(1, "integer")
367  );
368  }
369 
373  public static function _lookGlossaryID(int $term_id): int
374  {
375  global $DIC;
376 
377  $ilDB = $DIC->database();
378 
379  $query = "SELECT * FROM glossary_term WHERE id = " .
380  $ilDB->quote($term_id, "integer");
381  $obj_set = $ilDB->query($query);
382  $obj_rec = $ilDB->fetchAssoc($obj_set);
383 
384  return (int) ($obj_rec["glo_id"] ?? 0);
385  }
386 
390  public static function _lookGlossaryTerm(int $term_id): string
391  {
392  global $DIC;
393 
394  $ilDB = $DIC->database();
395 
396  $query = "SELECT * FROM glossary_term WHERE id = " .
397  $ilDB->quote($term_id, "integer");
398  $obj_set = $ilDB->query($query);
399  $obj_rec = $ilDB->fetchAssoc($obj_set);
400 
401  return $obj_rec["term"] ?? "";
402  }
403 
407  public static function _lookLanguage(int $term_id): string
408  {
409  global $DIC;
410 
411  $ilDB = $DIC->database();
412 
413  $query = "SELECT * FROM glossary_term WHERE id = " .
414  $ilDB->quote($term_id, "integer");
415  $obj_set = $ilDB->query($query);
416  $obj_rec = $ilDB->fetchAssoc($obj_set);
417 
418  return $obj_rec["language"];
419  }
420 
424  public static function _lookShortText(int $term_id): string
425  {
426  global $DIC;
427 
428  $ilDB = $DIC->database();
429 
430  $query = "SELECT * FROM glossary_term WHERE id = " .
431  $ilDB->quote($term_id, "integer");
432  $obj_set = $ilDB->query($query);
433  $obj_rec = $ilDB->fetchAssoc($obj_set);
434 
435  return $obj_rec["short_text"] ?? "";
436  }
437 
441  public static function _lookShortTextDirty(int $term_id): int
442  {
443  global $DIC;
444 
445  $ilDB = $DIC->database();
446 
447  $query = "SELECT * FROM glossary_term WHERE id = " .
448  $ilDB->quote($term_id, "integer");
449  $obj_set = $ilDB->query($query);
450  $obj_rec = $ilDB->fetchAssoc($obj_set);
451 
452  return (int) ($obj_rec["short_text_dirty"] ?? 0);
453  }
454 
458  public static function getTermList(
459  array $a_glo_ref_id,
460  string $searchterm = "",
461  string $a_first_letter = "",
462  string $a_def = "",
463  int $a_tax_node = 0,
464  bool $a_add_amet_fields = false,
465  ?array $a_amet_filter = null,
466  bool $a_include_references = false
467  ): array {
468  global $DIC;
469 
470  if (count($a_glo_ref_id) > 1) {
471  $a_glo_id = array_map(static function ($id): int {
472  return ilObject::_lookupObjectId($id);
473  }, $a_glo_ref_id);
474  } else {
475  $a_glo_id = ilObject::_lookupObjectId(current($a_glo_ref_id));
476  }
477  $ilDB = $DIC->database();
478 
479  $join = $in = "";
480 
481  $terms = array();
482 
483  // get all term ids under taxonomy node (if given)
484  if ($a_tax_node > 1) {
485  $tax_ids = ilObjTaxonomy::getUsageOfObject($a_glo_id);
486  if (count($tax_ids) > 0) {
487  $items = ilObjTaxonomy::getSubTreeItems("glo", $a_glo_id, "term", $tax_ids[0], $a_tax_node);
488  $sub_tree_ids = array();
489  foreach ($items as $i) {
490  $sub_tree_ids[] = $i["item_id"];
491  }
492  $in = " AND " . $ilDB->in("gt.id", $sub_tree_ids, false, "integer");
493  }
494  }
495 
496  if ($a_def != "") {
497  // meta glossary?
498  if (is_array($a_glo_id)) {
499  $glo_where = $ilDB->in("page_object.parent_id", $a_glo_id, false, "integer");
500  } else {
501  $glo_where = " page_object.parent_id = " . $ilDB->quote($a_glo_id, "integer");
502  }
503 
504  $join = " JOIN page_object ON (" .
505  $glo_where .
506  " AND page_object.parent_type = " . $ilDB->quote("term", "text") .
507  " AND page_object.page_id = gt.id" .
508  " AND " . $ilDB->like("page_object.content", "text", "%" . $a_def . "%") .
509  ")";
510  }
511 
512  $searchterm = (!empty($searchterm))
513  ? " AND " . $ilDB->like("term", "text", "%" . $searchterm . "%") . " "
514  : "";
515 
516  if ($a_first_letter != "") {
517  $searchterm .= " AND " . $ilDB->upper($ilDB->substr("term", 1, 1)) . " = " . $ilDB->upper($ilDB->quote($a_first_letter, "text")) . " ";
518  }
519 
520  // include references
521  $where_glo_id_or = "";
522  if ($a_include_references) {
523  $join .= " LEFT JOIN glo_term_reference tr ON (gt.id = tr.term_id) ";
524  if (is_array($a_glo_id)) {
525  $where_glo_id_or = " OR " . $ilDB->in("tr.glo_id", $a_glo_id, false, "integer");
526  } else {
527  $where_glo_id_or = " OR tr.glo_id = " . $ilDB->quote($a_glo_id, "integer");
528  }
529  }
530 
531  // meta glossary
532  if (is_array($a_glo_id)) {
533  $where = "(" . $ilDB->in("gt.glo_id", $a_glo_id, false, "integer") . $where_glo_id_or . ")";
534  } else {
535  $where = "(gt.glo_id = " . $ilDB->quote($a_glo_id, "integer") . $where_glo_id_or . ")";
536  }
537 
538  $where .= $in;
539 
540 
541  $q = "SELECT DISTINCT(gt.term), gt.id, gt.glo_id, gt.language, gt.short_text, gt.short_text_dirty FROM glossary_term gt " .
542  $join . " WHERE " . $where . $searchterm . " ORDER BY gt.term, gt.id";
543 
544  $term_set = $ilDB->query($q);
545  $glo_ids = array();
546  while ($term_rec = $ilDB->fetchAssoc($term_set)) {
547  $terms[] = array("term" => $term_rec["term"],
548  "language" => $term_rec["language"], "id" => $term_rec["id"], "glo_id" => $term_rec["glo_id"],
549  "short_text" => strip_tags((string) $term_rec["short_text"], "<br>"),
550  "short_text_dirty" => $term_rec["short_text_dirty"]);
551  $glo_ids[] = $term_rec["glo_id"];
552  }
553 
554  // add advanced metadata
555  if (($a_add_amet_fields || is_array($a_amet_filter)) && count($a_glo_ref_id) == 1) {
556  $terms = ilAdvancedMDValues::queryForRecords(current($a_glo_ref_id), "glo", "term", $glo_ids, "term", $terms, "glo_id", "id", $a_amet_filter);
557  }
558  return $terms;
559  }
560 
561  public static function getFirstLetters(
562  array $a_glo_id,
563  int $a_tax_node = 0
564  ): array {
565  global $DIC;
566 
567  $ilDB = $DIC->database();
568 
569  // meta glossary
570  if (count($a_glo_id) > 1) {
571  $where = $ilDB->in("glo_id", $a_glo_id, false, "integer");
572  } else {
573  $a_glo_id = current($a_glo_id);
574  $where = " glo_id = " . $ilDB->quote($a_glo_id, "integer") . " ";
575  $in = "";
576  // get all term ids under taxonomy node (if given)
577  if ($a_tax_node > 1) {
578  $tax_ids = ilObjTaxonomy::getUsageOfObject($a_glo_id);
579  if (count($tax_ids) > 0) {
580  $items = ilObjTaxonomy::getSubTreeItems("glo", $a_glo_id, "term", $tax_ids[0], $a_tax_node);
581  $sub_tree_ids = array();
582  foreach ($items as $i) {
583  $sub_tree_ids[] = $i["item_id"];
584  }
585  $in = " AND " . $ilDB->in("id", $sub_tree_ids, false, "integer");
586  }
587  }
588 
589  $where .= $in;
590  }
591 
592  $q = "SELECT DISTINCT " . $ilDB->upper($ilDB->substr("term", 1, 1)) . " let FROM glossary_term WHERE " . $where . " ORDER BY let";
593  $let_set = $ilDB->query($q);
594 
595  $let = array();
596  while ($let_rec = $ilDB->fetchAssoc($let_set)) {
597  $let[$let_rec["let"]] = $let_rec["let"];
598  }
599  return $let;
600  }
601 
602  public function exportXML(
603  ilXmlWriter $a_xml_writer,
604  int $a_inst
605  ): void {
606  $attrs = array();
607  $attrs["Language"] = $this->getLanguage();
608  $attrs["Id"] = "il_" . IL_INST_ID . "_git_" . $this->getId();
609  $a_xml_writer->xmlStartTag("GlossaryItem", $attrs);
610 
611  $attrs = array();
612  $a_xml_writer->xmlElement("GlossaryTerm", $attrs, $this->getTerm());
613 
614  $a_xml_writer->xmlEndTag("GlossaryItem");
615  }
616 
617  public static function getNumberOfUsages(int $a_term_id): int
618  {
619  return count(self::getUsages($a_term_id));
620  }
621 
622  public static function getUsages(int $a_term_id): array
623  {
624  $usages = (ilInternalLink::_getSourcesOfTarget("git", $a_term_id, 0));
625 
627  $usages["glo:termref:" . $glo_id . ":-"] = array(
628  "type" => "glo:termref",
629  "id" => $glo_id,
630  "lang" => "-"
631  );
632  }
633 
634  return $usages;
635  }
636 
641  public static function _copyTerm(
642  int $a_term_id,
643  int $a_glossary_id
644  ): int {
645  $old_term = new ilGlossaryTerm($a_term_id);
646 
647  // copy the term
648  $new_term = new ilGlossaryTerm();
649  $new_term->setTerm($old_term->getTerm());
650  $new_term->setLanguage($old_term->getLanguage());
651  $new_term->setGlossaryId($a_glossary_id);
652  $new_term->setShortText($old_term->getShortText());
653  $new_term->setShortTextDirty($old_term->getShortTextDirty());
654  $new_term->create();
655 
656  $new_page = $new_term->getPageObject();
657  $old_term->getPageObject()->copy($new_page->getId(), $new_page->getParentType(), $new_page->getParentId(), true);
658 
659  // adv metadata
660  $old_recs = ilAdvancedMDRecord::_getSelectedRecordsByObject("glo", $old_term->getGlossaryId(), "term");
661  $new_recs = ilAdvancedMDRecord::_getSelectedRecordsByObject("glo", $a_glossary_id, "term");
662  foreach ($old_recs as $old_record_obj) {
663  reset($new_recs);
664  foreach ($new_recs as $new_record_obj) {
665  if ($old_record_obj->getRecordId() == $new_record_obj->getRecordId()) {
666  foreach (ilAdvancedMDFieldDefinition::getInstancesByRecordId($old_record_obj->getRecordId()) as $def) {
667  // now we need to copy $def->getFieldId() values from old term to new term
668  // how?
669  // clone values
670 
671  $source_primary = array("obj_id" => array("integer", $old_term->getGlossaryId()));
672  $source_primary["sub_type"] = array("text", "term");
673  $source_primary["sub_id"] = array("integer", $old_term->getId());
674  $source_primary["field_id"] = array("integer", $def->getFieldId());
675  $target_primary = array("obj_id" => array("integer", $new_term->getGlossaryId()));
676  $target_primary["sub_type"] = array("text", "term");
677  $target_primary["sub_id"] = array("integer", $new_term->getId());
678 
679  ilADTFactory::getInstance()->initActiveRecordByType();
681  "adv_md_values",
682  array(
683  "obj_id" => "integer",
684  "sub_type" => "text",
685  "sub_id" => "integer",
686  "field_id" => "integer"
687  ),
688  $source_primary,
689  $target_primary,
690  array("disabled" => "integer")
691  );
692  }
693  }
694  }
695  }
696 
697  return $new_term->getId();
698  }
699 
703  public static function getTermsOfGlossary(
704  int $a_glo_id
705  ): array {
706  global $DIC;
707 
708  $ilDB = $DIC->database();
709 
710  $set = $ilDB->query(
711  "SELECT id FROM glossary_term WHERE " .
712  " glo_id = " . $ilDB->quote($a_glo_id, "integer")
713  );
714  $ids = array();
715  while ($rec = $ilDB->fetchAssoc($set)) {
716  $ids[] = (int) $rec["id"];
717  }
718  return $ids;
719  }
720 }
static deleteReferencesOfTerm(int $a_term_id)
Delete all references of a term.
Global event handler.
const IL_INST_ID
Definition: constants.php:40
static getUsages(int $a_term_id)
setShortTextDirty(int $a_val)
ilGlossaryDefPage $page_object
static getSubTreeItems(string $a_comp, int $a_obj_id, string $a_item_type, int $a_tax_id, $a_node)
Get all assigned items under a node.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _exists(int $a_id)
checks whether a glossary term with specified id exists or not
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assignPageObject(ilGlossaryDefPage $a_page_object)
static _getIdForImportId(string $a_import_id)
static _getAllReferences(int $id)
get all reference ids for object ID
ilAppEventHandler $event_handler
setShortText(string $a_text)
static _hasUntrashedReference(int $obj_id)
checks whether an object has at least one reference that is not in trash
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
static _getSelectedRecordsByObject(string $a_obj_type, int $a_id, string $a_sub_type="", bool $is_ref_id=true)
static getInstancesByRecordId( $a_record_id, $a_only_searchable=false, string $language='')
Get definitions by record id.
static _lookShortTextDirty(int $term_id)
get definition short text dirty
static getTermList(array $a_glo_ref_id, string $searchterm="", string $a_first_letter="", string $a_def="", int $a_tax_node=0, bool $a_add_amet_fields=false, ?array $a_amet_filter=null, bool $a_include_references=false)
Get all terms for given set of glossary ids.
setGlossary(ilObjGlossary $a_glossary)
static _copyTerm(int $a_term_id, int $a_glossary_id)
Copy a term to a glossary.
xmlEndTag(string $tag)
Writes an endtag.
exportXML(ilXmlWriter $a_xml_writer, int $a_inst)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static queryForRecords(int $adv_rec_obj_ref_id, string $adv_rec_obj_type, string $adv_rec_obj_subtype, array $a_obj_id, string $a_subtype, array $a_records, string $a_obj_id_key, string $a_obj_subid_key, ?array $a_amet_filter=null)
setTerm(string $a_term)
static lookupReferencesOfTerm(int $a_term_id)
create(bool $a_omit_page_creation=false)
shortenShortText(string $text)
Shorten short text.
static _lookGlossaryTerm(int $term_id)
get glossary term
global $DIC
Definition: shib_login.php:26
static _lookupObjectId(int $ref_id)
static getTermsOfGlossary(int $a_glo_id)
static _lookShortText(int $term_id)
get definition short text
ilGlobalTemplateInterface $tpl
setId(int $a_id)
set glossary term id (= glossary item id)
static _lookLanguage(int $term_id)
lookup term language
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setLanguage(string $a_language)
ilObjGlossary $glossary
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
static lookupSnippetLength(int $a_id)
$q
Definition: shib_logout.php:23
static setShortTextsDirty(int $a_glo_id)
Set all short texts of glossary dirty (e.g.
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
__construct(int $a_id=0)
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
static cloneByPrimary(string $a_table, array $a_primary_def, array $a_source_primary, array $a_target_primary, ?array $a_additional=null)
Clone values by (partial) primary key.
static getNumberOfUsages(int $a_term_id)
setGlossaryId(int $a_glo_id)
static setShortTextsDirtyGlobally()
Set short texts dirty (for all glossaries)
static getFirstLetters(array $a_glo_id, int $a_tax_node=0)
setImportId(string $a_import_id)
static _lookGlossaryID(int $term_id)
get glossary id form term id