ILIAS  release_8 Revision v8.23
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 ()
 
 setAutoGlossaries (array $a_val)
 
 addAutoGlossary (int $glo_id)
 
 getAutoGlossaries ()
 
 removeAutoGlossary (int $a_glo_id)
 
 update ()
 
 updateAutoGlossaries ()
 
 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
 __construct (int $id=0, bool $reference=true)
 
 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 $desc)
 
 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 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 = ""
 
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
 
int $id
 
bool $referenced
 
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 = ""
 
bool $offline = false
 
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 43 of file class.ilObjGlossary.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\user().

46  {
47  global $DIC;
48  $this->tpl = $DIC["tpl"];
49 
50  $this->db = $DIC->database();
51  $this->user = $DIC->user();
52  $this->type = "glo";
53  parent::__construct($a_id, $a_call_by_reference);
54  $this->content_style_domain = $DIC
55  ->contentStyle()
56  ->domain();
57  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _lookupOnline()

static ilObjGlossary::_lookupOnline ( int  $a_id)
static

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

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

Referenced by ilRepositoryExplorer\isClickable(), and ilRepositoryExplorerGUI\isNodeClickable().

184  : bool {
185  global $DIC;
186 
187  $db = $DIC->database();
188 
189  $q = "SELECT is_online FROM glossary WHERE id = " .
190  $db->quote($a_id, "integer");
191  $lm_set = $db->query($q);
192  $lm_rec = $db->fetchAssoc($lm_set);
193 
194  return ilUtil::yn2tf($lm_rec["is_online"]);
195  }
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
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 263 of file class.ilObjGlossary.php.

References ilObject\_lookupType().

Referenced by setAutoGlossaries().

263  : void
264  {
265  if ($glo_id > 0 && ilObject::_lookupType($glo_id) == "glo" &&
266  !in_array($glo_id, $this->auto_glossaries)) {
267  $this->auto_glossaries[] = $glo_id;
268  }
269  }
static _lookupType(int $id, bool $reference=false)
+ 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 841 of file class.ilObjGlossary.php.

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

843  : void {
844  // get terms of target glossary
845  $terms = ilGlossaryTerm::getTermList([$a_glo_ref_id]);
846 
847  // for each get page: get content
848  $source_terms = ilGlossaryTerm::getTermList([$this->getRefId()]);
849  $found_pages = array();
850  foreach ($source_terms as $source_term) {
851  $source_defs = ilGlossaryDefinition::getDefinitionList($source_term["id"]);
852 
853  for ($j = 0, $jMax = count($source_defs); $j < $jMax; $j++) {
854  $def = $source_defs[$j];
855  $pg = new ilGlossaryDefPage($def["id"]);
856 
857  $c = $pg->getXMLContent();
858  foreach ($terms as $t) {
859  if (is_int(stripos($c, $t["term"]))) {
860  $found_pages[$def["id"]]["terms"][] = $t;
861  if (!isset($found_pages[$def["id"]]["page"])) {
862  $found_pages[$def["id"]]["page"] = $pg;
863  }
864  }
865  }
866  reset($terms);
867  }
868  }
869 
870  // ilPCParagraph autoLinkGlossariesPage with page and terms
871  foreach ($found_pages as $id => $fp) {
872  ilPCParagraph::autoLinkGlossariesPage($fp["page"], $fp["terms"]);
873  }
874  }
$c
Definition: cli.php:38
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...
static getDefinitionList(int $a_term_id)
+ 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 721 of file class.ilObjGlossary.php.

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

721  : ?ilObject
722  {
723  $new_obj = parent::cloneObject($target_id, $copy_id, $omit_tree);
724  $this->cloneMetaData($new_obj);
725 
726  $tax_ass = null;
727  $new_tax_ass = null;
728  $map = [];
729 
730  //copy online status if object is not the root copy object
731  $cp_options = ilCopyWizardOptions::_getInstance($copy_id);
732 
733  if (!$cp_options->isRootNode($this->getRefId())) {
734  $new_obj->setOnline($this->getOnline());
735  }
736 
737  // $new_obj->setTitle($this->getTitle());
738  $new_obj->setDescription($this->getDescription());
739  $new_obj->setVirtualMode($this->getVirtualMode());
740  $new_obj->setPresentationMode($this->getPresentationMode());
741  $new_obj->setSnippetLength($this->getSnippetLength());
742  $new_obj->setAutoGlossaries($this->getAutoGlossaries());
743  $new_obj->update();
744 
745  // set/copy stylesheet
746  $this->content_style_domain->styleForRefId($this->getRefId())->cloneTo($new_obj->getId());
747 
748  // copy taxonomy
749  if (($tax_id = $this->getTaxonomyId()) > 0) {
750  // clone it
751  $tax = new ilObjTaxonomy($tax_id);
752  $new_tax = $tax->cloneObject(0, 0, true);
753  $map = $tax->getNodeMapping();
754 
755  // assign new taxonomy to new glossary
756  ilObjTaxonomy::saveUsage($new_tax->getId(), $new_obj->getId());
757 
758  $tax_ass = new ilTaxNodeAssignment("glo", $this->getId(), "term", $tax_id);
759  $new_tax_ass = new ilTaxNodeAssignment("glo", $new_obj->getId(), "term", $new_tax->getId());
760  }
761 
762  // copy terms
763  $term_mappings = array();
764  foreach (ilGlossaryTerm::getTermList([$this->getRefId()]) as $term) {
765  $new_term_id = ilGlossaryTerm::_copyTerm($term["id"], $new_obj->getId());
766  $term_mappings[$term["id"]] = $new_term_id;
767 
768  // copy tax node assignments
769  if ($tax_id > 0) {
770  $assignmts = $tax_ass->getAssignmentsOfItem($term["id"]);
771  foreach ($assignmts as $a) {
772  if ($map[$a["node_id"]] > 0) {
773  $new_tax_ass->addAssignment($map[$a["node_id"]], $new_term_id);
774  }
775  }
776  }
777  }
778 
779  // add mapping of term_ids to copy wizard options
780  if (!empty($term_mappings)) {
781  $cp_options->appendMapping($this->getRefId() . '_glo_terms', $term_mappings);
782  }
783 
784 
785  return $new_obj;
786  }
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...
$target_id
Definition: goto.php:52
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 59 of file class.ilObjGlossary.php.

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

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

◆ createExportDirectory()

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

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

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

491  : string
492  {
493  return ilExport::_createExportDirectory($this->getId(), $a_type, $this->getType());
494  }
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 461 of file class.ilObjGlossary.php.

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

461  : void
462  {
463  $glo_data_dir = ilFileUtils::getDataDir() . "/glo_data";
464  ilFileUtils::makeDir($glo_data_dir);
465  if (!is_writable($glo_data_dir)) {
466  throw new ilGlossaryException("Glossary Data Directory (" . $glo_data_dir
467  . ") not writeable.");
468  }
469 
470  // create glossary directory (data_dir/glo_data/glo_<id>)
471  $glo_dir = $glo_data_dir . "/glo_" . $this->getId();
472  ilFileUtils::makeDir($glo_dir);
473  if (!is_dir($glo_dir)) {
474  throw new ilGlossaryException("Creation of Glossary Directory failed.");
475  }
476  // create Import subdirectory (data_dir/glo_data/glo_<id>/import)
477  $import_dir = $glo_dir . "/import";
478  ilFileUtils::makeDir($import_dir);
479  if (!is_dir($import_dir)) {
480  throw new ilGlossaryException("Creation of Export Directory failed.");
481  }
482  }
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 659 of file class.ilObjGlossary.php.

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

659  : bool
660  {
661  // always call parent delete function first!!
662  if (!parent::delete()) {
663  return false;
664  }
665 
666  // delete terms
667  if (!$this->isVirtual()) {
668  $terms = $this->getTermList();
669  foreach ($terms as $term) {
670  $term_obj = new ilGlossaryTerm($term["id"]);
671  $term_obj->delete();
672  }
673  }
674 
675  // delete term references
676  $refs = new ilGlossaryTermReferences($this->getId());
677  $refs->delete();
678 
679  // delete glossary data entry
680  $q = "DELETE FROM glossary WHERE id = " . $this->db->quote($this->getId());
681  $this->db->query($q);
682 
683  // delete meta data
684  $this->deleteMetaData();
685 
686  return true;
687  }
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...
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)
+ Here is the call graph for this function:

◆ exportFileItems()

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

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

References ilLog\write().

Referenced by exportXML().

639  : void {
640  foreach ($this->file_ids as $file_id) {
641  $expLog->write(date("[y-m-d H:i:s] ") . "File Item " . $file_id);
642  $file_obj = new ilObjFile($file_id, false);
643  $file_obj->export($a_target_dir);
644  unset($file_obj);
645  }
646  }
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 530 of file class.ilObjGlossary.php.

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

535  : void {
536  // export glossary
537  $attrs = array();
538  $attrs["Type"] = "Glossary";
539  $a_xml_writer->xmlStartTag("ContentObject", $attrs);
540 
541  // MetaData
542  $this->exportXMLMetaData($a_xml_writer);
543 
544  // collect media objects
545  $terms = $this->getTermList();
546  $this->mob_ids = array();
547  $this->file_ids = array();
548  foreach ($terms as $term) {
549  $defs = ilGlossaryDefinition::getDefinitionList($term["id"]);
550 
551  foreach ($defs as $def) {
552  $this->page_object = new ilGlossaryDefPage($def["id"]);
553  $this->page_object->buildDom();
554  $this->page_object->insertInstIntoIDs(IL_INST_ID);
555  $mob_ids = $this->page_object->collectMediaObjects(false);
556  $file_ids = ilPCFileList::collectFileItems($this->page_object, $this->page_object->getDomDoc());
557  foreach ($mob_ids as $mob_id) {
558  $this->mob_ids[$mob_id] = $mob_id;
559  }
560  foreach ($file_ids as $file_id) {
561  $this->file_ids[$file_id] = $file_id;
562  }
563  }
564  }
565 
566  // export media objects
567  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Media Objects");
568  $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
569  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Media Objects");
570 
571  // FileItems
572  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export File Items");
573  $this->exportFileItems($a_target_dir, $expLog);
574  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export File Items");
575 
576  // Glossary
577  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Glossary Items");
578  $this->exportXMLGlossaryItems($a_xml_writer, $a_inst, $expLog);
579  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Glossary Items");
580 
581  $a_xml_writer->xmlEndTag("ContentObject");
582  }
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...
static getDefinitionList(int $a_term_id)
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 584 of file class.ilObjGlossary.php.

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

Referenced by exportXML().

588  : void {
589  $attrs = array();
590  $a_xml_writer->xmlStartTag("Glossary", $attrs);
591 
592  // MetaData
593  $this->exportXMLMetaData($a_xml_writer);
594 
595  $terms = $this->getTermList();
596 
597  // export glossary terms
598  reset($terms);
599  foreach ($terms as $term) {
600  $expLog->write(date("[y-m-d H:i:s] ") . "Page Object " . $term["obj_id"]);
601 
602  // export xml to writer object
603  $glo_term = new ilGlossaryTerm($term["id"]);
604  $glo_term->exportXML($a_xml_writer, $a_inst);
605 
606  unset($glo_term);
607  }
608 
609  $a_xml_writer->xmlEndTag("Glossary");
610  }
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 621 of file class.ilObjGlossary.php.

References ilLog\write().

Referenced by exportXML().

626  : void {
627  foreach ($this->mob_ids as $mob_id) {
628  $expLog->write(date("[y-m-d H:i:s] ") . "Media Object " . $mob_id);
629  $media_obj = new ilObjMediaObject($mob_id);
630  $media_obj->exportXML($a_xml_writer, $a_inst);
631  $media_obj->exportFiles($a_target_dir);
632  unset($media_obj);
633  }
634  }
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 612 of file class.ilObjGlossary.php.

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

Referenced by exportXML(), and exportXMLGlossaryItems().

614  : void {
615  $md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
616  $md2xml->setExportMode(true);
617  $md2xml->startExport();
618  $a_xml_writer->appendXML($md2xml->getXML());
619  }
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 824 of file class.ilObjGlossary.php.

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

824  : string
825  {
826  global $DIC;
827 
828  $lng = $DIC->language();
829 
830  if ($a_sub_type == "term") {
831  $lng->loadLanguageModule("glo");
832 
833  return $lng->txt("glo_term") . ' "' . ilGlossaryTerm::_lookGlossaryTerm($a_sub_id) . '"';
834  }
835  return "";
836  }
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 395 of file class.ilObjGlossary.php.

References $DIC, ilObject\$tree, ilTree\getChildsByType(), ilObject\getId(), ilTree\getNodeData(), ilTree\getParentId(), ilObject\getRefId(), ilTree\getSubTree(), getVirtualMode(), ILIAS\Repository\int(), isVirtual(), and removeOfflineGlossaries().

Referenced by getFirstLetters(), and getTermList().

398  : array {
399  global $DIC;
400 
401  $tree = $DIC->repositoryTree();
402 
403  if ($this->isVirtual()) {
404  $glo_ids = array();
405 
406  $virtual_mode = $this->getRefId() ? $this->getVirtualMode() : '';
407  switch ($virtual_mode) {
408  case "level":
409  $glo_arr = $tree->getChildsByType($tree->getParentId($this->getRefId()), "glo");
410  foreach ($glo_arr as $glo) {
411  {
412  if ($ids_are_ref_ids) {
413  $glo_ids[] = (int) $glo['child'];
414  } else {
415  $glo_ids[] = (int) $glo['obj_id'];
416  }
417  }
418  }
419  break;
420 
421  case "subtree":
422  $subtree_nodes = $tree->getSubTree($tree->getNodeData($tree->getParentId($this->getRefId())));
423 
424  foreach ($subtree_nodes as $node) {
425  if ($node['type'] == 'glo') {
426  if ($ids_are_ref_ids) {
427  $glo_ids[] = (int) $node['child'];
428  } else {
429  $glo_ids[] = (int) $node['obj_id'];
430  }
431  }
432  }
433  break;
434  }
435  if (!$a_include_offline_childs) {
436  $glo_ids = $this->removeOfflineGlossaries($glo_ids, $ids_are_ref_ids);
437  }
438  // always show entries of current glossary (if no permission is given, user will not come to the presentation screen)
439  // see bug #14477
440  if ($ids_are_ref_ids) {
441  if (!in_array($this->getRefId(), $glo_ids)) {
442  $glo_ids[] = $this->getRefId();
443  }
444  } elseif (!in_array($this->getId(), $glo_ids)) {
445  $glo_ids[] = $this->getId();
446  }
447  } elseif ($ids_are_ref_ids) {
448  $glo_ids = [$this->getRefId()];
449  } else {
450  $glo_ids = [$this->getId()];
451  }
452 
453  return $glo_ids;
454  }
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
ilTree $tree
global $DIC
Definition: feed.php:28
getChildsByType(int $a_node_id, string $a_type)
get child nodes of given node by object type
removeOfflineGlossaries(array $a_glo_ids, bool $ids_are_ref_ids=false)
Remove offline glossaries from obj id array.
getParentId(int $a_node_id)
get parent id of given node
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAutoGlossaries()

ilObjGlossary::getAutoGlossaries ( )
Returns
int[]

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

References $auto_glossaries.

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

274  : array
275  {
276  return $this->auto_glossaries;
277  }
+ Here is the caller graph for this function:

◆ getDeletionDependencies()

