ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjContentObject Class Reference

Class ilObjContentObject. More...

+ Inheritance diagram for ilObjContentObject:
+ Collaboration diagram for ilObjContentObject:

Public Member Functions

 ilObjContentObject ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 create ($a_no_meta_data=false)
 create content object 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...
 
 setProgressIcons ($a_val)
 Set progress icons. More...
 
 getProgressIcons ()
 Get progress icons. More...
 
 setStoreTries ($a_val)
 Set store tries. More...
 
 getStoreTries ()
 Get store tries. More...
 
 setRestrictForwardNavigation ($a_val)
 Set restrict forward navigation. More...
 
 getRestrictForwardNavigation ()
 Get restrict forward navigation. 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, $a_copy_id=0)
 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...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. More...
 

Static Public Member Functions

static _lookupRestrictForwardNavigation ($a_obj_id)
 Lookup forward restriction navigation. More...
 
static _lookupDisableDefaultFeedback ($a_id)
 Lookup disable default feedback. More...
 
static _lookupStoreTries ($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...
 

Data Fields

 $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...
 

Static Protected Member Functions

static _lookup ($a_obj_id, $a_field)
 Lookup property. More...
 

Protected Attributes

 $rating
 
 $rating_pages
 

Private Attributes

 $import_dir = ''
 

Detailed Description

Member Function Documentation

◆ _checkPreconditionsOfPage()

ilObjContentObject::_checkPreconditionsOfPage (   $cont_ref_id,
  $cont_obj_id,
  $page_id 
)

checks wether the preconditions of a page are fulfilled or not

Definition at line 1257 of file class.ilObjContentObject.php.

References $ilErr, $ilUser, $path, and ilConditionHandler\_checkAllConditionsOfTarget().

Referenced by ilLMPresentationGUI\ilPage(), ilLMPresentationGUI\showPrintView(), and ilLMPresentationGUI\showPrintViewSelection().

1258  {
1259  global $ilUser,$ilErr;
1260 
1261  $lm_tree = new ilTree($cont_obj_id);
1262  $lm_tree->setTableNames('lm_tree','lm_data');
1263  $lm_tree->setTreeTablePK("lm_id");
1264 
1265  if ($lm_tree->isInTree($page_id))
1266  {
1267  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1268  foreach ($path as $node)
1269  {
1270  if ($node["type"] == "st")
1271  {
1272  if (!ilConditionHandler::_checkAllConditionsOfTarget($cont_ref_id,$node["child"], "st"))
1273  {
1274  return false;
1275  }
1276  }
1277  }
1278  }
1279 
1280  return true;
1281  }
_checkAllConditionsOfTarget($a_target_ref_id, $a_target_id, $a_target_type="", $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
global $ilUser
Definition: imgupload.php:15
$path
Definition: index.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteStyleAssignments()

ilObjContentObject::_deleteStyleAssignments (   $a_style_id)

delete all style references to style

Parameters
int$a_style_idstyle_id

Definition at line 870 of file class.ilObjContentObject.php.

References $ilDB, and ilObject\getId().

Referenced by ilObjStyleSheet\delete().

871  {
872  global $ilDB;
873 
874  $q = "UPDATE content_object SET ".
875  " stylesheet = ".$ilDB->quote(0, "integer").
876  " WHERE stylesheet = ".$ilDB->quote((int) $this->getId($a_style_id), "integer");
877 
878  $ilDB->manipulate($q);
879  }
getId()
get object id public
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getMissingPreconditionsOfPage()

ilObjContentObject::_getMissingPreconditionsOfPage (   $cont_ref_id,
  $cont_obj_id,
  $page_id 
)

gets all missing preconditions of page

Definition at line 1286 of file class.ilObjContentObject.php.

References $path, ilConditionHandler\_checkCondition(), and ilConditionHandler\_getConditionsOfTarget().

Referenced by ilLMPresentationGUI\showPreconditionsOfPage().

1287  {
1288  $lm_tree = new ilTree($cont_obj_id);
1289  $lm_tree->setTableNames('lm_tree','lm_data');
1290  $lm_tree->setTreeTablePK("lm_id");
1291 
1292  $conds = array();
1293  if ($lm_tree->isInTree($page_id))
1294  {
1295  // get full path of page
1296  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1297  foreach ($path as $node)
1298  {
1299  if ($node["type"] == "st")
1300  {
1301  // get all preconditions of upper chapters
1302  $tconds = ilConditionHandler::_getConditionsOfTarget($cont_ref_id,$node["child"], "st");
1303  foreach ($tconds as $tcond)
1304  {
1305  // store all missing preconditions
1306  if (!ilConditionHandler::_checkCondition($tcond["id"]))
1307  {
1308  $conds[] = $tcond;
1309  }
1310  }
1311  }
1312  }
1313  }
1314 
1315  return $conds;
1316  }
static _getConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_target_type="")
get all conditions of target object
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
_checkCondition($a_id, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
$path
Definition: index.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getMissingPreconditionsTopChapter()

ilObjContentObject::_getMissingPreconditionsTopChapter (   $cont_obj_ref_id,
  $cont_obj_id,
  $page_id 
)

get top chapter of page for that any precondition is missing

Definition at line 1321 of file class.ilObjContentObject.php.

References $path, ilConditionHandler\_checkCondition(), and ilConditionHandler\_getConditionsOfTarget().

Referenced by ilLMPresentationGUI\showPreconditionsOfPage().

1322  {
1323  $lm_tree = new ilTree($cont_obj_id);
1324  $lm_tree->setTableNames('lm_tree','lm_data');
1325  $lm_tree->setTreeTablePK("lm_id");
1326 
1327  $conds = array();
1328  if ($lm_tree->isInTree($page_id))
1329  {
1330  // get full path of page
1331  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1332  foreach ($path as $node)
1333  {
1334  if ($node["type"] == "st")
1335  {
1336  // get all preconditions of upper chapters
1337  $tconds = ilConditionHandler::_getConditionsOfTarget($cont_obj_ref_id,$node["child"], "st");
1338  foreach ($tconds as $tcond)
1339  {
1340  // look for missing precondition
1341  if (!ilConditionHandler::_checkCondition($tcond["id"]))
1342  {
1343  return $node["child"];
1344  }
1345  }
1346  }
1347  }
1348  }
1349 
1350  return "";
1351  }
static _getConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_target_type="")
get all conditions of target object
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
_checkCondition($a_id, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
$path
Definition: index.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getNrLMsIndividualStyles()

ilObjContentObject::_getNrLMsIndividualStyles ( )

get number of learning modules with individual styles

Definition at line 836 of file class.ilObjContentObject.php.

References $ilDB.

Referenced by ilObjStyleSettingsGUI\editContentStylesObject().

837  {
838  global $ilDB;
839 
840  // joining with style table (not perfectly nice)
841  $q = "SELECT count(*) as cnt FROM content_object, style_data ".
842  " WHERE stylesheet = style_data.id ".
843  " AND standard = ".$ilDB->quote(0, "integer");
844  $cset = $ilDB->query($q);
845  $crow = $ilDB->fetchAssoc($cset);
846 
847  return (int) $crow["cnt"];
848  }
global $ilDB
+ Here is the caller graph for this function:

◆ _getNrLMsNoStyle()

ilObjContentObject::_getNrLMsNoStyle ( )

get number of learning modules assigned no style

Definition at line 853 of file class.ilObjContentObject.php.

References $ilDB.

Referenced by ilObjStyleSettingsGUI\editContentStylesObject().

854  {
855  global $ilDB;
856 
857  $q = "SELECT count(*) as cnt FROM content_object ".
858  " WHERE stylesheet = ".$ilDB->quote(0, "integer");
859  $cset = $ilDB->query($q);
860  $crow = $ilDB->fetchAssoc($cset);
861 
862  return (int) $crow["cnt"];
863  }
global $ilDB
+ Here is the caller graph for this function:

◆ _getNrOfAssignedLMs()

ilObjContentObject::_getNrOfAssignedLMs (   $a_style_id)

gets the number of learning modules assigned to a content style

Parameters
int$a_style_idstyle id

Definition at line 820 of file class.ilObjContentObject.php.

References $ilDB.

Referenced by ilObjStyleSettingsGUI\editContentStylesObject().

821  {
822  global $ilDB;
823 
824  $q = "SELECT count(*) as cnt FROM content_object ".
825  " WHERE stylesheet = ".$ilDB->quote($a_style_id, "integer");
826  $cset = $ilDB->query($q);
827  $crow = $ilDB->fetchAssoc($cset);
828 
829  return (int) $crow["cnt"];
830  }
global $ilDB
+ Here is the caller graph for this function:

◆ _lookup()

static ilObjContentObject::_lookup (   $a_obj_id,
  $a_field 
)
staticprotected

Lookup property.

Parameters
int$a_obj_idobject id
string$a_fieldproperty field name
Returns
string property value

Definition at line 727 of file class.ilObjContentObject.php.

References $ilDB, $ilLog, and $res.

728  {
729  global $ilDB, $ilLog;
730 
731  $q = "SELECT ".$a_field." FROM content_object ".
732  " WHERE id = ".$ilDB->quote($a_obj_id, "integer");
733 
734  $res = $ilDB->query($q);
735  $rec = $ilDB->fetchAssoc($res);
736 
737  return $rec[$a_field];
738  }
global $ilDB

◆ _lookupContObjIdByStyleId()

ilObjContentObject::_lookupContObjIdByStyleId (   $a_style_id)

lookup style sheet ID

Definition at line 769 of file class.ilObjContentObject.php.

References $ilDB, and $res.

Referenced by ilObjStyleSheet\_getClonableContentStyles().

770  {
771  global $ilDB;
772 
773  $q = "SELECT id FROM content_object ".
774  " WHERE stylesheet = ".$ilDB->quote($a_style_id, "integer");
775  $res = $ilDB->query($q);
776  $obj_ids = array();
777  while($cont = $ilDB->fetchAssoc($res))
778  {
779  $obj_ids[] = $cont["id"];
780  }
781  return $obj_ids;
782  }
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupDisableDefaultFeedback()

static ilObjContentObject::_lookupDisableDefaultFeedback (   $a_id)
static

Lookup disable default feedback.

Definition at line 787 of file class.ilObjContentObject.php.

References $ilDB, and $res.

Referenced by ilLMPageConfig\configureByObjectId(), and ilLMPageGUI\onFeedbackEditingForwarding().

788  {
789  global $ilDB;
790 
791  $q = "SELECT disable_def_feedback FROM content_object ".
792  " WHERE id = ".$ilDB->quote($a_id, "integer");
793  $res = $ilDB->query($q);
794  $rec = $ilDB->fetchAssoc($res);
795 
796  return $rec["disable_def_feedback"];
797  }
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupOnline()

ilObjContentObject::_lookupOnline (   $a_id)

check wether content object is online

Definition at line 1195 of file class.ilObjContentObject.php.

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

1196  {
1197  global $ilDB;
1198 
1199 //echo "class ilObjContentObject::_lookupOnline($a_id) called. Use Access class instead.";
1200 
1201  $q = "SELECT is_online FROM content_object WHERE id = ".$ilDB->quote($a_id, "integer");
1202  $lm_set = $ilDB->query($q);
1203  $lm_rec = $ilDB->fetchAssoc($lm_set);
1204 
1205  return ilUtil::yn2tf($lm_rec["is_online"]);
1206  }
$lm_set
global $ilDB
static yn2tf($a_yn)
convert "y"/"n" to true/false
+ Here is the call graph for this function:

◆ _lookupRestrictForwardNavigation()

static ilObjContentObject::_lookupRestrictForwardNavigation (   $a_obj_id)
static

Lookup forward restriction navigation.

Parameters
int$a_obj_idobject id
Returns
string property value

Definition at line 746 of file class.ilObjContentObject.php.

Referenced by ilLMPageGUI\processAnswer().

747  {
748  return self::_lookup($a_obj_id, "restrict_forw_nav");
749  }
+ Here is the caller graph for this function:

◆ _lookupStoreTries()

static ilObjContentObject::_lookupStoreTries (   $a_id)
static

Lookup disable default feedback.

Definition at line 802 of file class.ilObjContentObject.php.

References $ilDB, and $res.

Referenced by ilLMPageGUI\__construct().

803  {
804  global $ilDB;
805 
806  $q = "SELECT store_tries FROM content_object ".
807  " WHERE id = ".$ilDB->quote($a_id, "integer");
808  $res = $ilDB->query($q);
809  $rec = $ilDB->fetchAssoc($res);
810 
811  return $rec["store_tries"];
812  }
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupStyleSheetId()

ilObjContentObject::_lookupStyleSheetId (   $a_cont_obj_id)

lookup style sheet ID

Definition at line 754 of file class.ilObjContentObject.php.

References $ilDB, and $res.

Referenced by ilPCParagraphGUI\setStyle().

755  {
756  global $ilDB;
757 
758  $q = "SELECT stylesheet FROM content_object ".
759  " WHERE id = ".$ilDB->quote($a_cont_obj_id, "integer");
760  $res = $ilDB->query($q);
761  $sheet = $ilDB->fetchAssoc($res);
762 
763  return $sheet["stylesheet"];
764  }
global $ilDB
+ Here is the caller graph for this function:

◆ _moveLMStyles()

ilObjContentObject::_moveLMStyles (   $a_from_style,
  $a_to_style 
)

move learning modules from one style to another

Definition at line 687 of file class.ilObjContentObject.php.

References $ilDB, and ilObject\$ilias.

Referenced by ilObjStyleSettingsGUI\moveIndividualStylesObject(), and ilObjStyleSettingsGUI\moveLMStylesObject().

688  {
689  global $ilDB, $ilias;
690 
691  if ($a_from_style < 0) // change / delete all individual styles
692  {
693  $q = "SELECT stylesheet FROM content_object, style_data ".
694  " WHERE content_object.stylesheet = style_data.id ".
695  " AND style_data.standard = ".$ilDB->quote(0, "integer").
696  " AND content_object.stylesheet > ".$ilDB->quote(0, "integer");
697  $style_set = $ilDB->query($q);
698  while($style_rec = $ilDB->fetchAssoc($style_set))
699  {
700  // assign learning modules to new style
701  $q = "UPDATE content_object SET ".
702  " stylesheet = ".$ilDB->quote((int) $a_to_style, "integer").
703  " WHERE stylesheet = ".$ilDB->quote($style_rec["stylesheet"], "integer");
704  $ilDB->manipulate($q);
705 
706  // delete style
707  $style_obj =& $ilias->obj_factory->getInstanceByObjId($style_rec["stylesheet"]);
708  $style_obj->delete();
709  }
710  }
711  else
712  {
713  $q = "UPDATE content_object SET ".
714  " stylesheet = ".$ilDB->quote((int) $a_to_style, "integer").
715  " WHERE stylesheet = ".$ilDB->quote($a_from_style, "integer");
716  $ilDB->manipulate($q);
717  }
718  }
global $ilDB
+ Here is the caller graph for this function:

◆ addFirstChapterAndPage()

ilObjContentObject::addFirstChapterAndPage ( )

Add first chapter and page.

Definition at line 388 of file class.ilObjContentObject.php.

References ilObject\$lng, ilObject\getId(), IL_FIRST_NODE, and ilLMObject\putInTree().

389  {
390  global $lng;
391 
392  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
393  include_once("./Modules/LearningModule/classes/class.ilStructureObject.php");
394  include_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
395 
396  $root_id = $this->lm_tree->getRootId();
397 
398  // chapter
399  $chap = new ilStructureObject($this);
400  $chap->setType("st");
401  $chap->setTitle($lng->txt("cont_new_chap"));
402  $chap->setLMId($this->getId());
403  $chap->create();
404  ilLMObject::putInTree($chap, $root_id, IL_FIRST_NODE);
405 
406  // page
407  $page = new ilLMPageObject($this);
408  $page->setType("pg");
409  $page->setTitle($lng->txt("cont_new_page"));
410  $page->setLMId($this->getId());
411  $page->create();
412  ilLMObject::putInTree($page, $chap->getId(), IL_FIRST_NODE);
413  }
Class ilLMPageObject.
getId()
get object id public
const IL_FIRST_NODE
Definition: class.ilTree.php:5
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
put this object into content object tree
Class ilStructreObject.
+ Here is the call graph for this function:

◆ autoLinkGlossaryTerms()

ilObjContentObject::autoLinkGlossaryTerms (   $a_glo_id)

Auto link glossary terms.

Parameters

Definition at line 3402 of file class.ilObjContentObject.php.

References ilObject\$id, $t, ilPCParagraph\autoLinkGlossariesPage(), ilPageObject\getAllPages(), ilObject\getId(), ilGlossaryTerm\getTermList(), and ilObject\getType().

3403  {
3404  // get terms
3405  include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
3406  $terms = ilGlossaryTerm::getTermList($a_glo_id);
3407 
3408  // each get page: get content
3409  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
3410  $pages = ilLMPage::getAllPages($this->getType(), $this->getId());
3411 
3412  // determine terms that occur in the page
3413  $found_pages = array();
3414  foreach ($pages as $p)
3415  {
3416  $pg = new ilLMPage($p["id"]);
3417  $c = $pg->getXMLContent();
3418  foreach ($terms as $t)
3419  {
3420  if (is_int(stripos($c, $t["term"])))
3421  {
3422  $found_pages[$p["id"]]["terms"][] = $t;
3423  if (!is_object($found_pages[$p["id"]]["page"]))
3424  {
3425  $found_pages[$p["id"]]["page"] = $pg;
3426  }
3427  }
3428  }
3429  reset($terms);
3430  }
3431 
3432  // ilPCParagraph autoLinkGlossariesPage with page and terms
3433  include_once("./Services/COPage/classes/class.ilPCParagraph.php");
3434  foreach ($found_pages as $id => $fp)
3435  {
3436  ilPCParagraph::autoLinkGlossariesPage($fp["page"], $fp["terms"]);
3437  }
3438 
3439 
3440  }
static getAllPages($a_parent_type, $a_parent_id, $a_lang="-")
Get all pages for parent object.
static autoLinkGlossariesPage($a_page, $a_terms)
Auto link glossary of whole page.
getId()
get object id public
static getTermList($a_glo_id, $searchterm="", $a_first_letter="", $a_def="", $a_tax_node=0, $a_add_amet_fields=false, array $a_amet_filter=null)
Get all terms for given set of glossary ids.
getType()
get object type public
Extension of ilPageObject for learning modules.
+ Here is the call graph for this function:

◆ checkTree()

ilObjContentObject::checkTree ( )

Definition at line 1437 of file class.ilObjContentObject.php.

References ilObject\getId().

Referenced by executeDragDrop().

1438  {
1439  $tree = new ilTree($this->getId());
1440  $tree->setTableNames('lm_tree','lm_data');
1441  $tree->setTreeTablePK("lm_id");
1442  $tree->checkTree();
1443  $tree->checkTreeChilds();
1444 //echo "checked";
1445  }
getId()
get object id public
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanFrames()

ilObjContentObject::cleanFrames ( )

Definition at line 1040 of file class.ilObjContentObject.php.

Referenced by cloneObject(), exportXMLProperties(), and updateProperties().

1041  {
1042  return $this->clean_frames;
1043  }
+ Here is the caller graph for this function:

◆ cloneObject()

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

Clone learning module.

public

Parameters
inttarget ref_id
intcopy id

Definition at line 3250 of file class.ilObjContentObject.php.

References $ilDB, ilObject\$ilias, $ilUser, ilCopyWizardOptions\_getInstance(), ilObjStyleSheet\_lookupStandard(), cleanFrames(), ilObject\cloneMetaData(), copyAllPagesAndChapters(), getDescription(), getDisableDefaultFeedback(), ilObject\getId(), ilObjectTranslation\getInstance(), getLayout(), getLayoutPerPage(), getOnline(), getPageHeader(), getProgressIcons(), getPublicAccessMode(), getStyleSheetId(), getTitle(), getTOCMode(), hasRating(), hasRatingPages(), isActiveDownloads(), isActiveDownloadsPublic(), isActiveHistoryUserComments(), isActiveLMMenu(), isActiveNumbering(), isActivePreventGlossaryAppendix(), isActivePrintView(), isActiveTOC(), and publicNotes().

3251  {
3252  global $ilDB, $ilUser, $ilias;
3253 
3254  $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
3255  $this->cloneMetaData($new_obj);
3256  //$new_obj->createProperties();
3257 
3258  //copy online status if object is not the root copy object
3259  $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
3260 
3261  if(!$cp_options->isRootNode($this->getRefId()))
3262  {
3263  $new_obj->setOnline($this->getOnline());
3264  }
3265 
3266  $new_obj->setTitle($this->getTitle());
3267  $new_obj->setDescription($this->getDescription());
3268  $new_obj->setLayoutPerPage($this->getLayoutPerPage());
3269  $new_obj->setLayout($this->getLayout());
3270  $new_obj->setTOCMode($this->getTOCMode());
3271  $new_obj->setActiveLMMenu($this->isActiveLMMenu());
3272  $new_obj->setActiveTOC($this->isActiveTOC());
3273  $new_obj->setActiveNumbering($this->isActiveNumbering());
3274  $new_obj->setActivePrintView($this->isActivePrintView());
3275  $new_obj->setActivePreventGlossaryAppendix($this->isActivePreventGlossaryAppendix());
3276  $new_obj->setActiveDownloads($this->isActiveDownloads());
3277  $new_obj->setActiveDownloadsPublic($this->isActiveDownloadsPublic());
3278  $new_obj->setPublicNotes($this->publicNotes());
3279  $new_obj->setCleanFrames($this->cleanFrames());
3280  $new_obj->setHistoryUserComments($this->isActiveHistoryUserComments());
3281  $new_obj->setPublicAccessMode($this->getPublicAccessMode());
3282  $new_obj->setPageHeader($this->getPageHeader());
3283  $new_obj->setRating($this->hasRating());
3284  $new_obj->setRatingPages($this->hasRatingPages());
3285  $new_obj->setDisableDefaultFeedback($this->getDisableDefaultFeedback());
3286  $new_obj->setProgressIcons($this->getProgressIcons());
3287 
3288  $new_obj->update();
3289 
3290  $new_obj->createLMTree();
3291 
3292  // copy style
3293  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
3294  $style_id = $this->getStyleSheetId();
3295  if ($style_id > 0 &&
3297  {
3298  $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
3299  $new_id = $style_obj->ilClone();
3300  $new_obj->setStyleSheetId($new_id);
3301  $new_obj->update();
3302  }
3303 
3304  // copy content
3305  $this->copyAllPagesAndChapters($new_obj, $a_copy_id);
3306 
3307  // Copy learning progress settings
3308  include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
3309  $obj_settings = new ilLPObjSettings($this->getId());
3310  $obj_settings->cloneSettings($new_obj->getId());
3311  unset($obj_settings);
3312 
3313  // copy (page) multilang settings
3314  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
3315  $ot = ilObjectTranslation::getInstance($this->getId());
3316  $ot->copy($new_obj->getId());
3317 
3318  return $new_obj;
3319  }
getStyleSheetId()
get ID of assigned style sheet object
getLayout()
get default page layout of content object (see directory layouts/)
getPublicAccessMode()
get public access mode ("complete" | "selected")
getLayoutPerPage()
Get layout per page.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getProgressIcons()
Get progress icons.
getPageHeader()
get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER)
getId()
get object id public
getTOCMode()
get toc mode ("chapters" | "pages")
cloneMetaData($target_obj)
Copy meta data.
getDisableDefaultFeedback()
Get disable default feedback for questions.
copyAllPagesAndChapters($a_target_obj, $a_copy_id=0)
Copy all pages and chapters.
_lookupStandard($a_id)
Lookup standard flag.
global $ilUser
Definition: imgupload.php:15
static getInstance($a_obj_id)
Get instance.
global $ilDB
getTitle()
get title of content object
getDescription()
get description of content object
+ Here is the call graph for this function:

◆ copyAllPagesAndChapters()

ilObjContentObject::copyAllPagesAndChapters (   $a_target_obj,
  $a_copy_id = 0 
)

Copy all pages and chapters.

Parameters
object$a_target_objtarget learning module

Definition at line 3326 of file class.ilObjContentObject.php.

References $options, ilCopyWizardOptions\_getInstance(), ilObject\getId(), ilLMPageObject\getPageList(), ilObject\getRefId(), IL_LAST_NODE, ilLMObject\pasteTree(), and ilLMObject\updateInternalLinks().

Referenced by cloneObject().

3327  {
3328  $parent_id = $a_target_obj->lm_tree->readRootId();
3329 
3330  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
3331  include_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
3332 
3333  // get all chapters of root lm
3334  $chapters = $this->lm_tree->getChildsByType($this->lm_tree->readRootId(), "st");
3335  $copied_nodes = array();
3336  //$time = time();
3337  foreach ($chapters as $chap)
3338  {
3339  $cid = ilLMObject::pasteTree($a_target_obj, $chap["child"], $parent_id,
3340  IL_LAST_NODE, $time, $copied_nodes, true, $this);
3341  $target = $cid;
3342  }
3343 
3344  // copy free pages
3345  $pages = ilLMPageObject::getPageList($this->getId());
3346  foreach ($pages as $p)
3347  {
3348  if (!$this->lm_tree->isInTree($p["obj_id"]))
3349  {
3350  $item = new ilLMPageObject($this, $p["obj_id"]);
3351  $target_item = $item->copy($a_target_obj);
3352  $copied_nodes[$item->getId()] = $target_item->getId();
3353  }
3354  }
3355 
3356  // Add mapping for pages and chapters
3357  include_once './Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
3359  foreach($copied_nodes as $old_id => $new_id)
3360  {
3361  $options->appendMapping(
3362  $this->getRefId().'_'.$old_id,
3363  $a_target_obj->getRefId().'_'.$new_id
3364  );
3365  }
3366 
3367  ilLMObject::updateInternalLinks($copied_nodes);
3368 
3369  $a_target_obj->checkTree();
3370 
3371  }
static updateInternalLinks($a_copied_nodes, $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
static pasteTree($a_target_lm, $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_source_lm=null)
Paste item (tree) from clipboard to current lm.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
Class ilLMPageObject.
if(!is_array($argv)) $options
getId()
get object id public
getPageList($lm_id)
static
const IL_LAST_NODE
Definition: class.ilTree.php:4
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilObjContentObject::create (   $a_no_meta_data = false)

create content object

Definition at line 54 of file class.ilObjContentObject.php.

References $ilUser, ilObject\createMetaData(), createProperties(), and updateAutoGlossaries().

55  {
56  global $ilUser;
57 
58  parent::create();
59 
60  // meta data will be created by
61  // import parser
62  if (!$a_no_meta_data)
63  {
64  $this->createMetaData();
65  }
66 
67  $this->createProperties();
68  $this->updateAutoGlossaries();
69  }
createMetaData()
create meta data entry
updateAutoGlossaries()
Update auto glossaries.
global $ilUser
Definition: imgupload.php:15
createProperties()
create new properties record
+ Here is the call graph for this function:

◆ createExportDirectory()

ilObjContentObject::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)

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

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

Referenced by ilObjDlBook\export().

505  {
506  $lm_data_dir = ilUtil::getDataDir()."/lm_data";
507  if(!is_writable($lm_data_dir))
508  {
509  $this->ilias->raiseError("Content object Data Directory (".$lm_data_dir
510  .") not writeable.",$this->ilias->error_obj->FATAL);
511  }
512  // create learning module directory (data_dir/lm_data/lm_<id>)
513  $lm_dir = $lm_data_dir."/lm_".$this->getId();
514  ilUtil::makeDir($lm_dir);
515  if(!@is_dir($lm_dir))
516  {
517  $this->ilias->raiseError("Creation of Learning Module Directory failed.",$this->ilias->error_obj->FATAL);
518  }
519  // create Export subdirectory (data_dir/lm_data/lm_<id>/Export)
520  switch ($a_type)
521  {
522  // scorm
523  case "scorm":
524  $export_dir = $lm_dir."/export_scorm";
525  break;
526 
527  default: // = xml
528  if (substr($a_type, 0, 4) == "html")
529  {
530  $export_dir = $lm_dir."/export_".$a_type;
531  }
532  else
533  {
534  $export_dir = $lm_dir."/export";
535  }
536  break;
537  }
538  ilUtil::makeDir($export_dir);
539 
540  if(!@is_dir($export_dir))
541  {
542  $this->ilias->raiseError("Creation of Export Directory failed.",$this->ilias->error_obj->FATAL);
543  }
544  }
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:
+ Here is the caller graph for this function:

◆ createImportDirectory()

ilObjContentObject::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)

Definition at line 430 of file class.ilObjContentObject.php.

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

Referenced by importFromZipFile().

431  {
432  $lm_data_dir = ilUtil::getDataDir()."/lm_data";
433  if(!is_writable($lm_data_dir))
434  {
435  $this->ilias->raiseError("Content object Data Directory (".$lm_data_dir
436  .") not writeable.",$this->ilias->error_obj->FATAL);
437  }
438 
439  // create learning module directory (data_dir/lm_data/lm_<id>)
440  $lm_dir = $lm_data_dir."/lm_".$this->getId();
441  ilUtil::makeDir($lm_dir);
442  if(!@is_dir($lm_dir))
443  {
444  $this->ilias->raiseError("Creation of Learning Module Directory failed.",$this->ilias->error_obj->FATAL);
445  }
446 
447  // create import subdirectory (data_dir/lm_data/lm_<id>/import)
448  $import_dir = $lm_dir."/import";
450  if(!@is_dir($import_dir))
451  {
452  $this->ilias->raiseError("Creation of Import Directory failed.",$this->ilias->error_obj->FATAL);
453  }
454  }
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:
+ Here is the caller graph for this function:

◆ createLMTree()

ilObjContentObject::createLMTree ( )

create content object tree (that stores structure object hierarchie)

todo: rename LM to ConOb

Definition at line 325 of file class.ilObjContentObject.php.

References ilObject\getId().

326  {
327  $this->lm_tree =& new ilTree($this->getId());
328  $this->lm_tree->setTreeTablePK("lm_id");
329  $this->lm_tree->setTableNames('lm_tree','lm_data');
330  $this->lm_tree->addTree($this->getId(), 1);
331  }
getId()
get object id public
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
+ Here is the call graph for this function:

◆ createProperties()

ilObjContentObject::createProperties ( )

create new properties record

Definition at line 1178 of file class.ilObjContentObject.php.

References $ilDB, ilNote\activateComments(), ilObject\getId(), ilObject\getType(), and readProperties().

Referenced by create().

1179  {
1180  global $ilDB;
1181 
1182  $q = "INSERT INTO content_object (id) VALUES (".$ilDB->quote($this->getId(), "integer").")";
1183  $ilDB->manipulate($q);
1184 
1185  // #14661
1186  include_once("./Services/Notes/classes/class.ilNote.php");
1187  ilNote::activateComments($this->getId(), 0, $this->getType(), true);
1188 
1189  $this->readProperties(); // to get db default values
1190  }
getId()
get object id public
readProperties()
read content object properties
getType()
get object type public
static activateComments($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_activate=true)
Activate notes feature.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilObjContentObject::delete ( )

delete learning module and all related data

this method has been tested on may 9th 2004 meta data, content object data, data directory, bib items learning module tree and 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 582 of file class.ilObjContentObject.php.

References $ilBench, $ilDB, ilLMObject\_deleteAllObjectData(), ilUtil\delDir(), ilObject\deleteMetaData(), getDataDirectory(), and ilObject\getId().

583  {
584  global $ilDB;
585 
586  global $ilBench;
587 
588  // always call parent delete function first!!
589  if (!parent::delete())
590  {
591  return false;
592  }
593 
594  // delete lm object data
595  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
597 
598  // delete meta data of content object
599  $this->deleteMetaData();
600 
601  // delete bibitem data
602  $nested = new ilNestedSetXML();
603  $nested->init($this->getId(), "bib");
604  $nested->deleteAllDBData();
605 
606 
607  // delete learning module tree
608  $this->lm_tree->removeTree($this->lm_tree->getTreeId());
609 
610  // delete data directory
612 
613  // delete content object record
614  $q = "DELETE FROM content_object WHERE id = ".
615  $ilDB->quote($this->getId(), "integer");
616  $ilDB->manipulate($q);
617 
618  // delete lm menu entries
619  $q = "DELETE FROM lm_menu WHERE lm_id = ".
620  $ilDB->quote($this->getId(), "integer");
621  $ilDB->manipulate($q);
622 
623  // remove auto glossary entries
624  $ilDB->manipulate("DELETE FROM lm_glossaries WHERE ".
625  " lm_id = ".$ilDB->quote($this->getId(), "integer")
626  );
627 
628 
629  return true;
630  }
Class NestedSetXML functions for storing XML-Data into nested-set-database-strcture.
getId()
get object id public
getDataDirectory()
get data directory
global $ilBench
Definition: ilias.php:18
global $ilDB
deleteMetaData()
delete meta data entry
_deleteAllObjectData(&$a_cobj)
delete all objects of content object (digi book / learning module)
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ executeDragDrop()

ilObjContentObject::executeDragDrop (   $source_id,
  $target_id,
  $first_child,
  $as_subitem = false,
  $movecopy = "move" 
)

Execute Drag Drop Action.

Parameters
string$source_idSource element ID
string$target_idTarget element ID
string$first_childInsert as first child of target
string$movecopyPosition ("move" | "copy")

Definition at line 2858 of file class.ilObjContentObject.php.

References $target_id, ilHistory\_createEntry(), ilLMObject\_lookupTitle(), checkTree(), ilObject\getId(), ilLMObjectFactory\getInstance(), ilObject\getType(), and IL_FIRST_NODE.

2859  {
2860  $lmtree = new ilTree($this->getId());
2861  $lmtree->setTableNames('lm_tree','lm_data');
2862  $lmtree->setTreeTablePK("lm_id");
2863 //echo "-".$source_id."-".$target_id."-".$first_child."-".$as_subitem."-";
2864  $source_obj = ilLMObjectFactory::getInstance($this, $source_id, true);
2865  $source_obj->setLMId($this->getId());
2866 
2867  if (!$first_child)
2868  {
2869  $target_obj = ilLMObjectFactory::getInstance($this, $target_id, true);
2870  $target_obj->setLMId($this->getId());
2871  $target_parent = $lmtree->getParentId($target_id);
2872  }
2873 
2874  // handle pages
2875  if ($source_obj->getType() == "pg")
2876  {
2877 //echo "1";
2878  if ($lmtree->isInTree($source_obj->getId()))
2879  {
2880  $node_data = $lmtree->getNodeData($source_obj->getId());
2881 
2882  // cut on move
2883  if ($movecopy == "move")
2884  {
2885  $parent_id = $lmtree->getParentId($source_obj->getId());
2886  $lmtree->deleteTree($node_data);
2887 
2888  // write history entry
2889  require_once("./Services/History/classes/class.ilHistory.php");
2890  ilHistory::_createEntry($source_obj->getId(), "cut",
2891  array(ilLMObject::_lookupTitle($parent_id), $parent_id),
2892  $this->getType().":pg");
2893  ilHistory::_createEntry($parent_id, "cut_page",
2894  array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
2895  $this->getType().":st");
2896  }
2897  else
2898  {
2899  // copy page
2900  $new_page =& $source_obj->copy();
2901  $source_id = $new_page->getId();
2902  $source_obj =& $new_page;
2903  }
2904 
2905  // paste page
2906  if(!$lmtree->isInTree($source_obj->getId()))
2907  {
2908  if ($first_child) // as first child
2909  {
2910  $target_pos = IL_FIRST_NODE;
2911  $parent = $target_id;
2912  }
2913  else if ($as_subitem) // as last child
2914  {
2915  $parent = $target_id;
2916  $target_pos = IL_FIRST_NODE;
2917  $pg_childs =& $lmtree->getChildsByType($parent, "pg");
2918  if (count($pg_childs) != 0)
2919  {
2920  $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
2921  }
2922  }
2923  else // at position
2924  {
2925  $target_pos = $target_id;
2926  $parent = $target_parent;
2927  }
2928 
2929  // insert page into tree
2930  $lmtree->insertNode($source_obj->getId(),
2931  $parent, $target_pos);
2932 
2933  // write history entry
2934  if ($movecopy == "move")
2935  {
2936  // write history comments
2937  include_once("./Services/History/classes/class.ilHistory.php");
2938  ilHistory::_createEntry($source_obj->getId(), "paste",
2939  array(ilLMObject::_lookupTitle($parent), $parent),
2940  $this->getType().":pg");
2941  ilHistory::_createEntry($parent, "paste_page",
2942  array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
2943  $this->getType().":st");
2944  }
2945 
2946  }
2947  }
2948  }
2949 
2950  // handle chapters
2951  if ($source_obj->getType() == "st")
2952  {
2953 //echo "2";
2954  $source_node = $lmtree->getNodeData($source_id);
2955  $subnodes = $lmtree->getSubtree($source_node);
2956 
2957  // check, if target is within subtree
2958  foreach ($subnodes as $subnode)
2959  {
2960  if($subnode["obj_id"] == $target_id)
2961  {
2962  return;
2963  }
2964  }
2965 
2966  $target_pos = $target_id;
2967 
2968  if ($first_child) // as first subchapter
2969  {
2970  $target_pos = IL_FIRST_NODE;
2971  $target_parent = $target_id;
2972 
2973  $pg_childs =& $lmtree->getChildsByType($target_parent, "pg");
2974  if (count($pg_childs) != 0)
2975  {
2976  $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
2977  }
2978  }
2979  else if ($as_subitem) // as last subchapter
2980  {
2981  $target_parent = $target_id;
2982  $target_pos = IL_FIRST_NODE;
2983  $childs =& $lmtree->getChilds($target_parent);
2984  if (count($childs) != 0)
2985  {
2986  $target_pos = $childs[count($childs) - 1]["obj_id"];
2987  }
2988  }
2989 
2990  // insert into
2991 /*
2992  if ($position == "into")
2993  {
2994  $target_parent = $target_id;
2995  $target_pos = IL_FIRST_NODE;
2996 
2997  // if target_pos is still first node we must skip all pages
2998  if ($target_pos == IL_FIRST_NODE)
2999  {
3000  $pg_childs =& $lmtree->getChildsByType($target_parent, "pg");
3001  if (count($pg_childs) != 0)
3002  {
3003  $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
3004  }
3005  }
3006  }
3007 */
3008 
3009 
3010  // delete source tree
3011  if ($movecopy == "move")
3012  {
3013  $lmtree->deleteTree($source_node);
3014  }
3015  else
3016  {
3017  // copy chapter (incl. subcontents)
3018  $new_chapter =& $source_obj->copy($lmtree, $target_parent, $target_pos);
3019  }
3020 
3021  if (!$lmtree->isInTree($source_id))
3022  {
3023  $lmtree->insertNode($source_id, $target_parent, $target_pos);
3024 
3025  // insert moved tree
3026  if ($movecopy == "move")
3027  {
3028  foreach ($subnodes as $node)
3029  {
3030  if($node["obj_id"] != $source_id)
3031  {
3032  $lmtree->insertNode($node["obj_id"], $node["parent"]);
3033  }
3034  }
3035  }
3036  }
3037 
3038  // check the tree
3039  $this->checkTree();
3040  }
3041 
3042  $this->checkTree();
3043  }
getInstance(&$a_content_obj, $a_id=0, $a_halt=true)
$target_id
Definition: goto.php:88
static _lookupTitle($a_obj_id)
Lookup title.
_createEntry($a_obj_id, $a_action, $a_info_params="", $a_obj_type="", $a_user_comment="", $a_update_last=false)
Creates a new history entry for an object.
getId()
get object id public
const IL_FIRST_NODE
Definition: class.ilTree.php:5
getType()
get object type public
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
+ Here is the call graph for this function:

◆ exportFileItems()

ilObjContentObject::exportFileItems (   $a_target_dir,
$expLog 
)

export files of file itmes

Definition at line 1781 of file class.ilObjContentObject.php.

Referenced by exportXML().

1782  {
1783  include_once("./Modules/File/classes/class.ilObjFile.php");
1784 
1785  foreach ($this->file_ids as $file_id)
1786  {
1787  $expLog->write(date("[y-m-d H:i:s] ")."File Item ".$file_id);
1788  $file_obj = new ilObjFile($file_id, false);
1789  $file_obj->export($a_target_dir);
1790  unset($file_obj);
1791  }
1792  }
Class ilObjFile.
+ Here is the caller graph for this function:

◆ exportFO()

ilObjContentObject::exportFO ( $a_xml_writer,
  $a_target_dir 
)

export object to fo

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 2744 of file class.ilObjContentObject.php.

References $ilBench, and exportFOStructureObjects().

2745  {
2746  global $ilBench;
2747 
2748  // fo:root (start)
2749  $attrs = array();
2750  $attrs["xmlns:fo"] = "http://www.w3.org/1999/XSL/Format";
2751  $a_xml_writer->xmlStartTag("fo:root", $attrs);
2752 
2753  // fo:layout-master-set (start)
2754  $attrs = array();
2755  $a_xml_writer->xmlStartTag("fo:layout-master-set", $attrs);
2756 
2757  // fo:simple-page-master (start)
2758  $attrs = array();
2759  $attrs["master-name"] = "DinA4";
2760  $attrs["page-height"] = "29.7cm";
2761  $attrs["page-width"] = "21cm";
2762  $attrs["margin-top"] = "4cm";
2763  $attrs["margin-bottom"] = "1cm";
2764  $attrs["margin-left"] = "2.8cm";
2765  $attrs["margin-right"] = "7.3cm";
2766  $a_xml_writer->xmlStartTag("fo:simple-page-master", $attrs);
2767 
2768  // fo:region-body (complete)
2769  $attrs = array();
2770  $attrs["margin-top"] = "0cm";
2771  $attrs["margin-bottom"] = "1.25cm";
2772  $a_xml_writer->xmlElement("fo:region-body", $attrs);
2773 
2774  // fo:region-before (complete)
2775  $attrs = array();
2776  $attrs["extent"] = "1cm";
2777  $a_xml_writer->xmlElement("fo:region-before", $attrs);
2778 
2779  // fo:region-after (complete)
2780  $attrs = array();
2781  $attrs["extent"] = "1cm";
2782  $a_xml_writer->xmlElement("fo:region-after", $attrs);
2783 
2784  // fo:simple-page-master (end)
2785  $a_xml_writer->xmlEndTag("fo:simple-page-master");
2786 
2787  // fo:layout-master-set (end)
2788  $a_xml_writer->xmlEndTag("fo:layout-master-set");
2789 
2790  // fo:page-sequence (start)
2791  $attrs = array();
2792  $attrs["master-reference"] = "DinA4";
2793  $a_xml_writer->xmlStartTag("fo:page-sequence", $attrs);
2794 
2795  // fo:flow (start)
2796  $attrs = array();
2797  $attrs["flow-name"] = "xsl-region-body";
2798  $a_xml_writer->xmlStartTag("fo:flow", $attrs);
2799 
2800 
2801  // StructureObjects
2802  //$expLog->write(date("[y-m-d H:i:s] ")."Start Export Structure Objects");
2803  $ilBench->start("ContentObjectExport", "exportFOStructureObjects");
2804  $this->exportFOStructureObjects($a_xml_writer, $expLog);
2805  $ilBench->stop("ContentObjectExport", "exportFOStructureObjects");
2806  //$expLog->write(date("[y-m-d H:i:s] ")."Finished Export Structure Objects");*/
2807 
2808  // fo:flow (end)
2809  $a_xml_writer->xmlEndTag("fo:flow");
2810 
2811  // fo:page-sequence (end)
2812  $a_xml_writer->xmlEndTag("fo:page-sequence");
2813 
2814  // fo:root (end)
2815  $a_xml_writer->xmlEndTag("fo:root");
2816  }
exportFOStructureObjects(&$a_xml_writer)
export structure objects to fo
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ exportFOStructureObjects()

ilObjContentObject::exportFOStructureObjects ( $a_xml_writer)

export structure objects to fo

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 2824 of file class.ilObjContentObject.php.

Referenced by exportFO().

2825  {
2826  $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
2827  foreach ($childs as $child)
2828  {
2829  if($child["type"] != "st")
2830  {
2831  continue;
2832  }
2833 
2834  $structure_obj = new ilStructureObject($this, $child["obj_id"]);
2835  $structure_obj->exportFO($a_xml_writer, $expLog);
2836  unset($structure_obj);
2837  }
2838  }
Class ilStructreObject.
+ Here is the caller graph for this function:

◆ exportHTML()

ilObjContentObject::exportHTML (   $a_target_dir,
  $log,
  $a_zip_file = true,
  $a_export_format = "html",
  $a_lang = "" 
)

export html package

Definition at line 2064 of file class.ilObjContentObject.php.

References $_GET, $file, $GLOBALS, $ilBench, ilObject\$ilias, $ilUser, $tpl, ilObject\_exists(), ilObject\_lookupType(), ilPlayerUtil\copyPlayerFilesToTargetDirectory(), ilExplorerBaseGUI\createHTMLExportDirs(), ilUtil\delDir(), exportHTMLFile(), exportHTMLGlossaryTerms(), exportHTMLMOB(), exportHTMLPages(), getExportDirectory(), ilPlayerUtil\getFlashVideoPlayerDirectory(), ilObject\getId(), ilUtil\getImagePath(), ilObjectTranslation\getInstance(), getStyleSheetId(), ilUtil\getStyleSheetLocation(), ilObjStyleSheet\getSyntaxStylePath(), ilObject\getType(), ilUtil\getWebspaceDir(), isActiveTOC(), ilUtil\makeDir(), ilUtil\makeDirParents(), ilUtil\rCopy(), and ilUtil\zip().

Referenced by exportSCORM().

2065  {
2066  global $tpl, $ilBench, $ilLocator, $ilUser, $ilObjDataCache, $ilias;
2067 
2068  $user_lang = $ilUser->getLanguage();
2069  if ($a_lang != "")
2070  {
2071  $ilUser->setLanguage($a_lang);
2072  $ilUser->setCurrentLanguage($a_lang);
2073  $ilObjDataCache->deleteCachedEntry($this->getId());
2074  }
2075 
2076  // initialize temporary target directory
2077  ilUtil::delDir($a_target_dir);
2078  ilUtil::makeDir($a_target_dir);
2079  $mob_dir = $a_target_dir."/mobs";
2080  ilUtil::makeDir($mob_dir);
2081  $file_dir = $a_target_dir."/files";
2082  ilUtil::makeDir($file_dir);
2083  $teximg_dir = $a_target_dir."/teximg";
2084  ilUtil::makeDir($teximg_dir);
2085  $style_dir = $a_target_dir."/style";
2086  ilUtil::makeDir($style_dir);
2087  $style_img_dir = $a_target_dir."/style/images";
2088  ilUtil::makeDir($style_img_dir);
2089  $content_style_dir = $a_target_dir."/content_style";
2090  ilUtil::makeDir($content_style_dir);
2091  $content_style_img_dir = $a_target_dir."/content_style/images";
2092  ilUtil::makeDir($content_style_img_dir);
2093  $GLOBALS["teximgcnt"] = 0;
2094 
2095  // export system style sheet
2096  $location_stylesheet = ilUtil::getStyleSheetLocation("filesystem");
2097  $style_name = $ilUser->prefs["style"].".css";
2098  copy($location_stylesheet, $style_dir."/".$style_name);
2099  $fh = fopen($location_stylesheet, "r");
2100  $css = fread($fh, filesize($location_stylesheet));
2101  preg_match_all("/url\(([^\)]*)\)/",$css,$files);
2102  foreach (array_unique($files[1]) as $fileref)
2103  {
2104  $css_fileref = str_replace(array("'", '"'), "", $fileref);
2105  $fileref = dirname($location_stylesheet)."/".$css_fileref;
2106  if (is_file($fileref))
2107  {
2108 //echo "<br>make dir: ".dirname($style_dir."/".$css_fileref);
2109  ilUtil::makeDirParents(dirname($style_dir."/".$css_fileref));
2110 //echo "<br>copy: ".$fileref." TO ".$style_dir."/".$css_fileref;
2111  copy($fileref, $style_dir."/".$css_fileref);
2112  }
2113  }
2114  fclose($fh);
2115  $location_stylesheet = ilUtil::getStyleSheetLocation();
2116 
2117  // export content style sheet
2118  $ilBench->start("ExportHTML", "exportContentStyle");
2119  if ($this->getStyleSheetId() < 1)
2120  {
2121  $cont_stylesheet = "./Services/COPage/css/content.css";
2122 
2123  $css = fread(fopen($cont_stylesheet,'r'),filesize($cont_stylesheet));
2124  preg_match_all("/url\(([^\)]*)\)/",$css,$files);
2125  foreach (array_unique($files[1]) as $fileref)
2126  {
2127  if (is_file(str_replace("..", ".", $fileref)))
2128  {
2129  copy(str_replace("..", ".", $fileref), $content_style_img_dir."/".basename($fileref));
2130  }
2131  $css = str_replace($fileref, "images/".basename($fileref),$css);
2132  }
2133  fwrite(fopen($content_style_dir."/content.css",'w'),$css);
2134  }
2135  else
2136  {
2137  $style = new ilObjStyleSheet($this->getStyleSheetId());
2138  $style->writeCSSFile($content_style_dir."/content.css", "images");
2139  $style->copyImagesToDir($content_style_img_dir);
2140  }
2141  $ilBench->stop("ExportHTML", "exportContentStyle");
2142 
2143  // export syntax highlighting style
2144  $syn_stylesheet = ilObjStyleSheet::getSyntaxStylePath();
2145  copy($syn_stylesheet, $a_target_dir."/syntaxhighlight.css");
2146 
2147  // get learning module presentation gui class
2148  include_once("./Modules/LearningModule/classes/class.ilLMPresentationGUI.php");
2149  $_GET["cmd"] = "nop";
2150  $lm_gui =& new ilLMPresentationGUI();
2151  $lm_gui->setOfflineMode(true);
2152  $lm_gui->setOfflineDirectory($a_target_dir);
2153  $lm_gui->setExportFormat($a_export_format);
2154  $ot = ilObjectTranslation::getInstance($this->getId());
2155  if ($a_lang != "")
2156  {
2157  if ($a_lang == $ot->getMasterLanguage())
2158  {
2159  $lm_gui->lang = "";
2160  }
2161  else
2162  {
2163  $lm_gui->lang = $a_lang;
2164  }
2165  }
2166 
2167  // export pages
2168  $ilBench->start("ExportHTML", "exportHTMLPages");
2169  $this->exportHTMLPages($lm_gui, $a_target_dir, $lm_gui->lang);
2170  $ilBench->stop("ExportHTML", "exportHTMLPages");
2171 
2172  // export glossary terms
2173  $ilBench->start("ExportHTML", "exportHTMLGlossaryTerms");
2174  $this->exportHTMLGlossaryTerms($lm_gui, $a_target_dir);
2175  $ilBench->stop("ExportHTML", "exportHTMLGlossaryTerms");
2176 
2177  // export all media objects
2178  $ilBench->start("ExportHTML", "exportHTMLMediaObjects");
2179  $linked_mobs = array();
2180  foreach ($this->offline_mobs as $mob)
2181  {
2182  if (ilObject::_exists($mob) && ilObject::_lookupType($mob) == "mob")
2183  {
2184  $this->exportHTMLMOB($a_target_dir, $lm_gui, $mob, "_blank", $linked_mobs);
2185  }
2186  }
2187  $linked_mobs2 = array(); // mobs linked in link areas
2188  foreach ($linked_mobs as $mob)
2189  {
2190  if (ilObject::_exists($mob))
2191  {
2192  $this->exportHTMLMOB($a_target_dir, $lm_gui, $mob, "_blank", $linked_mobs2);
2193  }
2194  }
2195  $_GET["obj_type"] = "MediaObject";
2196  $_GET["obj_id"] = $a_mob_id;
2197  $_GET["cmd"] = "";
2198  $ilBench->stop("ExportHTML", "exportHTMLMediaObjects");
2199 
2200  // export all file objects
2201  $ilBench->start("ExportHTML", "exportHTMLFileObjects");
2202  foreach ($this->offline_files as $file)
2203  {
2204  $this->exportHTMLFile($a_target_dir, $file);
2205  }
2206  $ilBench->stop("ExportHTML", "exportHTMLFileObjects");
2207 
2208  // export questions (images)
2209  if (count($this->q_ids) > 0)
2210  {
2211  foreach ($this->q_ids as $q_id)
2212  {
2213  ilUtil::makeDirParents($a_target_dir."/assessment/0/".$q_id."/images");
2214  ilUtil::rCopy(ilUtil::getWebspaceDir()."/assessment/0/".$q_id."/images",
2215  $a_target_dir."/assessment/0/".$q_id."/images");
2216  }
2217  }
2218 
2219  // export table of contents
2220  $ilBench->start("ExportHTML", "exportHTMLTOC");
2221  $ilLocator->clearItems();
2222  if ($this->isActiveTOC())
2223  {
2224  $tpl = new ilTemplate("tpl.main.html", true, true);
2225  //$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2226  $content =& $lm_gui->showTableOfContents();
2227  $file = $a_target_dir."/table_of_contents.html";
2228 
2229  // open file
2230  if (!($fp = @fopen($file,"w+")))
2231  {
2232  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2233  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2234  }
2235  chmod($file, 0770);
2236  fwrite($fp, $content);
2237  fclose($fp);
2238  }
2239  $ilBench->stop("ExportHTML", "exportHTMLTOC");
2240 
2241  // export images
2242  $ilBench->start("ExportHTML", "exportHTMLImages");
2243  $image_dir = $a_target_dir."/images";
2244  ilUtil::makeDir($image_dir);
2245  ilUtil::makeDir($image_dir."/browser");
2246  copy(ilUtil::getImagePath("enlarge.svg", false, "filesystem"),
2247  $image_dir."/enlarge.svg");
2248  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
2249  $image_dir."/browser/plus.png");
2250  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
2251  $image_dir."/browser/minus.png");
2252  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
2253  $image_dir."/browser/blank.png");
2254  copy(ilUtil::getImagePath("spacer.png", false, "filesystem"),
2255  $image_dir."/spacer.png");
2256  copy(ilUtil::getImagePath("icon_st.svg", false, "filesystem"),
2257  $image_dir."/icon_st.svg");
2258  copy(ilUtil::getImagePath("icon_pg.svg", false, "filesystem"),
2259  $image_dir."/icon_pg.svg");
2260  copy(ilUtil::getImagePath("icon_lm.svg", false, "filesystem"),
2261  $image_dir."/icon_lm.svg");
2262  copy(ilUtil::getImagePath("nav_arr_L.png", false, "filesystem"),
2263  $image_dir."/nav_arr_L.png");
2264  copy(ilUtil::getImagePath("nav_arr_R.png", false, "filesystem"),
2265  $image_dir."/nav_arr_R.png");
2266 
2267  $ilBench->stop("ExportHTML", "exportHTMLImages");
2268 
2269  // export flv/mp3 player
2270  $services_dir = $a_target_dir."/Services";
2271  ilUtil::makeDir($services_dir);
2272  $media_service_dir = $services_dir."/MediaObjects";
2273  ilUtil::makeDir($media_service_dir);
2274  include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
2275  $flv_dir = $a_target_dir."/".ilPlayerUtil::getFlashVideoPlayerDirectory();
2276  ilUtil::makeDir($flv_dir);
2277  $mp3_dir = $media_service_dir."/flash_mp3_player";
2278  ilUtil::makeDir($mp3_dir);
2279 // copy(ilPlayerUtil::getFlashVideoPlayerFilename(true),
2280 // $flv_dir."/".ilPlayerUtil::getFlashVideoPlayerFilename());
2282  include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
2285 
2286  // js files
2287  ilUtil::makeDir($a_target_dir.'/js');
2288  ilUtil::makeDir($a_target_dir.'/js/yahoo');
2289  ilUtil::makeDir($a_target_dir.'/css');
2290  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
2291  foreach (self::getSupplyingExportFiles($a_target_dir) as $f)
2292  {
2293  if ($f["source"] != "")
2294  {
2295  copy($f["source"], $f["target"]);
2296  }
2297  }
2298 
2299  // template workaround: reset of template
2300  $tpl = new ilTemplate("tpl.main.html", true, true);
2301  $tpl->setVariable("LOCATION_STYLESHEET",$location_stylesheet);
2302  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2303 
2304  if ($a_lang != "")
2305  {
2306  $ilUser->setLanguage($user_lang);
2307  $ilUser->setCurrentLanguage($user_lang);
2308  }
2309 
2310  // zip everything
2311  if ($a_zip_file)
2312  {
2313  if ($a_lang == "")
2314  {
2315  $zip_target_dir = $this->getExportDirectory("html");
2316  }
2317  else
2318  {
2319  $zip_target_dir = $this->getExportDirectory("html_".$a_lang);
2320  ilUtil::makeDir($zip_target_dir);
2321  }
2322 
2323  // zip it all
2324  $date = time();
2325  $zip_file = $zip_target_dir."/".$date."__".IL_INST_ID."__".
2326  $this->getType()."_".$this->getId().".zip";
2327 //echo "-".$a_target_dir."-".$zip_file."-"; exit;
2328  ilUtil::zip($a_target_dir, $zip_file);
2329  ilUtil::delDir($a_target_dir);
2330  }
2331  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
print $file
exportHTMLGlossaryTerms(&$a_lm_gui, $a_target_dir)
export glossary terms
getStyleSheetId()
get ID of assigned style sheet object
getExportDirectory($a_type="xml")
get export directory of lm
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
copyPlayerFilesToTargetDirectory($a_target_dir)
Copy css files to target dir.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
exportHTMLFile($a_target_dir, $a_file_id)
export file object
getSyntaxStylePath()
get syntax style path
global $tpl
Definition: ilias.php:8
Class ilLMPresentationGUI.
static createHTMLExportDirs($a_target_dir)
Create html export directories.
getId()
get object id public
$GLOBALS['ct_recipient']
exportHTMLMOB($a_target_dir, &$a_lm_gui, $a_mob_id, $a_frame, &$a_linked_mobs)
export media object to html
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
static getFlashVideoPlayerDirectory()
Get flash video player directory.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
getType()
get object type public
static _lookupType($a_id, $a_reference=false)
lookup object type
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
global $ilUser
Definition: imgupload.php:15
static getInstance($a_obj_id)
Get instance.
global $ilBench
Definition: ilias.php:18
Class ilObjStyleSheet.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static getWebspaceDir($mode="filesystem")
get webspace directory
exportHTMLPages(&$a_lm_gui, $a_target_dir, $a_lang="")
export all pages of learning module to html file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportHTMLFile()

