ILIAS  release_4-4 Revision
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, $a_amet_filter="")
 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...
 
 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...
 
 createRoleFolder ()
 creates a local role folder 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 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 19 of file class.ilObjGlossary.php.

Member Function Documentation

◆ _lookupOnline()

ilObjGlossary::_lookupOnline (   $a_id)

check wether content object is online

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

References $lm_set, and ilUtil\yn2tf().

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

224  {
225  global $ilDB;
226 
227  $q = "SELECT is_online FROM glossary WHERE id = ".
228  $ilDB->quote($a_id, "integer");
229  $lm_set = $ilDB->query($q);
230  $lm_rec = $ilDB->fetchAssoc($lm_set);
231 
232  return ilUtil::yn2tf($lm_rec["is_online"]);
233  }
$lm_set
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 1136 of file class.ilObjGlossary.php.

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

1137  {
1138  global $ilDB, $ilUser, $ilias;
1139 
1140  $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
1141  $this->cloneMetaData($new_obj);
1142 
1143  $new_obj->setTitle($this->getTitle());
1144  $new_obj->setDescription($this->getDescription());
1145  $new_obj->setVirtualMode($this->getVirtualMode());
1146  $new_obj->setPresentationMode($this->getPresentationMode());
1147  $new_obj->setSnippetLength($this->getSnippetLength());
1148  $new_obj->update();
1149 
1150  // set/copy stylesheet
1151  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1152  $style_id = $this->getStyleSheetId();
1153  if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id))
1154  {
1155  $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
1156  $new_id = $style_obj->ilClone();
1157  $new_obj->setStyleSheetId($new_id);
1158  $new_obj->update();
1159  }
1160 
1161  // copy taxonomy
1162  if (($tax_id = $this->getTaxonomyId()) > 0)
1163  {
1164  // clone it
1165  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1166  $tax = new ilObjTaxonomy($tax_id);
1167  $new_tax = $tax->cloneObject(0,0,true);
1168  $map = $tax->getNodeMapping();
1169 
1170  // assign new taxonomy to new glossary
1171  ilObjTaxonomy::saveUsage($new_tax->getId(), $new_obj->getId());
1172  }
1173 
1174  // assign new tax/new glossary
1175  // handle mapping
1176 
1177  // prepare tax node assignments objects
1178  include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
1179  if ($tax_id > 0)
1180  {
1181  $tax_ass = new ilTaxNodeAssignment("glo", $this->getId(), "term", $tax_id);
1182  $new_tax_ass = new ilTaxNodeAssignment("glo", $new_obj->getId(), "term", $new_tax->getId());
1183  }
1184 
1185  // copy terms
1186  foreach (ilGlossaryTerm::getTermList($this->getId()) as $term)
1187  {
1188  $new_term_id = ilGlossaryTerm::_copyTerm($term["id"], $new_obj->getId());
1189 
1190  // copy tax node assignments
1191  if ($tax_id > 0)
1192  {
1193  $assignmts = $tax_ass->getAssignmentsOfItem($term["id"]);
1194  foreach ($assignmts as $a)
1195  {
1196  if ($map[$a["node_id"]] > 0)
1197  {
1198  $new_tax_ass->addAssignment($map[$a["node_id"]] ,$new_term_id);
1199  }
1200  }
1201  }
1202  }
1203 
1204  return $new_obj;
1205  }
static getTermList($a_glo_id, $searchterm="", $a_first_letter="", $a_def="", $a_tax_node=0, $a_add_amet_fields=false, $a_amet_filter="")
Get all terms for given set of glossary ids.
Taxonomy node <-> item assignment.
getDescription()
get description of glossary object
getTitle()
get title of glossary object
getVirtualMode()
get glossary type (normal or virtual)
_copyTerm($a_term_id, $a_glossary_id)
Copy a term to a glossary.
getId()
get object id public
getTaxonomyId()
Get taxonomy.
cloneMetaData($target_obj)
Copy meta data.
getPresentationMode()
Get presentation mode.
getSnippetLength()
Get snippet length.
_lookupStandard($a_id)
Lookup standard flag.
global $ilUser
Definition: imgupload.php:15
getStyleSheetId()
Get ID of assigned style sheet object.
static saveUsage($a_tax_id, $a_obj_id)
Save Usage.
+ Here is the call graph for this function:

