ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
ilObjGlossary Class Reference

Class ilObjGlossary. More...

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

Public Member Functions

 ilObjGlossary ($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 ()
 
 _lookupOnline ($a_id)
 check wether content object is online More...
 
 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...
 
 update ()
 Update object. 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)
 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...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event happend, each object may decide how it reacts. More...
 
 getXMLZip ()
 Get zipped xml file for glossary. More...
 
 getTaxonomyId ()
 Get taxonomy. More...
 
 cloneObject ($a_target_id, $a_copy_id=0)
 Clone glossary. More...
 
 removeOfflineGlossaries ($a_glo_ids)
 Remove offline glossaries from obj id array. More...
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 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 ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 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...
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) 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...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type 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...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. 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...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. More...
 

Static Public Member Functions

static lookupSnippetLength ($a_id)
 Lookup snippet length. 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 _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id 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 hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Static Protected Member Functions

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

Additional Inherited Members

- 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
 
 $obj_data_record
 object_data record 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.

Member Function Documentation

◆ _lookupOnline()

ilObjGlossary::_lookupOnline (   $a_id)

check wether content object is online

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

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

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

227  {
228  global $ilDB;
229 
230  $q = "SELECT is_online FROM glossary WHERE id = ".
231  $ilDB->quote($a_id, "integer");
232  $lm_set = $ilDB->query($q);
233  $lm_rec = $ilDB->fetchAssoc($lm_set);
234 
235  return ilUtil::yn2tf($lm_rec["is_online"]);
236  }
$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:

◆ cloneObject()

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

Clone glossary.

Parameters
inttarget ref_id
intcopy id

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

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

1159  {
1160  global $ilDB, $ilUser, $ilias;
1161 
1162  $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
1163  $this->cloneMetaData($new_obj);
1164 
1165  //copy online status if object is not the root copy object
1166  $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
1167 
1168  if(!$cp_options->isRootNode($this->getRefId()))
1169  {
1170  $new_obj->setOnline($this->getOnline());
1171  }
1172 
1173 // $new_obj->setTitle($this->getTitle());
1174  $new_obj->setDescription($this->getDescription());
1175  $new_obj->setVirtualMode($this->getVirtualMode());
1176  $new_obj->setPresentationMode($this->getPresentationMode());
1177  $new_obj->setSnippetLength($this->getSnippetLength());
1178  $new_obj->update();
1179 
1180  // set/copy stylesheet
1181  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1182  $style_id = $this->getStyleSheetId();
1183  if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id))
1184  {
1185  $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
1186  $new_id = $style_obj->ilClone();
1187  $new_obj->setStyleSheetId($new_id);
1188  $new_obj->update();
1189  }
1190 
1191  // copy taxonomy
1192  if (($tax_id = $this->getTaxonomyId()) > 0)
1193  {
1194  // clone it
1195  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1196  $tax = new ilObjTaxonomy($tax_id);
1197  $new_tax = $tax->cloneObject(0,0,true);
1198  $map = $tax->getNodeMapping();
1199 
1200  // assign new taxonomy to new glossary
1201  ilObjTaxonomy::saveUsage($new_tax->getId(), $new_obj->getId());
1202  }
1203 
1204  // assign new tax/new glossary
1205  // handle mapping
1206 
1207  // prepare tax node assignments objects
1208  include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
1209  if ($tax_id > 0)
1210  {
1211  $tax_ass = new ilTaxNodeAssignment("glo", $this->getId(), "term", $tax_id);
1212  $new_tax_ass = new ilTaxNodeAssignment("glo", $new_obj->getId(), "term", $new_tax->getId());
1213  }
1214 
1215  // copy terms
1216  foreach (ilGlossaryTerm::getTermList($this->getId()) as $term)
1217  {
1218  $new_term_id = ilGlossaryTerm::_copyTerm($term["id"], $new_obj->getId());
1219 
1220  // copy tax node assignments
1221  if ($tax_id > 0)
1222  {
1223  $assignmts = $tax_ass->getAssignmentsOfItem($term["id"]);
1224  foreach ($assignmts as $a)
1225  {
1226  if ($map[$a["node_id"]] > 0)
1227  {
1228  $new_tax_ass->addAssignment($map[$a["node_id"]] ,$new_term_id);
1229  }
1230  }
1231  }
1232  }
1233 
1234  return $new_obj;
1235  }
Taxonomy node <-> item assignment.
getDescription()
get description of glossary object
getVirtualMode()
get glossary type (normal or virtual)
static _getInstance($a_copy_id)
Get instance of copy wizard options.
_copyTerm($a_term_id, $a_glossary_id)
Copy a term to a glossary.
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)
Get all terms for given set of glossary ids.
getTaxonomyId()
Get taxonomy.
cloneMetaData($target_obj)
Copy meta data.
getPresentationMode()
Get presentation mode.
getSnippetLength()
Get snippet length.
_lookupStandard($a_id)
Lookup standard flag.
getStyleSheetId()
Get ID of assigned style sheet object.
global $ilUser
Definition: imgupload.php:15
static saveUsage($a_tax_id, $a_obj_id)
Save Usage.
global $ilDB
+ Here is the call graph for this function:

◆ create()

ilObjGlossary::create (   $a_upload = false)

create glossary object

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

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

37  {
38  global $ilDB;
39 
40  parent::create();
41 
42  // meta data will be created by
43  // import parser
44  if (!$a_upload)
45  {
46  $this->createMetaData();
47  }
48 
49  $ilDB->manipulate("INSERT INTO glossary (id, is_online, virtual, pres_mode, snippet_length) VALUES (".
50  $ilDB->quote($this->getId(), "integer").",".
51  $ilDB->quote("n", "text").",".
52  $ilDB->quote($this->getVirtualMode(), "text").",".
53  $ilDB->quote("table", "text").",".
54  $ilDB->quote(200, "integer").
55  ")");
56  $this->setPresentationMode("table");
57  $this->setSnippetLength(200);
58 
59  if (((int) $this->getStyleSheetId()) > 0)
60  {
61  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
63  }
64 
65  }
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
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 499 of file class.ilObjGlossary.php.

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

500  {
501  include_once("./Services/Export/classes/class.ilExport.php");
502  return ilExport::_createExportDirectory($this->getId(), $a_type, $this->getType());
503  }
_createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
Create export directory.
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 460 of file class.ilObjGlossary.php.

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

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

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

1004  {
1005  global $ilDB;
1006 
1007  // always call parent delete function first!!
1008  if (!parent::delete())
1009  {
1010  return false;
1011  }
1012 
1013  // delete terms
1014  if (!$this->isVirtual())
1015  {
1016  $terms = $this->getTermList();
1017  foreach ($terms as $term)
1018  {
1019  $term_obj =& new ilGlossaryTerm($term["id"]);
1020  $term_obj->delete();
1021  }
1022  }
1023 
1024  // delete glossary data entry
1025  $q = "DELETE FROM glossary WHERE id = ".$ilDB->quote($this->getId());
1026  $ilDB->query($q);
1027 
1028  // delete meta data
1029  $this->deleteMetaData();
1030 /*
1031  $nested = new ilNestedSetXML();
1032  $nested->init($this->getId(), $this->getType());
1033  $nested->deleteAllDBData();
1034 */
1035 
1036  return true;
1037  }
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)
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 962 of file class.ilObjGlossary.php.

Referenced by exportXML().

963  {
964  include_once("./Modules/File/classes/class.ilObjFile.php");
965 
966  foreach ($this->file_ids as $file_id)
967  {
968  $expLog->write(date("[y-m-d H:i:s] ")."File Item ".$file_id);
969  $file_obj = new ilObjFile($file_id, false);
970  $file_obj->export($a_target_dir);
971  unset($file_obj);
972  }
973  }
Class ilObjFile.
+ Here is the caller graph for this function:

◆ exportHTML()

ilObjGlossary::exportHTML (   $a_target_dir,
  $log 
)

export html package

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

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

550  {
551  global $ilias, $tpl;
552 
553  // initialize temporary target directory
554  ilUtil::delDir($a_target_dir);
555  ilUtil::makeDir($a_target_dir);
556 
557  include_once("./Services/COPage/classes/class.ilCOPageHTMLExport.php");
558  $this->co_page_html_export = new ilCOPageHTMLExport($a_target_dir);
559  $this->co_page_html_export->createDirectories();
560 
561  // export system style sheet
562  $location_stylesheet = ilUtil::getStyleSheetLocation("filesystem");
563  $style_name = $ilias->account->prefs["style"].".css";
564  copy($location_stylesheet, $a_target_dir."/".$style_name);
565  $location_stylesheet = ilUtil::getStyleSheetLocation();
566 
567  if ($this->getStyleSheetId() < 1)
568  {
569  $cont_stylesheet = "Services/COPage/css/content.css";
570  copy($cont_stylesheet, $a_target_dir."/content.css");
571  }
572  else
573  {
574  $content_style_img_dir = $a_target_dir."/images";
575  ilUtil::makeDir($content_style_img_dir);
576  $style = new ilObjStyleSheet($this->getStyleSheetId());
577  $style->writeCSSFile($a_target_dir."/content.css", "images");
578  $style->copyImagesToDir($content_style_img_dir);
579  }
580 
581  // export syntax highlighting style
582  $syn_stylesheet = ilObjStyleSheet::getSyntaxStylePath();
583  copy($syn_stylesheet, $a_target_dir."/syntaxhighlight.css");
584 
585  // get glossary presentation gui class
586  include_once("./Modules/Glossary/classes/class.ilGlossaryPresentationGUI.php");
587  $_GET["cmd"] = "nop";
588  $glo_gui =& new ilGlossaryPresentationGUI();
589  $glo_gui->setOfflineMode(true);
590  $glo_gui->setOfflineDirectory($a_target_dir);
591 
592  // could be implemented in the future if other export
593  // formats are supported (e.g. scorm)
594  //$glo_gui->setExportFormat($a_export_format);
595 
596  // export terms
597  $this->exportHTMLGlossaryTerms($glo_gui, $a_target_dir);
598 
599  // export all media objects
600  foreach ($this->offline_mobs as $mob)
601  {
602  $this->exportHTMLMOB($a_target_dir, $glo_gui, $mob, "_blank");
603  }
604  $_GET["obj_type"] = "MediaObject";
605  $_GET["obj_id"] = $a_mob_id;
606  $_GET["cmd"] = "";
607 
608  // export all file objects
609  foreach ($this->offline_files as $file)
610  {
611  $this->exportHTMLFile($a_target_dir, $file);
612  }
613 
614  // export images
615  $image_dir = $a_target_dir."/images";
616  ilUtil::makeDir($image_dir);
617  ilUtil::makeDir($image_dir."/browser");
618  copy(ilUtil::getImagePath("enlarge.svg", false, "filesystem"),
619  $image_dir."/enlarge.svg");
620  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
621  $image_dir."/browser/plus.png");
622  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
623  $image_dir."/browser/minus.png");
624  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
625  $image_dir."/browser/blank.png");
626  copy(ilUtil::getImagePath("icon_st.svg", false, "filesystem"),
627  $image_dir."/icon_st.svg");
628  copy(ilUtil::getImagePath("icon_pg.svg", false, "filesystem"),
629  $image_dir."/icon_pg.svg");
630  copy(ilUtil::getImagePath("nav_arr_L.png", false, "filesystem"),
631  $image_dir."/nav_arr_L.png");
632  copy(ilUtil::getImagePath("nav_arr_R.png", false, "filesystem"),
633  $image_dir."/nav_arr_R.png");
634 
635  // template workaround: reset of template
636  $tpl = new ilTemplate("tpl.main.html", true, true);
637  $tpl->setVariable("LOCATION_STYLESHEET",$location_stylesheet);
638  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
639 
640  // zip everything
641  if (true)
642  {
643  // zip it all
644  $date = time();
645  $zip_file = $this->getExportDirectory("html")."/".$date."__".IL_INST_ID."__".
646  $this->getType()."_".$this->getId().".zip";
647 //echo "zip-".$a_target_dir."-to-".$zip_file;
648  ilUtil::zip($a_target_dir, $zip_file);
649  ilUtil::delDir($a_target_dir);
650  }
651  }
print $file
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
getSyntaxStylePath()
get syntax style path
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 zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
getType()
get object type public
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.
Class ilObjStyleSheet.
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 796 of file class.ilObjGlossary.php.

References ilUtil\makeDir().

Referenced by exportHTML().

797  {
798  $file_dir = $a_target_dir."/files/file_".$a_file_id;
799  ilUtil::makeDir($file_dir);
800  include_once("./Modules/File/classes/class.ilObjFile.php");
801  $file_obj = new ilObjFile($a_file_id, false);
802  $source_file = $file_obj->getDirectory($file_obj->getVersion())."/".$file_obj->getFileName();
803  if (!is_file($source_file))
804  {
805  $source_file = $file_obj->getDirectory()."/".$file_obj->getFileName();
806  }
807  copy($source_file, $file_dir."/".$file_obj->getFileName());
808  }
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 657 of file class.ilObjGlossary.php.

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

Referenced by exportHTML().

658  {
659  global $ilUser;
660 
661  include_once("./Services/COPage/classes/class.ilCOPageHTMLExport.php");
662  $copage_export = new ilCOPageHTMLExport($a_target_dir);
663  $copage_export->exportSupportScripts();
664 
665  // index.html file
666  $a_glo_gui->tpl = new ilTemplate("tpl.main.html", true, true);
667  $style_name = $ilUser->prefs["style"].".css";;
668  $a_glo_gui->tpl->setVariable("LOCATION_STYLESHEET","./".$style_name);
669  $a_glo_gui->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
670  $a_glo_gui->tpl->setTitle($this->getTitle());
671 
672  $content = $a_glo_gui->listTerms();
673  $file = $a_target_dir."/index.html";
674 
675  // open file
676  if (!($fp = @fopen($file,"w+")))
677  {
678  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
679  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
680  }
681  chmod($file, 0770);
682  fwrite($fp, $content);
683  fclose($fp);
684 
685  $terms = $this->getTermList();
686 
687  $this->offline_mobs = array();
688  $this->offline_files = array();
689 
690  foreach($terms as $term)
691  {
692  $a_glo_gui->tpl = new ilTemplate("tpl.main.html", true, true);
693  $a_glo_gui->tpl = $copage_export->getPreparedMainTemplate();
694  //$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
695 
696  // set style
697  $style_name = $ilUser->prefs["style"].".css";;
698  $a_glo_gui->tpl->setVariable("LOCATION_STYLESHEET","./".$style_name);
699 
700  $_GET["term_id"] = $term["id"];
701  $_GET["frame"] = "_blank";
702  $content =& $a_glo_gui->listDefinitions($_GET["ref_id"],$term["id"],false);
703  $file = $a_target_dir."/term_".$term["id"].".html";
704 
705  // open file
706  if (!($fp = @fopen($file,"w+")))
707  {
708  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
709  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
710  }
711  chmod($file, 0770);
712  fwrite($fp, $content);
713  fclose($fp);
714 
715  // store linked/embedded media objects of glosssary term
716  include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
717  $defs = ilGlossaryDefinition::getDefinitionList($term["id"]);
718  foreach($defs as $def)
719  {
720  $def_mobs = ilObjMediaObject::_getMobsOfObject("gdf:pg", $def["id"]);
721  foreach($def_mobs as $def_mob)
722  {
723  $this->offline_mobs[$def_mob] = $def_mob;
724  }
725 
726  // get all files of page
727  include_once("./Modules/File/classes/class.ilObjFile.php");
728  $def_files = ilObjFile::_getFilesOfObject("gdf:pg", $def["id"]);
729  $this->offline_files = array_merge($this->offline_files, $def_files);
730 
731  }
732  }
733  }
print $file
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)
Get term list.
_getFilesOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_usage_lang="-")
get all files of an object
getTitle()
get title of glossary object
special template class to simplify handling of ITX/PEAR
_getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
global $ilUser
Definition: imgupload.php:15
+ 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 738 of file class.ilObjGlossary.php.

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

Referenced by exportHTML().

739  {
740  global $tpl;
741 
742  $mob_dir = $a_target_dir."/mobs";
743 
744  $source_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob_id;
745  if (@is_dir($source_dir))
746  {
747  ilUtil::makeDir($mob_dir."/mm_".$a_mob_id);
748  ilUtil::rCopy($source_dir, $mob_dir."/mm_".$a_mob_id);
749  }
750 
751  $tpl = new ilTemplate("tpl.main.html", true, true);
752  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
753  $_GET["obj_type"] = "MediaObject";
754  $_GET["mob_id"] = $a_mob_id;
755  $_GET["cmd"] = "";
756  $content =& $a_glo_gui->media();
757  $file = $a_target_dir."/media_".$a_mob_id.".html";
758 
759  // open file
760  if (!($fp = @fopen($file,"w+")))
761  {
762  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
763  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
764  }
765  chmod($file, 0770);
766  fwrite($fp, $content);
767  fclose($fp);
768 
769  // fullscreen
770  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
771  $mob_obj = new ilObjMediaObject($a_mob_id);
772  if ($mob_obj->hasFullscreenItem())
773  {
774  $tpl = new ilTemplate("tpl.main.html", true, true);
775  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
776  $_GET["mob_id"] = $a_mob_id;
777  $_GET["cmd"] = "fullscreen";
778  $content = $a_glo_gui->fullscreen();
779  $file = $a_target_dir."/fullscreen_".$a_mob_id.".html";
780 
781  // open file
782  if (!($fp = @fopen($file,"w+")))
783  {
784  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
785  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
786  }
787  chmod($file, 0770);
788  fwrite($fp, $content);
789  fclose($fp);
790  }
791  }
print $file
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 ...
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 817 of file class.ilObjGlossary.php.

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

818  {
819  global $ilBench;
820 
821  // export glossary
822  $attrs = array();
823  $attrs["Type"] = "Glossary";
824  $a_xml_writer->xmlStartTag("ContentObject", $attrs);
825 
826  // MetaData
827  $this->exportXMLMetaData($a_xml_writer);
828 
829  // collect media objects
830  $terms = $this->getTermList();
831  $this->mob_ids = array();
832  $this->file_ids = array();
833  foreach ($terms as $term)
834  {
835  include_once "./Modules/Glossary/classes/class.ilGlossaryDefinition.php";
836 
837  $defs = ilGlossaryDefinition::getDefinitionList($term[id]);
838 
839  foreach($defs as $def)
840  {
841  $this->page_object = new ilGlossaryDefPage($def["id"]);
842  $this->page_object->buildDom();
843  $this->page_object->insertInstIntoIDs(IL_INST_ID);
844  $mob_ids = $this->page_object->collectMediaObjects(false);
845  include_once("./Services/COPage/classes/class.ilPCFileList.php");
846  $file_ids = ilPCFileList::collectFileItems($this->page_object, $this->page_object->getDomDoc());
847  foreach($mob_ids as $mob_id)
848  {
849  $this->mob_ids[$mob_id] = $mob_id;
850  }
851  foreach($file_ids as $file_id)
852  {
853  $this->file_ids[$file_id] = $file_id;
854  }
855  }
856  }
857 
858  // export media objects
859  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Media Objects");
860  $ilBench->start("GlossaryExport", "exportMediaObjects");
861  $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
862  $ilBench->stop("GlossaryExport", "exportMediaObjects");
863  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Media Objects");
864 
865  // FileItems
866  $expLog->write(date("[y-m-d H:i:s] ")."Start Export File Items");
867  $ilBench->start("ContentObjectExport", "exportFileItems");
868  $this->exportFileItems($a_target_dir, $expLog);
869  $ilBench->stop("ContentObjectExport", "exportFileItems");
870  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export File Items");
871 
872  // Glossary
873  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Glossary Items");
874  $ilBench->start("GlossaryExport", "exportGlossaryItems");
875  $this->exportXMLGlossaryItems($a_xml_writer, $a_inst, $expLog);
876  $ilBench->stop("GlossaryExport", "exportGlossaryItems");
877  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Glossary Items");
878 
879  $a_xml_writer->xmlEndTag("ContentObject");
880  }
exportXMLGlossaryItems(&$a_xml_writer, $a_inst, &$expLog)
export page objects to xml (see ilias_co.dtd)
getDefinitionList($a_term_id)
static
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)
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)
static collectFileItems($a_page, $a_domdoc)
Get all file items that are used within the page.
Glossary definition page object.
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 888 of file class.ilObjGlossary.php.

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

Referenced by exportXML().

889  {
890  global $ilBench;
891 
892  $attrs = array();
893  $a_xml_writer->xmlStartTag("Glossary", $attrs);
894 
895  // MetaData
896  $this->exportXMLMetaData($a_xml_writer);
897 
898  $terms = $this->getTermList();
899 
900  // export glossary terms
901  reset($terms);
902  foreach ($terms as $term)
903  {
904  $ilBench->start("GlossaryExport", "exportGlossaryItem");
905  $expLog->write(date("[y-m-d H:i:s] ")."Page Object ".$page["obj_id"]);
906 
907  // export xml to writer object
908  $ilBench->start("GlossaryExport", "exportGlossaryItem_getGlossaryTerm");
909  $glo_term = new ilGlossaryTerm($term["id"]);
910  $ilBench->stop("GlossaryExport", "exportGlossaryItem_getGlossaryTerm");
911  $ilBench->start("GlossaryExport", "exportGlossaryItem_XML");
912  $glo_term->exportXML($a_xml_writer, $a_inst);
913  $ilBench->stop("GlossaryExport", "exportGlossaryItem_XML");
914 
915  unset($glo_term);
916 
917  $ilBench->stop("GlossaryExport", "exportGlossaryItem");
918  }
919 
920  $a_xml_writer->xmlEndTag("Glossary");
921  }
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)
Get term list.
exportXMLMetaData(&$a_xml_writer)
export content objects meta data to xml (see ilias_co.dtd)
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 944 of file class.ilObjGlossary.php.

Referenced by exportXML().

945  {
946  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
947 
948  foreach ($this->mob_ids as $mob_id)
949  {
950  $expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
951  $media_obj = new ilObjMediaObject($mob_id);
952  $media_obj->exportXML($a_xml_writer, $a_inst);
953  $media_obj->exportFiles($a_target_dir);
954  unset($media_obj);
955  }
956  }
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 929 of file class.ilObjGlossary.php.

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

Referenced by exportXML(), and exportXMLGlossaryItems().

930  {
931  include_once("Services/MetaData/classes/class.ilMD2XML.php");
932  $md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
933  $md2xml->setExportMode(true);
934  $md2xml->startExport();
935  $a_xml_writer->appendXML($md2xml->getXML());
936  }
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 1259 of file class.ilObjGlossary.php.

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

1260  {
1261  global $lng;
1262 
1263  if($a_sub_type == "term")
1264  {
1265  $lng->loadLanguageModule("glo");
1266 
1267  include_once "Modules/Glossary/classes/class.ilGlossaryTerm.php";
1268  return $lng->txt("glo_term").' "'. ilGlossaryTerm::_lookGlossaryTerm($a_sub_id).'"';
1269  }
1270  }
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 387 of file class.ilObjGlossary.php.

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

Referenced by getFirstLetters(), and getTermList().

388  {
389  global $tree;
390 
391  if ($this->isVirtual())
392  {
393  $glo_ids = array();
394 
395  $virtual_mode = $this->getRefId() ? $this->getVirtualMode() : '';
396  switch ($virtual_mode)
397  {
398  case "level":
399  $glo_arr = $tree->getChildsByType($tree->getParentId($this->getRefId()),"glo");
400  $glo_ids[] = $this->getId();
401  foreach ($glo_arr as $glo)
402  {
403  {
404  $glo_ids[] = $glo['obj_id'];
405  }
406  }
407  if (!$a_include_offline_childs)
408  {
409  $glo_ids = ilObjGlossary::removeOfflineGlossaries($glo_ids);
410  }
411  // always show entries of current glossary (if no permission is given, user will not come to the presentation screen)
412  // see bug #14477
413  if (!in_array($this->getId(), $glo_ids))
414  {
415  $glo_ids[] = $this->getId();
416  }
417  break;
418 
419  case "subtree":
420  $subtree_nodes = $tree->getSubTree($tree->getNodeData($tree->getParentId($this->getRefId())));
421 
422  foreach ($subtree_nodes as $node)
423  {
424  if ($node['type'] == 'glo')
425  {
426  $glo_ids[] = $node['obj_id'];
427  }
428  }
429  if (!$a_include_offline_childs)
430  {
431  $glo_ids = ilObjGlossary::removeOfflineGlossaries($glo_ids);
432  }
433  // always show entries of current glossary (if no permission is given, user will not come to the presentation screen)
434  // see bug #14477
435  if (!in_array($this->getId(), $glo_ids))
436  {
437  $glo_ids[] = $this->getId();
438  }
439  break;
440 
441  // fallback to none virtual mode in case of error
442  default:
443  $glo_ids[] = $this->getId();
444  break;
445  }
446  }
447  else
448  {
449  $glo_ids = $this->getId();
450  }
451 
452  return $glo_ids;
453  }
removeOfflineGlossaries($a_glo_ids)
Remove offline glossaries from obj id array.
getVirtualMode()
get glossary type (normal or virtual)
getId()
get object id public
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:

◆ getDeletionDependencies()

static ilObjGlossary::getDeletionDependencies (   $a_obj_id)
static

Get deletion dependencies.

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

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

1118  {
1119  global $lng;
1120 
1121  $dep = array();
1122  include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
1124  foreach ($sms as $sm)
1125  {
1126  $lng->loadLanguageModule("content");
1127  $dep[$sm] = $lng->txt("glo_used_in_scorm");
1128  }
1129 //echo "-".$a_obj_id."-";
1130 //var_dump($dep);
1131  return $dep;
1132  }
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 101 of file class.ilObjGlossary.php.

Referenced by cloneObject().

102  {
103  return parent::getDescription();
104  }
+ Here is the caller graph for this function:

◆ getExportDirectory()

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

Get export directory of glossary.

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

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

Referenced by exportHTML().

509  {
510  include_once("./Services/Export/classes/class.ilExport.php");
511  return ilExport::_getExportDirectory($this->getId(), $a_type, $this->getType());
512  }
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 517 of file class.ilObjGlossary.php.

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

518  {
519  include_once("./Services/Export/classes/class.ilExport.php");
520  return ilExport::_getExportFiles($this->getId(), array("xml", "html"), $this->getType());
521  }
getId()
get object id public
_getExportFiles($a_obj_id, $a_export_types="", $a_obj_type="")
Get Export Files for a repository object.
getType()
get object type public
+ Here is the call graph for this function:

◆ getFirstLetters()

ilObjGlossary::getFirstLetters (   $a_tax_node = 0)

Get term list.

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

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

375  {
376  $glo_ids = $this->getAllGlossaryIds();
377  $first_letters = ilGlossaryTerm::getFirstLetters($glo_ids, $a_tax_node);
378  return $first_letters;
379  }
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 489 of file class.ilObjGlossary.php.

References ilUtil\getDataDir().

490  {
491  $export_dir = ilUtil::getDataDir()."/glo_data"."/glo_".$this->getId()."/import";
492 
493  return $export_dir;
494  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:

◆ getOnline()

ilObjGlossary::getOnline ( )

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

Referenced by cloneObject().

219  {
220  return $this->online;
221  }
+ Here is the caller graph for this function:

◆ getPresentationMode()

ilObjGlossary::getPresentationMode ( )

Get presentation mode.

Returns
string presentation mode

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

Referenced by cloneObject(), and update().

187  {
188  return $this->pres_mode;
189  }
+ 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 541 of file class.ilObjGlossary.php.

Referenced by update().

542  {
543  return $this->public_export_file[$a_type];
544  }
+ Here is the caller graph for this function:

◆ getShowTaxonomy()

ilObjGlossary::getShowTaxonomy ( )

Get show taxonomy.

Returns
bool show taxonomy

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

Referenced by update().

320  {
321  return $this->show_tax;
322  }
+ Here is the caller graph for this function:

◆ getSnippetLength()

ilObjGlossary::getSnippetLength ( )

Get snippet length.

Returns
int snippet length

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

Referenced by cloneObject(), and update().

207  {
208  return ($this->snippet_length > 0)
209  ? $this->snippet_length
210  : null;
211  }
+ Here is the caller graph for this function:

◆ getStyleSheetId()

ilObjGlossary::getStyleSheetId ( )

Get ID of assigned style sheet object.

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

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

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

◆ getTaxonomyId()

ilObjGlossary::getTaxonomyId ( )

Get taxonomy.

Returns
int taxononmy ID

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

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

Referenced by cloneObject().

1140  {
1141  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1142  $tax_ids = ilObjTaxonomy::getUsageOfObject($this->getId());
1143  if (count($tax_ids) > 0)
1144  {
1145  // glossaries handle max. one taxonomy
1146  return $tax_ids[0];
1147  }
1148  return 0;
1149  }
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 
)

Get term list.

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

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

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

357  {
358  if ($a_omit_virtual)
359  {
360  $glo_ids[] = $this->getId();
361  }
362  else
363  {
364  $glo_ids = $this->getAllGlossaryIds($a_include_offline_childs);
365  }
366  $list = ilGlossaryTerm::getTermList($glo_ids, $searchterm, $a_letter, $a_def, $a_tax_node,
367  $a_add_amet_fields, $a_amet_filter);
368  return $list;
369  }
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)
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 157 of file class.ilObjGlossary.php.

Referenced by exportHTMLGlossaryTerms().

158  {
159  return parent::getTitle();
160  }
+ Here is the caller graph for this function:

◆ getVirtualMode()

ilObjGlossary::getVirtualMode ( )

get glossary type (normal or virtual)

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

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

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

◆ getXMLZip()

ilObjGlossary::getXMLZip ( )

Get zipped xml file for glossary.

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

1107  {
1108  include_once("./Modules/Glossary/classes/class.ilGlossaryExport.php");
1109  $glo_exp = new ilGlossaryExport($this);
1110  return $glo_exp->buildExportFile();
1111  }
Export class for content objects.

◆ ilObjGlossary()

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

Constructor public.

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

References ilObject\ilObject().

28  {
29  $this->type = "glo";
30  $this->ilObject($a_id,$a_call_by_reference);
31  }
ilObject($a_id=0, $a_reference=true)
Constructor public.
+ Here is the call graph for this function:

◆ isActiveDownloads()

ilObjGlossary::isActiveDownloads ( )

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

Referenced by update().

283  {
284  return $this->downloads_active;
285  }
+ Here is the caller graph for this function:

◆ isActiveGlossaryMenu()

ilObjGlossary::isActiveGlossaryMenu ( )

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

Referenced by update().

273  {
274  return $this->glo_menu_active;
275  }
+ Here is the caller graph for this function:

◆ isVirtual()

ilObjGlossary::isVirtual ( )

returns true if glossary type is virtual (any mode)

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

Referenced by delete(), and getAllGlossaryIds().

148  {
149  return $this->virtual;
150  }
+ 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 244 of file class.ilObjGlossary.php.

References $ilDB.

Referenced by lookupSnippetLength().

245  {
246  global $ilDB;
247 
248  $set = $ilDB->query("SELECT $a_property FROM glossary WHERE id = ".
249  $ilDB->quote($a_id, "integer"));
250  $rec = $ilDB->fetchAssoc($set);
251 
252  return $rec[$a_property];
253  }
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 261 of file class.ilObjGlossary.php.

References lookup().

Referenced by ilGlossaryDefinition\shortenShortText().

262  {
263  return ilObjGlossary::lookup($a_id, "snippet_length");
264  }
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 980 of file class.ilObjGlossary.php.

References ilObject\getId().

981  {
982  if ($a_tag == "Identifier" && $a_param == "Entry")
983  {
984  $a_value = "il_".IL_INST_ID."_glo_".$this->getId();
985  }
986 
987  return $a_value;
988  }
getId()
get object id public
+ Here is the call graph for this function:

◆ notify()

ilObjGlossary::notify (   $a_event,
  $a_ref_id,
  $a_parent_non_rbac_id,
  $a_node_id,
  $a_params = 0 
)

notifys an object about an event occured Based on the event happend, each object may decide how it reacts.

public

Parameters
stringevent
integerreference id of object where the event occured
arraypasses optional paramters if required
Returns
boolean

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

References $_GET, and ilObject\getType().

1050  {
1051  global $tree;
1052 
1053  switch ($a_event)
1054  {
1055  case "link":
1056 
1057  //var_dump("<pre>",$a_params,"</pre>");
1058  //echo "Glossary ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
1059  //exit;
1060  break;
1061 
1062  case "cut":
1063 
1064  //echo "Glossary ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
1065  //exit;
1066  break;
1067 
1068  case "copy":
1069 
1070  //var_dump("<pre>",$a_params,"</pre>");
1071  //echo "Glossary ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
1072  //exit;
1073  break;
1074 
1075  case "paste":
1076 
1077  //echo "Glossary ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
1078  //exit;
1079  break;
1080 
1081  case "new":
1082 
1083  //echo "Glossary ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
1084  //exit;
1085  break;
1086  }
1087 
1088  // At the beginning of the recursive process it avoids second call of the notify function with the same parameter
1089  if ($a_node_id==$_GET["ref_id"])
1090  {
1091  $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
1092  $parent_type = $parent_obj->getType();
1093  if($parent_type == $this->getType())
1094  {
1095  $a_node_id = (int) $tree->getParentId($a_node_id);
1096  }
1097  }
1098 
1099  parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
1100  }
$_GET["client_id"]
redirection script todo: (a better solution should control the processing via a xml file) ...
getType()
get object type public
+ Here is the call graph for this function:

◆ read()

ilObjGlossary::read ( )

read data of content object

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

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

71  {
72  global $ilDB;
73 
74  parent::read();
75 # echo "Glossary<br>\n";
76 
77  $q = "SELECT * FROM glossary WHERE id = ".
78  $ilDB->quote($this->getId(), "integer");
79  $gl_set = $ilDB->query($q);
80  $gl_rec = $ilDB->fetchAssoc($gl_set);
81  $this->setOnline(ilUtil::yn2tf($gl_rec["is_online"]));
82  $this->setVirtualMode($gl_rec["virtual"]);
83  $this->setPublicExportFile("xml", $gl_rec["public_xml_file"]);
84  $this->setPublicExportFile("html", $gl_rec["public_html_file"]);
85  $this->setActiveGlossaryMenu(ilUtil::yn2tf($gl_rec["glo_menu_active"]));
86  $this->setActiveDownloads(ilUtil::yn2tf($gl_rec["downloads_active"]));
87  $this->setPresentationMode($gl_rec["pres_mode"]);
88  $this->setSnippetLength($gl_rec["snippet_length"]);
89  $this->setShowTaxonomy($gl_rec["show_tax"]);
90 
91  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
93 
94  }
setStyleSheetId($a_style_id)
Set ID of assigned style sheet object.
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
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:

◆ removeOfflineGlossaries()

ilObjGlossary::removeOfflineGlossaries (   $a_glo_ids)

Remove offline glossaries from obj id array.

Parameters

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

References $ilDB.

Referenced by getAllGlossaryIds().

1244  {
1245  global $ilDB;
1246 
1247  $set = $ilDB->query("SELECT id FROM glossary ".
1248  " WHERE ".$ilDB->in("id", $a_glo_ids, false, "integer").
1249  " AND is_online = ".$ilDB->quote("y", "text")
1250  );
1251  $glo_ids = array();
1252  while ($rec = $ilDB->fetchAssoc($set))
1253  {
1254  $glo_ids[] = $rec["id"];
1255  }
1256  return $glo_ids;
1257  }
global $ilDB
+ Here is the caller graph for this function:

◆ setActiveDownloads()

ilObjGlossary::setActiveDownloads (   $a_down)

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

Referenced by read().

278  {
279  $this->downloads_active = $a_down;
280  }
+ Here is the caller graph for this function:

◆ setActiveGlossaryMenu()

ilObjGlossary::setActiveGlossaryMenu (   $a_act_glo_menu)

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

Referenced by read().

268  {
269  $this->glo_menu_active = $a_act_glo_menu;
270  }
+ Here is the caller graph for this function:

◆ setDescription()

ilObjGlossary::setDescription (   $a_description)

set description of glossary object

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

110  {
111  parent::setDescription($a_description);
112  }

◆ setOnline()

ilObjGlossary::setOnline (   $a_online)

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

Referenced by read().

214  {
215  $this->online = $a_online;
216  }
+ Here is the caller graph for this function:

◆ setPresentationMode()

ilObjGlossary::setPresentationMode (   $a_val)

Set presentation mode.

Parameters
stringpresentation mode

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

Referenced by create(), and read().

177  {
178  $this->pres_mode = $a_val;
179  }
+ 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 529 of file class.ilObjGlossary.php.

Referenced by read().

530  {
531  $this->public_export_file[$a_type] = $a_file;
532  }
+ Here is the caller graph for this function:

◆ setShowTaxonomy()

ilObjGlossary::setShowTaxonomy (   $a_val)

Set show taxonomy.

Parameters
bool$a_valshow taxonomy

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

Referenced by read().

310  {
311  $this->show_tax = $a_val;
312  }
+ Here is the caller graph for this function:

◆ setSnippetLength()

ilObjGlossary::setSnippetLength (   $a_val)

Set snippet length.

Parameters
intsnippet length

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

Referenced by create(), and read().

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

◆ setStyleSheetId()

ilObjGlossary::setStyleSheetId (   $a_style_id)

Set ID of assigned style sheet object.

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

Referenced by read().

299  {
300  $this->style_id = $a_style_id;
301  }
+ Here is the caller graph for this function:

◆ setTitle()

ilObjGlossary::setTitle (   $a_title)

set title of glossary object

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

166  {
167  parent::setTitle($a_title);
168 // $this->meta_data->setTitle($a_title);
169  }

◆ setVirtualMode()

ilObjGlossary::setVirtualMode (   $a_mode)

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

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

Referenced by read().

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

◆ update()

ilObjGlossary::update ( )

Update object.

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

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

328  {
329  global $ilDB;
330 
331  $this->updateMetaData();
332 
333  $ilDB->manipulate("UPDATE glossary SET ".
334  " is_online = ".$ilDB->quote(ilUtil::tf2yn($this->getOnline()), "text").",".
335  " virtual = ".$ilDB->quote($this->getVirtualMode(), "text").",".
336  " public_xml_file = ".$ilDB->quote($this->getPublicExportFile("xml"), "text").",".
337  " public_html_file = ".$ilDB->quote($this->getPublicExportFile("html"), "text").",".
338  " glo_menu_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveGlossaryMenu()), "text").",".
339  " downloads_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveDownloads()), "text").", ".
340  " pres_mode = ".$ilDB->quote($this->getPresentationMode(), "text").", ".
341  " show_tax = ".$ilDB->quote((int) $this->getShowTaxonomy(), "integer").", ".
342  " snippet_length = ".$ilDB->quote((int)$this->getSnippetLength(), "integer")." ".
343  " WHERE id = ".$ilDB->quote($this->getId(), "integer"));
344 
345  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
347 
348  parent::update();
349  }
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
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:

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