ilObjContentObject::exportHTMLFile (   $a_target_dir,
  $a_file_id 
)

export file object

Definition at line 2424 of file class.ilObjContentObject.php.

References ilUtil\makeDir().

Referenced by exportHTML().

2425  {
2426  $file_dir = $a_target_dir."/files/file_".$a_file_id;
2427  ilUtil::makeDir($file_dir);
2428  include_once("./Modules/File/classes/class.ilObjFile.php");
2429  $file_obj = new ilObjFile($a_file_id, false);
2430  $source_file = $file_obj->getDirectory($file_obj->getVersion())."/".$file_obj->getFileName();
2431  if (!is_file($source_file))
2432  {
2433  $source_file = $file_obj->getDirectory()."/".$file_obj->getFileName();
2434  }
2435  if (is_file($source_file))
2436  {
2437  copy($source_file, $file_dir."/".$file_obj->getFileName());
2438  }
2439  }
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()

ilObjContentObject::exportHTMLGlossaryTerms ( $a_lm_gui,
  $a_target_dir 
)

export glossary terms

Definition at line 2507 of file class.ilObjContentObject.php.

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

Referenced by exportHTML().

2508  {
2509  global $ilLocator;
2510 
2511  foreach($this->offline_int_links as $int_link)
2512  {
2513  $ilLocator->clearItems();
2514  if ($int_link["type"] == "git")
2515  {
2516  $tpl = new ilTemplate("tpl.main.html", true, true);
2517  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2518 
2519  $_GET["obj_id"] = $int_link["id"];
2520  $_GET["frame"] = "_blank";
2521  $content =& $a_lm_gui->glossary();
2522  $file = $a_target_dir."/term_".$int_link["id"].".html";
2523 
2524  // open file
2525  if (!($fp = @fopen($file,"w+")))
2526  {
2527  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2528  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2529  }
2530  chmod($file, 0770);
2531  fwrite($fp, $content);
2532  fclose($fp);
2533 
2534  // store linked/embedded media objects of glosssary term
2535  include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
2536  $defs = ilGlossaryDefinition::getDefinitionList($int_link["id"]);
2537  foreach($defs as $def)
2538  {
2539  $def_mobs = ilObjMediaObject::_getMobsOfObject("gdf:pg", $def["id"]);
2540  foreach($def_mobs as $def_mob)
2541  {
2542  $this->offline_mobs[$def_mob] = $def_mob;
2543  }
2544 
2545  // get all files of page
2546  $def_files = ilObjFile::_getFilesOfObject("gdf:pg", $page["obj_id"]);
2547  $this->offline_files = array_merge($this->offline_files, $def_files);
2548 
2549  }
2550 
2551  }
2552  }
2553  }
print $file
getDefinitionList($a_term_id)
static
$_GET["client_id"]
_getFilesOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_usage_lang="-")
get all files of an object
global $tpl
Definition: ilias.php:8
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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportHTMLMOB()