◆ create()

ilObjGlossary::create (   $a_upload = false)

create glossary object

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

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

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

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

478  {
479  include_once("./Services/Export/classes/class.ilExport.php");
480  return ilExport::_createExportDirectory($this->getId(), $a_type, $this->getType());
481  }
_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 438 of file class.ilObjGlossary.php.

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

439  {
440  $glo_data_dir = ilUtil::getDataDir()."/glo_data";
441  ilUtil::makeDir($glo_data_dir);
442  if(!is_writable($glo_data_dir))
443  {
444  $this->ilias->raiseError("Glossary Data Directory (".$glo_data_dir
445  .") not writeable.",$this->ilias->error_obj->FATAL);
446  }
447 
448  // create glossary directory (data_dir/glo_data/glo_<id>)
449  $glo_dir = $glo_data_dir."/glo_".$this->getId();
450  ilUtil::makeDir($glo_dir);
451  if(!@is_dir($glo_dir))
452  {
453  $this->ilias->raiseError("Creation of Glossary Directory failed.",$this->ilias->error_obj->FATAL);
454  }
455  // create Import subdirectory (data_dir/glo_data/glo_<id>/import)
456  $import_dir = $glo_dir."/import";
457  ilUtil::makeDir($import_dir);
458  if(!@is_dir($import_dir))
459  {
460  $this->ilias->raiseError("Creation of Export Directory failed.",$this->ilias->error_obj->FATAL);
461  }
462  }
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 981 of file class.ilObjGlossary.php.

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

982  {
983  global $ilDB;
984 
985  // always call parent delete function first!!
986  if (!parent::delete())
987  {
988  return false;
989  }
990 
991  // delete terms
992  if (!$this->isVirtual())
993  {
994  $terms = $this->getTermList();
995  foreach ($terms as $term)
996  {
997  $term_obj =& new ilGlossaryTerm($term["id"]);
998  $term_obj->delete();
999  }
1000  }
1001 
1002  // delete glossary data entry
1003  $q = "DELETE FROM glossary WHERE id = ".$ilDB->quote($this->getId());
1004  $ilDB->query($q);
1005 
1006  // delete meta data
1007  $this->deleteMetaData();
1008 /*
1009  $nested = new ilNestedSetXML();
1010  $nested->init($this->getId(), $this->getType());
1011  $nested->deleteAllDBData();
1012 */
1013 
1014  return true;
1015  }
Class ilGlossaryTerm.
getId()
get object id public
getTermList($searchterm="", $a_letter="", $a_def="", $a_tax_node=0, $a_include_offline_childs=false, $a_add_amet_fields=false, $a_amet_filter="")
Get term list.
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 940 of file class.ilObjGlossary.php.

Referenced by exportXML().

941  {
942  include_once("./Modules/File/classes/class.ilObjFile.php");
943 
944  foreach ($this->file_ids as $file_id)
945  {
946  $expLog->write(date("[y-m-d H:i:s] ")."File Item ".$file_id);
947  $file_obj = new ilObjFile($file_id, false);
948  $file_obj->export($a_target_dir);
949  unset($file_obj);
950  }
951  }
Class ilObjFile.
+ Here is the caller graph for this function:

◆ exportHTML()

ilObjGlossary::exportHTML (   $a_target_dir,
  $log 
)

export html package

Definition at line 527 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().