static ilObjGlossary::getDeletionDependencies ( int  $obj_id)
static

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

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

695  : array
696  {
697  global $DIC;
698 
699  $lng = $DIC->language();
700 
701  $dep = array();
703  foreach ($sms as $sm) {
704  $lng->loadLanguageModule("content");
705  $dep[$sm] = $lng->txt("glo_used_in_scorm");
706  }
707  return $dep;
708  }
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 496 of file class.ilObjGlossary.php.

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

496  : string
497  {
498  return ilExport::_getExportDirectory($this->getId(), $a_type, $this->getType());
499  }
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 504 of file class.ilObjGlossary.php.

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

504  : array
505  {
506  return ilExport::_getExportFiles($this->getId(), array("xml", "html"), $this->getType());
507  }
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 383 of file class.ilObjGlossary.php.

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

385  : array {
386  $glo_ids = $this->getAllGlossaryIds();
387  $first_letters = ilGlossaryTerm::getFirstLetters($glo_ids, $a_tax_node);
388  return $first_letters;
389  }
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:

◆ getImportDirectory()

ilObjGlossary::getImportDirectory ( )

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

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

484  : string
485  {
486  $export_dir = ilFileUtils::getDataDir() . "/glo_data" . "/glo_" . $this->getId() . "/import";
487 
488  return $export_dir;
489  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:

◆ getOnline()

ilObjGlossary::getOnline ( )

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

References $online.

Referenced by cloneObject(), and update().

177  : bool
178  {
179  return $this->online;
180  }
+ Here is the caller graph for this function:

◆ getPresentationMode()

ilObjGlossary::getPresentationMode ( )

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

References $pres_mode.

Referenced by cloneObject(), and update().

154  : string
155  {
156  return $this->pres_mode;
157  }
+ 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 525 of file class.ilObjGlossary.php.

Referenced by update().

525  : string
526  {
527  return $this->public_export_file[$a_type] ?? "";
528  }
+ Here is the caller graph for this function:

◆ getShowTaxonomy()

ilObjGlossary::getShowTaxonomy ( )

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

References $show_tax.

Referenced by update().

246  : bool
247  {
248  return $this->show_tax;
249  }
+ Here is the caller graph for this function:

◆ getSnippetLength()

ilObjGlossary::getSnippetLength ( )

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

Referenced by cloneObject(), and update().

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

◆ getTaxonomyId()

ilObjGlossary::getTaxonomyId ( )

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

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

Referenced by cloneObject().

710  : int
711  {
712  $tax_ids = ilObjTaxonomy::getUsageOfObject($this->getId());
713  if (count($tax_ids) > 0) {
714  // glossaries handle max. one taxonomy
715  return (int) $tax_ids[0];
716  }
717  return 0;
718  }
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 354 of file class.ilObjGlossary.php.

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

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

364  : array {
365  if ($a_omit_virtual) {
366  $glo_ref_ids[] = $this->getRefId();
367  } else {
368  $glo_ref_ids = $this->getAllGlossaryIds($a_include_offline_childs, true);
369  }
371  $glo_ref_ids,
372  $searchterm,
373  $a_letter,
374  $a_def,
375  $a_tax_node,
376  $a_add_amet_fields,
377  $a_amet_filter,
378  $a_include_references
379  );
380  return $list;
381  }
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 139 of file class.ilObjGlossary.php.

References $virtual_mode.

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

139  : string
140  {
141  return $this->virtual_mode;
142  }
+ Here is the caller graph for this function:

◆ getXMLZip()

ilObjGlossary::getXMLZip ( )

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