ilObjContentObject::exportHTMLMOB (   $a_target_dir,
$a_lm_gui,
  $a_mob_id,
  $a_frame,
$a_linked_mobs 
)

export media object to html

Definition at line 2444 of file class.ilObjContentObject.php.

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

Referenced by exportHTML().

2445  {
2446  global $tpl;
2447 
2448  $mob_dir = $a_target_dir."/mobs";
2449 
2450  $source_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob_id;
2451  if (@is_dir($source_dir))
2452  {
2453  ilUtil::makeDir($mob_dir."/mm_".$a_mob_id);
2454  ilUtil::rCopy($source_dir, $mob_dir."/mm_".$a_mob_id);
2455  }
2456 
2457  $tpl = new ilTemplate("tpl.main.html", true, true);
2458  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2459  $_GET["obj_type"] = "MediaObject";
2460  $_GET["mob_id"] = $a_mob_id;
2461  $_GET["frame"] = $a_frame;
2462  $_GET["cmd"] = "";
2463  $content =& $a_lm_gui->media();
2464  $file = $a_target_dir."/media_".$a_mob_id.".html";
2465 
2466  // open file
2467  if (!($fp = @fopen($file,"w+")))
2468  {
2469  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2470  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2471  }
2472  chmod($file, 0770);
2473  fwrite($fp, $content);
2474  fclose($fp);
2475 
2476  // fullscreen
2477  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2478  $mob_obj = new ilObjMediaObject($a_mob_id);
2479  if ($mob_obj->hasFullscreenItem())
2480  {
2481  $tpl = new ilTemplate("tpl.main.html", true, true);
2482  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2483  $_GET["obj_type"] = "";
2484  $_GET["frame"] = "";
2485  $_GET["mob_id"] = $a_mob_id;
2486  $_GET["cmd"] = "fullscreen";
2487  $content =& $a_lm_gui->fullscreen();
2488  $file = $a_target_dir."/fullscreen_".$a_mob_id.".html";
2489 
2490  // open file
2491  if (!($fp = @fopen($file,"w+")))
2492  {
2493  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2494  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2495  }
2496  chmod($file, 0770);
2497  fwrite($fp, $content);
2498  fclose($fp);
2499  }
2500  $linked_mobs = $mob_obj->getLinkedMediaObjects();
2501  $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
2502  }
print $file
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
special template class to simplify handling of ITX/PEAR
Class ilObjMediaObject.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static getWebspaceDir($mode="filesystem")
get webspace directory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportHTMLPages()

