ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjGlossary Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjGlossary:
+ Collaboration diagram for ilObjGlossary:

Public Member Functions

 __construct (int $a_id=0, bool $a_call_by_reference=true)
 
 create (bool $a_upload=false)
 
 read ()
 
 setVirtualMode (string $a_mode)
 
 getVirtualMode ()
 
 isVirtual ()
 
 setPresentationMode (string $a_val)
 
 getPresentationMode ()
 
 setSnippetLength (int $a_val)
 Set definition snippet length (in overview) More...
 
 getSnippetLength ()
 
 setOnline (bool $a_online)
 
 getOnline ()
 
 setActiveGlossaryMenu (bool $a_act_glo_menu)
 
 isActiveGlossaryMenu ()
 
 setActiveDownloads (bool $a_down)
 
 isActiveDownloads ()
 
 setShowTaxonomy (bool $a_val)
 
 getShowTaxonomy ()
 
 setActiveFlashcards (bool $a_flash)
 
 isActiveFlashcards ()
 
 setFlashcardsMode (string $a_flash)
 
 getFlashcardsMode ()
 
 setAutoGlossaries (array $a_val)
 
 addAutoGlossary (int $glo_id)
 
 getAutoGlossaries ()
 
 removeAutoGlossary (int $a_glo_id)
 
 update ()
 
 updateAutoGlossaries ()
 
 getGlossariesForCollection ()
 
 addGlossaryForCollection (int $glo_id)
 
 removeGlossaryFromCollection (int $glo_id)
 
 getTermList (string $searchterm="", string $a_letter="", string $a_def="", int $a_tax_node=0, bool $a_include_offline_childs=false, bool $a_add_amet_fields=false, array $a_amet_filter=null, bool $a_omit_virtual=false, bool $a_include_references=false)
 
 getFirstLetters (int $a_tax_node=0)
 
 getAllGlossaryIds (bool $a_include_offline_childs=false, bool $ids_are_ref_ids=false)
 Get all glossary ids. More...
 
 createImportDirectory ()
 creates data directory for import files (data_dir/glo_data/glo_<id>/import, depending on data directory that is set in ILIAS setup/ini) More...
 
 getImportDirectory ()
 
 createExportDirectory (string $a_type="xml")
 
 getExportDirectory (string $a_type="xml")
 
 getExportFiles ()
 Get export files. More...
 
 setPublicExportFile (string $a_type, string $a_file)
 specify public export file for type More...
 
 getPublicExportFile (string $a_type)
 get public export file More...
 
 exportXML (ilXmlWriter $a_xml_writer, int $a_inst, string $a_target_dir, ilLog $expLog)
 
 exportXMLGlossaryItems (ilXmlWriter $a_xml_writer, int $a_inst, ilLog $expLog)
 
 exportXMLMetaData (ilXmlWriter $a_xml_writer)
 
 exportXMLMediaObjects (ilXmlWriter $a_xml_writer, int $a_inst, string $a_target_dir, ilLog $expLog)
 
 exportFileItems (string $a_target_dir, ilLog $expLog)
 
 modifyExportIdentifier (string $a_tag, string $a_param, string $a_value)
 
 delete ()
 
 getXMLZip ()
 
 getTaxonomyId ()
 
 cloneObject (int $target_id, int $copy_id=0, bool $omit_tree=false)
 
 removeOfflineGlossaries (array $a_glo_ids, bool $ids_are_ref_ids=false)
 Remove offline glossaries from obj id array. More...
 
 autoLinkGlossaryTerms (int $a_glo_ref_id)
 Auto link glossary terms. More...
 
 supportsLongTextQuery ()
 Is long text search supported. More...
 
- Public Member Functions inherited from ilObject
 getObjectProperties ()
 
 flushObjectProperties ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $description)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static _lookupOnline (int $a_id)
 
static lookupSnippetLength (int $a_id)
 
static lookupAutoGlossaries (int $a_id)
 
static getDeletionDependencies (int $obj_id)
 
static getAdvMDSubItemTitle (int $a_obj_id, string $a_sub_type, int $a_sub_id)
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, \ilDBInterface $ilDB=null)
 

Data Fields

array $auto_glossaries = array()
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 

Static Protected Member Functions

static lookup (int $a_id, string $a_property)
 Lookup glossary property. More...
 

Protected Attributes

ILIAS Glossary Term TermManager $term_manager
 
ILIAS Style Content DomainService $content_style_domain
 
ilGlossaryDefPage $page_object
 
array $file_ids = []
 
array $mob_ids = []
 
bool $show_tax = false
 
int $style_id = 0
 
bool $downloads_active = false
 
bool $glo_menu_active = false
 
bool $online = false
 
int $snippet_length = 0
 
string $pres_mode = ""
 
bool $virtual = false
 
string $virtual_mode = ""
 
bool $flashcards_active = false
 
string $flashcards_mode = ""
 
ilGlobalTemplateInterface $tpl
 
ilObjUser $user
 
array $public_export_file = []
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Additional Inherited Members

- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 22 of file class.ilObjGlossary.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjGlossary::__construct ( int  $a_id = 0,
bool  $a_call_by_reference = true 
)

Definition at line 46 of file class.ilObjGlossary.php.

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), and ILIAS\Repository\user().

49  {
50  global $DIC;
51  $this->tpl = $DIC["tpl"];
52 
53  $this->db = $DIC->database();
54  $this->user = $DIC->user();
55  $this->type = "glo";
56  parent::__construct($a_id, $a_call_by_reference);
57  $this->content_style_domain = $DIC
58  ->contentStyle()
59  ->domain();
60  $this->term_manager = $DIC->glossary()->internal()->domain()->term($this);
61  }
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ _lookupOnline()

static ilObjGlossary::_lookupOnline ( int  $a_id)
static

Definition at line 185 of file class.ilObjGlossary.php.

References ilObject\$db, $DIC, $lm_set, $q, ilDBInterface\fetchAssoc(), ilDBInterface\query(), ilDBInterface\quote(), and ilUtil\yn2tf().

Referenced by ilRepositoryExplorer\isClickable().