528  {
529  global $ilias, $tpl;
530 
531  // initialize temporary target directory
532  ilUtil::delDir($a_target_dir);
533  ilUtil::makeDir($a_target_dir);
534 
535  include_once("./Services/COPage/classes/class.ilCOPageHTMLExport.php");
536  $this->co_page_html_export = new ilCOPageHTMLExport($a_target_dir);
537  $this->co_page_html_export->createDirectories();
538 
539  // export system style sheet
540  $location_stylesheet = ilUtil::getStyleSheetLocation("filesystem");
541  $style_name = $ilias->account->prefs["style"].".css";
542  copy($location_stylesheet, $a_target_dir."/".$style_name);
543  $location_stylesheet = ilUtil::getStyleSheetLocation();
544 
545  if ($this->getStyleSheetId() < 1)
546  {
547  $cont_stylesheet = "Services/COPage/css/content.css";
548  copy($cont_stylesheet, $a_target_dir."/content.css");
549  }
550  else
551  {
552  $content_style_img_dir = $a_target_dir."/images";
553  ilUtil::makeDir($content_style_img_dir);
554  $style = new ilObjStyleSheet($this->getStyleSheetId());
555  $style->writeCSSFile($a_target_dir."/content.css", "images");
556  $style->copyImagesToDir($content_style_img_dir);
557  }
558 
559  // export syntax highlighting style
560  $syn_stylesheet = ilObjStyleSheet::getSyntaxStylePath();
561  copy($syn_stylesheet, $a_target_dir."/syntaxhighlight.css");
562 
563  // get glossary presentation gui class
564  include_once("./Modules/Glossary/classes/class.ilGlossaryPresentationGUI.php");
565  $_GET["cmd"] = "nop";
566  $glo_gui =& new ilGlossaryPresentationGUI();
567  $glo_gui->setOfflineMode(true);
568  $glo_gui->setOfflineDirectory($a_target_dir);
569 
570  // could be implemented in the future if other export
571  // formats are supported (e.g. scorm)
572  //$glo_gui->setExportFormat($a_export_format);
573 
574  // export terms
575  $this->exportHTMLGlossaryTerms($glo_gui, $a_target_dir);
576 
577  // export all media objects
578  foreach ($this->offline_mobs as $mob)
579  {
580  $this->exportHTMLMOB($a_target_dir, $glo_gui, $mob, "_blank");
581  }
582  $_GET["obj_type"] = "MediaObject";
583  $_GET["obj_id"] = $a_mob_id;
584  $_GET["cmd"] = "";
585 
586  // export all file objects
587  foreach ($this->offline_files as $file)
588  {
589  $this->exportHTMLFile($a_target_dir, $file);
590  }
591 
592  // export images
593  $image_dir = $a_target_dir."/images";
594  ilUtil::makeDir($image_dir);
595  ilUtil::makeDir($image_dir."/browser");
596  copy(ilUtil::getImagePath("enlarge.png", false, "filesystem"),
597  $image_dir."/enlarge.png");
598  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
599  $image_dir."/browser/plus.png");
600  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
601  $image_dir."/browser/minus.png");
602  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
603  $image_dir."/browser/blank.png");
604  copy(ilUtil::getImagePath("icon_st.png", false, "filesystem"),
605  $image_dir."/icon_st.png");
606  copy(ilUtil::getImagePath("icon_pg.png", false, "filesystem"),
607  $image_dir."/icon_pg.png");
608  copy(ilUtil::getImagePath("nav_arr_L.png", false, "filesystem"),
609  $image_dir."/nav_arr_L.png");
610  copy(ilUtil::getImagePath("nav_arr_R.png", false, "filesystem"),
611  $image_dir."/nav_arr_R.png");
612 
613  // template workaround: reset of template
614  $tpl = new ilTemplate("tpl.main.html", true, true);
615  $tpl->setVariable("LOCATION_STYLESHEET",$location_stylesheet);
616  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
617 
618  // zip everything
619  if (true)
620  {
621  // zip it all
622  $date = time();
623  $zip_file = $this->getExportDirectory("html")."/".$date."__".IL_INST_ID."__".
624  $this->getType()."_".$this->getId().".zip";
625 //echo "zip-".$a_target_dir."-to-".$zip_file;
626  ilUtil::zip($a_target_dir, $zip_file);
627  ilUtil::delDir($a_target_dir);
628  }
629  }
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
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
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
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 774 of file class.ilObjGlossary.php.

References ilUtil\makeDir().

Referenced by exportHTML().

775  {
776  $file_dir = $a_target_dir."/files/file_".$a_file_id;
777  ilUtil::makeDir($file_dir);
778  include_once("./Modules/File/classes/class.ilObjFile.php");
779  $file_obj = new ilObjFile($a_file_id, false);
780  $source_file = $file_obj->getDirectory($file_obj->getVersion())."/".$file_obj->getFileName();
781  if (!is_file($source_file))
782  {
783  $source_file = $file_obj->getDirectory()."/".$file_obj->getFileName();
784  }
785  copy($source_file, $file_dir."/".$file_obj->getFileName());
786  }
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 635 of file class.ilObjGlossary.php.

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