ilObjContentObject::exportHTMLPages ( $a_lm_gui,
  $a_target_dir,
  $a_lang = "" 
)

export all pages of learning module to html file

Definition at line 2558 of file class.ilObjContentObject.php.

References $ilBench, $lm_set, $mobs, $tpl, ilPageObject\_exists(), ilObjFile\_getFilesOfObject(), ilObjMediaObject\_getMobsOfObject(), ilPCQuestion\_getQuestionIdsForPage(), ilInternalLink\_getTargetsOfSource(), exportPageHTML(), ilLMObject\getExportId(), ilObject\getId(), getLMTree(), ilLMPageObject\getPageList(), ilObject\getType(), and ilPageContentUsage\getUsagesOfPage().

Referenced by exportHTML().

2559  {
2560  global $tpl, $ilBench, $ilLocator;
2561 
2562  $pages = ilLMPageObject::getPageList($this->getId());
2563 
2564  $lm_tree =& $this->getLMTree();
2565  $first_page = $lm_tree->fetchSuccessorNode($lm_tree->getRootId(), "pg");
2566  $this->first_page_id = $first_page["child"];
2567 
2568  // iterate all learning module pages
2569  $mobs = array();
2570  $int_links = array();
2571  $this->offline_files = array();
2572 
2573  include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
2574  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2575 
2576  // get html export id mapping
2577  $lm_set = new ilSetting("lm");
2578  $exp_id_map = array();
2579 
2580  if ($lm_set->get("html_export_ids"))
2581  {
2582  foreach ($pages as $page)
2583  {
2584  $exp_id = ilLMPageObject::getExportId($this->getId(), $page["obj_id"]);
2585  if (trim($exp_id) != "")
2586  {
2587  $exp_id_map[$page["obj_id"]] = trim($exp_id);
2588  }
2589  }
2590  }
2591 //exit;
2592  if ($a_lang == "")
2593  {
2594  $a_lang = "-";
2595  }
2596 
2597  reset($pages);
2598  foreach ($pages as $page)
2599  {
2600  if (ilLMPage::_exists($this->getType(), $page["obj_id"]))
2601  {
2602  $ilLocator->clearItems();
2603  $ilBench->start("ExportHTML", "exportHTMLPage");
2604  $ilBench->start("ExportHTML", "exportPageHTML");
2605  $this->exportPageHTML($a_lm_gui, $a_target_dir, $page["obj_id"],
2606  "", $exp_id_map);
2607  $ilBench->stop("ExportHTML", "exportPageHTML");
2608 
2609  // get all snippets of page
2610  $pcs = ilPageContentUsage::getUsagesOfPage($page["obj_id"], $this->getType().":pg", 0, false, $a_lang);
2611  foreach ($pcs as $pc)
2612  {
2613  if ($pc["type"] == "incl")
2614  {
2615  $incl_mobs = ilObjMediaObject::_getMobsOfObject("mep:pg", $pc["id"]);
2616  foreach($incl_mobs as $incl_mob)
2617  {
2618  $mobs[$incl_mob] = $incl_mob;
2619  }
2620  }
2621  }
2622 
2623  // get all media objects of page
2624  $pg_mobs = ilObjMediaObject::_getMobsOfObject($this->getType().":pg", $page["obj_id"], 0, $a_lang);
2625  foreach($pg_mobs as $pg_mob)
2626  {
2627  $mobs[$pg_mob] = $pg_mob;
2628  }
2629 
2630  // get all internal links of page
2631  $pg_links = ilInternalLink::_getTargetsOfSource($this->getType().":pg", $page["obj_id"], $a_lang);
2632  $int_links = array_merge($int_links, $pg_links);
2633 
2634  // get all files of page
2635  include_once("./Modules/File/classes/class.ilObjFile.php");
2636  $pg_files = ilObjFile::_getFilesOfObject($this->getType().":pg", $page["obj_id"], 0, $a_lang);
2637  $this->offline_files = array_merge($this->offline_files, $pg_files);
2638 
2639  // collect all questions
2640  include_once("./Services/COPage/classes/class.ilPCQuestion.php");
2641  $q_ids = ilPCQuestion::_getQuestionIdsForPage($this->getType(), $page["obj_id"], $a_lang);
2642  foreach($q_ids as $q_id)
2643  {
2644  $this->q_ids[$q_id] = $q_id;
2645  }
2646 
2647  $ilBench->stop("ExportHTML", "exportHTMLPage");
2648  }
2649  }
2650  $this->offline_mobs = $mobs;
2651  $this->offline_int_links = $int_links;
2652  }
ILIAS Setting Class.
static _getQuestionIdsForPage($a_parent_type, $a_page_id, $a_lang="-")
Get all questions of a page.
_getFilesOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_usage_lang="-")
get all files of an object
global $tpl
Definition: ilias.php:8
getUsagesOfPage($a_usage_id, $a_usage_type, $a_hist_nr=0, $a_all_hist_nrs=false, $a_lang="-")
Get page content usages for page.
$mobs
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
getId()
get object id public
& getLMTree()
get content object tree
getPageList($lm_id)
static
static getExportId($a_lm_id, $a_lmobj_id, $a_type="pg")
Get export ID.
getType()
get object type public
_getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
exportPageHTML(&$a_lm_gui, $a_target_dir, $a_lm_page_id, $a_frame="", $a_exp_id_map=array())
export page html
$lm_set
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportPageHTML()

ilObjContentObject::exportPageHTML ( $a_lm_gui,
  $a_target_dir,
  $a_lm_page_id,
  $a_frame = "",
  $a_exp_id_map = array() 
)

export page html

Definition at line 2659 of file class.ilObjContentObject.php.

References $_GET, $file, $ilBench, $tpl, and ilPCQuestion\resetInitialState().

Referenced by exportHTMLPages().

2661  {
2662  global $tpl, $ilBench;
2663 
2664 //echo "<br>B: export Page HTML ($a_lm_page_id)"; flush();
2665  // template workaround: reset of template
2666  $tpl = new ilTemplate("tpl.main.html", true, true);
2667  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2668 
2669  include_once("./Services/COPage/classes/class.ilPCQuestion.php");
2671 
2672  $_GET["obj_id"] = $a_lm_page_id;
2673  $_GET["frame"] = $a_frame;
2674 
2675  if ($a_frame == "")
2676  {
2677  //if ($nid = ilLMObject::_lookupNID($a_lm_gui->lm->getId(), $a_lm_page_id, "pg"))
2678  if (is_array($a_exp_id_map) && isset($a_exp_id_map[$a_lm_page_id]))
2679  {
2680  $file = $a_target_dir."/lm_pg_".$a_exp_id_map[$a_lm_page_id].".html";
2681  }
2682  else
2683  {
2684  $file = $a_target_dir."/lm_pg_".$a_lm_page_id.".html";
2685  }
2686  }
2687  else
2688  {
2689  if ($a_frame != "toc")
2690  {
2691  $file = $a_target_dir."/frame_".$a_lm_page_id."_".$a_frame.".html";
2692  }
2693  else
2694  {
2695  $file = $a_target_dir."/frame_".$a_frame.".html";
2696  }
2697  }
2698 
2699  // return if file is already existing
2700  if (@is_file($file))
2701  {
2702  return;
2703  }
2704 
2705  $content =& $a_lm_gui->layout("main.xml", false);
2706 
2707  // open file
2708  if (!($fp = @fopen($file,"w+")))
2709  {
2710  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2711  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2712  }
2713 
2714  // set file permissions
2715  chmod($file, 0770);
2716 
2717  // write xml data into the file
2718  fwrite($fp, $content);
2719 
2720  // close file
2721  fclose($fp);
2722 
2723  if ($this->first_page_id == $a_lm_page_id && $a_frame == "")
2724  {
2725  copy($file, $a_target_dir."/index.html");
2726  }
2727 
2728  // write frames of frameset
2729  $frameset = $a_lm_gui->getCurrentFrameSet();
2730 
2731  foreach ($frameset as $frame)
2732  {
2733  $this->exportPageHTML($a_lm_gui, $a_target_dir, $a_lm_page_id, $frame);
2734  }
2735 
2736  }
print $file
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
special template class to simplify handling of ITX/PEAR
static resetInitialState()
Reset initial state (for exports)
exportPageHTML(&$a_lm_gui, $a_target_dir, $a_lm_page_id, $a_frame="", $a_exp_id_map=array())
export page html
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportSCORM()

ilObjContentObject::exportSCORM (   $a_target_dir,
  $log 
)

export scorm package

Definition at line 2018 of file class.ilObjContentObject.php.

References $log, ilUtil\delDir(), exportHTML(), getExportDirectory(), ilObject\getId(), ilObject\getType(), ilUtil\makeDir(), and ilUtil\zip().

2019  {
2020  ilUtil::delDir($a_target_dir);
2021  ilUtil::makeDir($a_target_dir);
2022  //ilUtil::makeDir($a_target_dir."/res");
2023 
2024  // export everything to html
2025  $this->exportHTML($a_target_dir."/res", $log, false, "scorm");
2026 
2027  // build manifest file
2028  include("./Modules/LearningModule/classes/class.ilContObjectManifestBuilder.php");
2029  $man_builder = new ilContObjectManifestBuilder($this);
2030  $man_builder->buildManifest();
2031  $man_builder->dump($a_target_dir);
2032 
2033  // copy scorm 1.2 schema definitions
2034  copy("Modules/LearningModule/scorm_xsd/adlcp_rootv1p2.xsd", $a_target_dir."/adlcp_rootv1p2.xsd");
2035  copy("Modules/LearningModule/scorm_xsd/imscp_rootv1p1p2.xsd", $a_target_dir."/imscp_rootv1p1p2.xsd");
2036  copy("Modules/LearningModule/scorm_xsd/imsmd_rootv1p2p1.xsd", $a_target_dir."/imsmd_rootv1p2p1.xsd");
2037  copy("Modules/LearningModule/scorm_xsd/ims_xml.xsd", $a_target_dir."/ims_xml.xsd");
2038 
2039  // zip it all
2040  $date = time();
2041  $zip_file = $a_target_dir."/".$date."__".IL_INST_ID."__".
2042  $this->getType()."_".$this->getId().".zip";
2043  //echo "zip-".$a_target_dir."-to-".$zip_file;
2044  ilUtil::zip(array($a_target_dir."/res",
2045  $a_target_dir."/imsmanifest.xml",
2046  $a_target_dir."/adlcp_rootv1p2.xsd",
2047  $a_target_dir."/imscp_rootv1p1p2.xsd",
2048  $a_target_dir."/ims_xml.xsd",
2049  $a_target_dir."/imsmd_rootv1p2p1.xsd")
2050  , $zip_file);
2051 
2052  $dest_file = $this->getExportDirectory("scorm")."/".$date."__".IL_INST_ID."__".
2053  $this->getType()."_".$this->getId().".zip";
2054 
2055  rename($zip_file, $dest_file);
2056  ilUtil::delDir($a_target_dir);
2057 
2058  }
getExportDirectory($a_type="xml")
get export directory of lm
exportHTML($a_target_dir, $log, $a_zip_file=true, $a_export_format="html", $a_lang="")
export html package
getId()
get object id public
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 ...
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
Content Object (ILIAS native learning module / digilib book) Manifest export class.
+ Here is the call graph for this function:

◆ exportXML()

ilObjContentObject::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 1575 of file class.ilObjContentObject.php.

References $ilBench, exportFileItems(), exportXMLMediaObjects(), exportXMLMetaData(), exportXMLPageObjects(), exportXMLProperties(), exportXMLStructureObjects(), and ilObject\getType().

1576  {
1577  global $ilBench;
1578 
1579  $attrs = array();
1580  switch($this->getType())
1581  {
1582  case "lm":
1583  $attrs["Type"] = "LearningModule";
1584  break;
1585 
1586  case "dbk":
1587  $attrs["Type"] = "LibObject";
1588  break;
1589  }
1590  $a_xml_writer->xmlStartTag("ContentObject", $attrs);
1591 
1592  // MetaData
1593  $this->exportXMLMetaData($a_xml_writer);
1594 
1595  // StructureObjects
1596 //echo "ContObj:".$a_inst.":<br>";
1597  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Structure Objects");
1598  $ilBench->start("ContentObjectExport", "exportStructureObjects");
1599  $this->exportXMLStructureObjects($a_xml_writer, $a_inst, $expLog);
1600  $ilBench->stop("ContentObjectExport", "exportStructureObjects");
1601  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Structure Objects");
1602 
1603  // PageObjects
1604  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Page Objects");
1605  $ilBench->start("ContentObjectExport", "exportPageObjects");
1606  $this->exportXMLPageObjects($a_xml_writer, $a_inst, $expLog);
1607  $ilBench->stop("ContentObjectExport", "exportPageObjects");
1608  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Page Objects");
1609 
1610  // MediaObjects
1611  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Media Objects");
1612  $ilBench->start("ContentObjectExport", "exportMediaObjects");
1613  $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
1614  $ilBench->stop("ContentObjectExport", "exportMediaObjects");
1615  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Media Objects");
1616 
1617  // FileItems
1618  $expLog->write(date("[y-m-d H:i:s] ")."Start Export File Items");
1619  $ilBench->start("ContentObjectExport", "exportFileItems");
1620  $this->exportFileItems($a_target_dir, $expLog);
1621  $ilBench->stop("ContentObjectExport", "exportFileItems");
1622  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export File Items");
1623 
1624  // Questions
1625  if (count($this->q_ids) > 0)
1626  {
1627  $qti_file = fopen($a_target_dir."/qti.xml", "w");
1628  include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
1629  $pool = new ilObjQuestionPool();
1630  fwrite($qti_file, $pool->toXML($this->q_ids));
1631  fclose($qti_file);
1632  }
1633 
1634  // To do: implement version selection/detection
1635  // Properties
1636  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Properties");
1637  $this->exportXMLProperties($a_xml_writer, $expLog);
1638  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Properties");
1639 
1640  $a_xml_writer->xmlEndTag("ContentObject");
1641  }
exportFileItems($a_target_dir, &$expLog)
export files of file itmes
exportXMLPageObjects(&$a_xml_writer, $a_inst, &$expLog)
export page objects to xml (see ilias_co.dtd)
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)
exportXMLStructureObjects(&$a_xml_writer, $a_inst, &$expLog)
export structure objects to xml (see ilias_co.dtd)
exportXMLProperties($a_xml_writer, &$expLog)
export properties of content object
getType()
get object type public
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ exportXMLMediaObjects()

ilObjContentObject::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 1739 of file class.ilObjContentObject.php.

References ilObject\_lookupType().

Referenced by exportXML().

1740  {
1741  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1742 
1743  $linked_mobs = array();
1744 
1745  // mobs directly embedded into pages
1746  foreach ($this->mob_ids as $mob_id)
1747  {
1748  if ($mob_id > 0 && ilObject::_lookupType($mob_id) == "mob")
1749  {
1750  $expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
1751  $media_obj = new ilObjMediaObject($mob_id);
1752  $media_obj->exportXML($a_xml_writer, $a_inst);
1753  $media_obj->exportFiles($a_target_dir);
1754 
1755  $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
1756  $linked_mobs = array_merge($linked_mobs, $lmobs);
1757 
1758  unset($media_obj);
1759  }
1760  }
1761 
1762  // linked mobs (in map areas)
1763  foreach ($linked_mobs as $mob_id)
1764  {
1765  if ($mob_id > 0)
1766  {
1767  $expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
1768  $media_obj = new ilObjMediaObject($mob_id);
1769  $media_obj->exportXML($a_xml_writer, $a_inst);
1770  $media_obj->exportFiles($a_target_dir);
1771  unset($media_obj);
1772  }
1773  }
1774 
1775  }
Class ilObjMediaObject.
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLMetaData()

ilObjContentObject::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 1649 of file class.ilObjContentObject.php.

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

Referenced by exportXML().

1650  {
1651  include_once("Services/MetaData/classes/class.ilMD2XML.php");
1652  $md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
1653  $md2xml->setExportMode(true);
1654  $md2xml->startExport();
1655  $a_xml_writer->appendXML($md2xml->getXML());
1656  }
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:

◆ exportXMLPageObjects()

ilObjContentObject::exportXMLPageObjects ( $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 1689 of file class.ilObjContentObject.php.

References $ilBench, ilPageObject\_exists(), ilObject\getId(), ilLMPageObject\getPageList(), and ilObject\getType().

Referenced by exportXML().

1690  {
1691  global $ilBench;
1692 
1693  include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
1694  include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
1695 
1696  $pages = ilLMPageObject::getPageList($this->getId());
1697  foreach ($pages as $page)
1698  {
1699  if (ilLMPage::_exists($this->getType(), $page["obj_id"]))
1700  {
1701  $expLog->write(date("[y-m-d H:i:s] ")."Page Object ".$page["obj_id"]);
1702 
1703  // export xml to writer object
1704  $page_obj = new ilLMPageObject($this, $page["obj_id"]);
1705  $page_obj->exportXML($a_xml_writer, "normal", $a_inst);
1706 
1707  // collect media objects
1708  $mob_ids = $page_obj->getMediaObjectIDs();
1709  foreach($mob_ids as $mob_id)
1710  {
1711  $this->mob_ids[$mob_id] = $mob_id;
1712  }
1713 
1714  // collect all file items
1715  $file_ids = $page_obj->getFileItemIds();
1716  foreach($file_ids as $file_id)
1717  {
1718  $this->file_ids[$file_id] = $file_id;
1719  }
1720 
1721  // collect all questions
1722  $q_ids = $page_obj->getQuestionIds();
1723  foreach($q_ids as $q_id)
1724  {
1725  $this->q_ids[$q_id] = $q_id;
1726  }
1727 
1728  unset($page_obj);
1729  }
1730  }
1731  }
Class ilLMPageObject.
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
getId()
get object id public
getPageList($lm_id)
static
getType()
get object type public
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLProperties()

ilObjContentObject::exportXMLProperties (   $a_xml_writer,
$expLog 
)

export properties of content object

Definition at line 1798 of file class.ilObjContentObject.php.

References cleanFrames(), getDisableDefaultFeedback(), getFooterPage(), getHeaderPage(), getLayout(), getLayoutPerPage(), getPageHeader(), getProgressIcons(), getRestrictForwardNavigation(), getStoreTries(), getTOCMode(), hasRating(), hasRatingPages(), isActiveHistoryUserComments(), isActiveLMMenu(), isActiveNumbering(), isActivePrintView(), isActiveTOC(), publicNotes(), and ilUtil\tf2yn().

Referenced by exportXML().

1799  {
1800  $attrs = array();
1801  $a_xml_writer->xmlStartTag("Properties", $attrs);
1802 
1803  // Layout
1804  $attrs = array("Name" => "Layout", "Value" => $this->getLayout());
1805  $a_xml_writer->xmlElement("Property", $attrs);
1806 
1807  // Page Header
1808  $attrs = array("Name" => "PageHeader", "Value" => $this->getPageHeader());
1809  $a_xml_writer->xmlElement("Property", $attrs);
1810 
1811  // TOC Mode
1812  $attrs = array("Name" => "TOCMode", "Value" => $this->getTOCMode());
1813  $a_xml_writer->xmlElement("Property", $attrs);
1814 
1815  // LM Menu Activation
1816  $attrs = array("Name" => "ActiveLMMenu", "Value" =>
1817  ilUtil::tf2yn($this->isActiveLMMenu()));
1818  $a_xml_writer->xmlElement("Property", $attrs);
1819 
1820  // Numbering Activation
1821  $attrs = array("Name" => "ActiveNumbering", "Value" =>
1822  ilUtil::tf2yn($this->isActiveNumbering()));
1823  $a_xml_writer->xmlElement("Property", $attrs);
1824 
1825  // Table of contents button activation
1826  $attrs = array("Name" => "ActiveTOC", "Value" =>
1827  ilUtil::tf2yn($this->isActiveTOC()));
1828  $a_xml_writer->xmlElement("Property", $attrs);
1829 
1830  // Print view button activation
1831  $attrs = array("Name" => "ActivePrintView", "Value" =>
1832  ilUtil::tf2yn($this->isActivePrintView()));
1833  $a_xml_writer->xmlElement("Property", $attrs);
1834 
1835  // Note that download button is not saved, because
1836  // download files do not exist after import
1837 
1838  // Clean frames
1839  $attrs = array("Name" => "CleanFrames", "Value" =>
1840  ilUtil::tf2yn($this->cleanFrames()));
1841  $a_xml_writer->xmlElement("Property", $attrs);
1842 
1843  // Public notes activation
1844  $attrs = array("Name" => "PublicNotes", "Value" =>
1845  ilUtil::tf2yn($this->publicNotes()));
1846  $a_xml_writer->xmlElement("Property", $attrs);
1847 
1848  // History comments for authors activation
1849  $attrs = array("Name" => "HistoryUserComments", "Value" =>
1851  $a_xml_writer->xmlElement("Property", $attrs);
1852 
1853  // Rating
1854  $attrs = array("Name" => "Rating", "Value" =>
1855  ilUtil::tf2yn($this->hasRating()));
1856  $a_xml_writer->xmlElement("Property", $attrs);
1857  $attrs = array("Name" => "RatingPages", "Value" =>
1858  ilUtil::tf2yn($this->hasRatingPages()));
1859  $a_xml_writer->xmlElement("Property", $attrs);
1860 
1861  // Header Page
1862  if ($this->getHeaderPage() > 0)
1863  {
1864  $attrs = array("Name" => "HeaderPage", "Value" =>
1865  "il_".IL_INST_ID."_pg_".$this->getHeaderPage());
1866  $a_xml_writer->xmlElement("Property", $attrs);
1867  }
1868 
1869  // Footer Page
1870  if ($this->getFooterPage() > 0)
1871  {
1872  $attrs = array("Name" => "FooterPage", "Value" =>
1873  "il_".IL_INST_ID."_pg_".$this->getFooterPage());
1874  $a_xml_writer->xmlElement("Property", $attrs);
1875  }
1876 
1877  // layout per page
1878  $attrs = array("Name" => "LayoutPerPage", "Value" =>
1879  $this->getLayoutPerPage());
1880  $a_xml_writer->xmlElement("Property", $attrs);
1881 
1882  // progress icons
1883  $attrs = array("Name" => "ProgressIcons", "Value" =>
1884  $this->getProgressIcons());
1885  $a_xml_writer->xmlElement("Property", $attrs);
1886 
1887  // store tries
1888  $attrs = array("Name" => "StoreTries", "Value" =>
1889  $this->getStoreTries());
1890  $a_xml_writer->xmlElement("Property", $attrs);
1891 
1892  // restrict forward navigation
1893  $attrs = array("Name" => "RestrictForwardNavigation", "Value" =>
1894  $this->getRestrictForwardNavigation());
1895  $a_xml_writer->xmlElement("Property", $attrs);
1896 
1897  // disable default feedback
1898  $attrs = array("Name" => "DisableDefaultFeedback", "Value" =>
1899  $this->getDisableDefaultFeedback());
1900  $a_xml_writer->xmlElement("Property", $attrs);
1901 
1902  $a_xml_writer->xmlEndTag("Properties");
1903  }
static tf2yn($a_tf)
convert true/false to "y"/"n"
getLayout()
get default page layout of content object (see directory layouts/)
getStoreTries()
Get store tries.
getLayoutPerPage()
Get layout per page.
getProgressIcons()
Get progress icons.
getPageHeader()
get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER)
getTOCMode()
get toc mode ("chapters" | "pages")
getDisableDefaultFeedback()
Get disable default feedback for questions.
getRestrictForwardNavigation()
Get restrict forward navigation.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLStructureObjects()

ilObjContentObject::exportXMLStructureObjects ( $a_xml_writer,
  $a_inst,
$expLog 
)

export structure objects to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 1664 of file class.ilObjContentObject.php.

Referenced by exportXML().

1665  {
1666  include_once './Modules/LearningModule/classes/class.ilStructureObject.php';
1667 
1668  $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
1669  foreach ($childs as $child)
1670  {
1671  if($child["type"] != "st")
1672  {
1673  continue;
1674  }
1675 
1676  $structure_obj = new ilStructureObject($this, $child["obj_id"]);
1677  $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
1678  unset($structure_obj);
1679  }
1680  }
Class ilStructreObject.
+ Here is the caller graph for this function:

◆ fixTree()

ilObjContentObject::fixTree ( )

fix tree

Definition at line 1450 of file class.ilObjContentObject.php.

References $ilDB, ilLMObjectFactory\getInstance(), and getLMTree().

1451  {
1452  global $ilDB;
1453 
1454  $tree =& $this->getLMTree();
1455 
1456  // check numbering, if errors, renumber
1457  // it is very important to keep this step before deleting subtrees
1458  // in the following steps
1459  $set = $ilDB->query("SELECT DISTINCT l1.lm_id".
1460  " FROM lm_tree l1".
1461  " JOIN lm_tree l2 ON ( l1.child = l2.parent".
1462  " AND l1.lm_id = l2.lm_id )".
1463  " JOIN lm_data ON ( l1.child = lm_data.obj_id )".
1464  " WHERE (l2.lft < l1.lft".
1465  " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)".
1466  " AND l1.lm_id = ".$ilDB->quote($this->getId(), "integer").
1467  " ORDER BY lm_data.create_date DESC"
1468  );
1469  if ($rec = $ilDB->fetchAssoc($set))
1470  {
1471  $tree->renumber();
1472  }
1473 
1474  // delete subtrees that have no lm_data records
1475  $nodes = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1476  foreach ($nodes as $node)
1477  {
1478  $q = "SELECT * FROM lm_data WHERE obj_id = ".
1479  $ilDB->quote($node["child"], "integer");
1480  $obj_set = $ilDB->query($q);
1481  $obj_rec = $ilDB->fetchAssoc($obj_set);
1482  if (!$obj_rec)
1483  {
1484  $node_data = $tree->getNodeData($node["child"]);
1485  $tree->deleteTree($node_data);
1486  }
1487  }
1488 
1489  // delete subtrees that have pages as parent
1490  $nodes = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1491  foreach ($nodes as $node)
1492  {
1493  $q = "SELECT * FROM lm_data WHERE obj_id = ".
1494  $ilDB->quote($node["parent"], "integer");
1495  $obj_set = $ilDB->query($q);
1496  $obj_rec = $ilDB->fetchAssoc($obj_set);
1497  if ($obj_rec["type"] == "pg")
1498  {
1499  $node_data = $tree->getNodeData($node["child"]);
1500  if ($tree->isInTree($node["child"]))
1501  {
1502  $tree->deleteTree($node_data);
1503  }
1504  }
1505  }
1506 
1507  // check for multi-references pages or chapters
1508  // if errors -> create copies of them here
1509  $set = $ilDB->query("SELECT DISTINCT l1.lm_id".
1510  " FROM lm_tree l1".
1511  " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )".
1512  " JOIN lm_data ON (l1.child = lm_data.obj_id)".
1513  " WHERE l1.child <> 1".
1514  " AND l1.lm_id <> lm_data.lm_id".
1515  " AND l1.lm_id = ".$ilDB->quote($this->getId(), "integer"));
1516  if ($rec = $ilDB->fetchAssoc($set))
1517  {
1518  $set = $ilDB->query("SELECT DISTINCT l1.child ".
1519  " FROM lm_tree l1".
1520  " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )".
1521  " JOIN lm_data ON (l1.child = lm_data.obj_id)".
1522  " WHERE l1.child <> 1".
1523  " AND l1.lm_id <> lm_data.lm_id".
1524  " AND l1.lm_id = ".$ilDB->quote($this->getId(), "integer"));
1525  include_once("./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
1526  while ($rec = $ilDB->fetchAssoc($set))
1527  {
1528  $cobj = ilLMObjectFactory::getInstance($this, $rec["child"]);
1529 
1530  if (is_object($cobj))
1531  {
1532  if ($cobj->getType() == "pg")
1533  {
1534  // make a copy of it
1535  $pg_copy = $cobj->copy($this);
1536 
1537  // replace the child in the tree with the copy (id)
1538  $ilDB->manipulate("UPDATE lm_tree SET ".
1539  " child = ".$ilDB->quote($pg_copy->getId(), "integer").
1540  " WHERE child = ".$ilDB->quote($cobj->getId(), "integer").
1541  " AND lm_id = ".$ilDB->quote($this->getId(), "integer")
1542  );
1543  }
1544  else if ($cobj->getType() == "st")
1545  {
1546  // make a copy of it
1547  $st_copy = $cobj->copy($this);
1548 
1549  // replace the child in the tree with the copy (id)
1550  $ilDB->manipulate("UPDATE lm_tree SET ".
1551  " child = ".$ilDB->quote($st_copy->getId(), "integer").
1552  " WHERE child = ".$ilDB->quote($cobj->getId(), "integer").
1553  " AND lm_id = ".$ilDB->quote($this->getId(), "integer")
1554  );
1555 
1556  // make all childs refer to the copy now
1557  $ilDB->manipulate("UPDATE lm_tree SET ".
1558  " parent = ".$ilDB->quote($st_copy->getId(), "integer").
1559  " WHERE parent = ".$ilDB->quote($cobj->getId(), "integer").
1560  " AND lm_id = ".$ilDB->quote($this->getId(), "integer")
1561  );
1562  }
1563  }
1564  }
1565  }
1566  }
getInstance(&$a_content_obj, $a_id=0, $a_halt=true)
& getLMTree()
get content object tree
global $ilDB
+ Here is the call graph for this function:

◆ getAutoGlossaries()

ilObjContentObject::getAutoGlossaries ( )

Get auto glossaries.

Returns
array int

Definition at line 360 of file class.ilObjContentObject.php.

References $auto_glossaries.

Referenced by removeAutoGlossary(), and updateAutoGlossaries().

361  {
362  return $this->auto_glossaries;
363  }
+ Here is the caller graph for this function:

◆ getAvailableLayouts()

ilObjContentObject::getAvailableLayouts ( )

get all available lm layouts

static

Definition at line 1213 of file class.ilObjContentObject.php.

References $file, and $ret.

Referenced by ilObjContentObjectGUI\getLayoutOption(), and ilLMPageObjectGUI\initEditLayoutForm().

1214  {
1215  $dir = opendir("./Modules/LearningModule/layouts/lm");
1216 
1217  $layouts = array();
1218 
1219  while($file = readdir($dir))
1220  {
1221  if ($file != "." && $file != ".." && $file != "CVS" && $file != ".svn")
1222  {
1223  // directories
1224  if (@is_dir("./Modules/LearningModule/layouts/lm/".$file))
1225  {
1226  $layouts[$file] = $file;
1227  }
1228  }
1229  }
1230  asort($layouts);
1231 
1232  // workaround: fix ordering
1233  $ret = array(
1234  'toc2win' => 'toc2win',
1235  'toc2windyn' => 'toc2windyn',
1236  '1window' => '1window',
1237  '2window' => '2window',
1238  '3window' => '3window',
1239  'presentation' => 'presentation',
1240  'fullscreen' => 'fullscreen'
1241  );
1242 
1243  foreach ($layouts as $l)
1244  {
1245  if (!in_array($l, $ret))
1246  {
1247  $ret[$l] = $l;
1248  }
1249  }
1250 
1251  return $ret;
1252  }
print $file
+ Here is the caller graph for this function:

◆ getDataDirectory()

ilObjContentObject::getDataDirectory ( )

get data directory

Definition at line 459 of file class.ilObjContentObject.php.

References ilUtil\getDataDir().

Referenced by delete().

460  {
461  return ilUtil::getDataDir()."/lm_data".
462  "/lm_".$this->getId();
463  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDescription()

ilObjContentObject::getDescription ( )

get description of content object

Returns
string description

Definition at line 127 of file class.ilObjContentObject.php.

Referenced by cloneObject().

128  {
129  return parent::getDescription();
130  }
+ Here is the caller graph for this function:

◆ getDisableDefaultFeedback()

ilObjContentObject::getDisableDefaultFeedback ( )

Get disable default feedback for questions.

Returns
bool disable default feedback

Definition at line 187 of file class.ilObjContentObject.php.

Referenced by cloneObject(), exportXMLProperties(), and updateProperties().

188  {
189  return $this->disable_def_feedback;
190  }
+ Here is the caller graph for this function:

◆ getExportDirectory()

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

get export directory of lm

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

References ilUtil\getDataDir().

Referenced by ilObjDlBook\export(), exportHTML(), exportSCORM(), and getExportFiles().

550  {
551  switch ($a_type)
552  {
553  case "scorm":
554  $export_dir = ilUtil::getDataDir()."/lm_data"."/lm_".$this->getId()."/export_scorm";
555  break;
556 
557  default: // = xml
558  if (substr($a_type, 0, 4) == "html")
559  {
560  $export_dir = ilUtil::getDataDir()."/lm_data"."/lm_".$this->getId()."/export_".$a_type;
561  }
562  else
563  {
564  $export_dir = ilUtil::getDataDir()."/lm_data"."/lm_".$this->getId()."/export";
565  }
566  break;
567  }
568  return $export_dir;
569  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExportFiles()

ilObjContentObject::getExportFiles ( )

get export files

Definition at line 1908 of file class.ilObjContentObject.php.

References $file, ilObject\$type, and getExportDirectory().

1909  {
1910  $file = array();
1911 
1912  $types = array("xml", "html", "scorm");
1913 
1914  foreach ($types as $type)
1915  {
1916  $dir = $this->getExportDirectory($type);
1917  // quit if import dir not available
1918  if (!@is_dir($dir) or
1919  !is_writeable($dir))
1920  {
1921  continue;
1922  }
1923 
1924  // open directory
1925  $cdir = dir($dir);
1926 
1927  // initialize array
1928 
1929  // get files and save the in the array
1930  while ($entry = $cdir->read())
1931  {
1932  if ($entry != "." and
1933  $entry != ".." and
1934  substr($entry, -4) == ".zip" and
1935  ereg("^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.zip\$", $entry))
1936  {
1937  $file[$entry.$type] = array("type" => $type, "file" => $entry,
1938  "size" => filesize($dir."/".$entry));
1939  }
1940  }
1941 
1942  // close import directory
1943  $cdir->close();
1944  }
1945 
1946  // sort files
1947  ksort ($file);
1948  reset ($file);
1949  return $file;
1950  }
print $file
getExportDirectory($a_type="xml")
get export directory of lm
+ Here is the call graph for this function:

◆ getFooterPage()

ilObjContentObject::getFooterPage ( )

Definition at line 1075 of file class.ilObjContentObject.php.

Referenced by exportXMLProperties(), and updateProperties().

1076  {
1077  return $this->footer_page;
1078  }
+ Here is the caller graph for this function:

◆ getHeaderPage()

ilObjContentObject::getHeaderPage ( )

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

Referenced by exportXMLProperties(), and updateProperties().

1066  {
1067  return $this->header_page;
1068  }
+ Here is the caller graph for this function:

◆ getHideHeaderFooterPrint()

ilObjContentObject::getHideHeaderFooterPrint ( )

Get hide header footer in print mode.

Returns
bool hide header and footer?

Definition at line 1000 of file class.ilObjContentObject.php.

Referenced by updateProperties().

1001  {
1002  return $this->hide_header_footer_print;
1003  }
+ Here is the caller graph for this function:

◆ getImportDirectory()

ilObjContentObject::getImportDirectory ( )

get import directory of lm

Definition at line 468 of file class.ilObjContentObject.php.

References $import_dir, and ilUtil\getDataDir().

Referenced by importFromZipFile().

469  {
470  if(strlen($this->import_dir))
471  {
472  return $this->import_dir;
473  }
474 
475  $import_dir = ilUtil::getDataDir()."/lm_data".
476  "/lm_".$this->getId()."/import";
477  if(@is_dir($import_dir))
478  {
479  return $import_dir;
480  }
481  else
482  {
483  return false;
484  }
485  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImportId()

ilObjContentObject::getImportId ( )

Definition at line 142 of file class.ilObjContentObject.php.

References ilObject\$import_id.

Referenced by importFromDirectory().

143  {
144  return $this->import_id;
145  }
+ Here is the caller graph for this function:

◆ getLayout()

ilObjContentObject::getLayout ( )

get default page layout of content object (see directory layouts/)

Returns
string default layout

Definition at line 638 of file class.ilObjContentObject.php.

References $layout.

Referenced by cloneObject(), exportXMLProperties(), and updateProperties().

639  {
640  return $this->layout;
641  }
+ Here is the caller graph for this function:

◆ getLayoutPerPage()

ilObjContentObject::getLayoutPerPage ( )

Get layout per page.

Returns
boolean layout per page

Definition at line 167 of file class.ilObjContentObject.php.

Referenced by cloneObject(), exportXMLProperties(), and updateProperties().

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

◆ getLMTree()

& ilObjContentObject::getLMTree ( )

get content object tree

Definition at line 419 of file class.ilObjContentObject.php.

References $lm_tree.

Referenced by exportHTMLPages(), and fixTree().

420  {
421  return $this->lm_tree;
422  }
+ Here is the caller graph for this function:

◆ getOfflineFiles()

ilObjContentObject::getOfflineFiles (   $dir)

get offline files

Definition at line 1978 of file class.ilObjContentObject.php.

References $file.

1979  {
1980  // quit if offline dir not available
1981  if (!@is_dir($dir) or
1982  !is_writeable($dir))
1983  {
1984  return array();
1985  }
1986 
1987  // open directory
1988  $dir = dir($dir);
1989 
1990  // initialize array
1991  $file = array();
1992 
1993  // get files and save the in the array
1994  while ($entry = $dir->read())
1995  {
1996  if ($entry != "." and
1997  $entry != ".." and
1998  substr($entry, -4) == ".pdf" and
1999  ereg("^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.pdf\$", $entry))
2000  {
2001  $file[] = $entry;
2002  }
2003  }
2004 
2005  // close import directory
2006  $dir->close();
2007 
2008  // sort files
2009  sort ($file);
2010  reset ($file);
2011 
2012  return $file;
2013  }
print $file

◆ getOnline()

ilObjContentObject::getOnline ( )

Definition at line 930 of file class.ilObjContentObject.php.

References $online.

Referenced by cloneObject(), and updateProperties().

931  {
932  return $this->online;
933  }
+ Here is the caller graph for this function:

◆ getPageHeader()

ilObjContentObject::getPageHeader ( )

get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER)

Definition at line 884 of file class.ilObjContentObject.php.

References $pg_header.

Referenced by cloneObject(), exportXMLProperties(), and updateProperties().

885  {
886  return $this->pg_header;
887  }
+ Here is the caller graph for this function:

◆ getProgressIcons()

ilObjContentObject::getProgressIcons ( )

Get progress icons.

Returns
bool show progress icons

Definition at line 207 of file class.ilObjContentObject.php.

Referenced by cloneObject(), exportXMLProperties(), and updateProperties().

208  {
209  return $this->progr_icons;
210  }
+ Here is the caller graph for this function:

◆ getPublicAccessMode()

ilObjContentObject::getPublicAccessMode ( )

get public access mode ("complete" | "selected")

Definition at line 910 of file class.ilObjContentObject.php.

Referenced by cloneObject(), and updateProperties().

911  {
912  return $this->public_access_mode;
913  }
+ Here is the caller graph for this function:

◆ getPublicExportFile()

ilObjContentObject::getPublicExportFile (   $a_type)

get public export file

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

Definition at line 1970 of file class.ilObjContentObject.php.

Referenced by updateProperties().

1971  {
1972  return $this->public_export_file[$a_type];
1973  }
+ Here is the caller graph for this function:

◆ getRestrictForwardNavigation()

ilObjContentObject::getRestrictForwardNavigation ( )

Get restrict forward navigation.

Returns
bool restrict forward navigation

Definition at line 247 of file class.ilObjContentObject.php.

Referenced by exportXMLProperties(), and updateProperties().

248  {
249  return $this->restrict_forw_nav;
250  }
+ Here is the caller graph for this function:

◆ getStoreTries()

ilObjContentObject::getStoreTries ( )

Get store tries.

Returns
bool store tries

Definition at line 227 of file class.ilObjContentObject.php.

Referenced by exportXMLProperties(), and updateProperties().

228  {
229  return $this->store_tries;
230  }
+ Here is the caller graph for this function:

◆ getStyleSheetId()

ilObjContentObject::getStyleSheetId ( )

get ID of assigned style sheet object

Definition at line 656 of file class.ilObjContentObject.php.

References $style_id.

Referenced by cloneObject(), exportHTML(), and updateProperties().

657  {
658  return $this->style_id;
659  }
+ Here is the caller graph for this function:

◆ getSupplyingExportFiles()

static ilObjContentObject::getSupplyingExportFiles (   $a_target_dir = ".")
static

Get supplying export files.

Parameters

Definition at line 2339 of file class.ilObjContentObject.php.

References $mathJaxSetting, ilExplorerBaseGUI\getLocalExplorerJsPath(), iljQueryUtil\getLocaljQueryPath(), iljQueryUtil\getLocaljQueryUIPath(), ilExplorerBaseGUI\getLocalJsTreeJsPath(), iljQueryUtil\getLocalMaphilightPath(), ilPlayerUtil\getLocalMediaElementCssPath(), ilPlayerUtil\getLocalMediaElementJsPath(), and ilYuiUtil\getLocalPath().

Referenced by ilLMPresentationGUI\layout().

2340  {
2341  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
2342  include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
2343  include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
2344  include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
2345  $scripts = array(
2346  array("source" => ilYuiUtil::getLocalPath('yahoo/yahoo-min.js'),
2347  "target" => $a_target_dir.'/js/yahoo/yahoo-min.js',
2348  "type" => "js"),
2349  array("source" => ilYuiUtil::getLocalPath('yahoo-dom-event/yahoo-dom-event.js'),
2350  "target" => $a_target_dir.'/js/yahoo/yahoo-dom-event.js',
2351  "type" => "js"),
2352  array("source" => ilYuiUtil::getLocalPath('animation/animation-min.js'),
2353  "target" => $a_target_dir.'/js/yahoo/animation-min.js',
2354  "type" => "js"),
2355  array("source" => './Services/JavaScript/js/Basic.js',
2356  "target" => $a_target_dir.'/js/Basic.js',
2357  "type" => "js"),
2358  array("source" => './Services/Accordion/js/accordion.js',
2359  "target" => $a_target_dir.'/js/accordion.js',
2360  "type" => "js"),
2361  array("source" => './Services/Accordion/css/accordion.css',
2362  "target" => $a_target_dir.'/css/accordion.css',
2363  "type" => "css"),
2364  array("source" => iljQueryUtil::getLocaljQueryPath(),
2365  "target" => $a_target_dir.'/js/jquery.js',
2366  "type" => "js"),
2367  array("source" => iljQueryUtil::getLocalMaphilightPath(),
2368  "target" => $a_target_dir.'/js/maphilight.js',
2369  "type" => "js"),
2370  array("source" => iljQueryUtil::getLocaljQueryUIPath(),
2371  "target" => $a_target_dir.'/js/jquery-ui-min.js',
2372  "type" => "js"),
2373  array("source" => './Services/COPage/js/ilCOPagePres.js',
2374  "target" => $a_target_dir.'/js/ilCOPagePres.js',
2375  "type" => "js"),
2376  array("source" => './Modules/Scorm2004/scripts/questions/pure.js',
2377  "target" => $a_target_dir.'/js/pure.js',
2378  "type" => "js"),
2379  array("source" => './Modules/Scorm2004/scripts/questions/question_handling.js',
2380  "target" => $a_target_dir.'/js/question_handling.js',
2381  "type" => "js"),
2382  array("source" => './Modules/TestQuestionPool/js/ilMatchingQuestion.js',
2383  "target" => $a_target_dir.'/js/ilMatchingQuestion.js',
2384  "type" => "js"),
2385  array("source" => './Modules/Scorm2004/templates/default/question_handling.css',
2386  "target" => $a_target_dir.'/css/question_handling.css',
2387  "type" => "css"),
2388  array("source" => './Modules/TestQuestionPool/templates/default/test_javascript.css',
2389  "target" => $a_target_dir.'/css/test_javascript.css',
2390  "type" => "css"),
2391  array("source" => ilPlayerUtil::getLocalMediaElementJsPath(),
2392  "target" => $a_target_dir."/".ilPlayerUtil::getLocalMediaElementJsPath(),
2393  "type" => "js"),
2394  array("source" => ilPlayerUtil::getLocalMediaElementCssPath(),
2395  "target" => $a_target_dir."/".ilPlayerUtil::getLocalMediaElementCssPath(),
2396  "type" => "css"),
2397  array("source" => ilExplorerBaseGUI::getLocalExplorerJsPath(),
2398  "target" => $a_target_dir."/".ilExplorerBaseGUI::getLocalExplorerJsPath(),
2399  "type" => "js"),
2400  array("source" => ilExplorerBaseGUI::getLocalJsTreeJsPath(),
2401  "target" => $a_target_dir."/".ilExplorerBaseGUI::getLocalJsTreeJsPath(),
2402  "type" => "js"),
2403  array("source" => './Modules/LearningModule/js/LearningModule.js',
2404  "target" => $a_target_dir.'/js/LearningModule.js',
2405  "type" => "js")
2406  );
2407 
2408  $mathJaxSetting = new ilSetting("MathJax");
2409  $use_mathjax = $mathJaxSetting->get("enable");
2410  if ($use_mathjax)
2411  {
2412  $scripts[] = array("source" => "",
2413  "target" => $mathJaxSetting->get("path_to_mathjax"),
2414  "type" => "js");
2415  }
2416 
2417  return $scripts;
2418 
2419  }
ILIAS Setting Class.
getLocalMediaElementCssPath()
Get local path of jQuery file.
if(strpos($jquery_path, './')===0) else if(strpos($jquery_path, '.')===0) $mathJaxSetting
Definition: latex.php:34
getLocalMediaElementJsPath()
Get local path of jQuery file.
static getLocalJsTreeJsPath()
Get local path of jsTree js.
getLocaljQueryPath()
Get local path of jQuery file.
static getLocalExplorerJsPath()
Get local path of explorer js.
getLocalMaphilightPath()
Get local path of maphilight file.
static getLocalPath($a_name="")
Get local path of a YUI js file.
getLocaljQueryUIPath()
Get local path of jQuery UI file.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTitle()

ilObjContentObject::getTitle ( )

get title of content object

Returns
string title

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

Referenced by cloneObject(), ilTermUsagesTableGUI\fillRow(), ilMediaPoolPageUsagesTableGUI\fillRow(), and ilMediaObjectUsagesTableGUI\fillRow().

109  {
110  return parent::getTitle();
111  }
+ Here is the caller graph for this function:

◆ getTOCMode()

ilObjContentObject::getTOCMode ( )

get toc mode ("chapters" | "pages")

Definition at line 902 of file class.ilObjContentObject.php.

Referenced by cloneObject(), exportXMLProperties(), and updateProperties().

903  {
904  return $this->toc_mode;
905  }
+ Here is the caller graph for this function:

◆ getTree()

& ilObjContentObject::getTree ( )

Definition at line 253 of file class.ilObjContentObject.php.

References $lm_tree.

254  {
255  return $this->lm_tree;
256  }

◆ getXMLZip()

ilObjContentObject::getXMLZip ( )

Definition at line 2840 of file class.ilObjContentObject.php.

2841  {
2842  include_once("./Modules/LearningModule/classes/class.ilContObjectExport.php");
2843 
2844  $cont_exp = new ilContObjectExport($this,'xml');
2845 
2846  $export_file = $cont_exp->buildExportFile();
2847  return $export_file;
2848  }
Export class for content objects.

◆ hasRating()

ilObjContentObject::hasRating ( )

Definition at line 3470 of file class.ilObjContentObject.php.

References $rating.

Referenced by cloneObject(), exportXMLProperties(), and updateProperties().

3471  {
3472  return $this->rating;
3473  }
+ Here is the caller graph for this function:

◆ hasRatingPages()

ilObjContentObject::hasRatingPages ( )

Definition at line 3480 of file class.ilObjContentObject.php.

References $rating_pages.

Referenced by cloneObject(), exportXMLProperties(), and updateProperties().

3481  {
3482  return $this->rating_pages;
3483  }
+ Here is the caller graph for this function:

◆ hasSuccessorPage()

ilObjContentObject::hasSuccessorPage (   $a_cont_obj_id,
  $a_page_id 
)

checks if page has a successor page

Definition at line 1420 of file class.ilObjContentObject.php.

Referenced by ilPageObjectGUI\showPage().

1421  {
1422  $tree = new ilTree($a_cont_obj_id);
1423  $tree->setTableNames('lm_tree','lm_data');
1424  $tree->setTreeTablePK("lm_id");
1425  if ($tree->isInTree($a_page_id))
1426  {
1427  $succ = $tree->fetchSuccessorNode($a_page_id, "pg");
1428  if ($succ > 0)
1429  {
1430  return true;
1431  }
1432  }
1433  return false;
1434  }
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
+ Here is the caller graph for this function:

◆ ilObjContentObject()

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

Constructor public.

Parameters
integerreference_id or object_id
booleantreat the id as reference_id (true) or object_id (false)

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

References ilObject\ilObject().

42  {
43  // this also calls read() method! (if $a_id is set)
44  $this->ilObject($a_id,$a_call_by_reference);
45 
46  $this->mob_ids = array();
47  $this->file_ids = array();
48  $this->q_ids = array();
49  }
ilObject($a_id=0, $a_reference=true)
Constructor public.
+ Here is the call graph for this function:

◆ import()

ilObjContentObject::import ( )

if implemented, this function should be called from an Out/GUI-Object

Definition at line 297 of file class.ilObjContentObject.php.

298  {
299  // nothing to do. just display the dialogue in Out
300  return;
301  }

◆ importFromDirectory()

ilObjContentObject::importFromDirectory (   $a_directory,
  $a_validate = true 
)

Import lm from directory.

Parameters

Definition at line 3159 of file class.ilObjContentObject.php.

References ilObject\$lng, $result, ilPageObject\_handleImportRepositoryLinks(), ilObject\_writeImportId(), ilObject\getId(), getImportId(), ilObject\getRefId(), ilObject\getType(), IL_MO_PARSE_QTI, IL_MO_VERIFY_QTI, ilObject\MDUpdateListener(), validatePages(), and writeStyleSheetId().

Referenced by importFromZipFile().

3160  {
3161  global $lng;
3162 
3163  // determine filename of xml file
3164  $subdir = basename($a_directory);
3165  $xml_file = $a_directory."/".$subdir.".xml";
3166 
3167  // check directory exists within zip file
3168  if (!is_dir($a_directory))
3169  {
3170  return sprintf($lng->txt("cont_no_subdir_in_zip"), $subdir);
3171  }
3172 
3173  // check whether xml file exists within zip file
3174  if (!is_file($xml_file))
3175  {
3176  return sprintf($lng->txt("cont_zip_file_invalid"), $subdir."/".$subdir.".xml");
3177  }
3178 
3179  // import questions
3180  $qti_file = $a_directory."/qti.xml";
3181  $qtis = array();
3182  if (is_file($qti_file))
3183  {
3184  include_once "./Services/QTI/classes/class.ilQTIParser.php";
3185  include_once("./Modules/Test/classes/class.ilObjTest.php");
3186  $qtiParser = new ilQTIParser ($qti_file,
3187  IL_MO_VERIFY_QTI, 0, "");
3188  $result = $qtiParser->startParsing ();
3189  $founditems = & $qtiParser->getFoundItems ();
3190  $testObj = new ilObjTest(0, true);
3191  if (count($founditems) > 0)
3192  {
3193  $qtiParser = new ilQTIParser($qti_file, IL_MO_PARSE_QTI, 0, "");
3194  $qtiParser->setTestObject($testObj);
3195  $result = $qtiParser->startParsing();
3196  $qtis = array_merge($qtis, $qtiParser->getImportMapping());
3197  }
3198  }
3199 
3200  include_once ("./Modules/LearningModule/classes/class.ilContObjParser.php");
3201  $contParser = new ilContObjParser($this, $xml_file, $subdir, $qmapping);
3202  $contParser->setQuestionMapping($qtis);
3203  $contParser->startParsing();
3204  ilObject::_writeImportId($this->getId(), $this->getImportId());
3205  $this->MDUpdateListener('General');
3206 
3207  // import style
3208  $style_file = $a_directory."/style.xml";
3209  $style_zip_file = $a_directory."/style.zip";
3210  if (is_file($style_zip_file)) // try to import style.zip first
3211  {
3212  require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
3213  $style = new ilObjStyleSheet();
3214  $style->import($style_zip_file);
3215  $this->writeStyleSheetId($style->getId());
3216  }
3217  else if (is_file($style_file)) // try to import style.xml
3218  {
3219  require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
3220  $style = new ilObjStyleSheet();
3221  $style->import($style_file);
3222  $this->writeStyleSheetId($style->getId());
3223  }
3224 
3225 // // validate
3226  if ($a_validate)
3227  {
3228  $mess = $this->validatePages();
3229  }
3230 
3231  if ($mess == "")
3232  {
3233  // handle internal links to this learning module
3234  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
3236  $this->getType(), $this->getRefId());
3237  }
3238 
3239  return $mess;
3240  }
Content Object Parser.
$result
validatePages()
Validate all pages.
writeStyleSheetId($a_style_id)
write ID of assigned style sheet object to db
_writeImportId($a_obj_id, $a_import_id)
write import id to db (static)
getId()
get object id public
const IL_MO_PARSE_QTI
static _handleImportRepositoryLinks($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
Change targest of repository links.
getType()
get object type public
Class ilObjStyleSheet.
getRefId()
get reference id public
const IL_MO_VERIFY_QTI
MDUpdateListener($a_element)
Meta data update listener.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importFromZipFile()

ilObjContentObject::importFromZipFile (   $a_tmp_file,
  $a_filename,
  $a_validate = true,
  $a_import_into_help_module = 0 
)

Import lm from zip file.

Parameters

Definition at line 3095 of file class.ilObjContentObject.php.

References $file, ilObject\$lng, createImportDirectory(), ilUtil\delDir(), ilUtil\getDir(), ilObject\getId(), getImportDirectory(), ilLMObject\getObjectList(), importFromDirectory(), ilUtil\moveUploadedFile(), and ilUtil\unzip().

3097  {
3098  global $lng;
3099 
3100  // create import directory
3101  $this->createImportDirectory();
3102 
3103  // copy uploaded file to import directory
3104  $file = pathinfo($a_filename);
3105  $full_path = $this->getImportDirectory()."/".$a_filename;
3106 
3107  ilUtil::moveUploadedFile($a_tmp_file,
3108  $a_filename, $full_path);
3109 
3110  // unzip file
3111  ilUtil::unzip($full_path);
3112 
3113  $subdir = basename($file["basename"],".".$file["extension"]);
3114 
3115  $mess = $this->importFromDirectory(
3116  $this->getImportDirectory()."/".$subdir, $a_validate);
3117 
3118  // this should only be true for help modules
3119  if ($a_import_into_help_module > 0)
3120  {
3121  // search the zip file
3122  $dir = $this->getImportDirectory()."/".$subdir;
3123  $files = ilUtil::getDir($dir);
3124  foreach ($files as $file)
3125  {
3126  if (is_int(strpos($file["entry"], "__help_")) &&
3127  is_int(strpos($file["entry"], ".zip")))
3128  {
3129  include_once("./Services/Export/classes/class.ilImport.php");
3130  $imp = new ilImport();
3131  $imp->getMapping()->addMapping('Services/Help', 'help_module', 0, $a_import_into_help_module);
3132  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
3133  $chaps = ilLMObject::getObjectList($this->getId(), "st");
3134  foreach ($chaps as $chap)
3135  {
3136  $chap_arr = explode("_", $chap["import_id"]);
3137  $imp->getMapping()->addMapping('Services/Help', 'help_chap',
3138  $chap_arr[count($chap_arr) - 1], $chap["obj_id"]);
3139  }
3140  $imp->importEntity($dir."/".$file["entry"], $file["entry"],
3141  "help", "Services/Help", true);
3142  }
3143  }
3144  }
3145 
3146  // delete import directory
3148 
3149  return $mess;
3150  }
print $file
getImportDirectory()
get import directory of lm
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
Import class.
importFromDirectory($a_directory, $a_validate=true)
Import lm from directory.
getId()
get object id public
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
createImportDirectory()
creates data directory for import files (data_dir/lm_data/lm_<id>/import, depending on data directory...
getObjectList($lm_id, $type="")
static
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ isActiveDownloads()

ilObjContentObject::isActiveDownloads ( )

Definition at line 1010 of file class.ilObjContentObject.php.

Referenced by cloneObject(), and updateProperties().

1011  {
1012  return $this->downloads_active;
1013  }
+ Here is the caller graph for this function:

◆ isActiveDownloadsPublic()

ilObjContentObject::isActiveDownloadsPublic ( )

Definition at line 1020 of file class.ilObjContentObject.php.

Referenced by cloneObject(), and updateProperties().

1021  {
1022  return $this->downloads_public_active;
1023  }
+ Here is the caller graph for this function:

◆ isActiveHistoryUserComments()

ilObjContentObject::isActiveHistoryUserComments ( )

Definition at line 1055 of file class.ilObjContentObject.php.

Referenced by cloneObject(), exportXMLProperties(), and updateProperties().

1056  {
1057  return $this->user_comments;
1058  }
+ Here is the caller graph for this function:

◆ isActiveLMMenu()

ilObjContentObject::isActiveLMMenu ( )

Definition at line 940 of file class.ilObjContentObject.php.

Referenced by cloneObject(), exportXMLProperties(), and updateProperties().

941  {
942  return $this->lm_menu_active;
943  }
+ Here is the caller graph for this function:

◆ isActiveNumbering()

ilObjContentObject::isActiveNumbering ( )

Definition at line 960 of file class.ilObjContentObject.php.

Referenced by cloneObject(), exportXMLProperties(), and updateProperties().

961  {
962  return $this->numbering;
963  }
+ Here is the caller graph for this function:

◆ isActivePreventGlossaryAppendix()

ilObjContentObject::isActivePreventGlossaryAppendix ( )

Definition at line 980 of file class.ilObjContentObject.php.

Referenced by cloneObject(), and updateProperties().

981  {
982  return $this->prevent_glossary_appendix_active;
983  }
+ Here is the caller graph for this function:

◆ isActivePrintView()

ilObjContentObject::isActivePrintView ( )

Definition at line 970 of file class.ilObjContentObject.php.

Referenced by cloneObject(), exportXMLProperties(), and updateProperties().

971  {
972  return $this->print_view_active;
973  }
+ Here is the caller graph for this function:

◆ isActiveTOC()

ilObjContentObject::isActiveTOC ( )

Definition at line 950 of file class.ilObjContentObject.php.

Referenced by cloneObject(), exportHTML(), exportXMLProperties(), and updateProperties().

951  {
952  return $this->toc_active;
953  }
+ Here is the caller graph for this function:

◆ isOnlineHelpModule()

static ilObjContentObject::isOnlineHelpModule (   $a_id,
  $a_as_obj_id = false 
)
static

Is module an online module.

Returns
boolean true, if current learning module is an online help lm

Definition at line 3452 of file class.ilObjContentObject.php.

References ilObject\_lookupObjId().

Referenced by ilContObjectExport\buildExportFileXML(), ilLMPageConfig\configureByObjectId(), ilObjContentObjectGUI\setContentSubTabs(), and ilObjContentObjectGUI\showExportIDsOverview().

3453  {
3454  if (!$a_as_obj_id && $a_id > 0 && $a_id == OH_REF_ID)
3455  {
3456  return true;
3457  }
3458  if ($a_as_obj_id && $a_id > 0 && $a_id == ilObject::_lookupObjId(OH_REF_ID))
3459  {
3460  return true;
3461  }
3462  return false;
3463  }
static _lookupObjId($a_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupAutoGlossaries()

ilObjContentObject::lookupAutoGlossaries (   $a_lm_id)

Lookup auto glossaries.

Parameters

Definition at line 3380 of file class.ilObjContentObject.php.

References $ilDB.

Referenced by ilLMPage\beforePageContentUpdate().

3381  {
3382  global $ilDB;
3383 
3384  // read auto glossaries
3385  $set = $ilDB->query("SELECT * FROM lm_glossaries ".
3386  " WHERE lm_id = ".$ilDB->quote($a_lm_id, "integer")
3387  );
3388  $glos = array();
3389  while ($rec = $ilDB->fetchAssoc($set))
3390  {
3391  $glos[] = $rec["glo_id"];
3392  }
3393  return $glos;
3394  }
global $ilDB
+ Here is the caller graph for this function:

◆ notify()

ilObjContentObject::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 1363 of file class.ilObjContentObject.php.

References $_GET, and ilObject\getType().

1364  {
1365  global $tree;
1366 
1367  switch ($a_event)
1368  {
1369  case "link":
1370 
1371  //var_dump("<pre>",$a_params,"</pre>");
1372  //echo "Content Object ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
1373  //exit;
1374  break;
1375 
1376  case "cut":
1377 
1378  //echo "Content Object ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
1379  //exit;
1380  break;
1381 
1382  case "copy":
1383 
1384  //var_dump("<pre>",$a_params,"</pre>");
1385  //echo "Content Object ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
1386  //exit;
1387  break;
1388 
1389  case "paste":
1390 
1391  //echo "Content Object ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
1392  //exit;
1393  break;
1394 
1395  case "new":
1396 
1397  //echo "Content Object ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
1398  //exit;
1399  break;
1400  }
1401 
1402  // At the beginning of the recursive process it avoids second call of the notify function with the same parameter
1403  if ($a_node_id==$_GET["ref_id"])
1404  {
1405  $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
1406  $parent_type = $parent_obj->getType();
1407  if($parent_type == $this->getType())
1408  {
1409  $a_node_id = (int) $tree->getParentId($a_node_id);
1410  }
1411  }
1412 
1413  parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
1414  }
$_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:

◆ publicNotes()

ilObjContentObject::publicNotes ( )

Definition at line 1030 of file class.ilObjContentObject.php.

Referenced by cloneObject(), exportXMLProperties(), and updateProperties().

1031  {
1032  return $this->pub_notes;
1033  }
+ Here is the caller graph for this function:

◆ putInTree()

ilObjContentObject::putInTree (   $a_parent)

put content object in main tree

Definition at line 308 of file class.ilObjContentObject.php.

309  {
310  global $tree;
311 
312  // put this object in tree under $a_parent
313  parent::putInTree($a_parent);
314 
315  // make new tree for this object
316  //$tree->addTree($this->getId());
317  }

◆ read()

ilObjContentObject::read ( )

read data of content object

Definition at line 76 of file class.ilObjContentObject.php.

References $ilDB, ilObject\getId(), readProperties(), and setAutoGlossaries().

77  {
78  global $ilDB;
79 
80  parent::read();
81 # echo "Content<br>\n";
82 
83  $this->lm_tree = new ilTree($this->getId());
84  $this->lm_tree->setTableNames('lm_tree','lm_data');
85  $this->lm_tree->setTreeTablePK("lm_id");
86 
87  $this->readProperties();
88 
89  // read auto glossaries
90  $set = $ilDB->query("SELECT * FROM lm_glossaries ".
91  " WHERE lm_id = ".$ilDB->quote($this->getId(), "integer")
92  );
93  $glos = array();
94  while ($rec = $ilDB->fetchAssoc($set))
95  {
96  $glos[] = $rec["glo_id"];
97  }
98  $this->setAutoGlossaries($glos);
99 
100  //parent::read();
101  }
getId()
get object id public
readProperties()
read content object properties
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
global $ilDB
setAutoGlossaries($a_val)
Set auto glossaries.
+ Here is the call graph for this function:

◆ readProperties()

ilObjContentObject::readProperties ( )

read content object properties

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

References $ilDB, $lm_set, ilNote\commentsActivated(), ilObject\getId(), ilObject\getType(), setActiveDownloads(), setActiveDownloadsPublic(), setActiveLMMenu(), setActiveNumbering(), setActivePreventGlossaryAppendix(), setActivePrintView(), setActiveTOC(), setCleanFrames(), setDisableDefaultFeedback(), setFooterPage(), setHeaderPage(), setHideHeaderFooterPrint(), setHistoryUserComments(), setLayout(), setLayoutPerPage(), setOnline(), setPageHeader(), setProgressIcons(), setPublicAccessMode(), setPublicExportFile(), setPublicNotes(), setRating(), setRatingPages(), setRestrictForwardNavigation(), setStoreTries(), setStyleSheetId(), setTOCMode(), and ilUtil\yn2tf().

Referenced by createProperties(), and read().

1084  {
1085  global $ilDB;
1086 
1087  $q = "SELECT * FROM content_object WHERE id = ".
1088  $ilDB->quote($this->getId(), "integer");
1089  $lm_set = $ilDB->query($q);
1090  $lm_rec = $ilDB->fetchAssoc($lm_set);
1091  $this->setLayout($lm_rec["default_layout"]);
1092  $this->setStyleSheetId((int) $lm_rec["stylesheet"]);
1093  $this->setPageHeader($lm_rec["page_header"]);
1094  $this->setTOCMode($lm_rec["toc_mode"]);
1095  $this->setOnline(ilUtil::yn2tf($lm_rec["is_online"]));
1096  $this->setActiveTOC(ilUtil::yn2tf($lm_rec["toc_active"]));
1097  $this->setActiveNumbering(ilUtil::yn2tf($lm_rec["numbering"]));
1098  $this->setActivePrintView(ilUtil::yn2tf($lm_rec["print_view_active"]));
1099  $this->setActivePreventGlossaryAppendix(ilUtil::yn2tf($lm_rec["no_glo_appendix"]));
1100  $this->setHideHeaderFooterPrint($lm_rec["hide_head_foot_print"]);
1101  $this->setActiveDownloads(ilUtil::yn2tf($lm_rec["downloads_active"]));
1102  $this->setActiveDownloadsPublic(ilUtil::yn2tf($lm_rec["downloads_public_active"]));
1103  $this->setActiveLMMenu(ilUtil::yn2tf($lm_rec["lm_menu_active"]));
1104  $this->setCleanFrames(ilUtil::yn2tf($lm_rec["clean_frames"]));
1105  $this->setHeaderPage((int) $lm_rec["header_page"]);
1106  $this->setFooterPage((int) $lm_rec["footer_page"]);
1107  $this->setHistoryUserComments(ilUtil::yn2tf($lm_rec["hist_user_comments"]));
1108  $this->setPublicAccessMode($lm_rec["public_access_mode"]);
1109  $this->setPublicExportFile("xml", $lm_rec["public_xml_file"]);
1110  $this->setPublicExportFile("html", $lm_rec["public_html_file"]);
1111  $this->setPublicExportFile("scorm", $lm_rec["public_scorm_file"]);
1112  $this->setLayoutPerPage($lm_rec["layout_per_page"]);
1113  $this->setRating($lm_rec["rating"]);
1114  $this->setRatingPages($lm_rec["rating_pages"]);
1115  $this->setDisableDefaultFeedback($lm_rec["disable_def_feedback"]);
1116  $this->setProgressIcons($lm_rec["progr_icons"]);
1117  $this->setStoreTries($lm_rec["store_tries"]);
1118  $this->setRestrictForwardNavigation($lm_rec["restrict_forw_nav"]);
1119 
1120  // #14661
1121  include_once("./Services/Notes/classes/class.ilNote.php");
1122  $this->setPublicNotes(ilNote::commentsActivated($this->getId(), 0, $this->getType()));
1123  }
setPublicExportFile($a_type, $a_file)
specify public export file for type
setTOCMode($a_toc_mode="chapters")
set toc mode
setLayoutPerPage($a_val)
Set layout per page.
setDisableDefaultFeedback($a_val)
Set disable default feedback for questions.
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
setRestrictForwardNavigation($a_val)
Set restrict forward navigation.
getId()
get object id public
setPageHeader($a_pg_header=IL_CHAPTER_TITLE)
set page header mode
setProgressIcons($a_val)
Set progress icons.
getType()
get object type public
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type)
Are comments activated for object?
$lm_set
setLayout($a_layout)
set default page layout
setHideHeaderFooterPrint($a_val)
Set hide header footer in print mode.
global $ilDB
static yn2tf($a_yn)
convert "y"/"n" to true/false
setStoreTries($a_val)
Set store tries.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeAutoGlossary()

ilObjContentObject::removeAutoGlossary (   $a_glo_id)

Remove auto glossary.

Parameters

Definition at line 371 of file class.ilObjContentObject.php.

References getAutoGlossaries(), and setAutoGlossaries().

372  {
373  $glo_ids = array();
374  foreach($this->getAutoGlossaries() as $g)
375  {
376  if ($g != $a_glo_id)
377  {
378  $glo_ids[] = $g;
379  }
380  }
381  $this->setAutoGlossaries($glo_ids);
382  }
getAutoGlossaries()
Get auto glossaries.
setAutoGlossaries($a_val)
Set auto glossaries.
+ Here is the call graph for this function:

◆ setActiveDownloads()

ilObjContentObject::setActiveDownloads (   $a_down)

Definition at line 1005 of file class.ilObjContentObject.php.

Referenced by readProperties().

1006  {
1007  $this->downloads_active = $a_down;
1008  }
+ Here is the caller graph for this function:

◆ setActiveDownloadsPublic()

ilObjContentObject::setActiveDownloadsPublic (   $a_down)

Definition at line 1015 of file class.ilObjContentObject.php.

Referenced by readProperties().

1016  {
1017  $this->downloads_public_active = $a_down;
1018  }
+ Here is the caller graph for this function:

◆ setActiveLMMenu()

ilObjContentObject::setActiveLMMenu (   $a_act_lm_menu)

Definition at line 935 of file class.ilObjContentObject.php.

Referenced by readProperties().

936  {
937  $this->lm_menu_active = $a_act_lm_menu;
938  }
+ Here is the caller graph for this function:

◆ setActiveNumbering()

ilObjContentObject::setActiveNumbering (   $a_num)

Definition at line 955 of file class.ilObjContentObject.php.

Referenced by readProperties().

956  {
957  $this->numbering = $a_num;
958  }
+ Here is the caller graph for this function:

◆ setActivePreventGlossaryAppendix()

ilObjContentObject::setActivePreventGlossaryAppendix (   $a_print)

Definition at line 975 of file class.ilObjContentObject.php.

Referenced by readProperties().

976  {
977  $this->prevent_glossary_appendix_active = $a_print;
978  }
+ Here is the caller graph for this function:

◆ setActivePrintView()

ilObjContentObject::setActivePrintView (   $a_print)

Definition at line 965 of file class.ilObjContentObject.php.

Referenced by readProperties().

966  {
967  $this->print_view_active = $a_print;
968  }
+ Here is the caller graph for this function:

◆ setActiveTOC()

ilObjContentObject::setActiveTOC (   $a_toc)

Definition at line 945 of file class.ilObjContentObject.php.

Referenced by readProperties().

946  {
947  $this->toc_active = $a_toc;
948  }
+ Here is the caller graph for this function:

◆ setAutoGlossaries()

ilObjContentObject::setAutoGlossaries (   $a_val)

Set auto glossaries.

Parameters
array$a_valint

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

References ilObject\_lookupType().

Referenced by read(), and removeAutoGlossary().

339  {
340  $this->auto_glossaries = array();
341  if (is_array($a_val))
342  {
343  foreach ($a_val as $v)
344  {
345  $v = (int) $v;
346  if ($v > 0 && ilObject::_lookupType($v) == "glo" &&
347  !in_array($v, $this->auto_glossaries))
348  {
349  $this->auto_glossaries[] = $v;
350  }
351  }
352  }
353  }
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCleanFrames()

ilObjContentObject::setCleanFrames (   $a_clean)

Definition at line 1035 of file class.ilObjContentObject.php.

Referenced by readProperties(), and updateProperties().

1036  {
1037  $this->clean_frames = $a_clean;
1038  }
+ Here is the caller graph for this function:

◆ setDescription()

ilObjContentObject::setDescription (   $a_description)

set description of content object

Definition at line 135 of file class.ilObjContentObject.php.

136  {
137  parent::setDescription($a_description);
138 // $this->meta_data->setDescription($a_description);
139  }

◆ setDisableDefaultFeedback()

ilObjContentObject::setDisableDefaultFeedback (   $a_val)

Set disable default feedback for questions.

Parameters
bool$a_valdisable default feedback

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

Referenced by readProperties().

178  {
179  $this->disable_def_feedback = $a_val;
180  }
+ Here is the caller graph for this function:

◆ setFooterPage()

ilObjContentObject::setFooterPage (   $a_pg)

Definition at line 1070 of file class.ilObjContentObject.php.

Referenced by readProperties().

1071  {
1072  $this->footer_page = $a_pg;
1073  }
+ Here is the caller graph for this function:

◆ setHeaderPage()

ilObjContentObject::setHeaderPage (   $a_pg)

Definition at line 1060 of file class.ilObjContentObject.php.

Referenced by readProperties().

1061  {
1062  $this->header_page = $a_pg;
1063  }
+ Here is the caller graph for this function:

◆ setHideHeaderFooterPrint()

ilObjContentObject::setHideHeaderFooterPrint (   $a_val)

Set hide header footer in print mode.

Parameters
bool$a_valhide header and footer?

Definition at line 990 of file class.ilObjContentObject.php.

Referenced by readProperties().

991  {
992  $this->hide_header_footer_print = $a_val;
993  }
+ Here is the caller graph for this function:

◆ setHistoryUserComments()

ilObjContentObject::setHistoryUserComments (   $a_comm)

Definition at line 1045 of file class.ilObjContentObject.php.

Referenced by readProperties().

1046  {
1047  $this->user_comments = $a_comm;
1048  }
+ Here is the caller graph for this function:

◆ setImportDirectory()

ilObjContentObject::setImportDirectory (   $a_import_dir)

Set import directory for further use in ilContObjParser.

Parameters
stringimport directory
Returns
void

Definition at line 493 of file class.ilObjContentObject.php.

494  {
495  $this->import_dir = $a_import_dir;
496  }

◆ setImportId()

ilObjContentObject::setImportId (   $a_id)

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

148  {
149  $this->import_id = $a_id;
150  }

◆ setLayout()

ilObjContentObject::setLayout (   $a_layout)

set default page layout

Parameters
string$a_layoutdefault page layout

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

Referenced by readProperties().

649  {
650  $this->layout = $a_layout;
651  }
+ Here is the caller graph for this function:

◆ setLayoutPerPage()

ilObjContentObject::setLayoutPerPage (   $a_val)

Set layout per page.

Parameters
booleanlayout per page

Definition at line 157 of file class.ilObjContentObject.php.

Referenced by readProperties().

158  {
159  $this->layout_per_page = $a_val;
160  }
+ Here is the caller graph for this function:

◆ setOnline()

ilObjContentObject::setOnline (   $a_online)

Definition at line 925 of file class.ilObjContentObject.php.

Referenced by readProperties().

926  {
927  $this->online = $a_online;
928  }
+ Here is the caller graph for this function:

◆ setPageHeader()

ilObjContentObject::setPageHeader (   $a_pg_header = IL_CHAPTER_TITLE)

set page header mode

Parameters
string$a_pg_headerIL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER

Definition at line 894 of file class.ilObjContentObject.php.

Referenced by readProperties().

895  {
896  $this->pg_header = $a_pg_header;
897  }
+ Here is the caller graph for this function:

◆ setProgressIcons()

ilObjContentObject::setProgressIcons (   $a_val)

Set progress icons.

Parameters
bool$a_valshow progress icons

Definition at line 197 of file class.ilObjContentObject.php.

Referenced by readProperties().

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

◆ setPublicAccessMode()

ilObjContentObject::setPublicAccessMode (   $a_mode)

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

Referenced by readProperties().

1051  {
1052  $this->public_access_mode = $a_mode;
1053  }
+ Here is the caller graph for this function:

◆ setPublicExportFile()

ilObjContentObject::setPublicExportFile (   $a_type,
  $a_file 
)

specify public export file for type

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

Definition at line 1958 of file class.ilObjContentObject.php.

Referenced by readProperties().

1959  {
1960  $this->public_export_file[$a_type] = $a_file;
1961  }
+ Here is the caller graph for this function:

◆ setPublicNotes()

ilObjContentObject::setPublicNotes (   $a_pub_notes)

Definition at line 1025 of file class.ilObjContentObject.php.

Referenced by readProperties().

1026  {
1027  $this->pub_notes = $a_pub_notes;
1028  }
+ Here is the caller graph for this function:

◆ setRating()

ilObjContentObject::setRating (   $a_value)

Definition at line 3465 of file class.ilObjContentObject.php.

Referenced by readProperties().

3466  {
3467  $this->rating = (bool)$a_value;
3468  }
+ Here is the caller graph for this function:

◆ setRatingPages()

ilObjContentObject::setRatingPages (   $a_value)

Definition at line 3475 of file class.ilObjContentObject.php.

Referenced by readProperties().

3476  {
3477  $this->rating_pages = (bool)$a_value;
3478  }
+ Here is the caller graph for this function:

◆ setRestrictForwardNavigation()

ilObjContentObject::setRestrictForwardNavigation (   $a_val)

Set restrict forward navigation.

Parameters
bool$a_valrestrict forward navigation

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

Referenced by readProperties().

238  {
239  $this->restrict_forw_nav = $a_val;
240  }
+ Here is the caller graph for this function:

◆ setStoreTries()

ilObjContentObject::setStoreTries (   $a_val)

Set store tries.

Parameters
bool$a_valstore tries

Definition at line 217 of file class.ilObjContentObject.php.

Referenced by readProperties().

218  {
219  $this->store_tries = $a_val;
220  }
+ Here is the caller graph for this function:

◆ setStyleSheetId()

ilObjContentObject::setStyleSheetId (   $a_style_id)

set ID of assigned style sheet object

Definition at line 664 of file class.ilObjContentObject.php.

Referenced by readProperties().

665  {
666  $this->style_id = $a_style_id;
667  }
+ Here is the caller graph for this function:

◆ setTitle()

ilObjContentObject::setTitle (   $a_title)

set title of content object

Definition at line 116 of file class.ilObjContentObject.php.

117  {
118  parent::setTitle($a_title);
119 // $this->meta_data->setTitle($a_title);
120  }

◆ setTOCMode()

ilObjContentObject::setTOCMode (   $a_toc_mode = "chapters")

set toc mode

Parameters
string$a_toc_mode"chapters" | "pages"

Definition at line 920 of file class.ilObjContentObject.php.

Referenced by readProperties().

921  {
922  $this->toc_mode = $a_toc_mode;
923  }
+ Here is the caller graph for this function:

◆ update()

ilObjContentObject::update ( )

update complete object (meta data and properties)

Definition at line 261 of file class.ilObjContentObject.php.

References updateAutoGlossaries(), ilObject\updateMetaData(), and updateProperties().

262  {
263  $this->updateMetaData();
264  parent::update();
265  $this->updateProperties();
266  $this->updateAutoGlossaries();
267  }
updateMetaData()
update meta data entry
updateAutoGlossaries()
Update auto glossaries.
updateProperties()
Update content object properties.
+ Here is the call graph for this function:

◆ updateAutoGlossaries()

ilObjContentObject::updateAutoGlossaries ( )

Update auto glossaries.

Parameters

Definition at line 275 of file class.ilObjContentObject.php.

References $ilDB, and getAutoGlossaries().

Referenced by create(), and update().

276  {
277  global $ilDB;
278 
279  // update auto glossaries
280  $ilDB->manipulate("DELETE FROM lm_glossaries WHERE ".
281  " lm_id = ".$ilDB->quote($this->getId(), "integer")
282  );
283  foreach ($this->getAutoGlossaries() as $glo_id)
284  {
285  $ilDB->manipulate("INSERT INTO lm_glossaries ".
286  "(lm_id, glo_id) VALUES (".
287  $ilDB->quote($this->getId(), "integer").",".
288  $ilDB->quote($glo_id, "integer").
289  ")");
290  }
291  }
getAutoGlossaries()
Get auto glossaries.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateProperties()

ilObjContentObject::updateProperties ( )

Update content object properties.

Definition at line 1128 of file class.ilObjContentObject.php.

References $ilDB, ilNote\activateComments(), cleanFrames(), getDisableDefaultFeedback(), getFooterPage(), getHeaderPage(), getHideHeaderFooterPrint(), ilObject\getId(), getLayout(), getLayoutPerPage(), getOnline(), getPageHeader(), getProgressIcons(), getPublicAccessMode(), getPublicExportFile(), getRestrictForwardNavigation(), getStoreTries(), getStyleSheetId(), getTOCMode(), ilObject\getType(), hasRating(), hasRatingPages(), isActiveDownloads(), isActiveDownloadsPublic(), isActiveHistoryUserComments(), isActiveLMMenu(), isActiveNumbering(), isActivePreventGlossaryAppendix(), isActivePrintView(), isActiveTOC(), publicNotes(), setCleanFrames(), and ilUtil\tf2yn().

Referenced by update().

1129  {
1130  global $ilDB;
1131 
1132  // force clean_frames to be set, if layout per page is activated
1133  if ($this->getLayoutPerPage())
1134  {
1135  $this->setCleanFrames(true);
1136  }
1137 
1138  $q = "UPDATE content_object SET ".
1139  " default_layout = ".$ilDB->quote($this->getLayout(), "text").", ".
1140  " stylesheet = ".$ilDB->quote($this->getStyleSheetId(), "integer").",".
1141  " page_header = ".$ilDB->quote($this->getPageHeader(), "text").",".
1142  " toc_mode = ".$ilDB->quote($this->getTOCMode(), "text").",".
1143  " is_online = ".$ilDB->quote(ilUtil::tf2yn($this->getOnline()), "text").",".
1144  " toc_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveTOC()), "text").",".
1145  " numbering = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveNumbering()), "text").",".
1146  " print_view_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActivePrintView()), "text").",".
1147  " no_glo_appendix = ".$ilDB->quote(ilUtil::tf2yn($this->isActivePreventGlossaryAppendix()), "text").",".
1148  " hide_head_foot_print = ".$ilDB->quote($this->getHideHeaderFooterPrint(), "integer").",".
1149  " downloads_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveDownloads()), "text").",".
1150  " downloads_public_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveDownloadsPublic()), "text").",".
1151  " clean_frames = ".$ilDB->quote(ilUtil::tf2yn($this->cleanFrames()), "text").",".
1152  " hist_user_comments = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveHistoryUserComments()), "text").",".
1153  " public_access_mode = ".$ilDB->quote($this->getPublicAccessMode(), "text").",".
1154  " public_xml_file = ".$ilDB->quote($this->getPublicExportFile("xml"), "text").",".
1155  " public_html_file = ".$ilDB->quote($this->getPublicExportFile("html"), "text").",".
1156  " public_scorm_file = ".$ilDB->quote($this->getPublicExportFile("scorm"), "text").",".
1157  " header_page = ".$ilDB->quote($this->getHeaderPage(), "integer").",".
1158  " footer_page = ".$ilDB->quote($this->getFooterPage(), "integer").",".
1159  " lm_menu_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveLMMenu()), "text").", ".
1160  " layout_per_page = ".$ilDB->quote($this->getLayoutPerPage(), "integer").", ".
1161  " rating = ".$ilDB->quote($this->hasRating(), "integer").", ".
1162  " rating_pages = ".$ilDB->quote($this->hasRatingPages(), "integer").", ".
1163  " disable_def_feedback = ".$ilDB->quote($this->getDisableDefaultFeedback(), "integer").", ".
1164  " progr_icons = ".$ilDB->quote($this->getProgressIcons(), "integer").", ".
1165  " store_tries = ".$ilDB->quote($this->getStoreTries(), "integer").", ".
1166  " restrict_forw_nav = ".$ilDB->quote($this->getRestrictForwardNavigation(), "integer")." ".
1167  " WHERE id = ".$ilDB->quote($this->getId(), "integer");
1168  $ilDB->manipulate($q);
1169 
1170  // #14661
1171  include_once("./Services/Notes/classes/class.ilNote.php");
1172  ilNote::activateComments($this->getId(), 0, $this->getType(), $this->publicNotes());
1173  }
getHideHeaderFooterPrint()
Get hide header footer in print mode.
static tf2yn($a_tf)
convert true/false to "y"/"n"
getStyleSheetId()
get ID of assigned style sheet object
getLayout()
get default page layout of content object (see directory layouts/)
getStoreTries()
Get store tries.
getPublicExportFile($a_type)
get public export file
getPublicAccessMode()
get public access mode ("complete" | "selected")
getLayoutPerPage()
Get layout per page.
getProgressIcons()
Get progress icons.
getPageHeader()
get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER)
getId()
get object id public
getTOCMode()
get toc mode ("chapters" | "pages")
getDisableDefaultFeedback()
Get disable default feedback for questions.
getType()
get object type public
getRestrictForwardNavigation()
Get restrict forward navigation.
static activateComments($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_activate=true)
Activate notes feature.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validatePages()

ilObjContentObject::validatePages ( )

Validate all pages.

Definition at line 3048 of file class.ilObjContentObject.php.

References ilObject\$title, ilPageObject\_exists(), ilLMObject\_lookupTitle(), ilObject\getId(), ilLMPageObject\getPageList(), ilObject\getType(), and ilUtil\sendInfo().

Referenced by importFromDirectory().

3049  {
3050  include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
3051  include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
3052 
3053  $mess = "";
3054 
3055  $pages = ilLMPageObject::getPageList($this->getId());
3056  foreach ($pages as $page)
3057  {
3058  if (ilLMPage::_exists($this->getType(), $page["obj_id"]))
3059  {
3060  $cpage = new ilLMPage($page["obj_id"]);
3061  $cpage->buildDom();
3062  $error = @$cpage->validateDom();
3063 
3064  if ($error != "")
3065  {
3066  $this->lng->loadLanguageModule("content");
3067  ilUtil::sendInfo($this->lng->txt("cont_import_validation_errors"));
3068  $title = ilLMObject::_lookupTitle($page["obj_id"]);
3069  $page_obj = new ilLMPageObject($this, $page["obj_id"]);
3070  $mess.= $this->lng->txt("obj_pg").": ".$title;
3071  $mess.= '<div class="small">';
3072  foreach ($error as $e)
3073  {
3074  $err_mess = implode($e, " - ");
3075  if (!is_int(strpos($err_mess, ":0:")))
3076  {
3077  $mess.= htmlentities($err_mess)."<br />";
3078  }
3079  }
3080  $mess.= '</div>';
3081  $mess.= "<br />";
3082  }
3083  }
3084  }
3085 
3086  return $mess;
3087  }
static _lookupTitle($a_obj_id)
Lookup title.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class ilLMPageObject.
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
getId()
get object id public
getPageList($lm_id)
static
getType()
get object type public
Extension of ilPageObject for learning modules.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeStyleSheetId()

ilObjContentObject::writeStyleSheetId (   $a_style_id)

write ID of assigned style sheet object to db

Definition at line 672 of file class.ilObjContentObject.php.

References $ilDB, and ilObject\getId().

Referenced by importFromDirectory().

673  {
674  global $ilDB;
675 
676  $q = "UPDATE content_object SET ".
677  " stylesheet = ".$ilDB->quote((int) $a_style_id, "integer").
678  " WHERE id = ".$ilDB->quote($this->getId(), "integer");
679  $ilDB->manipulate($q);
680 
681  $this->style_id = $a_style_id;
682  }
getId()
get object id public
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $auto_glossaries

ilObjContentObject::$auto_glossaries = array()

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

Referenced by getAutoGlossaries().

◆ $import_dir

ilObjContentObject::$import_dir = ''
private

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

Referenced by createImportDirectory(), and getImportDirectory().

◆ $layout

ilObjContentObject::$layout

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

Referenced by getLayout().

◆ $lm_tree

ilObjContentObject::$lm_tree

Definition at line 23 of file class.ilObjContentObject.php.

Referenced by getLMTree(), and getTree().

◆ $meta_data

ilObjContentObject::$meta_data

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

◆ $online

ilObjContentObject::$online

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

Referenced by getOnline().

◆ $pg_header

ilObjContentObject::$pg_header

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

Referenced by getPageHeader().

◆ $rating

ilObjContentObject::$rating
protected

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

Referenced by hasRating().

◆ $rating_pages

ilObjContentObject::$rating_pages
protected

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

Referenced by hasRatingPages().

◆ $style_id

ilObjContentObject::$style_id

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

Referenced by getStyleSheetId().


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