ILIAS  release_4-4 Revision
ilObjDlBook Class Reference

Class ilObjDlBook. More...

+ Inheritance diagram for ilObjDlBook:
+ Collaboration diagram for ilObjDlBook:

Public Member Functions

 ilObjDlBook ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 initBibItemObject ()
 init bib object (contains all bib item data) More...
 
 exportRekursiv ($obj_id, $depth, $left, $right)
 export lm_data-table to xml-structure More...
 
 export ($a_deliver=true)
 exports the digi-lib-object into a xml structure More...
 
 addTranslation ($a_ref_id)
 
 addTranslations ($a_arr_ref_id)
 
 deleteTranslation ($a_ref_id)
 
 deleteTranslations ($a_arr_ref_id)
 
 getTranslations ()
 
 getXMLZip ()
 
 readAssignedTranslations ()
 
- Public Member Functions inherited from ilObjContentObject
 ilObjContentObject ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 create ($a_no_meta_data=false)
 create content object More...
 
 initDefaultRoles ()
 init default roles settings OBSOLETE. More...
 
 read ()
 read data of content object More...
 
 getTitle ()
 get title of content object More...
 
 setTitle ($a_title)
 set title of content object More...
 
 getDescription ()
 get description of content object More...
 
 setDescription ($a_description)
 set description of content object More...
 
 getImportId ()
 
 setImportId ($a_id)
 
 setLayoutPerPage ($a_val)
 Set layout per page. More...
 
 getLayoutPerPage ()
 Get layout per page. More...
 
 setDisableDefaultFeedback ($a_val)
 Set disable default feedback for questions. More...
 
 getDisableDefaultFeedback ()
 Get disable default feedback for questions. More...
 
getTree ()
 
 update ()
 update complete object (meta data and properties) More...
 
 updateAutoGlossaries ()
 Update auto glossaries. More...
 
 import ()
 if implemented, this function should be called from an Out/GUI-Object More...
 
 putInTree ($a_parent)
 put content object in main tree More...
 
 createLMTree ()
 create content object tree (that stores structure object hierarchie) More...
 
 setAutoGlossaries ($a_val)
 Set auto glossaries. More...
 
 getAutoGlossaries ()
 Get auto glossaries. More...
 
 removeAutoGlossary ($a_glo_id)
 Remove auto glossary. More...
 
 addFirstChapterAndPage ()
 Add first chapter and page. More...
 
getLMTree ()
 get content object tree More...
 
 createImportDirectory ()
 creates data directory for import files (data_dir/lm_data/lm_<id>/import, depending on data directory that is set in ILIAS setup/ini) More...
 
 getDataDirectory ()
 get data directory More...
 
 getImportDirectory ()
 get import directory of lm More...
 
 setImportDirectory ($a_import_dir)
 Set import directory for further use in ilContObjParser. More...
 
 createExportDirectory ($a_type="xml")
 creates data directory for export files (data_dir/lm_data/lm_<id>/export, depending on data directory that is set in ILIAS setup/ini) More...
 
 getExportDirectory ($a_type="xml")
 get export directory of lm More...
 
 delete ()
 delete learning module and all related data More...
 
 getLayout ()
 get default page layout of content object (see directory layouts/) More...
 
 setLayout ($a_layout)
 set default page layout More...
 
 getStyleSheetId ()
 get ID of assigned style sheet object More...
 
 setStyleSheetId ($a_style_id)
 set ID of assigned style sheet object More...
 
 writeStyleSheetId ($a_style_id)
 write ID of assigned style sheet object to db More...
 
 _moveLMStyles ($a_from_style, $a_to_style)
 move learning modules from one style to another More...
 
 _lookupStyleSheetId ($a_cont_obj_id)
 lookup style sheet ID More...
 
 _lookupContObjIdByStyleId ($a_style_id)
 lookup style sheet ID More...
 
 _getNrOfAssignedLMs ($a_style_id)
 gets the number of learning modules assigned to a content style More...
 
 _getNrLMsIndividualStyles ()
 get number of learning modules with individual styles More...
 
 _getNrLMsNoStyle ()
 get number of learning modules assigned no style More...
 
 _deleteStyleAssignments ($a_style_id)
 delete all style references to style More...
 
 getPageHeader ()
 get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER) More...
 
 setPageHeader ($a_pg_header=IL_CHAPTER_TITLE)
 set page header mode More...
 
 getTOCMode ()
 get toc mode ("chapters" | "pages") More...
 
 getPublicAccessMode ()
 get public access mode ("complete" | "selected") More...
 
 setTOCMode ($a_toc_mode="chapters")
 set toc mode More...
 
 setOnline ($a_online)
 
 getOnline ()
 
 setActiveLMMenu ($a_act_lm_menu)
 
 isActiveLMMenu ()
 
 setActiveTOC ($a_toc)
 
 isActiveTOC ()
 
 setActiveNumbering ($a_num)
 
 isActiveNumbering ()
 
 setActivePrintView ($a_print)
 
 isActivePrintView ()
 
 setActivePreventGlossaryAppendix ($a_print)
 
 isActivePreventGlossaryAppendix ()
 
 setHideHeaderFooterPrint ($a_val)
 Set hide header footer in print mode. More...
 
 getHideHeaderFooterPrint ()
 Get hide header footer in print mode. More...
 
 setActiveDownloads ($a_down)
 
 isActiveDownloads ()
 
 setActiveDownloadsPublic ($a_down)
 
 isActiveDownloadsPublic ()
 
 setPublicNotes ($a_pub_notes)
 
 publicNotes ()
 
 setCleanFrames ($a_clean)
 
 cleanFrames ()
 
 setHistoryUserComments ($a_comm)
 
 setPublicAccessMode ($a_mode)
 
 isActiveHistoryUserComments ()
 
 setHeaderPage ($a_pg)
 
 getHeaderPage ()
 
 setFooterPage ($a_pg)
 
 getFooterPage ()
 
 readProperties ()
 read content object properties More...
 
 updateProperties ()
 Update content object properties. More...
 
 createProperties ()
 create new properties record More...
 
 _lookupOnline ($a_id)
 check wether content object is online More...
 
 getAvailableLayouts ()
 get all available lm layouts More...
 
 _checkPreconditionsOfPage ($cont_ref_id, $cont_obj_id, $page_id)
 checks wether the preconditions of a page are fulfilled or not More...
 
 _getMissingPreconditionsOfPage ($cont_ref_id, $cont_obj_id, $page_id)
 gets all missing preconditions of page More...
 
 _getMissingPreconditionsTopChapter ($cont_obj_ref_id, $cont_obj_id, $page_id)
 get top chapter of page for that any precondition is missing 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...
 
 hasSuccessorPage ($a_cont_obj_id, $a_page_id)
 checks if page has a successor page More...
 
 checkTree ()
 
 fixTree ()
 fix tree More...
 
 exportXML (&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
 export object to xml (see ilias_co.dtd) More...
 
 exportXMLMetaData (&$a_xml_writer)
 export content objects meta data to xml (see ilias_co.dtd) More...
 
 exportXMLStructureObjects (&$a_xml_writer, $a_inst, &$expLog)
 export structure objects to xml (see ilias_co.dtd) More...
 
 exportXMLPageObjects (&$a_xml_writer, $a_inst, &$expLog)
 export page objects 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...
 
 exportXMLProperties ($a_xml_writer, &$expLog)
 export properties of content object 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...
 
 getOfflineFiles ($dir)
 get offline files More...
 
 exportSCORM ($a_target_dir, $log)
 export scorm package More...
 
 exportHTML ($a_target_dir, $log, $a_zip_file=true, $a_export_format="html", $a_lang="")
 export html package More...
 
 exportHTMLFile ($a_target_dir, $a_file_id)
 export file object More...
 
 exportHTMLMOB ($a_target_dir, &$a_lm_gui, $a_mob_id, $a_frame, &$a_linked_mobs)
 export media object to html More...
 
 exportHTMLGlossaryTerms (&$a_lm_gui, $a_target_dir)
 export glossary terms More...
 
 exportHTMLPages (&$a_lm_gui, $a_target_dir, $a_lang="")
 export all pages of learning module to html file More...
 
 exportPageHTML (&$a_lm_gui, $a_target_dir, $a_lm_page_id, $a_frame="", $a_exp_id_map=array())
 export page html More...
 
 exportFO (&$a_xml_writer, $a_target_dir)
 export object to fo More...
 
 exportFOStructureObjects (&$a_xml_writer)
 export structure objects to fo More...
 
 getXMLZip ()
 
 executeDragDrop ($source_id, $target_id, $first_child, $as_subitem=false, $movecopy="move")
 Execute Drag Drop Action. More...
 
 validatePages ()
 Validate all pages. More...
 
 importFromZipFile ($a_tmp_file, $a_filename, $a_validate=true, $a_import_into_help_module=0)
 Import lm from zip file. More...
 
 importFromDirectory ($a_directory, $a_validate=true)
 Import lm from directory. More...
 
 cloneObject ($a_target_id, $a_copy_id=0)
 Clone learning module. More...
 
 copyAllPagesAndChapters ($a_target_obj)
 Copy all pages and chapters. More...
 
 lookupAutoGlossaries ($a_lm_id)
 Lookup auto glossaries. More...
 
 autoLinkGlossaryTerms ($a_glo_id)
 Auto link glossary terms. More...
 
 setRating ($a_value)
 
 hasRating ()
 
 setRatingPages ($a_value)
 
 hasRatingPages ()
 
- 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...
 

Data Fields

 $bib_obj
 
- Data Fields inherited from ilObjContentObject
 $lm_tree
 
 $meta_data
 
 $layout
 
 $style_id
 
 $pg_header
 
 $online
 
 $auto_glossaries = array()
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 
 $obj_data_record
 object_data record More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjContentObject
static _lookupDisableDefaultFeedback ($a_id)
 Lookup disable default feedback. More...
 
static getSupplyingExportFiles ($a_target_dir=".")
 Get supplying export files. More...
 
static isOnlineHelpModule ($a_id, $a_as_obj_id=false)
 Is module an online module. 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...
 
- Protected Attributes inherited from ilObjContentObject
 $rating
 
 $rating_pages
 

Detailed Description

Class ilObjDlBook.

Author
Databay AG ay@da.nosp@m.taba.nosp@m.y.de
Version
$Id$

Definition at line 14 of file class.ilObjDlBook.php.

Member Function Documentation

◆ addTranslation()

ilObjDlBook::addTranslation (   $a_ref_id)

Definition at line 326 of file class.ilObjDlBook.php.

References readAssignedTranslations().

Referenced by addTranslations().

327  {
328  global $ilDB;
329 
330  $ilDB->manipulate("DELETE FROM dbk_translations ".
331  " WHERE id = ".$ilDB->quote($this->ref_id, "integer")." ".
332  " AND tr_id = ".$ilDB->quote($a_ref_id, "integer"));
333 
334  $ilDB->manipulate("INSERT INTO dbk_translations (id, tr_id) VALUES ".
335  "(".$ilDB->quote($this->ref_id, "integer").", ".
336  "".$ilDB->quote($a_ref_id, "integer").")");
337 
338  $ilDB->manipulate("DELETE FROM dbk_translations ".
339  " WHERE id = ".$ilDB->quote($a_ref_id, "integer")." ".
340  " AND tr_id = ".$ilDB->quote($this->ref_id, "integer"));
341 
342  $ilDB->manipulate("INSERT INTO dbk_translations (id, tr_id) VALUES ".
343  "(".$ilDB->quote($a_ref_id, "integer").", ".
344  "".$ilDB->quote($this->ref_id, "integer").")");
345 
346  // UPDATE MEMBER VARIABLE
347  $this->readAssignedTranslations();
348 
349  return true;
350  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTranslations()

ilObjDlBook::addTranslations (   $a_arr_ref_id)

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

References ilObject\$ref_id, and addTranslation().

353  {
354  if(!is_array($a_arr_ref_id))
355  {
356  return false;
357  }
358  foreach($a_arr_ref_id as $ref_id)
359  {
360  $this->addTranslation($ref_id);
361  }
362  return true;
363  }
addTranslation($a_ref_id)
+ Here is the call graph for this function:

◆ deleteTranslation()

ilObjDlBook::deleteTranslation (   $a_ref_id)

Definition at line 364 of file class.ilObjDlBook.php.

References readAssignedTranslations().

Referenced by deleteTranslations().

365  {
366  global $ilDB;
367 
368  if(!$a_ref_id)
369  {
370  return false;
371  }
372 
373  $ilDB->manipulate("DELETE FROM dbk_translations ".
374  "WHERE id = ".$ilDB->quote($this->ref_id, "integer")." ".
375  "AND tr_id = ".$ilDB->quote($a_ref_id, "integer"));
376 
377  $ilDB->manipulate("DELETE FROM dbk_translations ".
378  "WHERE id = ".$ilDB->quote($a_ref_id, "integer")." ".
379  "AND tr_id = ".$ilDB->quote($this->ref_id, "integer"));
380 
381  // UPDATE MEMBER VARIABLE
382  $this->readAssignedTranslations();
383 
384  return true;
385  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteTranslations()

ilObjDlBook::deleteTranslations (   $a_arr_ref_id)

Definition at line 387 of file class.ilObjDlBook.php.

References ilObject\$ref_id, and deleteTranslation().

388  {
389  if(!is_array($a_arr_ref_id))
390  {
391  return false;
392  }
393  foreach($a_arr_ref_id as $ref_id)
394  {
395  $this->deleteTranslation($ref_id);
396  }
397  return true;
398  }
deleteTranslation($a_ref_id)
+ Here is the call graph for this function:

◆ export()

ilObjDlBook::export (   $a_deliver = true)

exports the digi-lib-object into a xml structure

Definition at line 129 of file class.ilObjDlBook.php.

References $query, $result, $row, ilObjContentObject\createExportDirectory(), ilUtil\deliverFile(), exportRekursiv(), ilObjContentObject\getExportDirectory(), ilUtil\rCopy(), and ilUtil\zip().

Referenced by getXMLZip().

130  {
131  global $ilDB;
132 
133  include_once("./Services/Xml/classes/class.ilNestedSetXML.php");
134  // ------------------------------------------------------
135  // anhand der ref_id die obj_id ermitteln.
136  // ------------------------------------------------------
137  $objRow["obj_id"] = ilOject::_lookupObjId();
138  $objRow["title"] = ilOject::_lookupTitle($objRow["obj_id"]);
139  $obj_id = $objRow["obj_id"];
140 
141  $this->mob_ids = array();
142 
143  // ------------------------------------------------------
144  // start xml-String
145  // ------------------------------------------------------
146  $xml = "<?xml version=\"1.0\"?>\n<!DOCTYPE ContentObject SYSTEM \"ilias_co.dtd\">\n<ContentObject Type=\"LibObject\">\n";
147 
148  // ------------------------------------------------------
149  // get global meta-data
150  // ------------------------------------------------------
151  $nested = new ilNestedSetXML();
152  $xml .= $nested->export($obj_id,"dbk")."\n";
153 
154  // ------------------------------------------------------
155  // get all book-xml-data recursiv
156  // ------------------------------------------------------
157 
158  $query = "SELECT *
159  FROM lm_tree, lm_data
160  WHERE lm_tree.lm_id = ".$ilDB->quote($obj_id, "integer")."
161  AND lm_tree.child = lm_data.obj_id
162  AND ( lm_data.type = 'du' )
163  AND lm_tree.depth = 1
164  ORDER BY lm_tree.lft";
165  $result = $ilDB->query($query);
166  $treeData = $ilDB->fetchAssoc($result);
167 
168  $xml .= $this->exportRekursiv($obj_id,2, $treeData["lft"], $treeData["rgt"]);
169 
170  // ------------------------------------------------------
171  // get or create export-directory
172  // ------------------------------------------------------
173  $this->createExportDirectory();
174  $export_dir = $this->getExportDirectory();
175 
176  // ------------------------------------------------------
177  // get mediaobject-xml-data
178  // ------------------------------------------------------
179  $mob_ids = $this->mob_ids;
180  if (is_array($mob_ids) && count($mob_ids)>0)
181  {
182  reset ($mob_ids);
183  while (list ($key, $val) = each ($mob_ids))
184  {
185 
186  $xml .= "<MediaObject>";
187 
188  $query = "SELECT * FROM media_item WHERE mob_id= ".
189  $ilDB->quote($key, "integer")." ";
190  //vd($query);
191  $first = true;
192  $result = $ilDB->query($query);
193  while (is_array($row = $ilDB->fetchRow($result)) )
194  {
195  if($first)
196  {
197  //vd($row[purpose]);
198  $nested = new ilNestedSetXML();
199  $metaxml = $nested->export($key,"mob");
200  $metaxml = preg_replace("/Entry=\"(.*?)\"/","Entry=\"il__mob_".$key."\"",$metaxml);
201 
202  $metaxml2 = "<Technical>";
203  $metaxml2 .= "<Format>".$row["format"]."</Format>";
204  $metaxml2 .= "<Size>14559</Size>";
205  $metaxml2 .= "<Location Type=\"".$row["location_type"]."\">".$row["location"]."</Location>";
206  $metaxml2 .= "</Technical>";
207 
208  $metaxml = str_replace("</MetaData>",$metaxml2."</MetaData>",$metaxml);
209 
210  $xml .= $metaxml;
211 
212  $first = false;
213  }
214 
215  $xml .= "<MediaItem Purpose=\"".$row["purpose"]."\">";
216  $xml .= "<Location Type=\"".$row["location_type"]."\">".$row["location"]."</Location>";
217  $xml .= "<Format>".$row["format"]."</Format>";
218  $xml .= "<Layout Width=\"".$row["width"]."\" Height=\"".$row["height"]."\"/>";
219  $xml .= "</MediaItem>";
220 
221  }
222  $xml .= "</MediaObject>";
223  }
224  }
225 
226 
227  // ------------------------------------------------------
228  // get bib-xml-data
229  // ------------------------------------------------------
230  $nested = new ilNestedSetXML();
231  $bib = $nested->export($obj_id,"bib");
232 
233  $xml .= $bib."\n";
234 
235  // ------------------------------------------------------
236  // xml-ending
237  // ------------------------------------------------------
238  $xml .= "</ContentObject>";
239 
240  // ------------------------------------------------------
241  // filename and directory-creation
242  // ------------------------------------------------------
243  $fileName = $objRow["title"];
244  $fileName = str_replace(" ","_",$fileName);
245 
246  if (!file_exists($export_dir."/".$fileName))
247  {
248  @mkdir($export_dir."/".$fileName);
249  @chmod($export_dir."/".$fileName,0755);
250  }
251 
252  if (!file_exists($export_dir."/".$fileName."/objects"))
253  {
254  @mkdir($export_dir."/".$fileName."/objects");
255  @chmod($export_dir."/".$fileName."/objects",0755);
256  }
257 
258  // ------------------------------------------------------
259  // copy mob-files
260  // ------------------------------------------------------
261  $mob_ids = $this->mob_ids;
262  if (is_array($mob_ids) && count($mob_ids)>0)
263  {
264  reset ($mob_ids);
265  while (list ($key, $val) = each ($mob_ids))
266  {
267 
268  if (!file_exists($export_dir."/".$fileName."/objects/mm".$key))
269  {
270  @mkdir($export_dir."/".$fileName."/objects/mm".$key);
271  @chmod($export_dir."/".$fileName."/objects/mm".$key,0755);
272  }
273 
274  $mobdir = "./data/mobs/mm_".$key;
275  ilUtil::rCopy($mobdir, $export_dir."/".$fileName."/objects/mm".$key);
276  }
277  }
278 
279  // ------------------------------------------------------
280  // save xml-file
281  // ------------------------------------------------------
282  $fp = fopen($export_dir."/".$fileName."/".$fileName.".xml","wb");
283  fwrite($fp,$xml);
284  fclose($fp);
285 
286  // ------------------------------------------------------
287  // zip all files
288  // ------------------------------------------------------
289  ilUtil::zip($export_dir."/".$fileName, $export_dir."/".$fileName.".zip");
290 
291  // ------------------------------------------------------
292  // deliver files
293  // ------------------------------------------------------
294 
295  if($a_deliver)
296  {
297  ilUtil::deliverFile($export_dir."/".$fileName.".zip",$fileName);
298  }
299  else
300  {
301  return $export_dir."/".$fileName.".zip";
302  }
303  /*
304  header("Expires: Mon, 1 Jan 1990 00:00:00 GMT");
305  header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
306  header("Cache-Control: no-store, no-cache, must-revalidate");
307  header("Cache-Control: post-check=0, pre-check=0", false);
308  header("Pragma: no-cache");
309  header("Content-type: application/octet-stream");
310  if (stristr(" ".$GLOBALS["HTTP_SERVER_VARS"]["HTTP_USER_AGENT"],"MSIE") )
311  {
312  header ("Content-Disposition: attachment; filename=" . $fileName.".zip");
313  }
314  else
315  {
316  header ("Content-Disposition: inline; filename=".$fileName.".zip" );
317  }
318  header ("Content-length:".(string)( filesize($export_dir."/".$fileName.".zip")) );
319 
320  readfile( $export_dir."/".$fileName.".zip" );
321  */
322 
323  }
Class NestedSetXML functions for storing XML-Data into nested-set-database-strcture.
getExportDirectory($a_type="xml")
get export directory of lm
$result
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
createExportDirectory($a_type="xml")
creates data directory for export files (data_dir/lm_data/lm_<id>/export, depending on data directory...
exportRekursiv($obj_id, $depth, $left, $right)
export lm_data-table to xml-structure
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportRekursiv()

ilObjDlBook::exportRekursiv (   $obj_id,
  $depth,
  $left,
  $right 
)

export lm_data-table to xml-structure

Parameters
integerobj_id
integerdepth
integerleft left border of nested-set-structure
integerright right border of nested-set-structure public
Returns
string xml

Definition at line 57 of file class.ilObjDlBook.php.

References $path, $query, $res, $result, $row, DB_FETCHMODE_ASSOC, domxml_open_mem(), xpath_eval(), and xpath_new_context().

Referenced by export().

58  {
59  global $ilDB;
60 
61  // Jetzt alle lm_data anhand der obj_id auslesen.
62  $query = "SELECT *
63  FROM lm_tree, lm_data
64  WHERE lm_tree.lm_id = ".$ilDB->quote($obj_id, "integer")."
65  AND lm_tree.child = lm_data.obj_id
66  AND ( lm_data.type = 'st' OR lm_data.type = 'pg' )
67  AND lm_tree.depth = ".$ilDB->quote($depth, "integer")."
68  AND lm_tree.lft > ".$ilDB->quote($left, "integer").
69  " and lm_tree.rgt < ".$ilDB->quote($right, "integer")."
70  ORDER BY lm_tree.lft";
71  $result = $ilDB->query($query);
72  while (is_array($row = $ilDB->fetchAssoc($result)) )
73  {
74  if ($row["type"] == "st")
75  {
76  $xml .= "<StructureObject>";
77 
78  $nested = new ilNestedSetXML();
79  $xml .= $nested->export($row["obj_id"],"st");
80  $xml .= "\n";
81 
82  $xml .= $this->exportRekursiv($obj_id, $depth+1, $row["lft"], $row["rgt"]);
83 
84  $xml .= "</StructureObject>";
85  }
86 
87  if ($row["type"] == "pg")
88  {
89 
90  $query = "SELECT * FROM page_object WHERE page_id= ".$ilDB->quote($row["obj_id"], "integer");
91  $result2 = $this->ilias->db->query($query);
92 
93  $row2 = $result2->fetchRow(DB_FETCHMODE_ASSOC);
94 
95  $PO = $row2["content"]."\n";
96 
97  if (stristr($PO,"MediaObject"))
98  {
99 
100  $dom = domxml_open_mem($PO);
101  $xpc = xpath_new_context($dom);
102  $path = "//MediaObject/MediaAlias";
103  $res =& xpath_eval($xpc, $path);
104  for($i = 0; $i < count($res->nodeset); $i++)
105  {
106  $id_arr = explode("_", $res->nodeset[$i]->get_attribute("OriginId"));
107  $mob_id = $id_arr[count($id_arr) - 1];
108  $this->mob_ids[$mob_id] = true;
109  }
110  }
111 
112  $nested = new ilNestedSetXML();
113  $mdxml = $nested->export($row["obj_id"],"pg");
114 
115  $PO = str_replace("<PageObject>","<PageObject>\n$mdxml\n",$PO);
116 
117  $xml .= $PO;
118 
119  }
120 
121  }
122 
123  return($xml);
124  }
Class NestedSetXML functions for storing XML-Data into nested-set-database-strcture.
domxml_open_mem($str, $mode=DOMXML_LOAD_PARSING, &$error=NULL)
$result
xpath_new_context($dom_document)
xpath_eval($xpath_context, $eval_str, $contextnode=null)
exportRekursiv($obj_id, $depth, $left, $right)
export lm_data-table to xml-structure
redirection script todo: (a better solution should control the processing via a xml file) ...
const DB_FETCHMODE_ASSOC
Definition: class.ilDB.php:10
$path
Definition: index.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTranslations()

ilObjDlBook::getTranslations ( )

Definition at line 399 of file class.ilObjDlBook.php.

400  {
401  return $this->tr_ids;
402  }

◆ getXMLZip()

ilObjDlBook::getXMLZip ( )

Definition at line 404 of file class.ilObjDlBook.php.

References export().

405  {
406  return $this->export(false);
407  }
export($a_deliver=true)
exports the digi-lib-object into a xml structure
+ Here is the call graph for this function:

◆ ilObjDlBook()

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

Constructor public.

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

References readAssignedTranslations().

23  {
24  $this->type = "dbk";
25  parent::ilObjContentObject($a_id, $a_call_by_reference);
26 
27  if($a_id)
28  {
29  $this->readAssignedTranslations();
30  }
31  }
+ Here is the call graph for this function:

◆ initBibItemObject()

ilObjDlBook::initBibItemObject ( )

init bib object (contains all bib item data)

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

38  {
39  include_once("./Modules/LearningModule/classes/class.ilBibItem.php");
40 
41  $this->bib_obj =& new ilBibItem($this);
42  $this->bib_obj->read();
43 
44  return true;
45  }
Class ilBibItem.

◆ readAssignedTranslations()

ilObjDlBook::readAssignedTranslations ( )

Definition at line 411 of file class.ilObjDlBook.php.

References $query, $res, and $row.

Referenced by addTranslation(), deleteTranslation(), and ilObjDlBook().

412  {
413  global $ilDB;
414 
415  $query = "SELECT tr_id FROM dbk_translations ".
416  "WHERE id = ".$ilDB->quote($this->ref_id, "integer");
417 
418  $res = $ilDB->query($query);
419  while ($row = $ilDB->fetchObject($res))
420  {
421  $tmp_tr_ids[] = $row->tr_id;
422  }
423  return $this->tr_ids = $tmp_tr_ids ? $tmp_tr_ids : array();
424  }
+ Here is the caller graph for this function:

Field Documentation

◆ $bib_obj

ilObjDlBook::$bib_obj

Definition at line 16 of file class.ilObjDlBook.php.


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