Referenced by exportHTML().

636  {
637  global $ilUser;
638 
639  include_once("./Services/COPage/classes/class.ilCOPageHTMLExport.php");
640  $copage_export = new ilCOPageHTMLExport($a_target_dir);
641  $copage_export->exportSupportScripts();
642 
643  // index.html file
644  $a_glo_gui->tpl = new ilTemplate("tpl.main.html", true, true);
645  $style_name = $ilUser->prefs["style"].".css";;
646  $a_glo_gui->tpl->setVariable("LOCATION_STYLESHEET","./".$style_name);
647  $a_glo_gui->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
648  $a_glo_gui->tpl->setTitle($this->getTitle());
649 
650  $content = $a_glo_gui->listTerms();
651  $file = $a_target_dir."/index.html";
652 
653  // open file
654  if (!($fp = @fopen($file,"w+")))
655  {
656  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
657  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
658  }
659  chmod($file, 0770);
660  fwrite($fp, $content);
661  fclose($fp);
662 
663  $terms = $this->getTermList();
664 
665  $this->offline_mobs = array();
666  $this->offline_files = array();
667 
668  foreach($terms as $term)
669  {
670  $a_glo_gui->tpl = new ilTemplate("tpl.main.html", true, true);
671  $a_glo_gui->tpl = $copage_export->getPreparedMainTemplate();
672  //$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
673 
674  // set style
675  $style_name = $ilUser->prefs["style"].".css";;
676  $a_glo_gui->tpl->setVariable("LOCATION_STYLESHEET","./".$style_name);
677 
678  $_GET["term_id"] = $term["id"];
679  $_GET["frame"] = "_blank";
680  $content =& $a_glo_gui->listDefinitions($_GET["ref_id"],$term["id"],false);
681  $file = $a_target_dir."/term_".$term["id"].".html";
682 
683  // open file
684  if (!($fp = @fopen($file,"w+")))
685  {
686  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
687  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
688  }
689  chmod($file, 0770);
690  fwrite($fp, $content);
691  fclose($fp);
692 
693  // store linked/embedded media objects of glosssary term
694  include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
695  $defs = ilGlossaryDefinition::getDefinitionList($term["id"]);
696  foreach($defs as $def)
697  {
698  $def_mobs = ilObjMediaObject::_getMobsOfObject("gdf:pg", $def["id"]);
699  foreach($def_mobs as $def_mob)
700  {
701  $this->offline_mobs[$def_mob] = $def_mob;
702  }
703 
704  // get all files of page
705  include_once("./Modules/File/classes/class.ilObjFile.php");
706  $def_files = ilObjFile::_getFilesOfObject("gdf:pg", $def["id"]);
707  $this->offline_files = array_merge($this->offline_files, $def_files);
708 
709  }
710  }
711  }
print $file
getDefinitionList($a_term_id)
static
HTML export class for pages.
$_GET["client_id"]
_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
getTermList($searchterm="", $a_letter="", $a_def="", $a_tax_node=0, $a_include_offline_childs=false, $a_add_amet_fields=false, $a_amet_filter="")
Get term list.
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 716 of file class.ilObjGlossary.php.

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

Referenced by exportHTML().

717  {
718  global $tpl;
719 
720  $mob_dir = $a_target_dir."/mobs";
721 
722  $source_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob_id;
723  if (@is_dir($source_dir))
724  {
725  ilUtil::makeDir($mob_dir."/mm_".$a_mob_id);
726  ilUtil::rCopy($source_dir, $mob_dir."/mm_".$a_mob_id);
727  }
728 
729  $tpl = new ilTemplate("tpl.main.html", true, true);
730  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
731  $_GET["obj_type"] = "MediaObject";
732  $_GET["mob_id"] = $a_mob_id;
733  $_GET["cmd"] = "";
734  $content =& $a_glo_gui->media();
735  $file = $a_target_dir."/media_".$a_mob_id.".html";
736 
737  // open file
738  if (!($fp = @fopen($file,"w+")))
739  {
740  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
741  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
742  }
743  chmod($file, 0770);
744  fwrite($fp, $content);
745  fclose($fp);
746 
747  // fullscreen
748  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
749  $mob_obj = new ilObjMediaObject($a_mob_id);
750  if ($mob_obj->hasFullscreenItem())
751  {
752  $tpl = new ilTemplate("tpl.main.html", true, true);
753  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
754  $_GET["mob_id"] = $a_mob_id;
755  $_GET["cmd"] = "fullscreen";
756  $content = $a_glo_gui->fullscreen();
757  $file = $a_target_dir."/fullscreen_".$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  }
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"]
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
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 795 of file class.ilObjGlossary.php.

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

796  {
797  global $ilBench;
798 
799  // export glossary
800  $attrs = array();
801  $attrs["Type"] = "Glossary";
802  $a_xml_writer->xmlStartTag("ContentObject", $attrs);
803 
804  // MetaData
805  $this->exportXMLMetaData($a_xml_writer);
806 
807  // collect media objects
808  $terms = $this->getTermList();
809  $this->mob_ids = array();
810  $this->file_ids = array();
811  foreach ($terms as $term)
812  {
813  include_once "./Modules/Glossary/classes/class.ilGlossaryDefinition.php";
814 
815  $defs = ilGlossaryDefinition::getDefinitionList($term[id]);
816 
817  foreach($defs as $def)
818  {
819  $this->page_object = new ilGlossaryDefPage($def["id"]);
820  $this->page_object->buildDom();
821  $this->page_object->insertInstIntoIDs(IL_INST_ID);
822  $mob_ids = $this->page_object->collectMediaObjects(false);
823  include_once("./Services/COPage/classes/class.ilPCFileList.php");
824  $file_ids = ilPCFileList::collectFileItems($this->page_object, $this->page_object->getDomDoc());
825  foreach($mob_ids as $mob_id)
826  {
827  $this->mob_ids[$mob_id] = $mob_id;
828  }
829  foreach($file_ids as $file_id)
830  {
831  $this->file_ids[$file_id] = $file_id;
832  }
833  }
834  }
835 
836  // export media objects
837  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Media Objects");
838  $ilBench->start("GlossaryExport", "exportMediaObjects");
839  $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
840  $ilBench->stop("GlossaryExport", "exportMediaObjects");
841  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Media Objects");
842 
843  // FileItems
844  $expLog->write(date("[y-m-d H:i:s] ")."Start Export File Items");
845  $ilBench->start("ContentObjectExport", "exportFileItems");
846  $this->exportFileItems($a_target_dir, $expLog);
847  $ilBench->stop("ContentObjectExport", "exportFileItems");
848  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export File Items");
849 
850  // Glossary
851  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Glossary Items");
852  $ilBench->start("GlossaryExport", "exportGlossaryItems");
853  $this->exportXMLGlossaryItems($a_xml_writer, $a_inst, $expLog);
854  $ilBench->stop("GlossaryExport", "exportGlossaryItems");
855  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Glossary Items");
856 
857  $a_xml_writer->xmlEndTag("ContentObject");
858  }
exportXMLGlossaryItems(&$a_xml_writer, $a_inst, &$expLog)
export page objects to xml (see ilias_co.dtd)
getDefinitionList($a_term_id)
static
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)
getTermList($searchterm="", $a_letter="", $a_def="", $a_tax_node=0, $a_include_offline_childs=false, $a_add_amet_fields=false, $a_amet_filter="")
Get term list.
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 866 of file class.ilObjGlossary.php.

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

Referenced by exportXML().

867  {
868  global $ilBench;
869 
870  $attrs = array();
871  $a_xml_writer->xmlStartTag("Glossary", $attrs);
872 
873  // MetaData
874  $this->exportXMLMetaData($a_xml_writer);
875 
876  $terms = $this->getTermList();
877 
878  // export glossary terms
879  reset($terms);
880  foreach ($terms as $term)
881  {
882  $ilBench->start("GlossaryExport", "exportGlossaryItem");
883  $expLog->write(date("[y-m-d H:i:s] ")."Page Object ".$page["obj_id"]);
884 
885  // export xml to writer object
886  $ilBench->start("GlossaryExport", "exportGlossaryItem_getGlossaryTerm");
887  $glo_term = new ilGlossaryTerm($term["id"]);
888  $ilBench->stop("GlossaryExport", "exportGlossaryItem_getGlossaryTerm");
889  $ilBench->start("GlossaryExport", "exportGlossaryItem_XML");
890  $glo_term->exportXML($a_xml_writer, $a_inst);
891  $ilBench->stop("GlossaryExport", "exportGlossaryItem_XML");
892 
893  unset($glo_term);
894 
895  $ilBench->stop("GlossaryExport", "exportGlossaryItem");
896  }
897 
898  $a_xml_writer->xmlEndTag("Glossary");
899  }
Class ilGlossaryTerm.
exportXMLMetaData(&$a_xml_writer)
export content objects meta data 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, $a_amet_filter="")
Get term list.
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 922 of file class.ilObjGlossary.php.

Referenced by exportXML().

923  {
924  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
925 
926  foreach ($this->mob_ids as $mob_id)
927  {
928  $expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
929  $media_obj = new ilObjMediaObject($mob_id);
930  $media_obj->exportXML($a_xml_writer, $a_inst);
931  $media_obj->exportFiles($a_target_dir);
932  unset($media_obj);
933  }
934  }
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 907 of file class.ilObjGlossary.php.

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

Referenced by exportXML(), and exportXMLGlossaryItems().

908  {
909  include_once("Services/MetaData/classes/class.ilMD2XML.php");
910  $md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
911  $md2xml->setExportMode(true);
912  $md2xml->startExport();
913  $a_xml_writer->appendXML($md2xml->getXML());
914  }
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:

◆ getAllGlossaryIds()

ilObjGlossary::getAllGlossaryIds (   $a_include_offline_childs = false)

Get all glossary ids.

Parameters

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

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

Referenced by getFirstLetters(), and getTermList().

378  {
379  global $tree;
380 
381  if ($this->isVirtual())
382  {
383  $glo_ids = array();
384 
385  $virtual_mode = $this->getRefId() ? $this->getVirtualMode() : '';
386  switch ($virtual_mode)
387  {
388  case "level":
389  $glo_arr = $tree->getChildsByType($tree->getParentId($this->getRefId()),"glo");
390  $glo_ids[] = $this->getId();
391  foreach ($glo_arr as $glo)
392  {
393  {
394  $glo_ids[] = $glo['obj_id'];
395  }
396  }
397  if (!$a_include_offline_childs)
398  {
399  $glo_ids = ilObjGlossary::removeOfflineGlossaries($glo_ids);
400  }
401  break;
402 
403  case "subtree":
404  $subtree_nodes = $tree->getSubTree($tree->getNodeData($tree->getParentId($this->getRefId())));
405 
406  foreach ($subtree_nodes as $node)
407  {
408  if ($node['type'] == 'glo')
409  {
410  $glo_ids[] = $node['obj_id'];
411  }
412  }
413  if (!$a_include_offline_childs)
414  {
415  $glo_ids = ilObjGlossary::removeOfflineGlossaries($glo_ids);
416  }
417  break;
418 
419  // fallback to none virtual mode in case of error
420  default:
421  $glo_ids[] = $this->getId();
422  break;
423  }
424  }
425  else
426  {
427  $glo_ids = $this->getId();
428  }
429 
430  return $glo_ids;
431  }
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 1095 of file class.ilObjGlossary.php.

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

1096  {
1097  global $lng;
1098 
1099  $dep = array();
1100  include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
1102  foreach ($sms as $sm)
1103  {
1104  $lng->loadLanguageModule("content");
1105  $dep[$sm] = $lng->txt("glo_used_in_scorm");
1106  }
1107 //echo "-".$a_obj_id."-";
1108 //var_dump($dep);
1109  return $dep;
1110  }
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 100 of file class.ilObjGlossary.php.

Referenced by cloneObject().

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

◆ getExportDirectory()

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

Get export directory of glossary.

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

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

Referenced by exportHTML().

487  {
488  include_once("./Services/Export/classes/class.ilExport.php");
489  return ilExport::_getExportDirectory($this->getId(), $a_type, $this->getType());
490  }
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 495 of file class.ilObjGlossary.php.

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

496  {
497  include_once("./Services/Export/classes/class.ilExport.php");
498  return ilExport::_getExportFiles($this->getId(), array("xml", "html"), $this->getType());
499  }
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 364 of file class.ilObjGlossary.php.

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

365  {
366  $glo_ids = $this->getAllGlossaryIds();
367  $first_letters = ilGlossaryTerm::getFirstLetters($glo_ids, $a_tax_node);
368  return $first_letters;
369  }
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 467 of file class.ilObjGlossary.php.

References ilUtil\getDataDir().

468  {
469  $export_dir = ilUtil::getDataDir()."/glo_data"."/glo_".$this->getId()."/import";
470 
471  return $export_dir;
472  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:

◆ getOnline()

ilObjGlossary::getOnline ( )

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

216  {
217  return $this->online;
218  }

◆ getPresentationMode()

ilObjGlossary::getPresentationMode ( )

Get presentation mode.

Returns
string presentation mode

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

Referenced by cloneObject(), and update().

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

Referenced by update().

520  {
521  return $this->public_export_file[$a_type];
522  }
+ Here is the caller graph for this function:

◆ getShowTaxonomy()

ilObjGlossary::getShowTaxonomy ( )

Get show taxonomy.

Returns
bool show taxonomy

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

Referenced by update().

317  {
318  return $this->show_tax;
319  }
+ Here is the caller graph for this function:

◆ getSnippetLength()

ilObjGlossary::getSnippetLength ( )

Get snippet length.

Returns
int snippet length

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

Referenced by cloneObject(), and update().

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

◆ getStyleSheetId()

ilObjGlossary::getStyleSheetId ( )

Get ID of assigned style sheet object.

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

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

288  {
289  return $this->style_id;
290  }
+ Here is the caller graph for this function:

◆ getTaxonomyId()

ilObjGlossary::getTaxonomyId ( )

Get taxonomy.

Returns
int taxononmy ID

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

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

Referenced by cloneObject().

1118  {
1119  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
1120  $tax_ids = ilObjTaxonomy::getUsageOfObject($this->getId());
1121  if (count($tax_ids) > 0)
1122  {
1123  // glossaries handle max. one taxonomy
1124  return $tax_ids[0];
1125  }
1126  return 0;
1127  }
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,
  $a_amet_filter = "" 
)

Get term list.

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

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

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

354  {
355  $glo_ids = $this->getAllGlossaryIds($a_include_offline_childs);
356  $list = ilGlossaryTerm::getTermList($glo_ids, $searchterm, $a_letter, $a_def, $a_tax_node,
357  $a_add_amet_fields, $a_amet_filter);
358  return $list;
359  }
static getTermList($a_glo_id, $searchterm="", $a_first_letter="", $a_def="", $a_tax_node=0, $a_add_amet_fields=false, $a_amet_filter="")
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 156 of file class.ilObjGlossary.php.

Referenced by cloneObject(), and exportHTMLGlossaryTerms().

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

◆ getVirtualMode()

ilObjGlossary::getVirtualMode ( )

get glossary type (normal or virtual)

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

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

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

◆ getXMLZip()

ilObjGlossary::getXMLZip ( )

Get zipped xml file for glossary.

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

1085  {
1086  include_once("./Modules/Glossary/classes/class.ilGlossaryExport.php");
1087  $glo_exp = new ilGlossaryExport($this);
1088  return $glo_exp->buildExportFile();
1089  }
Export class for content objects.

◆ ilObjGlossary()

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

Constructor public.

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

References ilObject\ilObject().

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

◆ isActiveDownloads()

ilObjGlossary::isActiveDownloads ( )

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

Referenced by update().

280  {
281  return $this->downloads_active;
282  }
+ Here is the caller graph for this function:

◆ isActiveGlossaryMenu()

ilObjGlossary::isActiveGlossaryMenu ( )

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

Referenced by update().

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

◆ isVirtual()

ilObjGlossary::isVirtual ( )

returns true if glossary type is virtual (any mode)

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

Referenced by delete(), and getAllGlossaryIds().

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

Referenced by lookupSnippetLength().

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

References lookup().

Referenced by ilGlossaryDefinition\shortenShortText().

259  {
260  return ilObjGlossary::lookup($a_id, "snippet_length");
261  }
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 958 of file class.ilObjGlossary.php.

References ilObject\getId().