187  : bool {
188  global $DIC;
189 
190  $db = $DIC->database();
191 
192  $q = "SELECT is_online FROM glossary WHERE id = " .
193  $db->quote($a_id, "integer");
194  $lm_set = $db->query($q);
195  $lm_rec = $db->fetchAssoc($lm_set);
196 
197  return ilUtil::yn2tf($lm_rec["is_online"]);
198  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: feed.php:28
ilDBInterface $db
query(string $query)
Run a (read-only) Query on the database.
$lm_set
$q
Definition: shib_logout.php:21
static yn2tf(string $a_yn)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addAutoGlossary()

ilObjGlossary::addAutoGlossary ( int  $glo_id)

Definition at line 286 of file class.ilObjGlossary.php.

References ilObject\_lookupType().

Referenced by setAutoGlossaries().

286  : void
287  {
288  if ($glo_id > 0 && ilObject::_lookupType($glo_id) == "glo" &&
289  !in_array($glo_id, $this->auto_glossaries)) {
290  $this->auto_glossaries[] = $glo_id;
291  }
292  }
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addGlossaryForCollection()

ilObjGlossary::addGlossaryForCollection ( int  $glo_id)

Definition at line 396 of file class.ilObjGlossary.php.

References ilObject\getId().

Referenced by ilObjGlossaryGUI\saveGlossaryForCollection().

396  : void
397  {
398  $this->db->replace(
399  "glossary_collection",
400  [
401  "id" => ["integer", $this->getId()],
402  "glo_id" => ["integer", $glo_id]
403  ],
404  []
405  );
406  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ autoLinkGlossaryTerms()

ilObjGlossary::autoLinkGlossaryTerms ( int  $a_glo_ref_id)

Auto link glossary terms.

Definition at line 887 of file class.ilObjGlossary.php.

References Vendor\Package\$c, $id, ilPCParagraph\autoLinkGlossariesPage(), ilObject\getRefId(), and ilGlossaryTerm\getTermList().

889  : void {
890  // get terms of target glossary
891  $terms = ilGlossaryTerm::getTermList([$a_glo_ref_id]);
892 
893  // for each get page: get content
894  $source_terms = ilGlossaryTerm::getTermList([$this->getRefId()]);
895  $found_pages = array();
896  foreach ($source_terms as $source_term) {
897  $pg = new ilGlossaryDefPage($source_term["id"]);
898  $c = $pg->getXMLContent();
899  foreach ($terms as $t) {
900  if (is_int(stripos($c, $t["term"]))) {
901  $found_pages[$source_term["id"]]["terms"][] = $t;
902  if (!isset($found_pages[$source_term["id"]]["page"])) {
903  $found_pages[$source_term["id"]]["page"] = $pg;
904  }
905  }
906  }
907  reset($terms);
908  }
909 
910  // ilPCParagraph autoLinkGlossariesPage with page and terms
911  foreach ($found_pages as $id => $fp) {
912  ilPCParagraph::autoLinkGlossariesPage($fp["page"], $fp["terms"]);
913  }
914  }
static autoLinkGlossariesPage(ilPageObject $a_page, array $a_terms)
Auto link glossary of whole page.
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ cloneObject()

ilObjGlossary::cloneObject ( int  $target_id,
int  $copy_id = 0,
bool  $omit_tree = false 
)

Definition at line 761 of file class.ilObjGlossary.php.

References Vendor\Package\$a, ilGlossaryTerm\_copyTerm(), ilCopyWizardOptions\_getInstance(), ilObject\cloneMetaData(), ilTaxNodeAssignment\getAssignmentsOfItem(), getAutoGlossaries(), ilObject\getDescription(), getFlashcardsMode(), getGlossariesForCollection(), ilObject\getId(), getOnline(), getPresentationMode(), ilObject\getRefId(), getSnippetLength(), getTaxonomyId(), ilGlossaryTerm\getTermList(), getVirtualMode(), isActiveFlashcards(), and ilObjTaxonomy\saveUsage().

761  : ?ilObject
762  {
763  $new_obj = parent::cloneObject($target_id, $copy_id, $omit_tree);
764  $this->cloneMetaData($new_obj);
765 
766  $tax_ass = null;
767  $new_tax_ass = null;
768  $map = [];
769 
770  //copy online status if object is not the root copy object
771  $cp_options = ilCopyWizardOptions::_getInstance($copy_id);
772 
773  if (!$cp_options->isRootNode($this->getRefId())) {
774  $new_obj->setOnline($this->getOnline());
775  }
776 
777  // $new_obj->setTitle($this->getTitle());
778  $new_obj->setDescription($this->getDescription());
779  $new_obj->setVirtualMode($this->getVirtualMode());
780  $new_obj->setPresentationMode($this->getPresentationMode());
781  $new_obj->setSnippetLength($this->getSnippetLength());
782  $new_obj->setAutoGlossaries($this->getAutoGlossaries());
783  $new_obj->setActiveFlashcards($this->isActiveFlashcards());
784  $new_obj->setFlashcardsMode($this->getFlashcardsMode());
785  $new_obj->update();
786 
787  // set/copy stylesheet
788  $this->content_style_domain->styleForRefId($this->getRefId())->cloneTo($new_obj->getId());
789 
790  // copy taxonomy
791  if (($tax_id = $this->getTaxonomyId()) > 0) {
792  // clone it
793  $tax = new ilObjTaxonomy($tax_id);
794  $new_tax = $tax->cloneObject(0, 0, true);
795  $map = $tax->getNodeMapping();
796 
797  // assign new taxonomy to new glossary
798  ilObjTaxonomy::saveUsage($new_tax->getId(), $new_obj->getId());
799 
800  $tax_ass = new ilTaxNodeAssignment("glo", $this->getId(), "term", $tax_id);
801  $new_tax_ass = new ilTaxNodeAssignment("glo", $new_obj->getId(), "term", $new_tax->getId());
802  }
803 
804  // copy terms
805  $term_mappings = array();
806  foreach (ilGlossaryTerm::getTermList([$this->getRefId()]) as $term) {
807  $new_term_id = ilGlossaryTerm::_copyTerm($term["id"], $new_obj->getId());
808  $term_mappings[$term["id"]] = $new_term_id;
809 
810  // copy tax node assignments
811  if ($tax_id > 0) {
812  $assignmts = $tax_ass->getAssignmentsOfItem($term["id"]);
813  foreach ($assignmts as $a) {
814  if ($map[$a["node_id"]] > 0) {
815  $new_tax_ass->addAssignment($map[$a["node_id"]], $new_term_id);
816  }
817  }
818  }
819  }
820 
821  // add mapping of term_ids to copy wizard options
822  if (!empty($term_mappings)) {
823  $cp_options->appendMapping($this->getRefId() . '_glo_terms', $term_mappings);
824  }
825 
826  // copy collection glossaries
827  foreach ($this->getGlossariesForCollection() as $glo_id) {
828  $new_obj->addGlossaryForCollection($glo_id);
829  }
830 
831  return $new_obj;
832  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.
static _copyTerm(int $a_term_id, int $a_glossary_id)
Copy a term to a glossary.
cloneMetaData(ilObject $target_obj)
Copy meta data.
getAssignmentsOfItem(int $a_item_id)
Get assignments for item.
static saveUsage(int $a_tax_id, int $a_obj_id)
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
static _getInstance(int $a_copy_id)
+ Here is the call graph for this function:

◆ create()

ilObjGlossary::create ( bool  $a_upload = false)

Definition at line 63 of file class.ilObjGlossary.php.

References $id, ilObject\createMetaData(), ilObject\getId(), getVirtualMode(), setPresentationMode(), setSnippetLength(), and updateAutoGlossaries().

63  : int
64  {
65  $id = parent::create();
66 
67  // meta data will be created by
68  // import parser
69  if (!$a_upload) {
70  $this->createMetaData();
71  }
72  $this->db->insert(
73  'glossary',
74  array(
75  'id' => array('integer', $this->getId()),
76  'is_online' => array('text', 'n'),
77  'virtual' => array('text', $this->getVirtualMode()),
78  'pres_mode' => array('text', 'table'),
79  'snippet_length' => array('integer', 200)
80  )
81  );
82 
83  $this->setPresentationMode("table");
84  $this->setSnippetLength(200);
85 
86  $this->updateAutoGlossaries();
87 
88  return $id;
89  }
setSnippetLength(int $a_val)
Set definition snippet length (in overview)
setPresentationMode(string $a_val)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ createExportDirectory()

ilObjGlossary::createExportDirectory ( string  $a_type = "xml")

Definition at line 536 of file class.ilObjGlossary.php.

References ilExport\_createExportDirectory(), ilObject\getId(), and ilObject\getType().

536  : string
537  {
538  return ilExport::_createExportDirectory($this->getId(), $a_type, $this->getType());
539  }
static _createExportDirectory(int $a_obj_id, string $a_export_type="xml", string $a_obj_type="")
+ Here is the call graph for this function:

◆ createImportDirectory()

ilObjGlossary::createImportDirectory ( )

creates data directory for import files (data_dir/glo_data/glo_<id>/import, depending on data directory that is set in ILIAS setup/ini)

Definition at line 506 of file class.ilObjGlossary.php.

References ilFileUtils\getDataDir(), ilObject\getId(), and ilFileUtils\makeDir().

506  : void
507  {
508  $glo_data_dir = ilFileUtils::getDataDir() . "/glo_data";
509  ilFileUtils::makeDir($glo_data_dir);
510  if (!is_writable($glo_data_dir)) {
511  throw new ilGlossaryException("Glossary Data Directory (" . $glo_data_dir
512  . ") not writeable.");
513  }
514 
515  // create glossary directory (data_dir/glo_data/glo_<id>)
516  $glo_dir = $glo_data_dir . "/glo_" . $this->getId();
517  ilFileUtils::makeDir($glo_dir);
518  if (!is_dir($glo_dir)) {
519  throw new ilGlossaryException("Creation of Glossary Directory failed.");
520  }
521  // create Import subdirectory (data_dir/glo_data/glo_<id>/import)
522  $import_dir = $glo_dir . "/import";
523  ilFileUtils::makeDir($import_dir);
524  if (!is_dir($import_dir)) {
525  throw new ilGlossaryException("Creation of Export Directory failed.");
526  }
527  }
static getDataDir()
get data directory (outside webspace)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
+ Here is the call graph for this function:

◆ delete()

ilObjGlossary::delete ( )

Definition at line 700 of file class.ilObjGlossary.php.

References $q, ilObject\deleteMetaData(), ilObject\getId(), getTermList(), and isVirtual().

700  : bool
701  {
702  // always call parent delete function first!!
703  if (!parent::delete()) {
704  return false;
705  }
706 
707  // delete terms
708  if (!$this->isVirtual()) {
709  $terms = $this->getTermList();
710  foreach ($terms as $term) {
711  $this->term_manager->deleteTerm((int) $term["id"]);
712  }
713  }
714 
715  // delete term references
716  $refs = new ilGlossaryTermReferences($this->getId());
717  $refs->delete();
718 
719  // delete glossary data entry
720  $q = "DELETE FROM glossary WHERE id = " . $this->db->quote($this->getId());
721  $this->db->query($q);
722 
723  // delete meta data
724  $this->deleteMetaData();
725 
726  return true;
727  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getTermList(string $searchterm="", string $a_letter="", string $a_def="", int $a_tax_node=0, bool $a_include_offline_childs=false, bool $a_add_amet_fields=false, array $a_amet_filter=null, bool $a_omit_virtual=false, bool $a_include_references=false)
$q
Definition: shib_logout.php:21
+ Here is the call graph for this function:

◆ exportFileItems()

ilObjGlossary::exportFileItems ( string  $a_target_dir,
ilLog  $expLog 
)

Definition at line 677 of file class.ilObjGlossary.php.

References ilLog\write().

Referenced by exportXML().

680  : void {
681  foreach ($this->file_ids as $file_id) {
682  $expLog->write(date("[y-m-d H:i:s] ") . "File Item " . $file_id);
683  $file_obj = new ilObjFile($file_id, false);
684  $file_obj->export($a_target_dir);
685  unset($file_obj);
686  }
687  }
Class ilObjFile.
write(string $a_msg, $a_log_level=null)
logging
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXML()

ilObjGlossary::exportXML ( ilXmlWriter  $a_xml_writer,
int  $a_inst,
string  $a_target_dir,
ilLog  $expLog 
)

Definition at line 575 of file class.ilObjGlossary.php.

References ilPCFileList\collectFileItems(), exportFileItems(), exportXMLGlossaryItems(), exportXMLMediaObjects(), exportXMLMetaData(), getTermList(), IL_INST_ID, ilLog\write(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

580  : void {
581  // export glossary
582  $attrs = array();
583  $attrs["Type"] = "Glossary";
584  $a_xml_writer->xmlStartTag("ContentObject", $attrs);
585 
586  // MetaData
587  $this->exportXMLMetaData($a_xml_writer);
588 
589  // collect media objects
590  $terms = $this->getTermList();
591  $this->mob_ids = array();
592  $this->file_ids = array();
593  foreach ($terms as $term) {
594  $this->page_object = new ilGlossaryDefPage($term["id"]);
595  $this->page_object->buildDom();
596  $this->page_object->insertInstIntoIDs(IL_INST_ID);
597  $mob_ids = $this->page_object->collectMediaObjects(false);
598  $file_ids = ilPCFileList::collectFileItems($this->page_object, $this->page_object->getDomDoc());
599  foreach ($mob_ids as $mob_id) {
600  $this->mob_ids[$mob_id] = $mob_id;
601  }
602  foreach ($file_ids as $file_id) {
603  $this->file_ids[$file_id] = $file_id;
604  }
605  }
606 
607  // export media objects
608  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Media Objects");
609  $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
610  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Media Objects");
611 
612  // FileItems
613  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export File Items");
614  $this->exportFileItems($a_target_dir, $expLog);
615  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export File Items");
616 
617  // Glossary
618  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Glossary Items");
619  $this->exportXMLGlossaryItems($a_xml_writer, $a_inst, $expLog);
620  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Glossary Items");
621 
622  $a_xml_writer->xmlEndTag("ContentObject");
623  }
const IL_INST_ID
Definition: constants.php:40
exportFileItems(string $a_target_dir, ilLog $expLog)
exportXMLMediaObjects(ilXmlWriter $a_xml_writer, int $a_inst, string $a_target_dir, ilLog $expLog)
xmlEndTag(string $tag)
Writes an endtag.
static collectFileItems(ilPageObject $a_page, DOMDocument $a_domdoc)
Get all file items that are used within the page.
getTermList(string $searchterm="", string $a_letter="", string $a_def="", int $a_tax_node=0, bool $a_include_offline_childs=false, bool $a_add_amet_fields=false, array $a_amet_filter=null, bool $a_omit_virtual=false, bool $a_include_references=false)
exportXMLMetaData(ilXmlWriter $a_xml_writer)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
write(string $a_msg, $a_log_level=null)
logging
exportXMLGlossaryItems(ilXmlWriter $a_xml_writer, int $a_inst, ilLog $expLog)
+ Here is the call graph for this function:

◆ exportXMLGlossaryItems()

ilObjGlossary::exportXMLGlossaryItems ( ilXmlWriter  $a_xml_writer,
int  $a_inst,
ilLog  $expLog 
)

Definition at line 625 of file class.ilObjGlossary.php.

References exportXMLMetaData(), getTermList(), ilLog\write(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by exportXML().

629  : void {
630  $attrs = array();
631  $a_xml_writer->xmlStartTag("Glossary", $attrs);
632 
633  // MetaData
634  $this->exportXMLMetaData($a_xml_writer);
635 
636  $terms = $this->getTermList();
637 
638  // export glossary terms
639  reset($terms);
640  foreach ($terms as $term) {
641  $expLog->write(date("[y-m-d H:i:s] ") . "Page Object " . $term["obj_id"]);
642 
643  // export xml to writer object
644  $glo_term = new ilGlossaryTerm($term["id"]);
645  $glo_term->exportXML($a_xml_writer, $a_inst);
646 
647  unset($glo_term);
648  }
649 
650  $a_xml_writer->xmlEndTag("Glossary");
651  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
xmlEndTag(string $tag)
Writes an endtag.
getTermList(string $searchterm="", string $a_letter="", string $a_def="", int $a_tax_node=0, bool $a_include_offline_childs=false, bool $a_add_amet_fields=false, array $a_amet_filter=null, bool $a_omit_virtual=false, bool $a_include_references=false)
exportXMLMetaData(ilXmlWriter $a_xml_writer)
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
write(string $a_msg, $a_log_level=null)
logging
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLMediaObjects()

ilObjGlossary::exportXMLMediaObjects ( ilXmlWriter  $a_xml_writer,
int  $a_inst,
string  $a_target_dir,
ilLog  $expLog 
)

Definition at line 662 of file class.ilObjGlossary.php.

References ilLog\write().

Referenced by exportXML().

667  : void {
668  foreach ($this->mob_ids as $mob_id) {
669  $expLog->write(date("[y-m-d H:i:s] ") . "Media Object " . $mob_id);
670  $media_obj = new ilObjMediaObject($mob_id);
671  $media_obj->exportXML($a_xml_writer, $a_inst);
672  $media_obj->exportFiles($a_target_dir);
673  unset($media_obj);
674  }
675  }
write(string $a_msg, $a_log_level=null)
logging
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLMetaData()

ilObjGlossary::exportXMLMetaData ( ilXmlWriter  $a_xml_writer)

Definition at line 653 of file class.ilObjGlossary.php.

References ilXmlWriter\appendXML(), ilObject\getId(), and ilObject\getType().

Referenced by exportXML(), and exportXMLGlossaryItems().

655  : void {
656  $md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
657  $md2xml->setExportMode(true);
658  $md2xml->startExport();
659  $a_xml_writer->appendXML($md2xml->getXML());
660  }
appendXML(string $a_str)
append xml string to document
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAdvMDSubItemTitle()

static ilObjGlossary::getAdvMDSubItemTitle ( int  $a_obj_id,
string  $a_sub_type,
int  $a_sub_id 
)
static

Implements ilAdvancedMetaDataSubItems.

Definition at line 870 of file class.ilObjGlossary.php.

References $DIC, ilObject\$lng, ilGlossaryTerm\_lookGlossaryTerm(), ilLanguage\loadLanguageModule(), and ilLanguage\txt().

870  : string
871  {
872  global $DIC;
873 
874  $lng = $DIC->language();
875 
876  if ($a_sub_type == "term") {
877  $lng->loadLanguageModule("glo");
878 
879  return $lng->txt("glo_term") . ' "' . ilGlossaryTerm::_lookGlossaryTerm($a_sub_id) . '"';
880  }
881  return "";
882  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
loadLanguageModule(string $a_module)
Load language module.
global $DIC
Definition: feed.php:28
ilLanguage $lng
static _lookGlossaryTerm(int $term_id)
get glossary term
+ Here is the call graph for this function:

◆ getAllGlossaryIds()

ilObjGlossary::getAllGlossaryIds ( bool  $a_include_offline_childs = false,
bool  $ids_are_ref_ids = false 
)

Get all glossary ids.

Returns
int[]

Definition at line 458 of file class.ilObjGlossary.php.

References $DIC, ilObject\$tree, ilObject\_getAllReferences(), getGlossariesForCollection(), ilObject\getId(), ilObject\getRefId(), getVirtualMode(), isVirtual(), and removeOfflineGlossaries().

Referenced by getFirstLetters(), and getTermList().

461  : array {
462  global $DIC;
463 
464  $tree = $DIC->repositoryTree();
465 
466  if ($this->isVirtual()) {
467  $glo_ids = array();
468 
469  $virtual_mode = $this->getRefId() ? $this->getVirtualMode() : '';
470  if ($virtual_mode === "coll") {
471  $glo_ids = $this->getGlossariesForCollection();
472  if ($ids_are_ref_ids) {
473  $glo_ref_ids = [];
474  foreach ($glo_ids as $obj_id) {
475  $glo_ref_ids[] = current(ilObject::_getAllReferences($obj_id));
476  }
477  $glo_ids = $glo_ref_ids;
478  }
479  }
480  if (!$a_include_offline_childs) {
481  $glo_ids = $this->removeOfflineGlossaries($glo_ids, $ids_are_ref_ids);
482  }
483  // always show entries of current glossary (if no permission is given, user will not come to the presentation screen)
484  // see bug #14477
485  if ($ids_are_ref_ids) {
486  if (!in_array($this->getRefId(), $glo_ids)) {
487  $glo_ids[] = $this->getRefId();
488  }
489  } elseif (!in_array($this->getId(), $glo_ids)) {
490  $glo_ids[] = $this->getId();
491  }
492  } elseif ($ids_are_ref_ids) {
493  $glo_ids = [$this->getRefId()];
494  } else {
495  $glo_ids = [$this->getId()];
496  }
497 
498  return $glo_ids;
499  }
static _getAllReferences(int $id)
get all reference ids for object ID
ilTree $tree
global $DIC
Definition: feed.php:28
removeOfflineGlossaries(array $a_glo_ids, bool $ids_are_ref_ids=false)
Remove offline glossaries from obj id array.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAutoGlossaries()

ilObjGlossary::getAutoGlossaries ( )
Returns
int[]

Definition at line 297 of file class.ilObjGlossary.php.

References $auto_glossaries.

Referenced by ilGlossaryAutoLinkTableGUI\__construct(), cloneObject(), removeAutoGlossary(), and updateAutoGlossaries().

297  : array
298  {
299  return $this->auto_glossaries;
300  }
+ Here is the caller graph for this function:

◆ getDeletionDependencies()

static ilObjGlossary::getDeletionDependencies ( int  $obj_id)
static

Definition at line 735 of file class.ilObjGlossary.php.

References $DIC, ilObject\$lng, ilObjSAHSLearningModule\getScormModulesForGlossary(), ilLanguage\loadLanguageModule(), and ilLanguage\txt().

735  : array
736  {
737  global $DIC;
738 
739  $lng = $DIC->language();
740 
741  $dep = array();
743  foreach ($sms as $sm) {
744  $lng->loadLanguageModule("content");
745  $dep[$sm] = $lng->txt("glo_used_in_scorm");
746  }
747  return $dep;
748  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getScormModulesForGlossary(int $a_glo_id)
Get SCORM modules that assign a certain glossary.
loadLanguageModule(string $a_module)
Load language module.
global $DIC
Definition: feed.php:28
ilLanguage $lng
+ Here is the call graph for this function:

◆ getExportDirectory()

ilObjGlossary::getExportDirectory ( string  $a_type = "xml")

Definition at line 541 of file class.ilObjGlossary.php.

References ilExport\_getExportDirectory(), ilObject\getId(), and ilObject\getType().

541  : string
542  {
543  return ilExport::_getExportDirectory($this->getId(), $a_type, $this->getType());
544  }
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object.
+ Here is the call graph for this function:

◆ getExportFiles()

ilObjGlossary::getExportFiles ( )

Get export files.

Definition at line 549 of file class.ilObjGlossary.php.

References ilExport\_getExportFiles(), ilObject\getId(), and ilObject\getType().

549  : array
550  {
551  return ilExport::_getExportFiles($this->getId(), array("xml", "html"), $this->getType());
552  }
static _getExportFiles(int $a_obj_id, $a_export_types="", string $a_obj_type="")
+ Here is the call graph for this function:

◆ getFirstLetters()

ilObjGlossary::getFirstLetters ( int  $a_tax_node = 0)

Definition at line 446 of file class.ilObjGlossary.php.

References getAllGlossaryIds(), and ilGlossaryTerm\getFirstLetters().

448  : array {
449  $glo_ids = $this->getAllGlossaryIds();
450  $first_letters = ilGlossaryTerm::getFirstLetters($glo_ids, $a_tax_node);
451  return $first_letters;
452  }
getAllGlossaryIds(bool $a_include_offline_childs=false, bool $ids_are_ref_ids=false)
Get all glossary ids.
static getFirstLetters(array $a_glo_id, int $a_tax_node=0)
+ Here is the call graph for this function:

◆ getFlashcardsMode()

ilObjGlossary::getFlashcardsMode ( )

Definition at line 269 of file class.ilObjGlossary.php.

References $flashcards_mode.

Referenced by cloneObject(), and update().

269  : string
270  {
271  return $this->flashcards_mode;
272  }
+ Here is the caller graph for this function:

◆ getGlossariesForCollection()

ilObjGlossary::getGlossariesForCollection ( )
Returns
int[]

Definition at line 382 of file class.ilObjGlossary.php.

References ILIAS\Repository\int().

Referenced by cloneObject(), and getAllGlossaryIds().

382  : array
383  {
384  $set = $this->db->query(
385  "SELECT * FROM glossary_collection " .
386  " WHERE id = " . $this->db->quote($this->getId(), "integer")
387  );
388  $glos = [];
389  while ($rec = $this->db->fetchAssoc($set)) {
390  $glos[] = (int) $rec["glo_id"];
391  }
392 
393  return $glos;
394  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImportDirectory()

ilObjGlossary::getImportDirectory ( )

Definition at line 529 of file class.ilObjGlossary.php.

References ilFileUtils\getDataDir(), and ilObject\getId().

529  : string
530  {
531  $export_dir = ilFileUtils::getDataDir() . "/glo_data" . "/glo_" . $this->getId() . "/import";
532 
533  return $export_dir;
534  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:

◆ getOnline()

ilObjGlossary::getOnline ( )

Definition at line 180 of file class.ilObjGlossary.php.

References $online.

Referenced by cloneObject(), and update().

180  : bool
181  {
182  return $this->online;
183  }
+ Here is the caller graph for this function:

◆ getPresentationMode()

ilObjGlossary::getPresentationMode ( )

Definition at line 157 of file class.ilObjGlossary.php.

References $pres_mode.

Referenced by cloneObject(), and update().

157  : string
158  {
159  return $this->pres_mode;
160  }
+ Here is the caller graph for this function:

◆ getPublicExportFile()

ilObjGlossary::getPublicExportFile ( string  $a_type)

get public export file

Parameters
string$a_typetype ("xml" / "html")

Definition at line 570 of file class.ilObjGlossary.php.

Referenced by update().

570  : string
571  {
572  return $this->public_export_file[$a_type] ?? "";
573  }
+ Here is the caller graph for this function:

◆ getShowTaxonomy()

ilObjGlossary::getShowTaxonomy ( )

Definition at line 249 of file class.ilObjGlossary.php.

References $show_tax.

Referenced by update().

249  : bool
250  {
251  return $this->show_tax;
252  }
+ Here is the caller graph for this function:

◆ getSnippetLength()

ilObjGlossary::getSnippetLength ( )

Definition at line 168 of file class.ilObjGlossary.php.

Referenced by cloneObject(), and update().

168  : int
169  {
170  return ($this->snippet_length > 0)
171  ? $this->snippet_length
172  : 200;
173  }
+ Here is the caller graph for this function:

◆ getTaxonomyId()

ilObjGlossary::getTaxonomyId ( )

Definition at line 750 of file class.ilObjGlossary.php.

References ilObject\getId(), and ilObjTaxonomy\getUsageOfObject().

Referenced by cloneObject().

750  : int
751  {
752  $tax_ids = ilObjTaxonomy::getUsageOfObject($this->getId());
753  if (count($tax_ids) > 0) {
754  // glossaries handle max. one taxonomy
755  return (int) $tax_ids[0];
756  }
757  return 0;
758  }
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTermList()

ilObjGlossary::getTermList ( string  $searchterm = "",
string  $a_letter = "",
string  $a_def = "",
int  $a_tax_node = 0,
bool  $a_include_offline_childs = false,
bool  $a_add_amet_fields = false,
array  $a_amet_filter = null,
bool  $a_omit_virtual = false,
bool  $a_include_references = false 
)

Definition at line 417 of file class.ilObjGlossary.php.

References getAllGlossaryIds(), ilObject\getRefId(), and ilGlossaryTerm\getTermList().

Referenced by delete(), exportXML(), exportXMLGlossaryItems(), and assQuestionGUI\outGlossarySelector().

427  : array {
428  if ($a_omit_virtual) {
429  $glo_ref_ids[] = $this->getRefId();
430  } else {
431  $glo_ref_ids = $this->getAllGlossaryIds($a_include_offline_childs, true);
432  }
434  $glo_ref_ids,
435  $searchterm,
436  $a_letter,
437  $a_def,
438  $a_tax_node,
439  $a_add_amet_fields,
440  $a_amet_filter,
441  $a_include_references
442  );
443  return $list;
444  }
getAllGlossaryIds(bool $a_include_offline_childs=false, bool $ids_are_ref_ids=false)
Get all glossary ids.
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getVirtualMode()

ilObjGlossary::getVirtualMode ( )

Definition at line 142 of file class.ilObjGlossary.php.

References $virtual_mode.

Referenced by cloneObject(), create(), getAllGlossaryIds(), and update().

142  : string
143  {
144  return $this->virtual_mode;
145  }
+ Here is the caller graph for this function:

◆ getXMLZip()

ilObjGlossary::getXMLZip ( )

Definition at line 729 of file class.ilObjGlossary.php.

729  : string
730  {
731  $glo_exp = new ilGlossaryExport($this);
732  return $glo_exp->buildExportFile();
733  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ isActiveDownloads()

ilObjGlossary::isActiveDownloads ( )

Definition at line 239 of file class.ilObjGlossary.php.

References $downloads_active.

Referenced by update().

239  : bool
240  {
242  }
+ Here is the caller graph for this function:

◆ isActiveFlashcards()

ilObjGlossary::isActiveFlashcards ( )

Definition at line 259 of file class.ilObjGlossary.php.

References $flashcards_active.

Referenced by cloneObject(), and update().

259  : bool
260  {
262  }
+ Here is the caller graph for this function:

◆ isActiveGlossaryMenu()

ilObjGlossary::isActiveGlossaryMenu ( )

Definition at line 229 of file class.ilObjGlossary.php.

References $glo_menu_active.

Referenced by update().

229  : bool
230  {
231  return $this->glo_menu_active;
232  }
+ Here is the caller graph for this function:

◆ isVirtual()

ilObjGlossary::isVirtual ( )

Definition at line 147 of file class.ilObjGlossary.php.

References $virtual.

Referenced by delete(), and getAllGlossaryIds().

147  : bool
148  {
149  return $this->virtual;
150  }
+ Here is the caller graph for this function:

◆ lookup()

static ilObjGlossary::lookup ( int  $a_id,
string  $a_property 
)
staticprotected

Lookup glossary property.

Definition at line 203 of file class.ilObjGlossary.php.

References ilObject\$db, $DIC, ilDBInterface\fetchAssoc(), ilDBInterface\query(), and ilDBInterface\quote().

206  : string {
207  global $DIC;
208 
209  $db = $DIC->database();
210 
211  $set = $db->query("SELECT $a_property FROM glossary WHERE id = " .
212  $db->quote($a_id, "integer"));
213  $rec = $db->fetchAssoc($set);
214 
215  return $rec[$a_property];
216  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: feed.php:28
ilDBInterface $db
query(string $query)
Run a (read-only) Query on the database.
+ Here is the call graph for this function:

◆ lookupAutoGlossaries()

static ilObjGlossary::lookupAutoGlossaries ( int  $a_id)
static

Definition at line 360 of file class.ilObjGlossary.php.

References ilObject\$db, $DIC, ilDBInterface\fetchAssoc(), ILIAS\Repository\int(), ilDBInterface\query(), and ilDBInterface\quote().

Referenced by ilGlossaryDefPage\beforePageContentUpdate().

362  : array {
363  global $DIC;
364 
365  $db = $DIC->database();
366 
367  // read auto glossaries
368  $set = $db->query(
369  "SELECT * FROM glo_glossaries " .
370  " WHERE id = " . $db->quote($a_id, "integer")
371  );
372  $glos = array();
373  while ($rec = $db->fetchAssoc($set)) {
374  $glos[] = (int) $rec["glo_id"];
375  }
376  return $glos;
377  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: feed.php:28
ilDBInterface $db
query(string $query)
Run a (read-only) Query on the database.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupSnippetLength()

static ilObjGlossary::lookupSnippetLength ( int  $a_id)
static

Definition at line 218 of file class.ilObjGlossary.php.

Referenced by ilGlossaryTerm\shortenShortText().

218  : int
219  {
220  return (int) self::lookup($a_id, "snippet_length");
221  }
+ Here is the caller graph for this function:

◆ modifyExportIdentifier()

ilObjGlossary::modifyExportIdentifier ( string  $a_tag,
string  $a_param,
string  $a_value 
)

Definition at line 689 of file class.ilObjGlossary.php.

References ilObject\getId(), and IL_INST_ID.

693  : string {
694  if ($a_tag == "Identifier" && $a_param == "Entry") {
695  $a_value = "il_" . IL_INST_ID . "_glo_" . $this->getId();
696  }
697  return $a_value;
698  }
const IL_INST_ID
Definition: constants.php:40
+ Here is the call graph for this function:

◆ read()

ilObjGlossary::read ( )

Definition at line 91 of file class.ilObjGlossary.php.

References $q, ilObject\getId(), setActiveDownloads(), setActiveFlashcards(), setActiveGlossaryMenu(), setAutoGlossaries(), setFlashcardsMode(), setOnline(), setPresentationMode(), setPublicExportFile(), setShowTaxonomy(), setSnippetLength(), setVirtualMode(), and ilUtil\yn2tf().

91  : void
92  {
93  parent::read();
94 
95  $q = "SELECT * FROM glossary WHERE id = " .
96  $this->db->quote($this->getId(), "integer");
97  $gl_set = $this->db->query($q);
98  $gl_rec = $this->db->fetchAssoc($gl_set);
99  $this->setOnline(ilUtil::yn2tf($gl_rec["is_online"]));
100  $this->setVirtualMode((string) ($gl_rec["virtual"] ?? ""));
101  if (isset($gl_rec["public_xml_file"]) && $gl_rec["public_xml_file"] != "") {
102  $this->setPublicExportFile("xml", $gl_rec["public_xml_file"]);
103  }
104  if (isset($gl_rec["public_html_file"]) && $gl_rec["public_html_file"] != "") {
105  $this->setPublicExportFile("html", $gl_rec["public_html_file"]);
106  }
107  $this->setActiveGlossaryMenu(ilUtil::yn2tf($gl_rec["glo_menu_active"]));
108  $this->setActiveDownloads(ilUtil::yn2tf($gl_rec["downloads_active"]));
109  $this->setPresentationMode((string) $gl_rec["pres_mode"]);
110  $this->setSnippetLength((int) $gl_rec["snippet_length"]);
111  $this->setShowTaxonomy((bool) $gl_rec["show_tax"]);
112  $this->setActiveFlashcards(ilUtil::yn2tf($gl_rec["flash_active"]));
113  $this->setFlashcardsMode($gl_rec["flash_mode"]);
114 
115  // read auto glossaries
116  $set = $this->db->query(
117  "SELECT * FROM glo_glossaries " .
118  " WHERE id = " . $this->db->quote($this->getId(), "integer")
119  );
120  $glos = array();
121  while ($rec = $this->db->fetchAssoc($set)) {
122  $glos[] = $rec["glo_id"];
123  }
124  $this->setAutoGlossaries($glos);
125  }
setSnippetLength(int $a_val)
Set definition snippet length (in overview)
setAutoGlossaries(array $a_val)
setActiveFlashcards(bool $a_flash)
setPresentationMode(string $a_val)
setOnline(bool $a_online)
setActiveGlossaryMenu(bool $a_act_glo_menu)
setFlashcardsMode(string $a_flash)
setPublicExportFile(string $a_type, string $a_file)
specify public export file for type
setActiveDownloads(bool $a_down)
setVirtualMode(string $a_mode)
$q
Definition: shib_logout.php:21
setShowTaxonomy(bool $a_val)
static yn2tf(string $a_yn)
+ Here is the call graph for this function:

◆ removeAutoGlossary()

ilObjGlossary::removeAutoGlossary ( int  $a_glo_id)

Definition at line 302 of file class.ilObjGlossary.php.

References getAutoGlossaries(), and setAutoGlossaries().

304  : void {
305  $glo_ids = array();
306  foreach ($this->getAutoGlossaries() as $g) {
307  if ($g != $a_glo_id) {
308  $glo_ids[] = $g;
309  }
310  }
311  $this->setAutoGlossaries($glo_ids);
312  }
setAutoGlossaries(array $a_val)
+ Here is the call graph for this function:

◆ removeGlossaryFromCollection()

ilObjGlossary::removeGlossaryFromCollection ( int  $glo_id)

Definition at line 408 of file class.ilObjGlossary.php.

408  : void
409  {
410  $this->db->manipulate(
411  "DELETE FROM glossary_collection WHERE " .
412  " id = " . $this->db->quote($this->getId(), "integer") .
413  " AND glo_id = " . $this->db->quote($glo_id, "integer")
414  );
415  }

◆ removeOfflineGlossaries()

ilObjGlossary::removeOfflineGlossaries ( array  $a_glo_ids,
bool  $ids_are_ref_ids = false 
)

Remove offline glossaries from obj id array.

Definition at line 837 of file class.ilObjGlossary.php.

References $id, ilObject\$ref_id, and ilObject\_lookupObjectId().

Referenced by getAllGlossaryIds().

840  : array {
841  $glo_ids = $a_glo_ids;
842  if ($ids_are_ref_ids) {
843  $glo_ids = array_map(static function ($id): int {
845  }, $a_glo_ids);
846  }
847 
848  $set = $this->db->query(
849  "SELECT id FROM glossary " .
850  " WHERE " . $this->db->in("id", $glo_ids, false, "integer") .
851  " AND is_online = " . $this->db->quote("y", "text")
852  );
853  $online_glo_ids = array();
854  while ($rec = $this->db->fetchAssoc($set)) {
855  $online_glo_ids[] = $rec["id"];
856  }
857 
858  if (!$ids_are_ref_ids) {
859  return $online_glo_ids;
860  }
861 
862  $online_ref_ids = array_filter($a_glo_ids, static function ($ref_id) use ($online_glo_ids): bool {
863  return in_array(ilObject::_lookupObjectId($ref_id), $online_glo_ids);
864  });
865 
866 
867  return $online_ref_ids;
868  }
static _lookupObjectId(int $ref_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setActiveDownloads()

ilObjGlossary::setActiveDownloads ( bool  $a_down)

Definition at line 234 of file class.ilObjGlossary.php.

Referenced by read().

234  : void
235  {
236  $this->downloads_active = $a_down;
237  }
+ Here is the caller graph for this function:

◆ setActiveFlashcards()

ilObjGlossary::setActiveFlashcards ( bool  $a_flash)

Definition at line 254 of file class.ilObjGlossary.php.

Referenced by read().

254  : void
255  {
256  $this->flashcards_active = $a_flash;
257  }
+ Here is the caller graph for this function:

◆ setActiveGlossaryMenu()

ilObjGlossary::setActiveGlossaryMenu ( bool  $a_act_glo_menu)

Definition at line 224 of file class.ilObjGlossary.php.

Referenced by read().

224  : void
225  {
226  $this->glo_menu_active = $a_act_glo_menu;
227  }
+ Here is the caller graph for this function:

◆ setAutoGlossaries()

ilObjGlossary::setAutoGlossaries ( array  $a_val)
Parameters
int[]$a_val

Definition at line 277 of file class.ilObjGlossary.php.

References addAutoGlossary().

Referenced by read(), and removeAutoGlossary().

279  : void {
280  $this->auto_glossaries = array();
281  foreach ($a_val as $v) {
282  $this->addAutoGlossary($v);
283  }
284  }
addAutoGlossary(int $glo_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFlashcardsMode()

ilObjGlossary::setFlashcardsMode ( string  $a_flash)

Definition at line 264 of file class.ilObjGlossary.php.

Referenced by read().

264  : void
265  {
266  $this->flashcards_mode = $a_flash;
267  }
+ Here is the caller graph for this function:

◆ setOnline()

ilObjGlossary::setOnline ( bool  $a_online)

Definition at line 175 of file class.ilObjGlossary.php.

Referenced by read().

175  : void
176  {
177  $this->online = $a_online;
178  }
+ Here is the caller graph for this function:

◆ setPresentationMode()

ilObjGlossary::setPresentationMode ( string  $a_val)

Definition at line 152 of file class.ilObjGlossary.php.

Referenced by create(), and read().

152  : void
153  {
154  $this->pres_mode = $a_val;
155  }
+ Here is the caller graph for this function:

◆ setPublicExportFile()

ilObjGlossary::setPublicExportFile ( string  $a_type,
string  $a_file 
)

specify public export file for type

Parameters
string$a_typetype ("xml" / "html")
string$a_filefile name

Definition at line 559 of file class.ilObjGlossary.php.

Referenced by read().

562  : void {
563  $this->public_export_file[$a_type] = $a_file;
564  }
+ Here is the caller graph for this function:

◆ setShowTaxonomy()

ilObjGlossary::setShowTaxonomy ( bool  $a_val)

Definition at line 244 of file class.ilObjGlossary.php.

Referenced by read().

244  : void
245  {
246  $this->show_tax = $a_val;
247  }
+ Here is the caller graph for this function:

◆ setSnippetLength()

ilObjGlossary::setSnippetLength ( int  $a_val)

Set definition snippet length (in overview)

Definition at line 163 of file class.ilObjGlossary.php.

Referenced by create(), and read().

163  : void
164  {
165  $this->snippet_length = $a_val;
166  }
+ Here is the caller graph for this function:

◆ setVirtualMode()

ilObjGlossary::setVirtualMode ( string  $a_mode)

Definition at line 127 of file class.ilObjGlossary.php.

Referenced by read().

127  : void
128  {
129  switch ($a_mode) {
130  case "coll":
131  $this->virtual_mode = $a_mode;
132  $this->virtual = true;
133  break;
134 
135  default:
136  $this->virtual_mode = "none";
137  $this->virtual = false;
138  break;
139  }
140  }
+ Here is the caller graph for this function:

◆ supportsLongTextQuery()

ilObjGlossary::supportsLongTextQuery ( )

Is long text search supported.

Definition at line 919 of file class.ilObjGlossary.php.

919  : bool
920  {
921  return true;
922  }

◆ update()

ilObjGlossary::update ( )

Definition at line 314 of file class.ilObjGlossary.php.

References getFlashcardsMode(), ilObject\getId(), getOnline(), getPresentationMode(), getPublicExportFile(), getShowTaxonomy(), getSnippetLength(), getVirtualMode(), isActiveDownloads(), isActiveFlashcards(), isActiveGlossaryMenu(), ilUtil\tf2yn(), updateAutoGlossaries(), and ilObject\updateMetaData().

314  : bool
315  {
316  $this->updateMetaData();
317 
318  $this->db->update(
319  'glossary',
320  array(
321  'is_online' => array('text', ilUtil::tf2yn($this->getOnline())),
322  'virtual' => array('text', $this->getVirtualMode()),
323  'public_xml_file' => array('text', $this->getPublicExportFile("xml")),
324  'public_html_file' => array('text', $this->getPublicExportFile("html")),
325  'glo_menu_active' => array('text', ilUtil::tf2yn($this->isActiveGlossaryMenu())),
326  'downloads_active' => array('text', ilUtil::tf2yn($this->isActiveDownloads())),
327  'pres_mode' => array('text', $this->getPresentationMode()),
328  'show_tax' => array('integer', $this->getShowTaxonomy()),
329  'snippet_length' => array('integer', $this->getSnippetLength()),
330  'flash_active' => array('text', ilUtil::tf2yn($this->isActiveFlashcards())),
331  'flash_mode' => array('text', $this->getFlashcardsMode())
332  ),
333  array(
334  'id' => array('integer', $this->getId())
335  )
336  );
337 
338  $this->updateAutoGlossaries();
339  return parent::update();
340  }
static tf2yn(bool $a_tf)
getPublicExportFile(string $a_type)
get public export file
+ Here is the call graph for this function:

◆ updateAutoGlossaries()

ilObjGlossary::updateAutoGlossaries ( )

Definition at line 342 of file class.ilObjGlossary.php.

References getAutoGlossaries(), and ilObject\getId().

Referenced by create(), and update().

342  : void
343  {
344  // update auto glossaries
345  $this->db->manipulate(
346  "DELETE FROM glo_glossaries WHERE " .
347  " id = " . $this->db->quote($this->getId(), "integer")
348  );
349  foreach ($this->getAutoGlossaries() as $glo_id) {
350  $this->db->insert(
351  'glo_glossaries',
352  array(
353  'id' => array('integer', $this->getId()),
354  'glo_id' => array('integer', $glo_id)
355  )
356  );
357  }
358  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $auto_glossaries

array ilObjGlossary::$auto_glossaries = array()

Definition at line 41 of file class.ilObjGlossary.php.

Referenced by getAutoGlossaries().

◆ $content_style_domain

ILIAS Style Content DomainService ilObjGlossary::$content_style_domain
protected

Definition at line 25 of file class.ilObjGlossary.php.

◆ $downloads_active

bool ilObjGlossary::$downloads_active = false
protected

Definition at line 31 of file class.ilObjGlossary.php.

Referenced by isActiveDownloads().

◆ $file_ids

array ilObjGlossary::$file_ids = []
protected

Definition at line 27 of file class.ilObjGlossary.php.

◆ $flashcards_active

bool ilObjGlossary::$flashcards_active = false
protected

Definition at line 38 of file class.ilObjGlossary.php.

Referenced by isActiveFlashcards().

◆ $flashcards_mode

string ilObjGlossary::$flashcards_mode = ""
protected

Definition at line 39 of file class.ilObjGlossary.php.

Referenced by getFlashcardsMode().

◆ $glo_menu_active

bool ilObjGlossary::$glo_menu_active = false
protected

Definition at line 32 of file class.ilObjGlossary.php.

Referenced by isActiveGlossaryMenu().

◆ $mob_ids

array ilObjGlossary::$mob_ids = []
protected

Definition at line 28 of file class.ilObjGlossary.php.

◆ $online

bool ilObjGlossary::$online = false
protected

Definition at line 33 of file class.ilObjGlossary.php.

Referenced by getOnline().

◆ $page_object

ilGlossaryDefPage ilObjGlossary::$page_object
protected

Definition at line 26 of file class.ilObjGlossary.php.

◆ $pres_mode

string ilObjGlossary::$pres_mode = ""
protected

Definition at line 35 of file class.ilObjGlossary.php.

Referenced by getPresentationMode().

◆ $public_export_file

array ilObjGlossary::$public_export_file = []
protected

Definition at line 43 of file class.ilObjGlossary.php.

◆ $show_tax

bool ilObjGlossary::$show_tax = false
protected

Definition at line 29 of file class.ilObjGlossary.php.

Referenced by getShowTaxonomy().

◆ $snippet_length

int ilObjGlossary::$snippet_length = 0
protected

Definition at line 34 of file class.ilObjGlossary.php.

◆ $style_id

int ilObjGlossary::$style_id = 0
protected

Definition at line 30 of file class.ilObjGlossary.php.

◆ $term_manager

ILIAS Glossary Term TermManager ilObjGlossary::$term_manager
protected

Definition at line 24 of file class.ilObjGlossary.php.

◆ $tpl

ilGlobalTemplateInterface ilObjGlossary::$tpl
protected

Definition at line 40 of file class.ilObjGlossary.php.

◆ $user

ilObjUser ilObjGlossary::$user
protected

Definition at line 42 of file class.ilObjGlossary.php.

◆ $virtual

bool ilObjGlossary::$virtual = false
protected

Definition at line 36 of file class.ilObjGlossary.php.

Referenced by isVirtual().

◆ $virtual_mode

string ilObjGlossary::$virtual_mode = ""
protected

Definition at line 37 of file class.ilObjGlossary.php.

Referenced by getVirtualMode().


The documentation for this class was generated from the following file: