ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjGlossary Class Reference

Class ilObjGlossary. More...

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

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 create ($a_upload=false)
 create glossary object More...
 
 read ()
 read data of content object More...
 
 getDescription ()
 get description of glossary object More...
 
 setDescription ($a_description)
 set description of glossary object More...
 
 setVirtualMode ($a_mode)
 set glossary type (virtual: fixed/level/subtree, normal:none) More...
 
 getVirtualMode ()
 get glossary type (normal or virtual) More...
 
 isVirtual ()
 returns true if glossary type is virtual (any mode) More...
 
 getTitle ()
 get title of glossary object More...
 
 setTitle ($a_title)
 set title of glossary object More...
 
 setPresentationMode ($a_val)
 Set presentation mode. More...
 
 getPresentationMode ()
 Get presentation mode. More...
 
 setSnippetLength ($a_val)
 Set snippet length. More...
 
 getSnippetLength ()
 Get snippet length. More...
 
 setOnline ($a_online)
 
 getOnline ()
 
 setActiveGlossaryMenu ($a_act_glo_menu)
 
 isActiveGlossaryMenu ()
 
 setActiveDownloads ($a_down)
 
 isActiveDownloads ()
 
 getStyleSheetId ()
 Get ID of assigned style sheet object. More...
 
 setStyleSheetId ($a_style_id)
 Set ID of assigned style sheet object. More...
 
 setShowTaxonomy ($a_val)
 Set show taxonomy. More...
 
 getShowTaxonomy ()
 Get show taxonomy. More...
 
 setAutoGlossaries ($a_val)
 Set auto glossaries. More...
 
 getAutoGlossaries ()
 Get auto glossaries. More...
 
 removeAutoGlossary ($a_glo_id)
 Remove auto glossary. More...
 
 update ()
 Update object. More...
 
 updateAutoGlossaries ()
 Update auto glossaries. More...
 
 getTermList ($searchterm="", $a_letter="", $a_def="", $a_tax_node=0, $a_include_offline_childs=false, $a_add_amet_fields=false, array $a_amet_filter=null, $a_omit_virtual=false, $a_include_references=false)
 Get term list. More...
 
 getFirstLetters ($a_tax_node=0)
 Get term list. More...
 
 getAllGlossaryIds ($a_include_offline_childs=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 ()
 get import directory of glossary More...
 
 createExportDirectory ($a_type="xml")
 Creates export directory. More...
 
 getExportDirectory ($a_type="xml")
 Get export directory of glossary. More...
 
 getExportFiles ()
 Get export files. More...
 
 setPublicExportFile ($a_type, $a_file)
 specify public export file for type More...
 
 getPublicExportFile ($a_type)
 get public export file More...
 
 exportHTML ($a_target_dir, $log)
 export html package More...
 
 exportHTMLGlossaryTerms (&$a_glo_gui, $a_target_dir)
 export glossary terms More...
 
 exportHTMLMOB ($a_target_dir, &$a_glo_gui, $a_mob_id)
 export media object to html More...
 
 exportHTMLFile ($a_target_dir, $a_file_id)
 export file object More...
 
 exportXML (&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
 export object to xml (see ilias_co.dtd) More...
 
 exportXMLGlossaryItems (&$a_xml_writer, $a_inst, &$expLog)
 export page objects to xml (see ilias_co.dtd) More...
 
 exportXMLMetaData (&$a_xml_writer)
 export content objects meta data to xml (see ilias_co.dtd) More...
 
 exportXMLMediaObjects (&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
 export media objects to xml (see ilias_co.dtd) More...
 
 exportFileItems ($a_target_dir, &$expLog)
 export files of file itmes More...
 
 modifyExportIdentifier ($a_tag, $a_param, $a_value)
 
 delete ()
 delete glossary and all related data More...
 
 getXMLZip ()
 Get zipped xml file for glossary. More...
 
 getTaxonomyId ()
 Get taxonomy. More...
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone glossary. More...
 
 removeOfflineGlossaries ($a_glo_ids)
 Remove offline glossaries from obj id array. More...
 
 autoLinkGlossaryTerms ($a_glo_id)
 Auto link glossary terms. More...
 
- Public Member Functions inherited from ilObject
 __construct ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ()
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 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 If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static _lookupOnline ($a_id)
 check wether content object is online More...
 
static lookupSnippetLength ($a_id)
 Lookup snippet length. More...
 
static lookupAutoGlossaries ($a_id)
 Lookup auto glossaries. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getAdvMDSubItemTitle ($a_obj_id, $a_sub_type, $a_sub_id)
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupImportId ($a_obj_id)
 
static _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
static _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _lookupOwner ($a_id)
 lookup object owner More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
static _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
static _lookupObjId ($a_id)
 
static _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
static _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
static _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
static _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Data Fields

 $auto_glossaries = array()
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 

Static Protected Member Functions

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

Detailed Description

Class ilObjGlossary.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor public.

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

33  {
34  $this->type = "glo";
35  parent::__construct($a_id,$a_call_by_reference);
36  }

Member Function Documentation

◆ _lookupOnline()

static ilObjGlossary::_lookupOnline (   $a_id)
static

check wether content object is online

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

References $ilDB, $lm_set, and ilUtil\yn2tf().

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

246  {
247  global $ilDB;
248 
249  $q = "SELECT is_online FROM glossary WHERE id = ".
250  $ilDB->quote($a_id, "integer");
251  $lm_set = $ilDB->query($q);
252  $lm_rec = $ilDB->fetchAssoc($lm_set);
253 
254  return ilUtil::yn2tf($lm_rec["is_online"]);
255  }
$lm_set
global $ilDB
static yn2tf($a_yn)
convert "y"/"n" to true/false
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ autoLinkGlossaryTerms()

ilObjGlossary::autoLinkGlossaryTerms (   $a_glo_id)

Auto link glossary terms.

Parameters

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

References ilObject\$id, $t, array, ilPCParagraph\autoLinkGlossariesPage(), ilGlossaryDefinition\getDefinitionList(), ilObject\getId(), and ilGlossaryTerm\getTermList().

1346  {
1347  // get terms of target glossary
1348  include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
1349  $terms = ilGlossaryTerm::getTermList($a_glo_id);
1350 
1351  // for each get page: get content
1352  $source_terms = ilGlossaryTerm::getTermList($this->getId());
1353  $found_pages = array();
1354  foreach($source_terms as $source_term)
1355  {
1356  $source_defs = ilGlossaryDefinition::getDefinitionList($source_term["id"]);
1357 
1358  for ($j = 0; $j < count($source_defs); $j++)
1359  {
1360  $def = $source_defs[$j];
1361  $pg = new ilGlossaryDefPage($def["id"]);
1362 
1363  $c = $pg->getXMLContent();
1364  foreach ($terms as $t)
1365  {
1366  if (is_int(stripos($c, $t["term"])))
1367  {
1368  $found_pages[$def["id"]]["terms"][] = $t;
1369  if (!is_object($found_pages[$def["id"]]["page"]))
1370  {
1371  $found_pages[$def["id"]]["page"] = $pg;
1372  }
1373  }
1374  }
1375  reset($terms);
1376  }
1377  }
1378 
1379  // ilPCParagraph autoLinkGlossariesPage with page and terms
1380  include_once("./Services/COPage/classes/class.ilPCParagraph.php");
1381  foreach ($found_pages as $id => $fp)
1382  {
1383  ilPCParagraph::autoLinkGlossariesPage($fp["page"], $fp["terms"]);
1384  }
1385 
1386 
1387  }
static getDefinitionList($a_term_id)
static
static autoLinkGlossariesPage($a_page, $a_terms)
Auto link glossary of whole page.
getId()
get object id public
static getTermList($a_glo_id, $searchterm="", $a_first_letter="", $a_def="", $a_tax_node=0, $a_add_amet_fields=false, array $a_amet_filter=null, $a_include_references=false)
Get all terms for given set of glossary ids.
Glossary definition page object.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ cloneObject()

ilObjGlossary::cloneObject (   $a_target_id,
  $a_copy_id = 0,
  $a_omit_tree = false 
)

Clone glossary.

Parameters
inttarget ref_id
intcopy id

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

References $ilDB, ilObject\$ilias, $ilUser, ilGlossaryTerm\_copyTerm(), ilCopyWizardOptions\_getInstance(), ilObjStyleSheet\_lookupStandard(), array, ilObject\cloneMetaData(), ilTaxNodeAssignment\getAssignmentsOfItem(), getAutoGlossaries(), getDescription(), ilObject\getId(), getOnline(), getPresentationMode(), ilObject\getRefId(), getSnippetLength(), getStyleSheetId(), getTaxonomyId(), ilGlossaryTerm\getTermList(), getVirtualMode(), and ilObjTaxonomy\saveUsage().

1216  {
1217  global $ilDB, $ilUser, $ilias;
1218 
1219  $new_obj = parent::cloneObject($a_target_id,$a_copy_id, $a_omit_tree);
1220  $this->cloneMetaData($new_obj);
1221 
1222  //copy online status if object is not the root copy object
1223  $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
1224 
1225  if(!$cp_options->isRootNode($this->getRefId()))
1226  {
1227  $new_obj->setOnline($this->getOnline());
1228  }
1229 
1230 // $new_obj->setTitle($this->getTitle());
1231  $new_obj->setDescription($this->getDescription());
1232  $new_obj->setVirtualMode($this->getVirtualMode());
1233  $new_obj->setPresentationMode($this->getPresentationMode());
1234  $new_obj->setSnippetLength($this->getSnippetLength());
1235  $new_obj->setAutoGlossaries($this->getAutoGlossaries());
1236  $new_obj->update();
1237 
1238  // set/copy stylesheet
1239  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
1240  $style_id = $this->getStyleSheetId();
1241  if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id))
1242  {
1243  $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
1244  $new_id = $style_obj->ilClone();
1245  $new_obj->setStyleSheetId($new_id);
1246  $new_obj->update();
1247  }
1248 
1249  // copy taxonomy
1250  if (($tax_id = $this->getTaxonomyId()) > 0)
1251  {
1252  // clone it
1253  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1254  $tax = new ilObjTaxonomy($tax_id);
1255  $new_tax = $tax->cloneObject(0,0,true);
1256  $map = $tax->getNodeMapping();
1257 
1258  // assign new taxonomy to new glossary
1259  ilObjTaxonomy::saveUsage($new_tax->getId(), $new_obj->getId());
1260  }
1261 
1262  // assign new tax/new glossary
1263  // handle mapping
1264 
1265  // prepare tax node assignments objects
1266  include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
1267  if ($tax_id > 0)
1268  {
1269  $tax_ass = new ilTaxNodeAssignment("glo", $this->getId(), "term", $tax_id);
1270  $new_tax_ass = new ilTaxNodeAssignment("glo", $new_obj->getId(), "term", $new_tax->getId());
1271  }
1272 
1273  // copy terms
1274  $term_mappings = array();
1275  foreach (ilGlossaryTerm::getTermList($this->getId()) as $term)
1276  {
1277  $new_term_id = ilGlossaryTerm::_copyTerm($term["id"], $new_obj->getId());
1278  $term_mappings[$term["id"]] = $new_term_id;
1279 
1280  // copy tax node assignments
1281  if ($tax_id > 0)
1282  {
1283  $assignmts = $tax_ass->getAssignmentsOfItem($term["id"]);
1284  foreach ($assignmts as $a)
1285  {
1286  if ($map[$a["node_id"]] > 0)
1287  {
1288  $new_tax_ass->addAssignment($map[$a["node_id"]] ,$new_term_id);
1289  }
1290  }
1291  }
1292  }
1293 
1294  // add mapping of term_ids to copy wizard options
1295  if (!empty($term_mappings))
1296  {
1297  $cp_options->appendMapping($this->getRefId().'_glo_terms', (array) $term_mappings);
1298  }
1299 
1300 
1301  return $new_obj;
1302  }
getAssignmentsOfItem($a_item_id)
Get assignments for item.
Taxonomy node <-> item assignment.
getDescription()
get description of glossary object
static _lookupStandard($a_id)
Lookup standard flag.
getVirtualMode()
get glossary type (normal or virtual)
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getId()
get object id public
getTaxonomyId()
Get taxonomy.
static getTermList($a_glo_id, $searchterm="", $a_first_letter="", $a_def="", $a_tax_node=0, $a_add_amet_fields=false, array $a_amet_filter=null, $a_include_references=false)
Get all terms for given set of glossary ids.
$ilUser
Definition: imgupload.php:18
cloneMetaData($target_obj)
Copy meta data.
getPresentationMode()
Get presentation mode.
getSnippetLength()
Get snippet length.
Create styles array
The data for the language used.
getAutoGlossaries()
Get auto glossaries.
static _copyTerm($a_term_id, $a_glossary_id)
Copy a term to a glossary.
getStyleSheetId()
Get ID of assigned style sheet object.
static saveUsage($a_tax_id, $a_obj_id)
Save Usage.
global $ilDB
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ create()

ilObjGlossary::create (   $a_upload = false)

create glossary object

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

References $ilDB, ilObject\createMetaData(), ilObject\getId(), getStyleSheetId(), getVirtualMode(), setPresentationMode(), setSnippetLength(), updateAutoGlossaries(), and ilObjStyleSheet\writeStyleUsage().

42  {
43  global $ilDB;
44 
45  parent::create();
46 
47  // meta data will be created by
48  // import parser
49  if (!$a_upload)
50  {
51  $this->createMetaData();
52  }
53 
54  $ilDB->manipulate("INSERT INTO glossary (id, is_online, glossary.virtual, pres_mode, snippet_length) VALUES (".
55  $ilDB->quote($this->getId(), "integer").",".
56  $ilDB->quote("n", "text").",".
57  $ilDB->quote($this->getVirtualMode(), "text").",".
58  $ilDB->quote("table", "text").",".
59  $ilDB->quote(200, "integer").
60  ")");
61  $this->setPresentationMode("table");
62  $this->setSnippetLength(200);
63 
64  $this->updateAutoGlossaries();
65 
66  if (((int) $this->getStyleSheetId()) > 0)
67  {
68  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
70  }
71 
72  }
setPresentationMode($a_val)
Set presentation mode.
createMetaData()
create meta data entry
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
getVirtualMode()
get glossary type (normal or virtual)
getId()
get object id public
updateAutoGlossaries()
Update auto glossaries.
getStyleSheetId()
Get ID of assigned style sheet object.
global $ilDB
setSnippetLength($a_val)
Set snippet length.
+ Here is the call graph for this function:

◆ createExportDirectory()

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

Creates export directory.

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

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

617  {
618  include_once("./Services/Export/classes/class.ilExport.php");
619  return ilExport::_createExportDirectory($this->getId(), $a_type, $this->getType());
620  }
static _createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
$a_type
Definition: workflow.php:93
getId()
get object id public
getType()
get object type public
+ 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 577 of file class.ilObjGlossary.php.

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

578  {
579  $glo_data_dir = ilUtil::getDataDir()."/glo_data";
580  ilUtil::makeDir($glo_data_dir);
581  if(!is_writable($glo_data_dir))
582  {
583  $this->ilias->raiseError("Glossary Data Directory (".$glo_data_dir
584  .") not writeable.",$this->ilias->error_obj->FATAL);
585  }
586 
587  // create glossary directory (data_dir/glo_data/glo_<id>)
588  $glo_dir = $glo_data_dir."/glo_".$this->getId();
589  ilUtil::makeDir($glo_dir);
590  if(!@is_dir($glo_dir))
591  {
592  $this->ilias->raiseError("Creation of Glossary Directory failed.",$this->ilias->error_obj->FATAL);
593  }
594  // create Import subdirectory (data_dir/glo_data/glo_<id>/import)
595  $import_dir = $glo_dir."/import";
596  ilUtil::makeDir($import_dir);
597  if(!@is_dir($import_dir))
598  {
599  $this->ilias->raiseError("Creation of Export Directory failed.",$this->ilias->error_obj->FATAL);
600  }
601  }
getId()
get object id public
redirection script todo: (a better solution should control the processing via a xml file) ...
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:

◆ delete()

ilObjGlossary::delete ( )

delete glossary and all related data

this method has been tested on may 9th 2004 meta data, terms, definitions, definition meta data and definition pages have been deleted correctly as desired

public

Returns
boolean true if all object data were removed; false if only a references were removed

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

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

1125  {
1126  global $ilDB;
1127 
1128  // always call parent delete function first!!
1129  if (!parent::delete())
1130  {
1131  return false;
1132  }
1133 
1134  // delete terms
1135  if (!$this->isVirtual())
1136  {
1137  $terms = $this->getTermList();
1138  foreach ($terms as $term)
1139  {
1140  $term_obj = new ilGlossaryTerm($term["id"]);
1141  $term_obj->delete();
1142  }
1143  }
1144 
1145  // delete term references
1146  include_once("./Modules/Glossary/classes/class.ilGlossaryTermReferences.php");
1147  $refs = new ilGlossaryTermReferences($this->getId());
1148  $refs->delete();
1149 
1150  // delete glossary data entry
1151  $q = "DELETE FROM glossary WHERE id = ".$ilDB->quote($this->getId());
1152  $ilDB->query($q);
1153 
1154  // delete meta data
1155  $this->deleteMetaData();
1156 
1157  return true;
1158  }
Class ilGlossaryTerm.
getTermList($searchterm="", $a_letter="", $a_def="", $a_tax_node=0, $a_include_offline_childs=false, $a_add_amet_fields=false, array $a_amet_filter=null, $a_omit_virtual=false, $a_include_references=false)
Get term list.
getId()
get object id public
global $ilDB
deleteMetaData()
delete meta data entry
isVirtual()
returns true if glossary type is virtual (any mode)
+ Here is the call graph for this function:

◆ exportFileItems()

ilObjGlossary::exportFileItems (   $a_target_dir,
$expLog 
)

export files of file itmes

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

References date.

Referenced by exportXML().

1084  {
1085  include_once("./Modules/File/classes/class.ilObjFile.php");
1086 
1087  foreach ($this->file_ids as $file_id)
1088  {
1089  $expLog->write(date("[y-m-d H:i:s] ")."File Item ".$file_id);
1090  $file_obj = new ilObjFile($file_id, false);
1091  $file_obj->export($a_target_dir);
1092  unset($file_obj);
1093  }
1094  }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Class ilObjFile.
+ Here is the caller graph for this function:

◆ exportHTML()

ilObjGlossary::exportHTML (   $a_target_dir,
  $log 
)

export html package

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

References $_GET, $file, ilObject\$ilias, $style, $tpl, ilUtil\delDir(), exportHTMLFile(), exportHTMLGlossaryTerms(), exportHTMLMOB(), getExportDirectory(), ilObject\getId(), ilUtil\getImagePath(), ilMathJax\getInstance(), getStyleSheetId(), ilUtil\getStyleSheetLocation(), ilObjStyleSheet\getSyntaxStylePath(), ilObject\getType(), ilUtil\makeDir(), ilMathJax\PURPOSE_EXPORT, time, and ilUtil\zip().

667  {
668  global $ilias, $tpl;
669 
670  // initialize temporary target directory
671  ilUtil::delDir($a_target_dir);
672  ilUtil::makeDir($a_target_dir);
673 
674  // init mathjax rendering for export
675  include_once './Services/MathJax/classes/class.ilMathJax.php';
677 
678  include_once("./Services/COPage/classes/class.ilCOPageHTMLExport.php");
679  $this->co_page_html_export = new ilCOPageHTMLExport($a_target_dir);
680  $this->co_page_html_export->createDirectories();
681 
682  // export system style sheet
683  $location_stylesheet = ilUtil::getStyleSheetLocation("filesystem");
684  $style_name = $ilias->account->prefs["style"].".css";
685  copy($location_stylesheet, $a_target_dir."/".$style_name);
686  $location_stylesheet = ilUtil::getStyleSheetLocation();
687 
688  if ($this->getStyleSheetId() < 1)
689  {
690  $cont_stylesheet = "Services/COPage/css/content.css";
691  copy($cont_stylesheet, $a_target_dir."/content.css");
692  }
693  else
694  {
695  $content_style_img_dir = $a_target_dir."/images";
696  ilUtil::makeDir($content_style_img_dir);
697  $style = new ilObjStyleSheet($this->getStyleSheetId());
698  $style->writeCSSFile($a_target_dir."/content.css", "images");
699  $style->copyImagesToDir($content_style_img_dir);
700  }
701 
702  // export syntax highlighting style
703  $syn_stylesheet = ilObjStyleSheet::getSyntaxStylePath();
704  copy($syn_stylesheet, $a_target_dir."/syntaxhighlight.css");
705 
706  // get glossary presentation gui class
707  include_once("./Modules/Glossary/classes/class.ilGlossaryPresentationGUI.php");
708  $_GET["cmd"] = "nop";
709  $glo_gui = new ilGlossaryPresentationGUI();
710  $glo_gui->setOfflineMode(true);
711  $glo_gui->setOfflineDirectory($a_target_dir);
712 
713  // could be implemented in the future if other export
714  // formats are supported (e.g. scorm)
715  //$glo_gui->setExportFormat($a_export_format);
716 
717  // export terms
718  $this->exportHTMLGlossaryTerms($glo_gui, $a_target_dir);
719 
720  // export all media objects
721  foreach ($this->offline_mobs as $mob)
722  {
723  $this->exportHTMLMOB($a_target_dir, $glo_gui, $mob, "_blank");
724  }
725  $_GET["obj_type"] = "MediaObject";
726  $_GET["obj_id"] = $a_mob_id;
727  $_GET["cmd"] = "";
728 
729  // export all file objects
730  foreach ($this->offline_files as $file)
731  {
732  $this->exportHTMLFile($a_target_dir, $file);
733  }
734 
735  // export images
736  $image_dir = $a_target_dir."/images";
737  ilUtil::makeDir($image_dir);
738  ilUtil::makeDir($image_dir."/browser");
739  copy(ilUtil::getImagePath("enlarge.svg", false, "filesystem"),
740  $image_dir."/enlarge.svg");
741  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
742  $image_dir."/browser/plus.png");
743  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
744  $image_dir."/browser/minus.png");
745  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
746  $image_dir."/browser/blank.png");
747  copy(ilUtil::getImagePath("icon_st.svg", false, "filesystem"),
748  $image_dir."/icon_st.svg");
749  copy(ilUtil::getImagePath("icon_pg.svg", false, "filesystem"),
750  $image_dir."/icon_pg.svg");
751  copy(ilUtil::getImagePath("nav_arr_L.png", false, "filesystem"),
752  $image_dir."/nav_arr_L.png");
753  copy(ilUtil::getImagePath("nav_arr_R.png", false, "filesystem"),
754  $image_dir."/nav_arr_R.png");
755 
756  // template workaround: reset of template
757  $tpl = new ilTemplate("tpl.main.html", true, true);
758  $tpl->setVariable("LOCATION_STYLESHEET",$location_stylesheet);
759  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
760 
761  // zip everything
762  if (true)
763  {
764  // zip it all
765  $date = time();
766  $zip_file = $this->getExportDirectory("html")."/".$date."__".IL_INST_ID."__".
767  $this->getType()."_".$this->getId().".zip";
768 //echo "zip-".$a_target_dir."-to-".$zip_file;
769  ilUtil::zip($a_target_dir, $zip_file);
770  ilUtil::delDir($a_target_dir);
771  }
772  }
$style
Definition: example_012.php:70
Class ilGlossaryPresentationGUI.
HTML export class for pages.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
exportHTMLFile($a_target_dir, $a_file_id)
export file object
global $tpl
Definition: ilias.php:8
getExportDirectory($a_type="xml")
Get export directory of glossary.
getId()
get object id public
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
static getSyntaxStylePath()
get syntax style path
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
getType()
get object type public
const PURPOSE_EXPORT
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
exportHTMLMOB($a_target_dir, &$a_glo_gui, $a_mob_id)
export media object to html
getStyleSheetId()
Get ID of assigned style sheet object.
static getInstance()
Singleton: get instance.
Class ilObjStyleSheet.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
exportHTMLGlossaryTerms(&$a_glo_gui, $a_target_dir)
export glossary terms
+ Here is the call graph for this function:

◆ exportHTMLFile()

ilObjGlossary::exportHTMLFile (   $a_target_dir,
  $a_file_id 
)

export file object

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

References ilUtil\makeDir().

Referenced by exportHTML().

918  {
919  $file_dir = $a_target_dir."/files/file_".$a_file_id;
920  ilUtil::makeDir($file_dir);
921  include_once("./Modules/File/classes/class.ilObjFile.php");
922  $file_obj = new ilObjFile($a_file_id, false);
923  $source_file = $file_obj->getDirectory($file_obj->getVersion())."/".$file_obj->getFileName();
924  if (!is_file($source_file))
925  {
926  $source_file = $file_obj->getDirectory()."/".$file_obj->getFileName();
927  }
928  copy($source_file, $file_dir."/".$file_obj->getFileName());
929  }
Class ilObjFile.
static makeDir($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:
+ Here is the caller graph for this function:

◆ exportHTMLGlossaryTerms()

ilObjGlossary::exportHTMLGlossaryTerms ( $a_glo_gui,
  $a_target_dir 
)

export glossary terms

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

References $_GET, $file, $ilUser, ilObjFile\_getFilesOfObject(), ilObjMediaObject\_getMobsOfObject(), array, ilGlossaryDefinition\getDefinitionList(), getTermList(), and getTitle().

Referenced by exportHTML().

779  {
780  global $ilUser;
781 
782  include_once("./Services/COPage/classes/class.ilCOPageHTMLExport.php");
783  $copage_export = new ilCOPageHTMLExport($a_target_dir);
784  $copage_export->exportSupportScripts();
785 
786  // index.html file
787  $a_glo_gui->tpl = new ilTemplate("tpl.main.html", true, true);
788  $style_name = $ilUser->prefs["style"].".css";;
789  $a_glo_gui->tpl->setVariable("LOCATION_STYLESHEET","./".$style_name);
790  $a_glo_gui->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
791  $a_glo_gui->tpl->setTitle($this->getTitle());
792 
793  $content = $a_glo_gui->listTerms();
794  $file = $a_target_dir."/index.html";
795 
796  // open file
797  if (!($fp = @fopen($file,"w+")))
798  {
799  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
800  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
801  }
802  chmod($file, 0770);
803  fwrite($fp, $content);
804  fclose($fp);
805 
806  $terms = $this->getTermList();
807 
808  $this->offline_mobs = array();
809  $this->offline_files = array();
810 
811  foreach($terms as $term)
812  {
813  $a_glo_gui->tpl = new ilTemplate("tpl.main.html", true, true);
814  $a_glo_gui->tpl = $copage_export->getPreparedMainTemplate();
815  //$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
816 
817  // set style
818  $style_name = $ilUser->prefs["style"].".css";;
819  $a_glo_gui->tpl->setVariable("LOCATION_STYLESHEET","./".$style_name);
820 
821  $_GET["term_id"] = $term["id"];
822  $_GET["frame"] = "_blank";
823  $content = $a_glo_gui->listDefinitions($_GET["ref_id"],$term["id"],false);
824  $file = $a_target_dir."/term_".$term["id"].".html";
825 
826  // open file
827  if (!($fp = @fopen($file,"w+")))
828  {
829  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
830  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
831  }
832  chmod($file, 0770);
833  fwrite($fp, $content);
834  fclose($fp);
835 
836  // store linked/embedded media objects of glosssary term
837  include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
838  $defs = ilGlossaryDefinition::getDefinitionList($term["id"]);
839  foreach($defs as $def)
840  {
841  $def_mobs = ilObjMediaObject::_getMobsOfObject("gdf:pg", $def["id"]);
842  foreach($def_mobs as $def_mob)
843  {
844  $this->offline_mobs[$def_mob] = $def_mob;
845  }
846 
847  // get all files of page
848  include_once("./Modules/File/classes/class.ilObjFile.php");
849  $def_files = ilObjFile::_getFilesOfObject("gdf:pg", $def["id"]);
850  $this->offline_files = array_merge($this->offline_files, $def_files);
851 
852  }
853  }
854  }
static _getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
static getDefinitionList($a_term_id)
static
HTML export class for pages.
$_GET["client_id"]
getTermList($searchterm="", $a_letter="", $a_def="", $a_tax_node=0, $a_include_offline_childs=false, $a_add_amet_fields=false, array $a_amet_filter=null, $a_omit_virtual=false, $a_include_references=false)
Get term list.
getTitle()
get title of glossary object
special template class to simplify handling of ITX/PEAR
$ilUser
Definition: imgupload.php:18
static _getFilesOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_usage_lang="-")
get all files of an object
Create styles array
The data for the language used.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportHTMLMOB()

ilObjGlossary::exportHTMLMOB (   $a_target_dir,
$a_glo_gui,
  $a_mob_id 
)

export media object to html

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

References $_GET, $file, $tpl, ilUtil\getWebspaceDir(), ilUtil\makeDir(), and ilUtil\rCopy().

Referenced by exportHTML().

860  {
861  global $tpl;
862 
863  $mob_dir = $a_target_dir."/mobs";
864 
865  $source_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob_id;
866  if (@is_dir($source_dir))
867  {
868  ilUtil::makeDir($mob_dir."/mm_".$a_mob_id);
869  ilUtil::rCopy($source_dir, $mob_dir."/mm_".$a_mob_id);
870  }
871 
872  $tpl = new ilTemplate("tpl.main.html", true, true);
873  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
874  $_GET["obj_type"] = "MediaObject";
875  $_GET["mob_id"] = $a_mob_id;
876  $_GET["cmd"] = "";
877  $content = $a_glo_gui->media();
878  $file = $a_target_dir."/media_".$a_mob_id.".html";
879 
880  // open file
881  if (!($fp = @fopen($file,"w+")))
882  {
883  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
884  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
885  }
886  chmod($file, 0770);
887  fwrite($fp, $content);
888  fclose($fp);
889 
890  // fullscreen
891  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
892  $mob_obj = new ilObjMediaObject($a_mob_id);
893  if ($mob_obj->hasFullscreenItem())
894  {
895  $tpl = new ilTemplate("tpl.main.html", true, true);
896  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
897  $_GET["mob_id"] = $a_mob_id;
898  $_GET["cmd"] = "fullscreen";
899  $content = $a_glo_gui->fullscreen();
900  $file = $a_target_dir."/fullscreen_".$a_mob_id.".html";
901 
902  // open file
903  if (!($fp = @fopen($file,"w+")))
904  {
905  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
906  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
907  }
908  chmod($file, 0770);
909  fwrite($fp, $content);
910  fclose($fp);
911  }
912  }
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
special template class to simplify handling of ITX/PEAR
Class ilObjMediaObject.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static getWebspaceDir($mode="filesystem")
get webspace directory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXML()