959  {
960  if ($a_tag == "Identifier" && $a_param == "Entry")
961  {
962  $a_value = "il_".IL_INST_ID."_glo_".$this->getId();
963  }
964 
965  return $a_value;
966  }
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 1027 of file class.ilObjGlossary.php.

References $_GET, and ilObject\getType().

1028  {
1029  global $tree;
1030 
1031  switch ($a_event)
1032  {
1033  case "link":
1034 
1035  //var_dump("<pre>",$a_params,"</pre>");
1036  //echo "Glossary ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
1037  //exit;
1038  break;
1039 
1040  case "cut":
1041 
1042  //echo "Glossary ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
1043  //exit;
1044  break;
1045 
1046  case "copy":
1047 
1048  //var_dump("<pre>",$a_params,"</pre>");
1049  //echo "Glossary ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
1050  //exit;
1051  break;
1052 
1053  case "paste":
1054 
1055  //echo "Glossary ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
1056  //exit;
1057  break;
1058 
1059  case "new":
1060 
1061  //echo "Glossary ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
1062  //exit;
1063  break;
1064  }
1065 
1066  // At the beginning of the recursive process it avoids second call of the notify function with the same parameter
1067  if ($a_node_id==$_GET["ref_id"])
1068  {
1069  $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
1070  $parent_type = $parent_obj->getType();
1071  if($parent_type == $this->getType())
1072  {
1073  $a_node_id = (int) $tree->getParentId($a_node_id);
1074  }
1075  }
1076 
1077  parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
1078  }
$_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 69 of file class.ilObjGlossary.php.

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

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

Referenced by getAllGlossaryIds().

1214  {
1215  global $ilDB;
1216 
1217  $set = $ilDB->query("SELECT id FROM glossary ".
1218  " WHERE ".$ilDB->in("id", $a_glo_ids, false, "integer").
1219  " AND is_online = ".$ilDB->quote("y", "text")
1220  );
1221  $glo_ids = array();
1222  while ($rec = $ilDB->fetchAssoc($set))
1223  {
1224  $glo_ids[] = $rec["id"];
1225  }
1226  return $glo_ids;
1227  }
+ Here is the caller graph for this function:

◆ setActiveDownloads()

ilObjGlossary::setActiveDownloads (   $a_down)

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

Referenced by read().

275  {
276  $this->downloads_active = $a_down;
277  }
+ Here is the caller graph for this function:

◆ setActiveGlossaryMenu()

ilObjGlossary::setActiveGlossaryMenu (   $a_act_glo_menu)

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

Referenced by read().

265  {
266  $this->glo_menu_active = $a_act_glo_menu;
267  }
+ Here is the caller graph for this function:

◆ setDescription()

ilObjGlossary::setDescription (   $a_description)

set description of glossary object

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

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

◆ setOnline()

ilObjGlossary::setOnline (   $a_online)

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

Referenced by read().

211  {
212  $this->online = $a_online;
213  }
+ Here is the caller graph for this function:

◆ setPresentationMode()

ilObjGlossary::setPresentationMode (   $a_val)

Set presentation mode.

Parameters
stringpresentation mode

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

Referenced by create(), and read().

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

Referenced by read().

508  {
509  $this->public_export_file[$a_type] = $a_file;
510  }
+ Here is the caller graph for this function:

◆ setShowTaxonomy()

ilObjGlossary::setShowTaxonomy (   $a_val)

Set show taxonomy.

Parameters
bool$a_valshow taxonomy

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

Referenced by read().

307  {
308  $this->show_tax = $a_val;
309  }
+ Here is the caller graph for this function:

◆ setSnippetLength()

ilObjGlossary::setSnippetLength (   $a_val)

Set snippet length.

Parameters
intsnippet length

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

Referenced by create(), and read().

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

◆ setStyleSheetId()

ilObjGlossary::setStyleSheetId (   $a_style_id)

Set ID of assigned style sheet object.

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

Referenced by read().

296  {
297  $this->style_id = $a_style_id;
298  }
+ Here is the caller graph for this function:

◆ setTitle()

ilObjGlossary::setTitle (   $a_title)

set title of glossary object

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

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

◆ setVirtualMode()

ilObjGlossary::setVirtualMode (   $a_mode)

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

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

Referenced by read().

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

◆ update()

ilObjGlossary::update ( )

Update object.

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

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

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

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