689  : string
690  {
691  $glo_exp = new ilGlossaryExport($this);
692  return $glo_exp->buildExportFile();
693  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ isActiveDownloads()

ilObjGlossary::isActiveDownloads ( )

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

References $downloads_active.

Referenced by update().

236  : bool
237  {
239  }
+ Here is the caller graph for this function:

◆ isActiveGlossaryMenu()

ilObjGlossary::isActiveGlossaryMenu ( )

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

References $glo_menu_active.

Referenced by update().

226  : bool
227  {
228  return $this->glo_menu_active;
229  }
+ Here is the caller graph for this function:

◆ isVirtual()

ilObjGlossary::isVirtual ( )

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

References $virtual.

Referenced by delete(), and getAllGlossaryIds().

144  : bool
145  {
146  return $this->virtual;
147  }
+ 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 200 of file class.ilObjGlossary.php.

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

203  : string {
204  global $DIC;
205 
206  $db = $DIC->database();
207 
208  $set = $db->query("SELECT $a_property FROM glossary WHERE id = " .
209  $db->quote($a_id, "integer"));
210  $rec = $db->fetchAssoc($set);
211 
212  return $rec[$a_property];
213  }
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 335 of file class.ilObjGlossary.php.

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

Referenced by ilGlossaryDefPage\beforePageContentUpdate().

337  : array {
338  global $DIC;
339 
340  $db = $DIC->database();
341 
342  // read auto glossaries
343  $set = $db->query(
344  "SELECT * FROM glo_glossaries " .
345  " WHERE id = " . $db->quote($a_id, "integer")
346  );
347  $glos = array();
348  while ($rec = $db->fetchAssoc($set)) {
349  $glos[] = (int) $rec["glo_id"];
350  }
351  return $glos;
352  }
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 215 of file class.ilObjGlossary.php.

Referenced by ilGlossaryDefinition\shortenShortText().

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

◆ modifyExportIdentifier()

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

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

References ilObject\getId(), and IL_INST_ID.

652  : string {
653  if ($a_tag == "Identifier" && $a_param == "Entry") {
654  $a_value = "il_" . IL_INST_ID . "_glo_" . $this->getId();
655  }
656  return $a_value;
657  }
const IL_INST_ID
Definition: constants.php:40
+ Here is the call graph for this function:

◆ read()

ilObjGlossary::read ( )

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

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

87  : void
88  {
89  parent::read();
90  # echo "Glossary<br>\n";
91 
92  $q = "SELECT * FROM glossary WHERE id = " .
93  $this->db->quote($this->getId(), "integer");
94  $gl_set = $this->db->query($q);
95  $gl_rec = $this->db->fetchAssoc($gl_set);
96  $this->setOnline(ilUtil::yn2tf($gl_rec["is_online"]));
97  $this->setVirtualMode((string) ($gl_rec["virtual"] ?? ""));
98  if (isset($gl_rec["public_xml_file"]) && $gl_rec["public_xml_file"] != "") {
99  $this->setPublicExportFile("xml", $gl_rec["public_xml_file"]);
100  }
101  if (isset($gl_rec["public_html_file"]) && $gl_rec["public_html_file"] != "") {
102  $this->setPublicExportFile("html", $gl_rec["public_html_file"]);
103  }
104  $this->setActiveGlossaryMenu(ilUtil::yn2tf($gl_rec["glo_menu_active"]));
105  $this->setActiveDownloads(ilUtil::yn2tf($gl_rec["downloads_active"]));
106  $this->setPresentationMode((string) $gl_rec["pres_mode"]);
107  $this->setSnippetLength((int) $gl_rec["snippet_length"]);
108  $this->setShowTaxonomy((bool) $gl_rec["show_tax"]);
109 
110  // read auto glossaries
111  $set = $this->db->query(
112  "SELECT * FROM glo_glossaries " .
113  " WHERE id = " . $this->db->quote($this->getId(), "integer")
114  );
115  $glos = array();
116  while ($rec = $this->db->fetchAssoc($set)) {
117  $glos[] = $rec["glo_id"];
118  }
119  $this->setAutoGlossaries($glos);
120  }
setSnippetLength(int $a_val)
Set definition snippet length (in overview)
setAutoGlossaries(array $a_val)
setPresentationMode(string $a_val)
setOnline(bool $a_online)
setActiveGlossaryMenu(bool $a_act_glo_menu)
setPublicExportFile(string $a_type, string $a_file)
specify public export file for type
setActiveDownloads(bool $a_down)
setVirtualMode(string $a_mode)
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 279 of file class.ilObjGlossary.php.

References getAutoGlossaries(), and setAutoGlossaries().

281  : void {
282  $glo_ids = array();
283  foreach ($this->getAutoGlossaries() as $g) {
284  if ($g != $a_glo_id) {
285  $glo_ids[] = $g;
286  }
287  }
288  $this->setAutoGlossaries($glo_ids);
289  }
setAutoGlossaries(array $a_val)
+ Here is the call graph for this function:

◆ removeOfflineGlossaries()

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

Remove offline glossaries from obj id array.

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

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

Referenced by getAllGlossaryIds().

794  : array {
795  $glo_ids = $a_glo_ids;
796  if ($ids_are_ref_ids) {
797  $glo_ids = array_map(static function ($id): int {
799  }, $a_glo_ids);
800  }
801 
802  $set = $this->db->query(
803  "SELECT id FROM glossary " .
804  " WHERE " . $this->db->in("id", $glo_ids, false, "integer") .
805  " AND is_online = " . $this->db->quote("y", "text")
806  );
807  $online_glo_ids = array();
808  while ($rec = $this->db->fetchAssoc($set)) {
809  $online_glo_ids[] = $rec["id"];
810  }
811 
812  if (!$ids_are_ref_ids) {
813  return $online_glo_ids;
814  }
815 
816  $online_ref_ids = array_filter($a_glo_ids, static function ($ref_id) use ($online_glo_ids): bool {
817  return in_array(ilObject::_lookupObjectId($ref_id), $online_glo_ids);
818  });
819 
820 
821  return $online_ref_ids;
822  }
static _lookupObjectId(int $ref_id)
+ 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 231 of file class.ilObjGlossary.php.

Referenced by read().

231  : void
232  {
233  $this->downloads_active = $a_down;
234  }
+ Here is the caller graph for this function:

◆ setActiveGlossaryMenu()

ilObjGlossary::setActiveGlossaryMenu ( bool  $a_act_glo_menu)

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

Referenced by read().

221  : void
222  {
223  $this->glo_menu_active = $a_act_glo_menu;
224  }
+ Here is the caller graph for this function:

◆ setAutoGlossaries()

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

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

References addAutoGlossary().

Referenced by read(), and removeAutoGlossary().

256  : void {
257  $this->auto_glossaries = array();
258  foreach ($a_val as $v) {
259  $this->addAutoGlossary($v);
260  }
261  }
addAutoGlossary(int $glo_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setOnline()

ilObjGlossary::setOnline ( bool  $a_online)

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

Referenced by read().

172  : void
173  {
174  $this->online = $a_online;
175  }
+ Here is the caller graph for this function:

◆ setPresentationMode()

ilObjGlossary::setPresentationMode ( string  $a_val)

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

Referenced by create(), and read().

149  : void
150  {
151  $this->pres_mode = $a_val;
152  }
+ 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 514 of file class.ilObjGlossary.php.

Referenced by read().

517  : void {
518  $this->public_export_file[$a_type] = $a_file;
519  }
+ Here is the caller graph for this function:

◆ setShowTaxonomy()

ilObjGlossary::setShowTaxonomy ( bool  $a_val)

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

Referenced by read().

241  : void
242  {
243  $this->show_tax = $a_val;
244  }
+ Here is the caller graph for this function:

◆ setSnippetLength()

ilObjGlossary::setSnippetLength ( int  $a_val)

Set definition snippet length (in overview)

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

Referenced by create(), and read().

160  : void
161  {
162  $this->snippet_length = $a_val;
163  }
+ Here is the caller graph for this function:

◆ setVirtualMode()

ilObjGlossary::setVirtualMode ( string  $a_mode)

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

Referenced by read().

122  : void
123  {
124  switch ($a_mode) {
125  case "level":
126  case "subtree":
127  // case "fixed":
128  $this->virtual_mode = $a_mode;
129  $this->virtual = true;
130  break;
131 
132  default:
133  $this->virtual_mode = "none";
134  $this->virtual = false;
135  break;
136  }
137  }
+ Here is the caller graph for this function:

◆ supportsLongTextQuery()

ilObjGlossary::supportsLongTextQuery ( )

Is long text search supported.

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

879  : bool
880  {
881  return true;
882  }

◆ update()

ilObjGlossary::update ( )

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

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

291  : bool
292  {
293  $this->updateMetaData();
294 
295  $this->db->update(
296  'glossary',
297  array(
298  'is_online' => array('text', ilUtil::tf2yn($this->getOnline())),
299  'virtual' => array('text', $this->getVirtualMode()),
300  'public_xml_file' => array('text', $this->getPublicExportFile("xml")),
301  'public_html_file' => array('text', $this->getPublicExportFile("html")),
302  'glo_menu_active' => array('text', ilUtil::tf2yn($this->isActiveGlossaryMenu())),
303  'downloads_active' => array('text', ilUtil::tf2yn($this->isActiveDownloads())),
304  'pres_mode' => array('text', $this->getPresentationMode()),
305  'show_tax' => array('integer', $this->getShowTaxonomy()),
306  'snippet_length' => array('integer', $this->getSnippetLength())
307  ),
308  array(
309  'id' => array('integer', $this->getId())
310  )
311  );
312 
313  $this->updateAutoGlossaries();
314  return parent::update();
315  }
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 317 of file class.ilObjGlossary.php.

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

Referenced by create(), and update().

317  : void
318  {
319  // update auto glossaries
320  $this->db->manipulate(
321  "DELETE FROM glo_glossaries WHERE " .
322  " id = " . $this->db->quote($this->getId(), "integer")
323  );
324  foreach ($this->getAutoGlossaries() as $glo_id) {
325  $this->db->insert(
326  'glo_glossaries',
327  array(
328  'id' => array('integer', $this->getId()),
329  'glo_id' => array('integer', $glo_id)
330  )
331  );
332  }
333  }
+ 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 38 of file class.ilObjGlossary.php.

Referenced by getAutoGlossaries().

◆ $content_style_domain

ILIAS Style Content DomainService ilObjGlossary::$content_style_domain
protected

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

◆ $downloads_active

bool ilObjGlossary::$downloads_active = false
protected

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

Referenced by isActiveDownloads().

◆ $file_ids

array ilObjGlossary::$file_ids = []
protected

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

◆ $glo_menu_active

bool ilObjGlossary::$glo_menu_active = false
protected

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

Referenced by isActiveGlossaryMenu().

◆ $mob_ids

array ilObjGlossary::$mob_ids = []
protected

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

◆ $online

bool ilObjGlossary::$online = false
protected

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

Referenced by getOnline().

◆ $page_object

ilGlossaryDefPage ilObjGlossary::$page_object
protected

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

◆ $pres_mode

string ilObjGlossary::$pres_mode = ""
protected

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

Referenced by getPresentationMode().

◆ $public_export_file

array ilObjGlossary::$public_export_file = []
protected

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

◆ $show_tax

bool ilObjGlossary::$show_tax = false
protected

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

Referenced by getShowTaxonomy().

◆ $snippet_length

int ilObjGlossary::$snippet_length = 0
protected

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

◆ $style_id

int ilObjGlossary::$style_id = 0
protected

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

◆ $tpl

ilGlobalTemplateInterface ilObjGlossary::$tpl
protected

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

◆ $user

ilObjUser ilObjGlossary::$user
protected

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

◆ $virtual

bool ilObjGlossary::$virtual = false
protected

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

Referenced by isVirtual().

◆ $virtual_mode

string ilObjGlossary::$virtual_mode = ""
protected

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

Referenced by getVirtualMode().


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