ilObjGlossary::exportXML ( $a_xml_writer,
  $a_inst,
  $a_target_dir,
$expLog 
)

export object to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

References $ilBench, array, ilPCFileList\collectFileItems(), date, exportFileItems(), exportXMLGlossaryItems(), exportXMLMediaObjects(), exportXMLMetaData(), ilGlossaryDefinition\getDefinitionList(), and getTermList().

939  {
940  global $ilBench;
941 
942  // export glossary
943  $attrs = array();
944  $attrs["Type"] = "Glossary";
945  $a_xml_writer->xmlStartTag("ContentObject", $attrs);
946 
947  // MetaData
948  $this->exportXMLMetaData($a_xml_writer);
949 
950  // collect media objects
951  $terms = $this->getTermList();
952  $this->mob_ids = array();
953  $this->file_ids = array();
954  foreach ($terms as $term)
955  {
956  include_once "./Modules/Glossary/classes/class.ilGlossaryDefinition.php";
957 
958  $defs = ilGlossaryDefinition::getDefinitionList($term[id]);
959 
960  foreach($defs as $def)
961  {
962  $this->page_object = new ilGlossaryDefPage($def["id"]);
963  $this->page_object->buildDom();
964  $this->page_object->insertInstIntoIDs(IL_INST_ID);
965  $mob_ids = $this->page_object->collectMediaObjects(false);
966  include_once("./Services/COPage/classes/class.ilPCFileList.php");
967  $file_ids = ilPCFileList::collectFileItems($this->page_object, $this->page_object->getDomDoc());
968  foreach($mob_ids as $mob_id)
969  {
970  $this->mob_ids[$mob_id] = $mob_id;
971  }
972  foreach($file_ids as $file_id)
973  {
974  $this->file_ids[$file_id] = $file_id;
975  }
976  }
977  }
978 
979  // export media objects
980  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Media Objects");
981  $ilBench->start("GlossaryExport", "exportMediaObjects");
982  $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
983  $ilBench->stop("GlossaryExport", "exportMediaObjects");
984  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Media Objects");
985 
986  // FileItems
987  $expLog->write(date("[y-m-d H:i:s] ")."Start Export File Items");
988  $ilBench->start("ContentObjectExport", "exportFileItems");
989  $this->exportFileItems($a_target_dir, $expLog);
990  $ilBench->stop("ContentObjectExport", "exportFileItems");
991  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export File Items");
992 
993  // Glossary
994  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Glossary Items");
995  $ilBench->start("GlossaryExport", "exportGlossaryItems");
996  $this->exportXMLGlossaryItems($a_xml_writer, $a_inst, $expLog);
997  $ilBench->stop("GlossaryExport", "exportGlossaryItems");
998  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Glossary Items");
999 
1000  $a_xml_writer->xmlEndTag("ContentObject");
1001  }
static getDefinitionList($a_term_id)
static
exportXMLGlossaryItems(&$a_xml_writer, $a_inst, &$expLog)
export page objects to xml (see ilias_co.dtd)
getTermList($searchterm="", $a_letter="", $a_def="", $a_tax_node=0, $a_include_offline_childs=false, $a_add_amet_fields=false, array $a_amet_filter=null, $a_omit_virtual=false, $a_include_references=false)
Get term list.
exportXMLMetaData(&$a_xml_writer)
export content objects meta data to xml (see ilias_co.dtd)
exportXMLMediaObjects(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
export media objects to xml (see ilias_co.dtd)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
static collectFileItems($a_page, $a_domdoc)
Get all file items that are used within the page.
Glossary definition page object.
Create styles array
The data for the language used.
global $ilBench
Definition: ilias.php:18
exportFileItems($a_target_dir, &$expLog)
export files of file itmes
+ Here is the call graph for this function:

◆ exportXMLGlossaryItems()

ilObjGlossary::exportXMLGlossaryItems ( $a_xml_writer,
  $a_inst,
$expLog 
)

export page objects to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

References $ilBench, array, date, exportXMLMetaData(), and getTermList().

Referenced by exportXML().

1010  {
1011  global $ilBench;
1012 
1013  $attrs = array();
1014  $a_xml_writer->xmlStartTag("Glossary", $attrs);
1015 
1016  // MetaData
1017  $this->exportXMLMetaData($a_xml_writer);
1018 
1019  $terms = $this->getTermList();
1020 
1021  // export glossary terms
1022  reset($terms);
1023  foreach ($terms as $term)
1024  {
1025  $ilBench->start("GlossaryExport", "exportGlossaryItem");
1026  $expLog->write(date("[y-m-d H:i:s] ")."Page Object ".$page["obj_id"]);
1027 
1028  // export xml to writer object
1029  $ilBench->start("GlossaryExport", "exportGlossaryItem_getGlossaryTerm");
1030  $glo_term = new ilGlossaryTerm($term["id"]);
1031  $ilBench->stop("GlossaryExport", "exportGlossaryItem_getGlossaryTerm");
1032  $ilBench->start("GlossaryExport", "exportGlossaryItem_XML");
1033  $glo_term->exportXML($a_xml_writer, $a_inst);
1034  $ilBench->stop("GlossaryExport", "exportGlossaryItem_XML");
1035 
1036  unset($glo_term);
1037 
1038  $ilBench->stop("GlossaryExport", "exportGlossaryItem");
1039  }
1040 
1041  $a_xml_writer->xmlEndTag("Glossary");
1042  }
Class ilGlossaryTerm.
getTermList($searchterm="", $a_letter="", $a_def="", $a_tax_node=0, $a_include_offline_childs=false, $a_add_amet_fields=false, array $a_amet_filter=null, $a_omit_virtual=false, $a_include_references=false)
Get term list.
exportXMLMetaData(&$a_xml_writer)
export content objects meta data to xml (see ilias_co.dtd)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Create styles array
The data for the language used.
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLMediaObjects()

ilObjGlossary::exportXMLMediaObjects ( $a_xml_writer,
  $a_inst,
  $a_target_dir,
$expLog 
)

export media objects to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

References date.

Referenced by exportXML().

1066  {
1067  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1068 
1069  foreach ($this->mob_ids as $mob_id)
1070  {
1071  $expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
1072  $media_obj = new ilObjMediaObject($mob_id);
1073  $media_obj->exportXML($a_xml_writer, $a_inst);
1074  $media_obj->exportFiles($a_target_dir);
1075  unset($media_obj);
1076  }
1077  }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Class ilObjMediaObject.
+ Here is the caller graph for this function:

◆ exportXMLMetaData()

ilObjGlossary::exportXMLMetaData ( $a_xml_writer)

export content objects meta data to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

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

Referenced by exportXML(), and exportXMLGlossaryItems().

1051  {
1052  include_once("Services/MetaData/classes/class.ilMD2XML.php");
1053  $md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
1054  $md2xml->setExportMode(true);
1055  $md2xml->startExport();
1056  $a_xml_writer->appendXML($md2xml->getXML());
1057  }
getId()
get object id public
getType()
get object type public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAdvMDSubItemTitle()

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

Implements ilAdvancedMetaDataSubItems.

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

References ilObject\$lng, and ilGlossaryTerm\_lookGlossaryTerm().

1327  {
1328  global $lng;
1329 
1330  if($a_sub_type == "term")
1331  {
1332  $lng->loadLanguageModule("glo");
1333 
1334  include_once "Modules/Glossary/classes/class.ilGlossaryTerm.php";
1335  return $lng->txt("glo_term").' "'. ilGlossaryTerm::_lookGlossaryTerm($a_sub_id).'"';
1336  }
1337  }
static _lookGlossaryTerm($term_id)
get glossary term
+ Here is the call graph for this function:

◆ getAllGlossaryIds()

ilObjGlossary::getAllGlossaryIds (   $a_include_offline_childs = false)

Get all glossary ids.

Parameters

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

References array, ilObject\getId(), ilObject\getRefId(), getVirtualMode(), isVirtual(), and removeOfflineGlossaries().

Referenced by getFirstLetters(), and getTermList().

505  {
506  global $tree;
507 
508  if ($this->isVirtual())
509  {
510  $glo_ids = array();
511 
512  $virtual_mode = $this->getRefId() ? $this->getVirtualMode() : '';
513  switch ($virtual_mode)
514  {
515  case "level":
516  $glo_arr = $tree->getChildsByType($tree->getParentId($this->getRefId()),"glo");
517  $glo_ids[] = $this->getId();
518  foreach ($glo_arr as $glo)
519  {
520  {
521  $glo_ids[] = $glo['obj_id'];
522  }
523  }
524  if (!$a_include_offline_childs)
525  {
526  $glo_ids = ilObjGlossary::removeOfflineGlossaries($glo_ids);
527  }
528  // always show entries of current glossary (if no permission is given, user will not come to the presentation screen)
529  // see bug #14477
530  if (!in_array($this->getId(), $glo_ids))
531  {
532  $glo_ids[] = $this->getId();
533  }
534  break;
535 
536  case "subtree":
537  $subtree_nodes = $tree->getSubTree($tree->getNodeData($tree->getParentId($this->getRefId())));
538 
539  foreach ($subtree_nodes as $node)
540  {
541  if ($node['type'] == 'glo')
542  {
543  $glo_ids[] = $node['obj_id'];
544  }
545  }
546  if (!$a_include_offline_childs)
547  {
548  $glo_ids = ilObjGlossary::removeOfflineGlossaries($glo_ids);
549  }
550  // always show entries of current glossary (if no permission is given, user will not come to the presentation screen)
551  // see bug #14477
552  if (!in_array($this->getId(), $glo_ids))
553  {
554  $glo_ids[] = $this->getId();
555  }
556  break;
557 
558  // fallback to none virtual mode in case of error
559  default:
560  $glo_ids[] = $this->getId();
561  break;
562  }
563  }
564  else
565  {
566  $glo_ids = $this->getId();
567  }
568 
569  return $glo_ids;
570  }
removeOfflineGlossaries($a_glo_ids)
Remove offline glossaries from obj id array.
getVirtualMode()
get glossary type (normal or virtual)
getId()
get object id public
Create styles array
The data for the language used.
getRefId()
get reference id public
isVirtual()
returns true if glossary type is virtual (any mode)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAutoGlossaries()

ilObjGlossary::getAutoGlossaries ( )

Get auto glossaries.

Returns
array int

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

References $auto_glossaries.

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

371  {
372  return $this->auto_glossaries;
373  }
+ Here is the caller graph for this function:

◆ getDeletionDependencies()

static ilObjGlossary::getDeletionDependencies (   $a_obj_id)
static

Get deletion dependencies.

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

References ilObject\$lng, array, and ilObjSAHSLearningModule\getScormModulesForGlossary().

1175  {
1176  global $lng;
1177 
1178  $dep = array();
1179  include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
1181  foreach ($sms as $sm)
1182  {
1183  $lng->loadLanguageModule("content");
1184  $dep[$sm] = $lng->txt("glo_used_in_scorm");
1185  }
1186 //echo "-".$a_obj_id."-";
1187 //var_dump($dep);
1188  return $dep;
1189  }
Create styles array
The data for the language used.
static getScormModulesForGlossary($a_glo_id)
Get SCORM modules that assign a certain glossary.
+ Here is the call graph for this function:

◆ getDescription()

ilObjGlossary::getDescription ( )

get description of glossary object

Returns
string description

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

Referenced by cloneObject().

121  {
122  return parent::getDescription();
123  }
+ Here is the caller graph for this function:

◆ getExportDirectory()

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

Get export directory of glossary.

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

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

Referenced by exportHTML().

626  {
627  include_once("./Services/Export/classes/class.ilExport.php");
628  return ilExport::_getExportDirectory($this->getId(), $a_type, $this->getType());
629  }
$a_type
Definition: workflow.php:93
getId()
get object id public
getType()
get object type public
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExportFiles()

ilObjGlossary::getExportFiles ( )

Get export files.

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

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

635  {
636  include_once("./Services/Export/classes/class.ilExport.php");
637  return ilExport::_getExportFiles($this->getId(), array("xml", "html"), $this->getType());
638  }
static _getExportFiles($a_obj_id, $a_export_types="", $a_obj_type="")
Get Export Files for a repository object.
getId()
get object id public
getType()
get object type public
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getFirstLetters()

ilObjGlossary::getFirstLetters (   $a_tax_node = 0)

Get term list.

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

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

492  {
493  $glo_ids = $this->getAllGlossaryIds();
494  $first_letters = ilGlossaryTerm::getFirstLetters($glo_ids, $a_tax_node);
495  return $first_letters;
496  }
static getFirstLetters($a_glo_id, $a_tax_node=0)
Get all terms for given set of glossary ids.
getAllGlossaryIds($a_include_offline_childs=false)
Get all glossary ids.
+ Here is the call graph for this function:

◆ getImportDirectory()

ilObjGlossary::getImportDirectory ( )

get import directory of glossary

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

References ilUtil\getDataDir().

607  {
608  $export_dir = ilUtil::getDataDir()."/glo_data"."/glo_".$this->getId()."/import";
609 
610  return $export_dir;
611  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:

◆ getOnline()

ilObjGlossary::getOnline ( )

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

Referenced by cloneObject().

238  {
239  return $this->online;
240  }
+ Here is the caller graph for this function:

◆ getPresentationMode()

ilObjGlossary::getPresentationMode ( )

Get presentation mode.

Returns
string presentation mode

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

Referenced by cloneObject(), and update().

206  {
207  return $this->pres_mode;
208  }
+ Here is the caller graph for this function:

◆ getPublicExportFile()

ilObjGlossary::getPublicExportFile (   $a_type)

get public export file

Parameters
string$a_typetype ("xml" / "html")
Returns
string $a_file file name

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

References $a_type.

Referenced by update().

659  {
660  return $this->public_export_file[$a_type];
661  }
$a_type
Definition: workflow.php:93
+ Here is the caller graph for this function:

◆ getShowTaxonomy()

ilObjGlossary::getShowTaxonomy ( )

Get show taxonomy.

Returns
bool show taxonomy

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

Referenced by update().

339  {
340  return $this->show_tax;
341  }
+ Here is the caller graph for this function:

◆ getSnippetLength()

ilObjGlossary::getSnippetLength ( )

Get snippet length.

Returns
int snippet length

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

Referenced by cloneObject(), and update().

226  {
227  return ($this->snippet_length > 0)
228  ? $this->snippet_length
229  : null;
230  }
+ Here is the caller graph for this function:

◆ getStyleSheetId()

ilObjGlossary::getStyleSheetId ( )

Get ID of assigned style sheet object.

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

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

310  {
311  return $this->style_id;
312  }
+ Here is the caller graph for this function:

◆ getTaxonomyId()

ilObjGlossary::getTaxonomyId ( )

Get taxonomy.

Returns
int taxononmy ID

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

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

Referenced by cloneObject().

1197  {
1198  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1199  $tax_ids = ilObjTaxonomy::getUsageOfObject($this->getId());
1200  if (count($tax_ids) > 0)
1201  {
1202  // glossaries handle max. one taxonomy
1203  return $tax_ids[0];
1204  }
1205  return 0;
1206  }
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTermList()

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

Get term list.

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

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

Referenced by delete(), exportHTMLGlossaryTerms(), exportXML(), and exportXMLGlossaryItems().

474  {
475  if ($a_omit_virtual)
476  {
477  $glo_ids[] = $this->getId();
478  }
479  else
480  {
481  $glo_ids = $this->getAllGlossaryIds($a_include_offline_childs);
482  }
483  $list = ilGlossaryTerm::getTermList($glo_ids, $searchterm, $a_letter, $a_def, $a_tax_node,
484  $a_add_amet_fields, $a_amet_filter, $a_include_references);
485  return $list;
486  }
getId()
get object id public
static getTermList($a_glo_id, $searchterm="", $a_first_letter="", $a_def="", $a_tax_node=0, $a_add_amet_fields=false, array $a_amet_filter=null, $a_include_references=false)
Get all terms for given set of glossary ids.
getAllGlossaryIds($a_include_offline_childs=false)
Get all glossary ids.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTitle()

ilObjGlossary::getTitle ( )

get title of glossary object

Returns
string title

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

Referenced by exportHTMLGlossaryTerms().

177  {
178  return parent::getTitle();
179  }
+ Here is the caller graph for this function:

◆ getVirtualMode()

ilObjGlossary::getVirtualMode ( )

get glossary type (normal or virtual)

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

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

159  {
160  return $this->virtual_mode;
161  }
+ Here is the caller graph for this function:

◆ getXMLZip()

ilObjGlossary::getXMLZip ( )

Get zipped xml file for glossary.

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

1164  {
1165  include_once("./Modules/Glossary/classes/class.ilGlossaryExport.php");
1166  $glo_exp = new ilGlossaryExport($this);
1167  return $glo_exp->buildExportFile();
1168  }
Export class for content objects.

◆ isActiveDownloads()

ilObjGlossary::isActiveDownloads ( )

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

Referenced by update().

302  {
303  return $this->downloads_active;
304  }
+ Here is the caller graph for this function:

◆ isActiveGlossaryMenu()

ilObjGlossary::isActiveGlossaryMenu ( )

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

Referenced by update().

292  {
293  return $this->glo_menu_active;
294  }
+ Here is the caller graph for this function:

◆ isVirtual()

ilObjGlossary::isVirtual ( )

returns true if glossary type is virtual (any mode)

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

Referenced by delete(), and getAllGlossaryIds().

167  {
168  return $this->virtual;
169  }
+ Here is the caller graph for this function:

◆ lookup()

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

Lookup glossary property.

Parameters
intglossary id
stringproperty

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

References $ilDB.

Referenced by lookupSnippetLength().

264  {
265  global $ilDB;
266 
267  $set = $ilDB->query("SELECT $a_property FROM glossary WHERE id = ".
268  $ilDB->quote($a_id, "integer"));
269  $rec = $ilDB->fetchAssoc($set);
270 
271  return $rec[$a_property];
272  }
global $ilDB
+ Here is the caller graph for this function:

◆ lookupAutoGlossaries()

static ilObjGlossary::lookupAutoGlossaries (   $a_id)
static

Lookup auto glossaries.

Parameters

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

References $ilDB, and array.

Referenced by ilGlossaryDefPage\beforePageContentUpdate().

454  {
455  global $ilDB;
456 
457  // read auto glossaries
458  $set = $ilDB->query("SELECT * FROM glo_glossaries ".
459  " WHERE id = ".$ilDB->quote($a_id, "integer")
460  );
461  $glos = array();
462  while ($rec = $ilDB->fetchAssoc($set))
463  {
464  $glos[] = $rec["glo_id"];
465  }
466  return $glos;
467  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ lookupSnippetLength()

static ilObjGlossary::lookupSnippetLength (   $a_id)
static

Lookup snippet length.

Parameters
intglossary id
Returns
int snippet length

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

References lookup().

Referenced by ilGlossaryDefinition\shortenShortText().

281  {
282  return ilObjGlossary::lookup($a_id, "snippet_length");
283  }
static lookup($a_id, $a_property)
Lookup glossary property.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modifyExportIdentifier()

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

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

References ilObject\getId().

1102  {
1103  if ($a_tag == "Identifier" && $a_param == "Entry")
1104  {
1105  $a_value = "il_".IL_INST_ID."_glo_".$this->getId();
1106  }
1107 
1108  return $a_value;
1109  }
getId()
get object id public
+ Here is the call graph for this function:

◆ read()

ilObjGlossary::read ( )

read data of content object

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

References $ilDB, array, ilObject\getId(), ilObjStyleSheet\lookupObjectStyle(), setActiveDownloads(), setActiveGlossaryMenu(), setAutoGlossaries(), setOnline(), setPresentationMode(), setPublicExportFile(), setShowTaxonomy(), setSnippetLength(), setStyleSheetId(), setVirtualMode(), and ilUtil\yn2tf().

78  {
79  global $ilDB;
80 
81  parent::read();
82 # echo "Glossary<br>\n";
83 
84  $q = "SELECT * FROM glossary WHERE id = ".
85  $ilDB->quote($this->getId(), "integer");
86  $gl_set = $ilDB->query($q);
87  $gl_rec = $ilDB->fetchAssoc($gl_set);
88  $this->setOnline(ilUtil::yn2tf($gl_rec["is_online"]));
89  $this->setVirtualMode($gl_rec["virtual"]);
90  $this->setPublicExportFile("xml", $gl_rec["public_xml_file"]);
91  $this->setPublicExportFile("html", $gl_rec["public_html_file"]);
92  $this->setActiveGlossaryMenu(ilUtil::yn2tf($gl_rec["glo_menu_active"]));
93  $this->setActiveDownloads(ilUtil::yn2tf($gl_rec["downloads_active"]));
94  $this->setPresentationMode($gl_rec["pres_mode"]);
95  $this->setSnippetLength($gl_rec["snippet_length"]);
96  $this->setShowTaxonomy($gl_rec["show_tax"]);
97 
98  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
100 
101  // read auto glossaries
102  $set = $ilDB->query("SELECT * FROM glo_glossaries ".
103  " WHERE id = ".$ilDB->quote($this->getId(), "integer")
104  );
105  $glos = array();
106  while ($rec = $ilDB->fetchAssoc($set))
107  {
108  $glos[] = $rec["glo_id"];
109  }
110  $this->setAutoGlossaries($glos);
111 
112 
113  }
setStyleSheetId($a_style_id)
Set ID of assigned style sheet object.
setAutoGlossaries($a_val)
Set auto glossaries.
setShowTaxonomy($a_val)
Set show taxonomy.
setPresentationMode($a_val)
Set presentation mode.
setPublicExportFile($a_type, $a_file)
specify public export file for type
static lookupObjectStyle($a_obj_id)
Lookup object style.
setActiveGlossaryMenu($a_act_glo_menu)
setVirtualMode($a_mode)
set glossary type (virtual: fixed/level/subtree, normal:none)
getId()
get object id public
Create styles array
The data for the language used.
global $ilDB
static yn2tf($a_yn)
convert "y"/"n" to true/false
setSnippetLength($a_val)
Set snippet length.
+ Here is the call graph for this function:

◆ removeAutoGlossary()

ilObjGlossary::removeAutoGlossary (   $a_glo_id)

Remove auto glossary.

Parameters

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

References array, getAutoGlossaries(), and setAutoGlossaries().

382  {
383  $glo_ids = array();
384  foreach($this->getAutoGlossaries() as $g)
385  {
386  if ($g != $a_glo_id)
387  {
388  $glo_ids[] = $g;
389  }
390  }
391  $this->setAutoGlossaries($glo_ids);
392  }
setAutoGlossaries($a_val)
Set auto glossaries.
Create styles array
The data for the language used.
getAutoGlossaries()
Get auto glossaries.
+ Here is the call graph for this function:

◆ removeOfflineGlossaries()

ilObjGlossary::removeOfflineGlossaries (   $a_glo_ids)

Remove offline glossaries from obj id array.

Parameters

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

References $ilDB, and array.

Referenced by getAllGlossaryIds().

1311  {
1312  global $ilDB;
1313 
1314  $set = $ilDB->query("SELECT id FROM glossary ".
1315  " WHERE ".$ilDB->in("id", $a_glo_ids, false, "integer").
1316  " AND is_online = ".$ilDB->quote("y", "text")
1317  );
1318  $glo_ids = array();
1319  while ($rec = $ilDB->fetchAssoc($set))
1320  {
1321  $glo_ids[] = $rec["id"];
1322  }
1323  return $glo_ids;
1324  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ setActiveDownloads()

ilObjGlossary::setActiveDownloads (   $a_down)

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

Referenced by read().

297  {
298  $this->downloads_active = $a_down;
299  }
+ Here is the caller graph for this function:

◆ setActiveGlossaryMenu()

ilObjGlossary::setActiveGlossaryMenu (   $a_act_glo_menu)

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

Referenced by read().

287  {
288  $this->glo_menu_active = $a_act_glo_menu;
289  }
+ Here is the caller graph for this function:

◆ setAutoGlossaries()

ilObjGlossary::setAutoGlossaries (   $a_val)

Set auto glossaries.

Parameters
array$a_valint

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

References ilObject\_lookupType(), and array.

Referenced by read(), and removeAutoGlossary().

349  {
350  $this->auto_glossaries = array();
351  if (is_array($a_val))
352  {
353  foreach ($a_val as $v)
354  {
355  $v = (int) $v;
356  if ($v > 0 && ilObject::_lookupType($v) == "glo" &&
357  !in_array($v, $this->auto_glossaries))
358  {
359  $this->auto_glossaries[] = $v;
360  }
361  }
362  }
363  }
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDescription()

ilObjGlossary::setDescription (   $a_description)

set description of glossary object

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

129  {
130  parent::setDescription($a_description);
131  }

◆ setOnline()

ilObjGlossary::setOnline (   $a_online)

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

Referenced by read().

233  {
234  $this->online = $a_online;
235  }
+ Here is the caller graph for this function:

◆ setPresentationMode()

ilObjGlossary::setPresentationMode (   $a_val)

Set presentation mode.

Parameters
stringpresentation mode

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

Referenced by create(), and read().

196  {
197  $this->pres_mode = $a_val;
198  }
+ Here is the caller graph for this function:

◆ setPublicExportFile()

ilObjGlossary::setPublicExportFile (   $a_type,
  $a_file 
)

specify public export file for type

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

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

References $a_type.

Referenced by read().

647  {
648  $this->public_export_file[$a_type] = $a_file;
649  }
$a_type
Definition: workflow.php:93
+ Here is the caller graph for this function:

◆ setShowTaxonomy()

ilObjGlossary::setShowTaxonomy (   $a_val)

Set show taxonomy.

Parameters
bool$a_valshow taxonomy

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

Referenced by read().

329  {
330  $this->show_tax = $a_val;
331  }
+ Here is the caller graph for this function:

◆ setSnippetLength()

ilObjGlossary::setSnippetLength (   $a_val)

Set snippet length.

Parameters
intsnippet length

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

Referenced by create(), and read().

216  {
217  $this->snippet_length = $a_val;
218  }
+ Here is the caller graph for this function:

◆ setStyleSheetId()

ilObjGlossary::setStyleSheetId (   $a_style_id)

Set ID of assigned style sheet object.

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

Referenced by read().

318  {
319  $this->style_id = $a_style_id;
320  }
+ Here is the caller graph for this function:

◆ setTitle()

ilObjGlossary::setTitle (   $a_title)

set title of glossary object

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

185  {
186  parent::setTitle($a_title);
187 // $this->meta_data->setTitle($a_title);
188  }

◆ setVirtualMode()

ilObjGlossary::setVirtualMode (   $a_mode)

set glossary type (virtual: fixed/level/subtree, normal:none)

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

Referenced by read().

138  {
139  switch ($a_mode)
140  {
141  case "level":
142  case "subtree":
143  // case "fixed":
144  $this->virtual_mode = $a_mode;
145  $this->virtual = true;
146  break;
147 
148  default:
149  $this->virtual_mode = "none";
150  $this->virtual = false;
151  break;
152  }
153  }
+ Here is the caller graph for this function:

◆ update()

ilObjGlossary::update ( )

Update object.

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

References $ilDB, ilObject\getId(), getPresentationMode(), getPublicExportFile(), getShowTaxonomy(), getSnippetLength(), getStyleSheetId(), getVirtualMode(), isActiveDownloads(), isActiveGlossaryMenu(), ilUtil\tf2yn(), updateAutoGlossaries(), ilObject\updateMetaData(), and ilObjStyleSheet\writeStyleUsage().

398  {
399  global $ilDB;
400 
401  $this->updateMetaData();
402 
403  $ilDB->manipulate("UPDATE glossary SET ".
404  " is_online = ".$ilDB->quote(ilUtil::tf2yn($this->getOnline()), "text").",".
405  " glossary.virtual = ".$ilDB->quote($this->getVirtualMode(), "text").",".
406  " public_xml_file = ".$ilDB->quote($this->getPublicExportFile("xml"), "text").",".
407  " public_html_file = ".$ilDB->quote($this->getPublicExportFile("html"), "text").",".
408  " glo_menu_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveGlossaryMenu()), "text").",".
409  " downloads_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveDownloads()), "text").", ".
410  " pres_mode = ".$ilDB->quote($this->getPresentationMode(), "text").", ".
411  " show_tax = ".$ilDB->quote((int) $this->getShowTaxonomy(), "integer").", ".
412  " snippet_length = ".$ilDB->quote((int)$this->getSnippetLength(), "integer")." ".
413  " WHERE id = ".$ilDB->quote($this->getId(), "integer"));
414 
415  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
417 
418  $this->updateAutoGlossaries();
419  parent::update();
420  }
static tf2yn($a_tf)
convert true/false to "y"/"n"
updateMetaData()
update meta data entry
getPublicExportFile($a_type)
get public export file
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
getVirtualMode()
get glossary type (normal or virtual)
getId()
get object id public
updateAutoGlossaries()
Update auto glossaries.
getPresentationMode()
Get presentation mode.
getSnippetLength()
Get snippet length.
getShowTaxonomy()
Get show taxonomy.
getStyleSheetId()
Get ID of assigned style sheet object.
global $ilDB
+ Here is the call graph for this function:

◆ updateAutoGlossaries()

ilObjGlossary::updateAutoGlossaries ( )

Update auto glossaries.

Parameters

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

References $ilDB, and getAutoGlossaries().

Referenced by create(), and update().

430  {
431  global $ilDB;
432 
433  // update auto glossaries
434  $ilDB->manipulate("DELETE FROM glo_glossaries WHERE ".
435  " id = ".$ilDB->quote($this->getId(), "integer")
436  );
437  foreach ($this->getAutoGlossaries() as $glo_id)
438  {
439  $ilDB->manipulate("INSERT INTO glo_glossaries ".
440  "(id, glo_id) VALUES (".
441  $ilDB->quote($this->getId(), "integer").",".
442  $ilDB->quote($glo_id, "integer").
443  ")");
444  }
445  }
getAutoGlossaries()
Get auto glossaries.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $auto_glossaries

ilObjGlossary::$auto_glossaries = array()

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

Referenced by getAutoGlossaries().


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