ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 @access 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 ()
 get import id More...
 
 setImportId ($a_id)
 set import id More...
 
 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...
 
 setForTranslation ($a_val)
 Set for translation. More...
 
 getForTranslation ()
 Get for translation. 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="", $a_all_languages=false)
 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(), $a_lang="-", $a_all_languages=false)
 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, $a_mapping=null)
 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 ()
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor @access 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 @access public More...
 
 setId ($a_id)
 set object id @access public More...
 
 setRefId ($a_id)
 set reference id @access public More...
 
 getRefId ()
 get reference id @access public More...
 
 getType ()
 get object type @access public More...
 
 setType ($a_type)
 set object type @access public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title @access public More...
 
 getUntranslatedTitle ()
 get untranslated object title @access 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 @access public More...
 
 getLastUpdateDate ()
 get last update date @access public More...
 
 getDiskUsage ()
 
 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) @access 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...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static writeHeaderPage ($a_lm_id, $a_page_id)
 Write header page. More...
 
static writeFooterPage ($a_lm_id, $a_page_id)
 Write footer page. More...
 
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 _lookupImportId ($a_obj_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 @global 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@access public More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static 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
 
 $for_translation = 0
 
 $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
 
 $log
 

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

1320 {
1321 global $ilUser,$ilErr;
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 if ($lm_tree->isInTree($page_id))
1328 {
1329 $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1330 foreach ($path as $node)
1331 {
1332 if ($node["type"] == "st")
1333 {
1334 if (!ilConditionHandler::_checkAllConditionsOfTarget($cont_ref_id,$node["child"], "st"))
1335 {
1336 return false;
1337 }
1338 }
1339 }
1340 }
1341
1342 return true;
1343 }
_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...
$path
Definition: index.php:22
global $ilUser
Definition: imgupload.php:15

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

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

+ 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 929 of file class.ilObjContentObject.php.

930 {
931 global $ilDB;
932
933 $q = "UPDATE content_object SET ".
934 " stylesheet = ".$ilDB->quote(0, "integer").
935 " WHERE stylesheet = ".$ilDB->quote((int) $this->getId($a_style_id), "integer");
936
937 $ilDB->manipulate($q);
938 }
getId()
get object id @access public
global $ilDB

References $ilDB, and ilObject\getId().

Referenced by ilObjStyleSheet\delete().

+ 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 1348 of file class.ilObjContentObject.php.

1349 {
1350 $lm_tree = new ilTree($cont_obj_id);
1351 $lm_tree->setTableNames('lm_tree','lm_data');
1352 $lm_tree->setTreeTablePK("lm_id");
1353
1354 $conds = array();
1355 if ($lm_tree->isInTree($page_id))
1356 {
1357 // get full path of page
1358 $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1359 foreach ($path as $node)
1360 {
1361 if ($node["type"] == "st")
1362 {
1363 // get all preconditions of upper chapters
1364 $tconds = ilConditionHandler::_getConditionsOfTarget($cont_ref_id,$node["child"], "st");
1365 foreach ($tconds as $tcond)
1366 {
1367 // store all missing preconditions
1368 if (!ilConditionHandler::_checkCondition($tcond["id"]))
1369 {
1370 $conds[] = $tcond;
1371 }
1372 }
1373 }
1374 }
1375 }
1376
1377 return $conds;
1378 }
static _getConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_target_type="")
get all conditions of target object
_checkCondition($a_id, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...

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

Referenced by ilLMPresentationGUI\showPreconditionsOfPage().

+ 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 1383 of file class.ilObjContentObject.php.

1384 {
1385 $lm_tree = new ilTree($cont_obj_id);
1386 $lm_tree->setTableNames('lm_tree','lm_data');
1387 $lm_tree->setTreeTablePK("lm_id");
1388
1389 $conds = array();
1390 if ($lm_tree->isInTree($page_id))
1391 {
1392 // get full path of page
1393 $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1394 foreach ($path as $node)
1395 {
1396 if ($node["type"] == "st")
1397 {
1398 // get all preconditions of upper chapters
1399 $tconds = ilConditionHandler::_getConditionsOfTarget($cont_obj_ref_id,$node["child"], "st");
1400 foreach ($tconds as $tcond)
1401 {
1402 // look for missing precondition
1403 if (!ilConditionHandler::_checkCondition($tcond["id"]))
1404 {
1405 return $node["child"];
1406 }
1407 }
1408 }
1409 }
1410 }
1411
1412 return "";
1413 }

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

Referenced by ilLMPresentationGUI\showPreconditionsOfPage().

+ 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 895 of file class.ilObjContentObject.php.

896 {
897 global $ilDB;
898
899 // joining with style table (not perfectly nice)
900 $q = "SELECT count(*) as cnt FROM content_object, style_data ".
901 " WHERE stylesheet = style_data.id ".
902 " AND standard = ".$ilDB->quote(0, "integer");
903 $cset = $ilDB->query($q);
904 $crow = $ilDB->fetchAssoc($cset);
905
906 return (int) $crow["cnt"];
907 }

References $ilDB.

Referenced by ilObjStyleSettingsGUI\editContentStylesObject().

+ Here is the caller graph for this function:

◆ _getNrLMsNoStyle()

ilObjContentObject::_getNrLMsNoStyle ( )

get number of learning modules assigned no style

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

913 {
914 global $ilDB;
915
916 $q = "SELECT count(*) as cnt FROM content_object ".
917 " WHERE stylesheet = ".$ilDB->quote(0, "integer");
918 $cset = $ilDB->query($q);
919 $crow = $ilDB->fetchAssoc($cset);
920
921 return (int) $crow["cnt"];
922 }

References $ilDB.

Referenced by ilObjStyleSettingsGUI\editContentStylesObject().

+ 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 879 of file class.ilObjContentObject.php.

880 {
881 global $ilDB;
882
883 $q = "SELECT count(*) as cnt FROM content_object ".
884 " WHERE stylesheet = ".$ilDB->quote($a_style_id, "integer");
885 $cset = $ilDB->query($q);
886 $crow = $ilDB->fetchAssoc($cset);
887
888 return (int) $crow["cnt"];
889 }

References $ilDB.

Referenced by ilObjStyleSettingsGUI\editContentStylesObject().

+ 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 786 of file class.ilObjContentObject.php.

787 {
788 global $ilDB, $ilLog;
789
790 $q = "SELECT ".$a_field." FROM content_object ".
791 " WHERE id = ".$ilDB->quote($a_obj_id, "integer");
792
793 $res = $ilDB->query($q);
794 $rec = $ilDB->fetchAssoc($res);
795
796 return $rec[$a_field];
797 }

References $ilDB, $ilLog, and $res.

Referenced by _lookupRestrictForwardNavigation().

+ Here is the caller graph for this function:

◆ _lookupContObjIdByStyleId()

ilObjContentObject::_lookupContObjIdByStyleId (   $a_style_id)

lookup style sheet ID

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

829 {
830 global $ilDB;
831
832 $q = "SELECT id FROM content_object ".
833 " WHERE stylesheet = ".$ilDB->quote($a_style_id, "integer");
834 $res = $ilDB->query($q);
835 $obj_ids = array();
836 while($cont = $ilDB->fetchAssoc($res))
837 {
838 $obj_ids[] = $cont["id"];
839 }
840 return $obj_ids;
841 }

References $ilDB, and $res.

Referenced by ilObjStyleSheet\_getClonableContentStyles().

+ Here is the caller graph for this function:

◆ _lookupDisableDefaultFeedback()

static ilObjContentObject::_lookupDisableDefaultFeedback (   $a_id)
static

Lookup disable default feedback.

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

847 {
848 global $ilDB;
849
850 $q = "SELECT disable_def_feedback FROM content_object ".
851 " WHERE id = ".$ilDB->quote($a_id, "integer");
852 $res = $ilDB->query($q);
853 $rec = $ilDB->fetchAssoc($res);
854
855 return $rec["disable_def_feedback"];
856 }

References $ilDB, and $res.

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

+ Here is the caller graph for this function:

◆ _lookupOnline()

ilObjContentObject::_lookupOnline (   $a_id)

check wether content object is online

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

1258 {
1259 global $ilDB;
1260
1261//echo "class ilObjContentObject::_lookupOnline($a_id) called. Use Access class instead.";
1262
1263 $q = "SELECT is_online FROM content_object WHERE id = ".$ilDB->quote($a_id, "integer");
1264 $lm_set = $ilDB->query($q);
1265 $lm_rec = $ilDB->fetchAssoc($lm_set);
1266
1267 return ilUtil::yn2tf($lm_rec["is_online"]);
1268 }
static yn2tf($a_yn)
convert "y"/"n" to true/false
$lm_set

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

+ 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 805 of file class.ilObjContentObject.php.

806 {
807 return self::_lookup($a_obj_id, "restrict_forw_nav");
808 }
static _lookup($a_obj_id, $a_field)
Lookup property.

References _lookup().

Referenced by ilLMPageGUI\processAnswer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupStoreTries()

static ilObjContentObject::_lookupStoreTries (   $a_id)
static

Lookup disable default feedback.

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

862 {
863 global $ilDB;
864
865 $q = "SELECT store_tries FROM content_object ".
866 " WHERE id = ".$ilDB->quote($a_id, "integer");
867 $res = $ilDB->query($q);
868 $rec = $ilDB->fetchAssoc($res);
869
870 return $rec["store_tries"];
871 }

References $ilDB, and $res.

Referenced by ilLMPageGUI\__construct().

+ Here is the caller graph for this function:

◆ _lookupStyleSheetId()

ilObjContentObject::_lookupStyleSheetId (   $a_cont_obj_id)

lookup style sheet ID

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

814 {
815 global $ilDB;
816
817 $q = "SELECT stylesheet FROM content_object ".
818 " WHERE id = ".$ilDB->quote($a_cont_obj_id, "integer");
819 $res = $ilDB->query($q);
820 $sheet = $ilDB->fetchAssoc($res);
821
822 return $sheet["stylesheet"];
823 }

References $ilDB, and $res.

Referenced by ilLearningModuleExporter\getXmlExportTailDependencies(), and ilPCParagraphGUI\setStyle().

+ 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 746 of file class.ilObjContentObject.php.

747 {
748 global $ilDB, $ilias;
749
750 if ($a_from_style < 0) // change / delete all individual styles
751 {
752 $q = "SELECT stylesheet FROM content_object, style_data ".
753 " WHERE content_object.stylesheet = style_data.id ".
754 " AND style_data.standard = ".$ilDB->quote(0, "integer").
755 " AND content_object.stylesheet > ".$ilDB->quote(0, "integer");
756 $style_set = $ilDB->query($q);
757 while($style_rec = $ilDB->fetchAssoc($style_set))
758 {
759 // assign learning modules to new style
760 $q = "UPDATE content_object SET ".
761 " stylesheet = ".$ilDB->quote((int) $a_to_style, "integer").
762 " WHERE stylesheet = ".$ilDB->quote($style_rec["stylesheet"], "integer");
763 $ilDB->manipulate($q);
764
765 // delete style
766 $style_obj =& $ilias->obj_factory->getInstanceByObjId($style_rec["stylesheet"]);
767 $style_obj->delete();
768 }
769 }
770 else
771 {
772 $q = "UPDATE content_object SET ".
773 " stylesheet = ".$ilDB->quote((int) $a_to_style, "integer").
774 " WHERE stylesheet = ".$ilDB->quote($a_from_style, "integer");
775 $ilDB->manipulate($q);
776 }
777 }

References $ilDB, and ilObject\$ilias.

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

+ Here is the caller graph for this function:

◆ addFirstChapterAndPage()

ilObjContentObject::addFirstChapterAndPage ( )

Add first chapter and page.

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

396 {
397 global $lng;
398
399 include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
400 include_once("./Modules/LearningModule/classes/class.ilStructureObject.php");
401 include_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
402
403 $root_id = $this->lm_tree->getRootId();
404
405 // chapter
406 $chap = new ilStructureObject($this);
407 $chap->setType("st");
408 $chap->setTitle($lng->txt("cont_new_chap"));
409 $chap->setLMId($this->getId());
410 $chap->create();
411 ilLMObject::putInTree($chap, $root_id, IL_FIRST_NODE);
412
413 // page
414 $page = new ilLMPageObject($this);
415 $page->setType("pg");
416 $page->setTitle($lng->txt("cont_new_page"));
417 $page->setLMId($this->getId());
418 $page->create();
419 ilLMObject::putInTree($page, $chap->getId(), IL_FIRST_NODE);
420 }
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 ilLMPageObject.
Class ilStructreObject.

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

+ Here is the call graph for this function:

◆ autoLinkGlossaryTerms()

ilObjContentObject::autoLinkGlossaryTerms (   $a_glo_id)

Auto link glossary terms.

Parameters

return

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

3541 {
3542 // get terms
3543 include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
3544 $terms = ilGlossaryTerm::getTermList($a_glo_id);
3545
3546 // each get page: get content
3547 include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
3548 $pages = ilLMPage::getAllPages($this->getType(), $this->getId());
3549
3550 // determine terms that occur in the page
3551 $found_pages = array();
3552 foreach ($pages as $p)
3553 {
3554 $pg = new ilLMPage($p["id"]);
3555 $c = $pg->getXMLContent();
3556 foreach ($terms as $t)
3557 {
3558 if (is_int(stripos($c, $t["term"])))
3559 {
3560 $found_pages[$p["id"]]["terms"][] = $t;
3561 if (!is_object($found_pages[$p["id"]]["page"]))
3562 {
3563 $found_pages[$p["id"]]["page"] = $pg;
3564 }
3565 }
3566 }
3567 reset($terms);
3568 }
3569
3570 // ilPCParagraph autoLinkGlossariesPage with page and terms
3571 include_once("./Services/COPage/classes/class.ilPCParagraph.php");
3572 foreach ($found_pages as $id => $fp)
3573 {
3574 ilPCParagraph::autoLinkGlossariesPage($fp["page"], $fp["terms"]);
3575 }
3576
3577
3578 }
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.
Extension of ilPageObject for learning modules.
getType()
get object type @access public
static autoLinkGlossariesPage($a_page, $a_terms)
Auto link glossary of whole page.
static getAllPages($a_parent_type, $a_parent_id, $a_lang="-")
Get all pages for parent object.

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

+ Here is the call graph for this function:

◆ checkTree()

ilObjContentObject::checkTree ( )

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

1500 {
1501 $tree = new ilTree($this->getId());
1502 $tree->setTableNames('lm_tree','lm_data');
1503 $tree->setTreeTablePK("lm_id");
1504 $tree->checkTree();
1505 $tree->checkTreeChilds();
1506//echo "checked";
1507 }

References ilObject\getId().

Referenced by executeDragDrop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanFrames()

ilObjContentObject::cleanFrames ( )

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

1100 {
1101 return $this->clean_frames;
1102 }

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

+ Here is the caller graph for this function:

◆ cloneObject()

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

Clone learning module.

@access public

Parameters
inttarget ref_id
intcopy id

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

3374 {
3375 global $ilDB, $ilUser, $ilias;
3376
3377 $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
3378 $this->cloneMetaData($new_obj);
3379 //$new_obj->createProperties();
3380
3381 //copy online status if object is not the root copy object
3382 $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
3383
3384 if(!$cp_options->isRootNode($this->getRefId()))
3385 {
3386 $new_obj->setOnline($this->getOnline());
3387 }
3388
3389// $new_obj->setTitle($this->getTitle());
3390 $new_obj->setDescription($this->getDescription());
3391 $new_obj->setLayoutPerPage($this->getLayoutPerPage());
3392 $new_obj->setLayout($this->getLayout());
3393 $new_obj->setTOCMode($this->getTOCMode());
3394 $new_obj->setActiveLMMenu($this->isActiveLMMenu());
3395 $new_obj->setActiveTOC($this->isActiveTOC());
3396 $new_obj->setActiveNumbering($this->isActiveNumbering());
3397 $new_obj->setActivePrintView($this->isActivePrintView());
3398 $new_obj->setActivePreventGlossaryAppendix($this->isActivePreventGlossaryAppendix());
3399 $new_obj->setActiveDownloads($this->isActiveDownloads());
3400 $new_obj->setActiveDownloadsPublic($this->isActiveDownloadsPublic());
3401 $new_obj->setPublicNotes($this->publicNotes());
3402 $new_obj->setCleanFrames($this->cleanFrames());
3403 $new_obj->setHistoryUserComments($this->isActiveHistoryUserComments());
3404 $new_obj->setPublicAccessMode($this->getPublicAccessMode());
3405 $new_obj->setPageHeader($this->getPageHeader());
3406 $new_obj->setRating($this->hasRating());
3407 $new_obj->setRatingPages($this->hasRatingPages());
3408 $new_obj->setDisableDefaultFeedback($this->getDisableDefaultFeedback());
3409 $new_obj->setProgressIcons($this->getProgressIcons());
3410 $new_obj->setStoreTries($this->getStoreTries());
3411 $new_obj->setRestrictForwardNavigation($this->getRestrictForwardNavigation());
3412 $new_obj->setAutoGlossaries($this->getAutoGlossaries());
3413
3414 $new_obj->update();
3415
3416 $new_obj->createLMTree();
3417
3418 // copy style
3419 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
3420 $style_id = $this->getStyleSheetId();
3421 if ($style_id > 0 &&
3423 {
3424 $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
3425 $new_id = $style_obj->ilClone();
3426 $new_obj->setStyleSheetId($new_id);
3427 $new_obj->update();
3428 }
3429
3430 // copy content
3431 $copied_nodes = $this->copyAllPagesAndChapters($new_obj, $a_copy_id);
3432
3433 // page header and footer
3434 if ($this->getHeaderPage() > 0 && ($new_page_header = $copied_nodes[$this->getHeaderPage()]) > 0)
3435 {
3436 $new_obj->setHeaderPage($new_page_header);
3437 }
3438 if ($this->getFooterPage() > 0 && ($new_page_footer = $copied_nodes[$this->getFooterPage()]) > 0)
3439 {
3440 $new_obj->setFooterPage($new_page_footer);
3441 }
3442 $new_obj->update();
3443
3444 // Copy learning progress settings
3445 include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
3446 $obj_settings = new ilLPObjSettings($this->getId());
3447 $obj_settings->cloneSettings($new_obj->getId());
3448 unset($obj_settings);
3449
3450 // copy (page) multilang settings
3451 include_once("./Services/Object/classes/class.ilObjectTranslation.php");
3453 $ot->copy($new_obj->getId());
3454
3455 return $new_obj;
3456 }
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getLayoutPerPage()
Get layout per page.
getRestrictForwardNavigation()
Get restrict forward navigation.
copyAllPagesAndChapters($a_target_obj, $a_copy_id=0)
Copy all pages and chapters.
getTOCMode()
get toc mode ("chapters" | "pages")
getAutoGlossaries()
Get auto glossaries.
getLayout()
get default page layout of content object (see directory layouts/)
getDescription()
get description of content object
getPageHeader()
get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER)
getPublicAccessMode()
get public access mode ("complete" | "selected")
getStyleSheetId()
get ID of assigned style sheet object
getStoreTries()
Get store tries.
getProgressIcons()
Get progress icons.
getDisableDefaultFeedback()
Get disable default feedback for questions.
_lookupStandard($a_id)
Lookup standard flag.
static getInstance($a_obj_id)
Get instance.
cloneMetaData($target_obj)
Copy meta data.

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

+ 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 3463 of file class.ilObjContentObject.php.

3464 {
3465 $parent_id = $a_target_obj->lm_tree->readRootId();
3466
3467 include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
3468 include_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
3469
3470 // get all chapters of root lm
3471 $chapters = $this->lm_tree->getChildsByType($this->lm_tree->readRootId(), "st");
3472 $copied_nodes = array();
3473 //$time = time();
3474 foreach ($chapters as $chap)
3475 {
3476 $cid = ilLMObject::pasteTree($a_target_obj, $chap["child"], $parent_id,
3477 IL_LAST_NODE, $time, $copied_nodes, true, $this);
3478 $target = $cid;
3479 }
3480
3481 // copy free pages
3482 $pages = ilLMPageObject::getPageList($this->getId());
3483 foreach ($pages as $p)
3484 {
3485 if (!$this->lm_tree->isInTree($p["obj_id"]))
3486 {
3487 $item = new ilLMPageObject($this, $p["obj_id"]);
3488 $target_item = $item->copy($a_target_obj);
3489 $copied_nodes[$item->getId()] = $target_item->getId();
3490 }
3491 }
3492
3493 // Add mapping for pages and chapters
3494 include_once './Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
3496 foreach($copied_nodes as $old_id => $new_id)
3497 {
3498 $options->appendMapping(
3499 $this->getRefId().'_'.$old_id,
3500 $a_target_obj->getRefId().'_'.$new_id
3501 );
3502 }
3503
3504 ilLMObject::updateInternalLinks($copied_nodes);
3505
3506 $a_target_obj->checkTree();
3507
3508 return $copied_nodes;
3509 }
const IL_LAST_NODE
Definition: class.ilTree.php:4
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 updateInternalLinks($a_copied_nodes, $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
getPageList($lm_id)
static
getRefId()
get reference id @access public
if(!is_array($argv)) $options

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

Referenced by cloneObject().

+ 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 61 of file class.ilObjContentObject.php.

62 {
63 global $ilUser;
64
65 parent::create();
66
67 // meta data will be created by
68 // import parser
69 if (!$a_no_meta_data)
70 {
71 $this->createMetaData();
72 }
73
74 $this->createProperties();
75 $this->updateAutoGlossaries();
76 }
createProperties()
create new properties record
updateAutoGlossaries()
Update auto glossaries.
createMetaData()
create meta data entry

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

+ 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 530 of file class.ilObjContentObject.php.

531 {
532 $lm_data_dir = ilUtil::getDataDir()."/lm_data";
533 if(!is_writable($lm_data_dir))
534 {
535 $this->ilias->raiseError("Content object Data Directory (".$lm_data_dir
536 .") not writeable.",$this->ilias->error_obj->FATAL);
537 }
538 // create learning module directory (data_dir/lm_data/lm_<id>)
539 $lm_dir = $lm_data_dir."/lm_".$this->getId();
540 ilUtil::makeDir($lm_dir);
541 if(!@is_dir($lm_dir))
542 {
543 $this->ilias->raiseError("Creation of Learning Module Directory failed.",$this->ilias->error_obj->FATAL);
544 }
545 // create Export subdirectory (data_dir/lm_data/lm_<id>/Export)
546 switch ($a_type)
547 {
548 // scorm
549 case "scorm":
550 $export_dir = $lm_dir."/export_scorm";
551 break;
552
553 default: // = xml
554 if (substr($a_type, 0, 4) == "html")
555 {
556 $export_dir = $lm_dir."/export_".$a_type;
557 }
558 else
559 {
560 $export_dir = $lm_dir."/export";
561 }
562 break;
563 }
564 ilUtil::makeDir($export_dir);
565
566 if(!@is_dir($export_dir))
567 {
568 $this->ilias->raiseError("Creation of Export Directory failed.",$this->ilias->error_obj->FATAL);
569 }
570 }
static getDataDir()
get data directory (outside webspace)
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
redirection script todo: (a better solution should control the processing via a xml file)

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

Referenced by ilObjDlBook\export().

+ 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 456 of file class.ilObjContentObject.php.

457 {
458 $lm_data_dir = ilUtil::getDataDir()."/lm_data";
459 if(!is_writable($lm_data_dir))
460 {
461 $this->ilias->raiseError("Content object Data Directory (".$lm_data_dir
462 .") not writeable.",$this->ilias->error_obj->FATAL);
463 }
464
465 // create learning module directory (data_dir/lm_data/lm_<id>)
466 $lm_dir = $lm_data_dir."/lm_".$this->getId();
467 ilUtil::makeDir($lm_dir);
468 if(!@is_dir($lm_dir))
469 {
470 $this->ilias->raiseError("Creation of Learning Module Directory failed.",$this->ilias->error_obj->FATAL);
471 }
472
473 // create import subdirectory (data_dir/lm_data/lm_<id>/import)
474 $import_dir = $lm_dir."/import";
476 if(!@is_dir($import_dir))
477 {
478 $this->ilias->raiseError("Creation of Import Directory failed.",$this->ilias->error_obj->FATAL);
479 }
480 }

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

Referenced by importFromZipFile().

+ 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 332 of file class.ilObjContentObject.php.

333 {
334 $this->lm_tree =& new ilTree($this->getId());
335 $this->lm_tree->setTreeTablePK("lm_id");
336 $this->lm_tree->setTableNames('lm_tree','lm_data');
337 $this->lm_tree->addTree($this->getId(), 1);
338 }

References ilObject\getId().

+ Here is the call graph for this function:

◆ createProperties()

ilObjContentObject::createProperties ( )

create new properties record

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

1241 {
1242 global $ilDB;
1243
1244 $q = "INSERT INTO content_object (id) VALUES (".$ilDB->quote($this->getId(), "integer").")";
1245 $ilDB->manipulate($q);
1246
1247 // #14661
1248 include_once("./Services/Notes/classes/class.ilNote.php");
1249 ilNote::activateComments($this->getId(), 0, $this->getType(), true);
1250
1251 $this->readProperties(); // to get db default values
1252 }
static activateComments($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_activate=true)
Activate notes feature.
readProperties()
read content object properties

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

Referenced by create().

+ 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

@access public

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

Reimplemented from ilObject.

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

609 {
610 global $ilDB;
611
612 global $ilBench;
613
614 // always call parent delete function first!!
615 if (!parent::delete())
616 {
617 return false;
618 }
619
620 // delete lm object data
621 include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
623
624 // delete meta data of content object
625 $this->deleteMetaData();
626
627 // delete bibitem data
628 $nested = new ilNestedSetXML();
629 $nested->init($this->getId(), "bib");
630 $nested->deleteAllDBData();
631
632
633 // delete learning module tree
634 $this->lm_tree->removeTree($this->lm_tree->getTreeId());
635
636 // delete data directory
638
639 // delete content object record
640 $q = "DELETE FROM content_object WHERE id = ".
641 $ilDB->quote($this->getId(), "integer");
642 $ilDB->manipulate($q);
643
644 // delete lm menu entries
645 $q = "DELETE FROM lm_menu WHERE lm_id = ".
646 $ilDB->quote($this->getId(), "integer");
647 $ilDB->manipulate($q);
648
649 // remove auto glossary entries
650 $ilDB->manipulate("DELETE FROM lm_glossaries WHERE ".
651 " lm_id = ".$ilDB->quote($this->getId(), "integer")
652 );
653
654
655 return true;
656 }
_deleteAllObjectData(&$a_cobj)
delete all objects of content object (digi book / learning module)
Class NestedSetXML functions for storing XML-Data into nested-set-database-strcture.
getDataDirectory()
get data directory
deleteMetaData()
delete meta data entry
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
global $ilBench
Definition: ilias.php:18

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

+ 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 2997 of file class.ilObjContentObject.php.

2998 {
2999 $lmtree = new ilTree($this->getId());
3000 $lmtree->setTableNames('lm_tree','lm_data');
3001 $lmtree->setTreeTablePK("lm_id");
3002//echo "-".$source_id."-".$target_id."-".$first_child."-".$as_subitem."-";
3003 $source_obj = ilLMObjectFactory::getInstance($this, $source_id, true);
3004 $source_obj->setLMId($this->getId());
3005
3006 if (!$first_child)
3007 {
3008 $target_obj = ilLMObjectFactory::getInstance($this, $target_id, true);
3009 $target_obj->setLMId($this->getId());
3010 $target_parent = $lmtree->getParentId($target_id);
3011 }
3012
3013 // handle pages
3014 if ($source_obj->getType() == "pg")
3015 {
3016//echo "1";
3017 if ($lmtree->isInTree($source_obj->getId()))
3018 {
3019 $node_data = $lmtree->getNodeData($source_obj->getId());
3020
3021 // cut on move
3022 if ($movecopy == "move")
3023 {
3024 $parent_id = $lmtree->getParentId($source_obj->getId());
3025 $lmtree->deleteTree($node_data);
3026
3027 // write history entry
3028 require_once("./Services/History/classes/class.ilHistory.php");
3029 ilHistory::_createEntry($source_obj->getId(), "cut",
3030 array(ilLMObject::_lookupTitle($parent_id), $parent_id),
3031 $this->getType().":pg");
3032 ilHistory::_createEntry($parent_id, "cut_page",
3033 array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
3034 $this->getType().":st");
3035 }
3036 else
3037 {
3038 // copy page
3039 $new_page =& $source_obj->copy();
3040 $source_id = $new_page->getId();
3041 $source_obj =& $new_page;
3042 }
3043
3044 // paste page
3045 if(!$lmtree->isInTree($source_obj->getId()))
3046 {
3047 if ($first_child) // as first child
3048 {
3049 $target_pos = IL_FIRST_NODE;
3050 $parent = $target_id;
3051 }
3052 else if ($as_subitem) // as last child
3053 {
3054 $parent = $target_id;
3055 $target_pos = IL_FIRST_NODE;
3056 $pg_childs =& $lmtree->getChildsByType($parent, "pg");
3057 if (count($pg_childs) != 0)
3058 {
3059 $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
3060 }
3061 }
3062 else // at position
3063 {
3064 $target_pos = $target_id;
3065 $parent = $target_parent;
3066 }
3067
3068 // insert page into tree
3069 $lmtree->insertNode($source_obj->getId(),
3070 $parent, $target_pos);
3071
3072 // write history entry
3073 if ($movecopy == "move")
3074 {
3075 // write history comments
3076 include_once("./Services/History/classes/class.ilHistory.php");
3077 ilHistory::_createEntry($source_obj->getId(), "paste",
3078 array(ilLMObject::_lookupTitle($parent), $parent),
3079 $this->getType().":pg");
3080 ilHistory::_createEntry($parent, "paste_page",
3081 array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
3082 $this->getType().":st");
3083 }
3084
3085 }
3086 }
3087 }
3088
3089 // handle chapters
3090 if ($source_obj->getType() == "st")
3091 {
3092//echo "2";
3093 $source_node = $lmtree->getNodeData($source_id);
3094 $subnodes = $lmtree->getSubtree($source_node);
3095
3096 // check, if target is within subtree
3097 foreach ($subnodes as $subnode)
3098 {
3099 if($subnode["obj_id"] == $target_id)
3100 {
3101 return;
3102 }
3103 }
3104
3105 $target_pos = $target_id;
3106
3107 if ($first_child) // as first subchapter
3108 {
3109 $target_pos = IL_FIRST_NODE;
3110 $target_parent = $target_id;
3111
3112 $pg_childs =& $lmtree->getChildsByType($target_parent, "pg");
3113 if (count($pg_childs) != 0)
3114 {
3115 $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
3116 }
3117 }
3118 else if ($as_subitem) // as last subchapter
3119 {
3120 $target_parent = $target_id;
3121 $target_pos = IL_FIRST_NODE;
3122 $childs =& $lmtree->getChilds($target_parent);
3123 if (count($childs) != 0)
3124 {
3125 $target_pos = $childs[count($childs) - 1]["obj_id"];
3126 }
3127 }
3128
3129 // insert into
3130/*
3131 if ($position == "into")
3132 {
3133 $target_parent = $target_id;
3134 $target_pos = IL_FIRST_NODE;
3135
3136 // if target_pos is still first node we must skip all pages
3137 if ($target_pos == IL_FIRST_NODE)
3138 {
3139 $pg_childs =& $lmtree->getChildsByType($target_parent, "pg");
3140 if (count($pg_childs) != 0)
3141 {
3142 $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
3143 }
3144 }
3145 }
3146*/
3147
3148
3149 // delete source tree
3150 if ($movecopy == "move")
3151 {
3152 $lmtree->deleteTree($source_node);
3153 }
3154 else
3155 {
3156 // copy chapter (incl. subcontents)
3157 $new_chapter =& $source_obj->copy($lmtree, $target_parent, $target_pos);
3158 }
3159
3160 if (!$lmtree->isInTree($source_id))
3161 {
3162 $lmtree->insertNode($source_id, $target_parent, $target_pos);
3163
3164 // insert moved tree
3165 if ($movecopy == "move")
3166 {
3167 foreach ($subnodes as $node)
3168 {
3169 if($node["obj_id"] != $source_id)
3170 {
3171 $lmtree->insertNode($node["obj_id"], $node["parent"]);
3172 }
3173 }
3174 }
3175 }
3176
3177 // check the tree
3178 $this->checkTree();
3179 }
3180
3181 $this->checkTree();
3182 }
_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.
getInstance(&$a_content_obj, $a_id=0, $a_halt=true)
static _lookupTitle($a_obj_id)
Lookup title.
$target_id
Definition: goto.php:88

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

+ Here is the call graph for this function:

◆ exportFileItems()

ilObjContentObject::exportFileItems (   $a_target_dir,
$expLog 
)

export files of file itmes

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

1844 {
1845 include_once("./Modules/File/classes/class.ilObjFile.php");
1846
1847 foreach ($this->file_ids as $file_id)
1848 {
1849 $expLog->write(date("[y-m-d H:i:s] ")."File Item ".$file_id);
1850 $file_obj = new ilObjFile($file_id, false);
1851 $file_obj->export($a_target_dir);
1852 unset($file_obj);
1853 }
1854 }
Class ilObjFile.

Referenced by exportXML().

+ 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 2883 of file class.ilObjContentObject.php.

2884 {
2885 global $ilBench;
2886
2887 // fo:root (start)
2888 $attrs = array();
2889 $attrs["xmlns:fo"] = "http://www.w3.org/1999/XSL/Format";
2890 $a_xml_writer->xmlStartTag("fo:root", $attrs);
2891
2892 // fo:layout-master-set (start)
2893 $attrs = array();
2894 $a_xml_writer->xmlStartTag("fo:layout-master-set", $attrs);
2895
2896 // fo:simple-page-master (start)
2897 $attrs = array();
2898 $attrs["master-name"] = "DinA4";
2899 $attrs["page-height"] = "29.7cm";
2900 $attrs["page-width"] = "21cm";
2901 $attrs["margin-top"] = "4cm";
2902 $attrs["margin-bottom"] = "1cm";
2903 $attrs["margin-left"] = "2.8cm";
2904 $attrs["margin-right"] = "7.3cm";
2905 $a_xml_writer->xmlStartTag("fo:simple-page-master", $attrs);
2906
2907 // fo:region-body (complete)
2908 $attrs = array();
2909 $attrs["margin-top"] = "0cm";
2910 $attrs["margin-bottom"] = "1.25cm";
2911 $a_xml_writer->xmlElement("fo:region-body", $attrs);
2912
2913 // fo:region-before (complete)
2914 $attrs = array();
2915 $attrs["extent"] = "1cm";
2916 $a_xml_writer->xmlElement("fo:region-before", $attrs);
2917
2918 // fo:region-after (complete)
2919 $attrs = array();
2920 $attrs["extent"] = "1cm";
2921 $a_xml_writer->xmlElement("fo:region-after", $attrs);
2922
2923 // fo:simple-page-master (end)
2924 $a_xml_writer->xmlEndTag("fo:simple-page-master");
2925
2926 // fo:layout-master-set (end)
2927 $a_xml_writer->xmlEndTag("fo:layout-master-set");
2928
2929 // fo:page-sequence (start)
2930 $attrs = array();
2931 $attrs["master-reference"] = "DinA4";
2932 $a_xml_writer->xmlStartTag("fo:page-sequence", $attrs);
2933
2934 // fo:flow (start)
2935 $attrs = array();
2936 $attrs["flow-name"] = "xsl-region-body";
2937 $a_xml_writer->xmlStartTag("fo:flow", $attrs);
2938
2939
2940 // StructureObjects
2941 //$expLog->write(date("[y-m-d H:i:s] ")."Start Export Structure Objects");
2942 $ilBench->start("ContentObjectExport", "exportFOStructureObjects");
2943 $this->exportFOStructureObjects($a_xml_writer, $expLog);
2944 $ilBench->stop("ContentObjectExport", "exportFOStructureObjects");
2945 //$expLog->write(date("[y-m-d H:i:s] ")."Finished Export Structure Objects");*/
2946
2947 // fo:flow (end)
2948 $a_xml_writer->xmlEndTag("fo:flow");
2949
2950 // fo:page-sequence (end)
2951 $a_xml_writer->xmlEndTag("fo:page-sequence");
2952
2953 // fo:root (end)
2954 $a_xml_writer->xmlEndTag("fo:root");
2955 }
exportFOStructureObjects(&$a_xml_writer)
export structure objects to fo

References $ilBench, and exportFOStructureObjects().

+ 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 2963 of file class.ilObjContentObject.php.

2964 {
2965 $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
2966 foreach ($childs as $child)
2967 {
2968 if($child["type"] != "st")
2969 {
2970 continue;
2971 }
2972
2973 $structure_obj = new ilStructureObject($this, $child["obj_id"]);
2974 $structure_obj->exportFO($a_xml_writer, $expLog);
2975 unset($structure_obj);
2976 }
2977 }

Referenced by exportFO().

+ 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 2126 of file class.ilObjContentObject.php.

2127 {
2128 global $tpl, $ilBench, $ilLocator, $ilUser, $ilObjDataCache, $ilias;
2129
2130 $user_lang = $ilUser->getLanguage();
2131
2132 // initialize temporary target directory
2133 ilUtil::delDir($a_target_dir);
2134 ilUtil::makeDir($a_target_dir);
2135 $mob_dir = $a_target_dir."/mobs";
2136 ilUtil::makeDir($mob_dir);
2137 $file_dir = $a_target_dir."/files";
2138 ilUtil::makeDir($file_dir);
2139 $teximg_dir = $a_target_dir."/teximg";
2140 ilUtil::makeDir($teximg_dir);
2141 $style_dir = $a_target_dir."/style";
2142 ilUtil::makeDir($style_dir);
2143 $style_img_dir = $a_target_dir."/style/images";
2144 ilUtil::makeDir($style_img_dir);
2145 $content_style_dir = $a_target_dir."/content_style";
2146 ilUtil::makeDir($content_style_dir);
2147 $content_style_img_dir = $a_target_dir."/content_style/images";
2148 ilUtil::makeDir($content_style_img_dir);
2149 $GLOBALS["teximgcnt"] = 0;
2150
2151 // export system style sheet
2152 $location_stylesheet = ilUtil::getStyleSheetLocation("filesystem");
2153 $style_name = $ilUser->prefs["style"].".css";
2154 copy($location_stylesheet, $style_dir."/".$style_name);
2155 $fh = fopen($location_stylesheet, "r");
2156 $css = fread($fh, filesize($location_stylesheet));
2157 preg_match_all("/url\‍(([^\‍)]*)\‍)/",$css,$files);
2158 foreach (array_unique($files[1]) as $fileref)
2159 {
2160 $css_fileref = str_replace(array("'", '"'), "", $fileref);
2161 $fileref = dirname($location_stylesheet)."/".$css_fileref;
2162 if (is_file($fileref))
2163 {
2164//echo "<br>make dir: ".dirname($style_dir."/".$css_fileref);
2165 ilUtil::makeDirParents(dirname($style_dir."/".$css_fileref));
2166//echo "<br>copy: ".$fileref." TO ".$style_dir."/".$css_fileref;
2167 copy($fileref, $style_dir."/".$css_fileref);
2168 }
2169 }
2170 fclose($fh);
2171 $location_stylesheet = ilUtil::getStyleSheetLocation();
2172
2173 // export content style sheet
2174 $ilBench->start("ExportHTML", "exportContentStyle");
2175 if ($this->getStyleSheetId() < 1)
2176 {
2177 $cont_stylesheet = "./Services/COPage/css/content.css";
2178
2179 $css = fread(fopen($cont_stylesheet,'r'),filesize($cont_stylesheet));
2180 preg_match_all("/url\‍(([^\‍)]*)\‍)/",$css,$files);
2181 foreach (array_unique($files[1]) as $fileref)
2182 {
2183 if (is_file(str_replace("..", ".", $fileref)))
2184 {
2185 copy(str_replace("..", ".", $fileref), $content_style_img_dir."/".basename($fileref));
2186 }
2187 $css = str_replace($fileref, "images/".basename($fileref),$css);
2188 }
2189 fwrite(fopen($content_style_dir."/content.css",'w'),$css);
2190 }
2191 else
2192 {
2193 $style = new ilObjStyleSheet($this->getStyleSheetId());
2194 $style->writeCSSFile($content_style_dir."/content.css", "images");
2195 $style->copyImagesToDir($content_style_img_dir);
2196 }
2197 $ilBench->stop("ExportHTML", "exportContentStyle");
2198
2199 // export syntax highlighting style
2200 $syn_stylesheet = ilObjStyleSheet::getSyntaxStylePath();
2201 copy($syn_stylesheet, $a_target_dir."/syntaxhighlight.css");
2202
2203 // get learning module presentation gui class
2204 include_once("./Modules/LearningModule/classes/class.ilLMPresentationGUI.php");
2205 $_GET["cmd"] = "nop";
2206 $get_transl = $_GET["transl"];
2207 $_GET["transl"] = "";
2208 $lm_gui =& new ilLMPresentationGUI();
2209 $lm_gui->setOfflineMode(true, ($a_lang == "all"));
2210 $lm_gui->setOfflineDirectory($a_target_dir);
2211 $lm_gui->setExportFormat($a_export_format);
2212
2214 $langs = array();
2215 if ($a_lang != "all")
2216 {
2217 $langs = array($a_lang);
2218 }
2219 else
2220 {
2221 $ot_langs = $ot->getLanguages();
2222 foreach ($ot_langs as $otl)
2223 {
2224 $langs[] = $otl["lang_code"];
2225 }
2226 }
2227
2228 // init collector arrays
2229 $this->offline_mobs = array();
2230 $this->offline_int_links = array();
2231 $this->offline_files = array();
2232
2233 // iterate all languages
2234 foreach ($langs as $lang)
2235 {
2236
2237 if ($lang != "")
2238 {
2239 $ilUser->setLanguage($lang);
2240 $ilUser->setCurrentLanguage($lang);
2241 }
2242 else
2243 {
2244 $ilUser->setLanguage($user_lang);
2245 $ilUser->setCurrentLanguage($user_lang);
2246 }
2247
2248 if ($lang != "")
2249 {
2250 if ($lang == $ot->getMasterLanguage())
2251 {
2252 $lm_gui->lang = "";
2253 }
2254 else
2255 {
2256 $lm_gui->lang = $lang;
2257 }
2258 }
2259
2260 // export pages
2261 $ilBench->start("ExportHTML", "exportHTMLPages");
2262 // now: forward ("all" info to export files and links)
2263 $this->exportHTMLPages($lm_gui, $a_target_dir, $lm_gui->lang, ($a_lang == "all"));
2264 $ilBench->stop("ExportHTML", "exportHTMLPages");
2265 }
2266
2267 // export glossary terms
2268 $ilBench->start("ExportHTML", "exportHTMLGlossaryTerms");
2269 $this->exportHTMLGlossaryTerms($lm_gui, $a_target_dir);
2270 $ilBench->stop("ExportHTML", "exportHTMLGlossaryTerms");
2271
2272 // export all media objects
2273 $ilBench->start("ExportHTML", "exportHTMLMediaObjects");
2274 $linked_mobs = array();
2275 foreach ($this->offline_mobs as $mob)
2276 {
2277 if (ilObject::_exists($mob) && ilObject::_lookupType($mob) == "mob")
2278 {
2279 $this->exportHTMLMOB($a_target_dir, $lm_gui, $mob, "_blank", $linked_mobs);
2280 }
2281 }
2282 $linked_mobs2 = array(); // mobs linked in link areas
2283 foreach ($linked_mobs as $mob)
2284 {
2285 if (ilObject::_exists($mob))
2286 {
2287 $this->exportHTMLMOB($a_target_dir, $lm_gui, $mob, "_blank", $linked_mobs2);
2288 }
2289 }
2290 $_GET["obj_type"] = "MediaObject";
2291 $_GET["obj_id"] = $a_mob_id;
2292 $_GET["cmd"] = "";
2293 $ilBench->stop("ExportHTML", "exportHTMLMediaObjects");
2294
2295 // export all file objects
2296 $ilBench->start("ExportHTML", "exportHTMLFileObjects");
2297 foreach ($this->offline_files as $file)
2298 {
2299 $this->exportHTMLFile($a_target_dir, $file);
2300 }
2301 $ilBench->stop("ExportHTML", "exportHTMLFileObjects");
2302
2303 // export questions (images)
2304 if (count($this->q_ids) > 0)
2305 {
2306 foreach ($this->q_ids as $q_id)
2307 {
2308 ilUtil::makeDirParents($a_target_dir."/assessment/0/".$q_id."/images");
2309 ilUtil::rCopy(ilUtil::getWebspaceDir()."/assessment/0/".$q_id."/images",
2310 $a_target_dir."/assessment/0/".$q_id."/images");
2311 }
2312 }
2313
2314 // export table of contents
2315 $ilBench->start("ExportHTML", "exportHTMLTOC");
2316 $ilLocator->clearItems();
2317 if ($this->isActiveTOC())
2318 {
2319 $tpl = new ilTemplate("tpl.main.html", true, true);
2320 //$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2321 $content =& $lm_gui->showTableOfContents();
2322 $file = $a_target_dir."/table_of_contents.html";
2323
2324 // open file
2325 if (!($fp = @fopen($file,"w+")))
2326 {
2327 die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2328 " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2329 }
2330 chmod($file, 0770);
2331 fwrite($fp, $content);
2332 fclose($fp);
2333 }
2334 $ilBench->stop("ExportHTML", "exportHTMLTOC");
2335
2336 // export images
2337 $ilBench->start("ExportHTML", "exportHTMLImages");
2338 $image_dir = $a_target_dir."/images";
2339 ilUtil::makeDir($image_dir);
2340 ilUtil::makeDir($image_dir."/browser");
2341 copy(ilUtil::getImagePath("enlarge.svg", false, "filesystem"),
2342 $image_dir."/enlarge.svg");
2343 copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
2344 $image_dir."/browser/plus.png");
2345 copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
2346 $image_dir."/browser/minus.png");
2347 copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
2348 $image_dir."/browser/blank.png");
2349 copy(ilUtil::getImagePath("spacer.png", false, "filesystem"),
2350 $image_dir."/spacer.png");
2351 copy(ilUtil::getImagePath("icon_st.svg", false, "filesystem"),
2352 $image_dir."/icon_st.svg");
2353 copy(ilUtil::getImagePath("icon_pg.svg", false, "filesystem"),
2354 $image_dir."/icon_pg.svg");
2355 copy(ilUtil::getImagePath("icon_lm.svg", false, "filesystem"),
2356 $image_dir."/icon_lm.svg");
2357 copy(ilUtil::getImagePath("nav_arr_L.png", false, "filesystem"),
2358 $image_dir."/nav_arr_L.png");
2359 copy(ilUtil::getImagePath("nav_arr_R.png", false, "filesystem"),
2360 $image_dir."/nav_arr_R.png");
2361
2362 $ilBench->stop("ExportHTML", "exportHTMLImages");
2363
2364 // export flv/mp3 player
2365 $services_dir = $a_target_dir."/Services";
2366 ilUtil::makeDir($services_dir);
2367 $media_service_dir = $services_dir."/MediaObjects";
2368 ilUtil::makeDir($media_service_dir);
2369 include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
2370 $flv_dir = $a_target_dir."/".ilPlayerUtil::getFlashVideoPlayerDirectory();
2371 ilUtil::makeDir($flv_dir);
2372 $mp3_dir = $media_service_dir."/flash_mp3_player";
2373 ilUtil::makeDir($mp3_dir);
2374// copy(ilPlayerUtil::getFlashVideoPlayerFilename(true),
2375// $flv_dir."/".ilPlayerUtil::getFlashVideoPlayerFilename());
2377 include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
2380
2381 // js files
2382 ilUtil::makeDir($a_target_dir.'/js');
2383 ilUtil::makeDir($a_target_dir.'/js/yahoo');
2384 ilUtil::makeDir($a_target_dir.'/css');
2385 include_once("./Services/YUI/classes/class.ilYuiUtil.php");
2386 foreach (self::getSupplyingExportFiles($a_target_dir) as $f)
2387 {
2388 if ($f["source"] != "")
2389 {
2390 copy($f["source"], $f["target"]);
2391 }
2392 }
2393
2394 // template workaround: reset of template
2395 $tpl = new ilTemplate("tpl.main.html", true, true);
2396 $tpl->setVariable("LOCATION_STYLESHEET",$location_stylesheet);
2397 $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2398
2399 if ($a_lang != "")
2400 {
2401 $ilUser->setLanguage($user_lang);
2402 $ilUser->setCurrentLanguage($user_lang);
2403 }
2404
2405 // zip everything
2406 if ($a_zip_file)
2407 {
2408 if ($a_lang == "")
2409 {
2410 $zip_target_dir = $this->getExportDirectory("html");
2411 }
2412 else
2413 {
2414 $zip_target_dir = $this->getExportDirectory("html_".$a_lang);
2415 ilUtil::makeDir($zip_target_dir);
2416 }
2417
2418 // zip it all
2419 $date = time();
2420 $zip_file = $zip_target_dir."/".$date."__".IL_INST_ID."__".
2421 $this->getType()."_".$this->getId().".zip";
2422//echo "-".$a_target_dir."-".$zip_file."-"; exit;
2423 ilUtil::zip($a_target_dir, $zip_file);
2424 ilUtil::delDir($a_target_dir);
2425 }
2426 }
print $file
global $tpl
Definition: ilias.php:8
$_GET["client_id"]
static createHTMLExportDirs($a_target_dir)
Create html export directories.
Class ilLMPresentationGUI.
exportHTMLGlossaryTerms(&$a_lm_gui, $a_target_dir)
export glossary terms
exportHTMLPages(&$a_lm_gui, $a_target_dir, $a_lang="", $a_all_languages=false)
export all pages of learning module to html file
exportHTMLFile($a_target_dir, $a_file_id)
export file object
getExportDirectory($a_type="xml")
get export directory of lm
exportHTMLMOB($a_target_dir, &$a_lm_gui, $a_mob_id, $a_frame, &$a_linked_mobs)
export media object to html
Class ilObjStyleSheet.
getSyntaxStylePath()
get syntax style path
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public
static _lookupType($a_id, $a_reference=false)
lookup object type
static getFlashVideoPlayerDirectory()
Get flash video player directory.
copyPlayerFilesToTargetDirectory($a_target_dir)
Copy css files to target dir.
special template class to simplify handling of ITX/PEAR
static getWebspaceDir($mode="filesystem")
get webspace directory
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static zip($a_dir, $a_file, $compress_content=false)
static makeDirParents($a_dir)
Create a new directory and all parent directories.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$style
Definition: example_012.php:70
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276

References $_GET, $file, $GLOBALS, $ilBench, ilObject\$ilias, $ilUser, $lang, $style, $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().

+ 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 2537 of file class.ilObjContentObject.php.

2538 {
2539 $file_dir = $a_target_dir."/files/file_".$a_file_id;
2540 ilUtil::makeDir($file_dir);
2541 include_once("./Modules/File/classes/class.ilObjFile.php");
2542 $file_obj = new ilObjFile($a_file_id, false);
2543 $source_file = $file_obj->getDirectory($file_obj->getVersion())."/".$file_obj->getFileName();
2544 if (!is_file($source_file))
2545 {
2546 $source_file = $file_obj->getDirectory()."/".$file_obj->getFileName();
2547 }
2548 if (is_file($source_file))
2549 {
2550 copy($source_file, $file_dir."/".$file_obj->getFileName());
2551 }
2552 }

References ilUtil\makeDir().

Referenced by exportHTML().

+ 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 2625 of file class.ilObjContentObject.php.

2626 {
2627 global $ilLocator;
2628
2629 foreach($this->offline_int_links as $int_link)
2630 {
2631 $ilLocator->clearItems();
2632 if ($int_link["type"] == "git")
2633 {
2634 $tpl = new ilTemplate("tpl.main.html", true, true);
2635 $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2636
2637 $_GET["obj_id"] = $int_link["id"];
2638 $_GET["frame"] = "_blank";
2639 $content =& $a_lm_gui->glossary();
2640 $file = $a_target_dir."/term_".$int_link["id"].".html";
2641
2642 // open file
2643 if (!($fp = @fopen($file,"w+")))
2644 {
2645 die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2646 " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2647 }
2648 chmod($file, 0770);
2649 fwrite($fp, $content);
2650 fclose($fp);
2651
2652 // store linked/embedded media objects of glosssary term
2653 include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
2654 $defs = ilGlossaryDefinition::getDefinitionList($int_link["id"]);
2655 foreach($defs as $def)
2656 {
2657 $def_mobs = ilObjMediaObject::_getMobsOfObject("gdf:pg", $def["id"]);
2658 foreach($def_mobs as $def_mob)
2659 {
2660 $this->offline_mobs[$def_mob] = $def_mob;
2661 include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
2662 $this->log->debug("HTML Export: Add media object $def_mob (".ilObject::_lookupTitle($def_mob).") ".
2663 " due to glossary entry ".$int_link["id"]." (".ilGlossaryTerm::_lookGlossaryTerm($int_link["id"]).").");
2664 }
2665
2666 // get all files of page
2667 $def_files = ilObjFile::_getFilesOfObject("gdf:pg", $page["obj_id"]);
2668 $this->offline_files = array_merge($this->offline_files, $def_files);
2669
2670 }
2671
2672 }
2673 }
2674 }
static _lookGlossaryTerm($term_id)
get glossary term
static _getFilesOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_usage_lang="-")
get all files of an object
_getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
static _lookupTitle($a_id)
lookup object title

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

Referenced by exportHTML().

+ 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 2557 of file class.ilObjContentObject.php.

2558 {
2559 global $tpl;
2560
2561 $mob_dir = $a_target_dir."/mobs";
2562
2563 $source_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob_id;
2564 if (@is_dir($source_dir))
2565 {
2566 ilUtil::makeDir($mob_dir."/mm_".$a_mob_id);
2567 ilUtil::rCopy($source_dir, $mob_dir."/mm_".$a_mob_id);
2568 }
2569
2570 $tpl = new ilTemplate("tpl.main.html", true, true);
2571 $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2572 $_GET["obj_type"] = "MediaObject";
2573 $_GET["mob_id"] = $a_mob_id;
2574 $_GET["frame"] = $a_frame;
2575 $_GET["cmd"] = "";
2576 $content =& $a_lm_gui->media();
2577 $file = $a_target_dir."/media_".$a_mob_id.".html";
2578
2579 // open file
2580 if (!($fp = @fopen($file,"w+")))
2581 {
2582 die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2583 " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2584 }
2585 chmod($file, 0770);
2586 fwrite($fp, $content);
2587 fclose($fp);
2588
2589 // fullscreen
2590 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2591 $mob_obj = new ilObjMediaObject($a_mob_id);
2592 if ($mob_obj->hasFullscreenItem())
2593 {
2594 $tpl = new ilTemplate("tpl.main.html", true, true);
2595 $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2596 $_GET["obj_type"] = "";
2597 $_GET["frame"] = "";
2598 $_GET["mob_id"] = $a_mob_id;
2599 $_GET["cmd"] = "fullscreen";
2600 $content =& $a_lm_gui->fullscreen();
2601 $file = $a_target_dir."/fullscreen_".$a_mob_id.".html";
2602
2603 // open file
2604 if (!($fp = @fopen($file,"w+")))
2605 {
2606 die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2607 " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2608 }
2609 chmod($file, 0770);
2610 fwrite($fp, $content);
2611 fclose($fp);
2612 }
2613 $linked_mobs = $mob_obj->getLinkedMediaObjects();
2614 foreach ($linked_mobs as $id)
2615 {
2616 $this->log->debug("HTML Export: Add media object $id (".ilObject::_lookupTitle($id).") ".
2617 " due to media object ".$a_mob_id." (".ilObject::_lookupTitle($a_mob_id).").");
2618 }
2619 $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
2620 }
Class ilObjMediaObject.

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

Referenced by exportHTML().

+ 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 = "",
  $a_all_languages = false 
)

export all pages of learning module to html file

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

2680 {
2681 global $tpl, $ilBench, $ilLocator;
2682
2683 $pages = ilLMPageObject::getPageList($this->getId());
2684
2685 $lm_tree =& $this->getLMTree();
2686 $first_page = $lm_tree->fetchSuccessorNode($lm_tree->getRootId(), "pg");
2687 $this->first_page_id = $first_page["child"];
2688
2689 // iterate all learning module pages
2690 $mobs = array();
2691 $int_links = array();
2692 $this->offline_files = array();
2693
2694 include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
2695 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2696
2697 // get html export id mapping
2698 $lm_set = new ilSetting("lm");
2699 $exp_id_map = array();
2700
2701 if ($lm_set->get("html_export_ids"))
2702 {
2703 foreach ($pages as $page)
2704 {
2705 $exp_id = ilLMPageObject::getExportId($this->getId(), $page["obj_id"]);
2706 if (trim($exp_id) != "")
2707 {
2708 $exp_id_map[$page["obj_id"]] = trim($exp_id);
2709 }
2710 }
2711 }
2712//exit;
2713 if ($a_lang == "")
2714 {
2715 $a_lang = "-";
2716 }
2717
2718 reset($pages);
2719 foreach ($pages as $page)
2720 {
2721 if (ilLMPage::_exists($this->getType(), $page["obj_id"]))
2722 {
2723 $ilLocator->clearItems();
2724 $ilBench->start("ExportHTML", "exportHTMLPage");
2725 $ilBench->start("ExportHTML", "exportPageHTML");
2726 $this->exportPageHTML($a_lm_gui, $a_target_dir, $page["obj_id"],
2727 "", $exp_id_map, $a_lang, $a_all_languages);
2728 $ilBench->stop("ExportHTML", "exportPageHTML");
2729
2730 // get all snippets of page
2731 $pcs = ilPageContentUsage::getUsagesOfPage($page["obj_id"], $this->getType().":pg", 0, false, $a_lang);
2732 foreach ($pcs as $pc)
2733 {
2734 if ($pc["type"] == "incl")
2735 {
2736 $incl_mobs = ilObjMediaObject::_getMobsOfObject("mep:pg", $pc["id"]);
2737 foreach($incl_mobs as $incl_mob)
2738 {
2739 $mobs[$incl_mob] = $incl_mob;
2740 include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
2741 $this->log->debug("HTML Export: Add media object $incl_mob (".ilObject::_lookupTitle($incl_mob).") ".
2742 " due to snippet ".$pc["id"]." in page ".$page["obj_id"]." (".ilLMObject::_lookupTitle($page["obj_id"]).").");
2743 }
2744 }
2745 }
2746
2747 // get all media objects of page
2748 $pg_mobs = ilObjMediaObject::_getMobsOfObject($this->getType().":pg", $page["obj_id"], 0, $a_lang);
2749 foreach($pg_mobs as $pg_mob)
2750 {
2751 $mobs[$pg_mob] = $pg_mob;
2752 include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
2753 $this->log->debug("HTML Export: Add media object $pg_mob (".ilObject::_lookupTitle($pg_mob).") ".
2754 " due to page ".$page["obj_id"]." (".ilLMObject::_lookupTitle($page["obj_id"]).").");
2755 }
2756
2757 // get all internal links of page
2758 $pg_links = ilInternalLink::_getTargetsOfSource($this->getType().":pg", $page["obj_id"], $a_lang);
2759 $int_links = array_merge($int_links, $pg_links);
2760
2761 // get all files of page
2762 include_once("./Modules/File/classes/class.ilObjFile.php");
2763 $pg_files = ilObjFile::_getFilesOfObject($this->getType().":pg", $page["obj_id"], 0, $a_lang);
2764 $this->offline_files = array_merge($this->offline_files, $pg_files);
2765
2766 // collect all questions
2767 include_once("./Services/COPage/classes/class.ilPCQuestion.php");
2768 $q_ids = ilPCQuestion::_getQuestionIdsForPage($this->getType(), $page["obj_id"], $a_lang);
2769 foreach($q_ids as $q_id)
2770 {
2771 $this->q_ids[$q_id] = $q_id;
2772 }
2773
2774 $ilBench->stop("ExportHTML", "exportHTMLPage");
2775 }
2776 }
2777 foreach ($mobs as $m)
2778 {
2779 $this->offline_mobs[$m] = $m;
2780 }
2781 foreach ($int_links as $k => $v)
2782 {
2783 $this->offline_int_links[$k] = $v;
2784 }
2785 }
static getExportId($a_lm_id, $a_lmobj_id, $a_type="pg")
Get export ID.
& getLMTree()
get content object tree
exportPageHTML(&$a_lm_gui, $a_target_dir, $a_lm_page_id, $a_frame="", $a_exp_id_map=array(), $a_lang="-", $a_all_languages=false)
export page html
static _getQuestionIdsForPage($a_parent_type, $a_page_id, $a_lang="-")
Get all questions of a page.
getUsagesOfPage($a_usage_id, $a_usage_type, $a_hist_nr=0, $a_all_hist_nrs=false, $a_lang="-")
Get page content usages for page.
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
ILIAS Setting Class.
$mobs

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

Referenced by exportHTML().

+ 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(),
  $a_lang = "-",
  $a_all_languages = false 
)

export page html

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

2794 {
2795 global $tpl, $ilBench;
2796
2797 $lang_suffix = "";
2798 if ($a_lang != "-" && $a_lang != "" && $a_all_languages)
2799 {
2800 $lang_suffix = "_".$a_lang;
2801 }
2802
2803//echo "<br>B: export Page HTML ($a_lm_page_id)"; flush();
2804 // template workaround: reset of template
2805 $tpl = new ilTemplate("tpl.main.html", true, true);
2806 $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2807
2808 include_once("./Services/COPage/classes/class.ilPCQuestion.php");
2810
2811 $_GET["obj_id"] = $a_lm_page_id;
2812 $_GET["frame"] = $a_frame;
2813
2814 if ($a_frame == "")
2815 {
2816 //if ($nid = ilLMObject::_lookupNID($a_lm_gui->lm->getId(), $a_lm_page_id, "pg"))
2817 if (is_array($a_exp_id_map) && isset($a_exp_id_map[$a_lm_page_id]))
2818 {
2819 $file = $a_target_dir."/lm_pg_".$a_exp_id_map[$a_lm_page_id].$lang_suffix.".html";
2820 }
2821 else
2822 {
2823 $file = $a_target_dir."/lm_pg_".$a_lm_page_id.$lang_suffix.".html";
2824 }
2825 }
2826 else
2827 {
2828 if ($a_frame != "toc")
2829 {
2830 $file = $a_target_dir."/frame_".$a_lm_page_id."_".$a_frame.$lang_suffix.".html";
2831 }
2832 else
2833 {
2834 $file = $a_target_dir."/frame_".$a_frame.$lang_suffix.".html";
2835 }
2836 }
2837
2838 // return if file is already existing
2839 if (@is_file($file))
2840 {
2841 return;
2842 }
2843
2844 $content =& $a_lm_gui->layout("main.xml", false);
2845
2846 // open file
2847 if (!($fp = @fopen($file,"w+")))
2848 {
2849 die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2850 " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2851 }
2852
2853 // set file permissions
2854 chmod($file, 0770);
2855
2856 // write xml data into the file
2857 fwrite($fp, $content);
2858
2859 // close file
2860 fclose($fp);
2861
2862 if ($this->first_page_id == $a_lm_page_id && $a_frame == "")
2863 {
2864 copy($file, $a_target_dir."/index".$lang_suffix.".html");
2865 }
2866
2867 // write frames of frameset
2868 $frameset = $a_lm_gui->getCurrentFrameSet();
2869
2870 foreach ($frameset as $frame)
2871 {
2872 $this->exportPageHTML($a_lm_gui, $a_target_dir, $a_lm_page_id, $frame);
2873 }
2874
2875 }
static resetInitialState()
Reset initial state (for exports)

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

Referenced by exportHTMLPages(), and exportPageHTML().

+ 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 2080 of file class.ilObjContentObject.php.

2081 {
2082 ilUtil::delDir($a_target_dir);
2083 ilUtil::makeDir($a_target_dir);
2084 //ilUtil::makeDir($a_target_dir."/res");
2085
2086 // export everything to html
2087 $this->exportHTML($a_target_dir."/res", $log, false, "scorm");
2088
2089 // build manifest file
2090 include("./Modules/LearningModule/classes/class.ilContObjectManifestBuilder.php");
2091 $man_builder = new ilContObjectManifestBuilder($this);
2092 $man_builder->buildManifest();
2093 $man_builder->dump($a_target_dir);
2094
2095 // copy scorm 1.2 schema definitions
2096 copy("Modules/LearningModule/scorm_xsd/adlcp_rootv1p2.xsd", $a_target_dir."/adlcp_rootv1p2.xsd");
2097 copy("Modules/LearningModule/scorm_xsd/imscp_rootv1p1p2.xsd", $a_target_dir."/imscp_rootv1p1p2.xsd");
2098 copy("Modules/LearningModule/scorm_xsd/imsmd_rootv1p2p1.xsd", $a_target_dir."/imsmd_rootv1p2p1.xsd");
2099 copy("Modules/LearningModule/scorm_xsd/ims_xml.xsd", $a_target_dir."/ims_xml.xsd");
2100
2101 // zip it all
2102 $date = time();
2103 $zip_file = $a_target_dir."/".$date."__".IL_INST_ID."__".
2104 $this->getType()."_".$this->getId().".zip";
2105 //echo "zip-".$a_target_dir."-to-".$zip_file;
2106 ilUtil::zip(array($a_target_dir."/res",
2107 $a_target_dir."/imsmanifest.xml",
2108 $a_target_dir."/adlcp_rootv1p2.xsd",
2109 $a_target_dir."/imscp_rootv1p1p2.xsd",
2110 $a_target_dir."/ims_xml.xsd",
2111 $a_target_dir."/imsmd_rootv1p2p1.xsd")
2112 , $zip_file);
2113
2114 $dest_file = $this->getExportDirectory("scorm")."/".$date."__".IL_INST_ID."__".
2115 $this->getType()."_".$this->getId().".zip";
2116
2117 rename($zip_file, $dest_file);
2118 ilUtil::delDir($a_target_dir);
2119
2120 }
Content Object (ILIAS native learning module / digilib book) Manifest export class.
exportHTML($a_target_dir, $log, $a_zip_file=true, $a_export_format="html", $a_lang="")
export html package

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

+ 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 1637 of file class.ilObjContentObject.php.

1638 {
1639 global $ilBench;
1640
1641 $attrs = array();
1642 switch($this->getType())
1643 {
1644 case "lm":
1645 $attrs["Type"] = "LearningModule";
1646 break;
1647
1648 case "dbk":
1649 $attrs["Type"] = "LibObject";
1650 break;
1651 }
1652 $a_xml_writer->xmlStartTag("ContentObject", $attrs);
1653
1654 // MetaData
1655 $this->exportXMLMetaData($a_xml_writer);
1656
1657 // StructureObjects
1658//echo "ContObj:".$a_inst.":<br>";
1659 $expLog->write(date("[y-m-d H:i:s] ")."Start Export Structure Objects");
1660 $ilBench->start("ContentObjectExport", "exportStructureObjects");
1661 $this->exportXMLStructureObjects($a_xml_writer, $a_inst, $expLog);
1662 $ilBench->stop("ContentObjectExport", "exportStructureObjects");
1663 $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Structure Objects");
1664
1665 // PageObjects
1666 $expLog->write(date("[y-m-d H:i:s] ")."Start Export Page Objects");
1667 $ilBench->start("ContentObjectExport", "exportPageObjects");
1668 $this->exportXMLPageObjects($a_xml_writer, $a_inst, $expLog);
1669 $ilBench->stop("ContentObjectExport", "exportPageObjects");
1670 $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Page Objects");
1671
1672 // MediaObjects
1673 $expLog->write(date("[y-m-d H:i:s] ")."Start Export Media Objects");
1674 $ilBench->start("ContentObjectExport", "exportMediaObjects");
1675 $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
1676 $ilBench->stop("ContentObjectExport", "exportMediaObjects");
1677 $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Media Objects");
1678
1679 // FileItems
1680 $expLog->write(date("[y-m-d H:i:s] ")."Start Export File Items");
1681 $ilBench->start("ContentObjectExport", "exportFileItems");
1682 $this->exportFileItems($a_target_dir, $expLog);
1683 $ilBench->stop("ContentObjectExport", "exportFileItems");
1684 $expLog->write(date("[y-m-d H:i:s] ")."Finished Export File Items");
1685
1686 // Questions
1687 if (count($this->q_ids) > 0)
1688 {
1689 $qti_file = fopen($a_target_dir."/qti.xml", "w");
1690 include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
1691 $pool = new ilObjQuestionPool();
1692 fwrite($qti_file, $pool->toXML($this->q_ids));
1693 fclose($qti_file);
1694 }
1695
1696 // To do: implement version selection/detection
1697 // Properties
1698 $expLog->write(date("[y-m-d H:i:s] ")."Start Export Properties");
1699 $this->exportXMLProperties($a_xml_writer, $expLog);
1700 $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Properties");
1701
1702 $a_xml_writer->xmlEndTag("ContentObject");
1703 }
exportXMLMediaObjects(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
export media objects to xml (see ilias_co.dtd)
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)
exportXMLProperties($a_xml_writer, &$expLog)
export properties of content object
exportXMLStructureObjects(&$a_xml_writer, $a_inst, &$expLog)
export structure objects to xml (see ilias_co.dtd)

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

+ 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 1801 of file class.ilObjContentObject.php.

1802 {
1803 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1804
1805 $linked_mobs = array();
1806
1807 // mobs directly embedded into pages
1808 foreach ($this->mob_ids as $mob_id)
1809 {
1810 if ($mob_id > 0 && ilObject::_lookupType($mob_id) == "mob")
1811 {
1812 $expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
1813 $media_obj = new ilObjMediaObject($mob_id);
1814 $media_obj->exportXML($a_xml_writer, $a_inst);
1815 $media_obj->exportFiles($a_target_dir);
1816
1817 $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
1818 $linked_mobs = array_merge($linked_mobs, $lmobs);
1819
1820 unset($media_obj);
1821 }
1822 }
1823
1824 // linked mobs (in map areas)
1825 foreach ($linked_mobs as $mob_id)
1826 {
1827 if ($mob_id > 0)
1828 {
1829 $expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
1830 $media_obj = new ilObjMediaObject($mob_id);
1831 $media_obj->exportXML($a_xml_writer, $a_inst);
1832 $media_obj->exportFiles($a_target_dir);
1833 unset($media_obj);
1834 }
1835 }
1836
1837 }

References ilObject\_lookupType().

Referenced by exportXML().

+ 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 1711 of file class.ilObjContentObject.php.

1712 {
1713 include_once("Services/MetaData/classes/class.ilMD2XML.php");
1714 $md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
1715 $md2xml->setExportMode(true);
1716 $md2xml->startExport();
1717 $a_xml_writer->appendXML($md2xml->getXML());
1718 }

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

Referenced by exportXML().

+ 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 1751 of file class.ilObjContentObject.php.

1752 {
1753 global $ilBench;
1754
1755 include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
1756 include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
1757
1758 $pages = ilLMPageObject::getPageList($this->getId());
1759 foreach ($pages as $page)
1760 {
1761 if (ilLMPage::_exists($this->getType(), $page["obj_id"]))
1762 {
1763 $expLog->write(date("[y-m-d H:i:s] ")."Page Object ".$page["obj_id"]);
1764
1765 // export xml to writer object
1766 $page_obj = new ilLMPageObject($this, $page["obj_id"]);
1767 $page_obj->exportXML($a_xml_writer, "normal", $a_inst);
1768
1769 // collect media objects
1770 $mob_ids = $page_obj->getMediaObjectIDs();
1771 foreach($mob_ids as $mob_id)
1772 {
1773 $this->mob_ids[$mob_id] = $mob_id;
1774 }
1775
1776 // collect all file items
1777 $file_ids = $page_obj->getFileItemIds();
1778 foreach($file_ids as $file_id)
1779 {
1780 $this->file_ids[$file_id] = $file_id;
1781 }
1782
1783 // collect all questions
1784 $q_ids = $page_obj->getQuestionIds();
1785 foreach($q_ids as $q_id)
1786 {
1787 $this->q_ids[$q_id] = $q_id;
1788 }
1789
1790 unset($page_obj);
1791 }
1792 }
1793 }

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

Referenced by exportXML().

+ 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 1860 of file class.ilObjContentObject.php.

1861 {
1862 $attrs = array();
1863 $a_xml_writer->xmlStartTag("Properties", $attrs);
1864
1865 // Layout
1866 $attrs = array("Name" => "Layout", "Value" => $this->getLayout());
1867 $a_xml_writer->xmlElement("Property", $attrs);
1868
1869 // Page Header
1870 $attrs = array("Name" => "PageHeader", "Value" => $this->getPageHeader());
1871 $a_xml_writer->xmlElement("Property", $attrs);
1872
1873 // TOC Mode
1874 $attrs = array("Name" => "TOCMode", "Value" => $this->getTOCMode());
1875 $a_xml_writer->xmlElement("Property", $attrs);
1876
1877 // LM Menu Activation
1878 $attrs = array("Name" => "ActiveLMMenu", "Value" =>
1879 ilUtil::tf2yn($this->isActiveLMMenu()));
1880 $a_xml_writer->xmlElement("Property", $attrs);
1881
1882 // Numbering Activation
1883 $attrs = array("Name" => "ActiveNumbering", "Value" =>
1885 $a_xml_writer->xmlElement("Property", $attrs);
1886
1887 // Table of contents button activation
1888 $attrs = array("Name" => "ActiveTOC", "Value" =>
1889 ilUtil::tf2yn($this->isActiveTOC()));
1890 $a_xml_writer->xmlElement("Property", $attrs);
1891
1892 // Print view button activation
1893 $attrs = array("Name" => "ActivePrintView", "Value" =>
1895 $a_xml_writer->xmlElement("Property", $attrs);
1896
1897 // Note that download button is not saved, because
1898 // download files do not exist after import
1899
1900 // Clean frames
1901 $attrs = array("Name" => "CleanFrames", "Value" =>
1902 ilUtil::tf2yn($this->cleanFrames()));
1903 $a_xml_writer->xmlElement("Property", $attrs);
1904
1905 // Public notes activation
1906 $attrs = array("Name" => "PublicNotes", "Value" =>
1907 ilUtil::tf2yn($this->publicNotes()));
1908 $a_xml_writer->xmlElement("Property", $attrs);
1909
1910 // History comments for authors activation
1911 $attrs = array("Name" => "HistoryUserComments", "Value" =>
1913 $a_xml_writer->xmlElement("Property", $attrs);
1914
1915 // Rating
1916 $attrs = array("Name" => "Rating", "Value" =>
1917 ilUtil::tf2yn($this->hasRating()));
1918 $a_xml_writer->xmlElement("Property", $attrs);
1919 $attrs = array("Name" => "RatingPages", "Value" =>
1920 ilUtil::tf2yn($this->hasRatingPages()));
1921 $a_xml_writer->xmlElement("Property", $attrs);
1922
1923 // Header Page
1924 if ($this->getHeaderPage() > 0)
1925 {
1926 $attrs = array("Name" => "HeaderPage", "Value" =>
1927 "il_".IL_INST_ID."_pg_".$this->getHeaderPage());
1928 $a_xml_writer->xmlElement("Property", $attrs);
1929 }
1930
1931 // Footer Page
1932 if ($this->getFooterPage() > 0)
1933 {
1934 $attrs = array("Name" => "FooterPage", "Value" =>
1935 "il_".IL_INST_ID."_pg_".$this->getFooterPage());
1936 $a_xml_writer->xmlElement("Property", $attrs);
1937 }
1938
1939 // layout per page
1940 $attrs = array("Name" => "LayoutPerPage", "Value" =>
1941 $this->getLayoutPerPage());
1942 $a_xml_writer->xmlElement("Property", $attrs);
1943
1944 // progress icons
1945 $attrs = array("Name" => "ProgressIcons", "Value" =>
1946 $this->getProgressIcons());
1947 $a_xml_writer->xmlElement("Property", $attrs);
1948
1949 // store tries
1950 $attrs = array("Name" => "StoreTries", "Value" =>
1951 $this->getStoreTries());
1952 $a_xml_writer->xmlElement("Property", $attrs);
1953
1954 // restrict forward navigation
1955 $attrs = array("Name" => "RestrictForwardNavigation", "Value" =>
1957 $a_xml_writer->xmlElement("Property", $attrs);
1958
1959 // disable default feedback
1960 $attrs = array("Name" => "DisableDefaultFeedback", "Value" =>
1961 $this->getDisableDefaultFeedback());
1962 $a_xml_writer->xmlElement("Property", $attrs);
1963
1964 $a_xml_writer->xmlEndTag("Properties");
1965 }
static tf2yn($a_tf)
convert true/false to "y"/"n"

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().

+ 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 1726 of file class.ilObjContentObject.php.

1727 {
1728 include_once './Modules/LearningModule/classes/class.ilStructureObject.php';
1729
1730 $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
1731 foreach ($childs as $child)
1732 {
1733 if($child["type"] != "st")
1734 {
1735 continue;
1736 }
1737
1738 $structure_obj = new ilStructureObject($this, $child["obj_id"]);
1739 $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
1740 unset($structure_obj);
1741 }
1742 }

Referenced by exportXML().

+ Here is the caller graph for this function:

◆ fixTree()

ilObjContentObject::fixTree ( )

fix tree

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

1513 {
1514 global $ilDB;
1515
1516 $tree =& $this->getLMTree();
1517
1518 // check numbering, if errors, renumber
1519 // it is very important to keep this step before deleting subtrees
1520 // in the following steps
1521 $set = $ilDB->query("SELECT DISTINCT l1.lm_id".
1522 " FROM lm_tree l1".
1523 " JOIN lm_tree l2 ON ( l1.child = l2.parent".
1524 " AND l1.lm_id = l2.lm_id )".
1525 " JOIN lm_data ON ( l1.child = lm_data.obj_id )".
1526 " WHERE (l2.lft < l1.lft".
1527 " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)".
1528 " AND l1.lm_id = ".$ilDB->quote($this->getId(), "integer").
1529 " ORDER BY lm_data.create_date DESC"
1530 );
1531 if ($rec = $ilDB->fetchAssoc($set))
1532 {
1533 $tree->renumber();
1534 }
1535
1536 // delete subtrees that have no lm_data records
1537 $nodes = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1538 foreach ($nodes as $node)
1539 {
1540 $q = "SELECT * FROM lm_data WHERE obj_id = ".
1541 $ilDB->quote($node["child"], "integer");
1542 $obj_set = $ilDB->query($q);
1543 $obj_rec = $ilDB->fetchAssoc($obj_set);
1544 if (!$obj_rec)
1545 {
1546 $node_data = $tree->getNodeData($node["child"]);
1547 $tree->deleteTree($node_data);
1548 }
1549 }
1550
1551 // delete subtrees that have pages as parent
1552 $nodes = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1553 foreach ($nodes as $node)
1554 {
1555 $q = "SELECT * FROM lm_data WHERE obj_id = ".
1556 $ilDB->quote($node["parent"], "integer");
1557 $obj_set = $ilDB->query($q);
1558 $obj_rec = $ilDB->fetchAssoc($obj_set);
1559 if ($obj_rec["type"] == "pg")
1560 {
1561 $node_data = $tree->getNodeData($node["child"]);
1562 if ($tree->isInTree($node["child"]))
1563 {
1564 $tree->deleteTree($node_data);
1565 }
1566 }
1567 }
1568
1569 // check for multi-references pages or chapters
1570 // if errors -> create copies of them here
1571 $set = $ilDB->query("SELECT DISTINCT l1.lm_id".
1572 " FROM lm_tree l1".
1573 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )".
1574 " JOIN lm_data ON (l1.child = lm_data.obj_id)".
1575 " WHERE l1.child <> 1".
1576 " AND l1.lm_id <> lm_data.lm_id".
1577 " AND l1.lm_id = ".$ilDB->quote($this->getId(), "integer"));
1578 if ($rec = $ilDB->fetchAssoc($set))
1579 {
1580 $set = $ilDB->query("SELECT DISTINCT l1.child ".
1581 " FROM lm_tree l1".
1582 " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )".
1583 " JOIN lm_data ON (l1.child = lm_data.obj_id)".
1584 " WHERE l1.child <> 1".
1585 " AND l1.lm_id <> lm_data.lm_id".
1586 " AND l1.lm_id = ".$ilDB->quote($this->getId(), "integer"));
1587 include_once("./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
1588 while ($rec = $ilDB->fetchAssoc($set))
1589 {
1590 $cobj = ilLMObjectFactory::getInstance($this, $rec["child"]);
1591
1592 if (is_object($cobj))
1593 {
1594 if ($cobj->getType() == "pg")
1595 {
1596 // make a copy of it
1597 $pg_copy = $cobj->copy($this);
1598
1599 // replace the child in the tree with the copy (id)
1600 $ilDB->manipulate("UPDATE lm_tree SET ".
1601 " child = ".$ilDB->quote($pg_copy->getId(), "integer").
1602 " WHERE child = ".$ilDB->quote($cobj->getId(), "integer").
1603 " AND lm_id = ".$ilDB->quote($this->getId(), "integer")
1604 );
1605 }
1606 else if ($cobj->getType() == "st")
1607 {
1608 // make a copy of it
1609 $st_copy = $cobj->copy($this);
1610
1611 // replace the child in the tree with the copy (id)
1612 $ilDB->manipulate("UPDATE lm_tree SET ".
1613 " child = ".$ilDB->quote($st_copy->getId(), "integer").
1614 " WHERE child = ".$ilDB->quote($cobj->getId(), "integer").
1615 " AND lm_id = ".$ilDB->quote($this->getId(), "integer")
1616 );
1617
1618 // make all childs refer to the copy now
1619 $ilDB->manipulate("UPDATE lm_tree SET ".
1620 " parent = ".$ilDB->quote($st_copy->getId(), "integer").
1621 " WHERE parent = ".$ilDB->quote($cobj->getId(), "integer").
1622 " AND lm_id = ".$ilDB->quote($this->getId(), "integer")
1623 );
1624 }
1625 }
1626 }
1627 }
1628 }

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

+ Here is the call graph for this function:

◆ getAutoGlossaries()

ilObjContentObject::getAutoGlossaries ( )

Get auto glossaries.

Returns
array int

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

References $auto_glossaries.

Referenced by cloneObject(), removeAutoGlossary(), and updateAutoGlossaries().

+ Here is the caller graph for this function:

◆ getAvailableLayouts()

ilObjContentObject::getAvailableLayouts ( )

get all available lm layouts

static

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

1276 {
1277 $dir = opendir("./Modules/LearningModule/layouts/lm");
1278
1279 $layouts = array();
1280
1281 while($file = readdir($dir))
1282 {
1283 if ($file != "." && $file != ".." && $file != "CVS" && $file != ".svn")
1284 {
1285 // directories
1286 if (@is_dir("./Modules/LearningModule/layouts/lm/".$file))
1287 {
1288 $layouts[$file] = $file;
1289 }
1290 }
1291 }
1292 asort($layouts);
1293
1294 // workaround: fix ordering
1295 $ret = array(
1296 'toc2win' => 'toc2win',
1297 'toc2windyn' => 'toc2windyn',
1298 '1window' => '1window',
1299 '2window' => '2window',
1300 '3window' => '3window',
1301 'presentation' => 'presentation',
1302 'fullscreen' => 'fullscreen'
1303 );
1304
1305 foreach ($layouts as $l)
1306 {
1307 if (!in_array($l, $ret))
1308 {
1309 $ret[$l] = $l;
1310 }
1311 }
1312
1313 return $ret;
1314 }
global $l
Definition: afr.php:30

References $file, $l, and $ret.

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

+ Here is the caller graph for this function:

◆ getDataDirectory()

ilObjContentObject::getDataDirectory ( )

get data directory

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

486 {
487 return ilUtil::getDataDir()."/lm_data".
488 "/lm_".$this->getId();
489 }

References ilUtil\getDataDir().

Referenced by delete().

+ 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

Reimplemented from ilObject.

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

135 {
136 return parent::getDescription();
137 }

Referenced by cloneObject().

+ 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 194 of file class.ilObjContentObject.php.

195 {
196 return $this->disable_def_feedback;
197 }

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

+ Here is the caller graph for this function:

◆ getExportDirectory()

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

get export directory of lm

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

576 {
577 switch ($a_type)
578 {
579 case "scorm":
580 $export_dir = ilUtil::getDataDir()."/lm_data"."/lm_".$this->getId()."/export_scorm";
581 break;
582
583 default: // = xml
584 if (substr($a_type, 0, 4) == "html")
585 {
586 $export_dir = ilUtil::getDataDir()."/lm_data"."/lm_".$this->getId()."/export_".$a_type;
587 }
588 else
589 {
590 $export_dir = ilUtil::getDataDir()."/lm_data"."/lm_".$this->getId()."/export";
591 }
592 break;
593 }
594 return $export_dir;
595 }

References ilUtil\getDataDir().

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

+ 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 1970 of file class.ilObjContentObject.php.

1971 {
1972 $file = array();
1973
1974 $types = array("xml", "html", "scorm");
1975
1976 foreach ($types as $type)
1977 {
1978 $dir = $this->getExportDirectory($type);
1979 // quit if import dir not available
1980 if (!@is_dir($dir) or
1981 !is_writeable($dir))
1982 {
1983 continue;
1984 }
1985
1986 // open directory
1987 $cdir = dir($dir);
1988
1989 // initialize array
1990
1991 // get files and save the in the array
1992 while ($entry = $cdir->read())
1993 {
1994 if ($entry != "." and
1995 $entry != ".." and
1996 substr($entry, -4) == ".zip" and
1997 ereg("^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.zip\$", $entry))
1998 {
1999 $file[$entry.$type] = array("type" => $type, "file" => $entry,
2000 "size" => filesize($dir."/".$entry));
2001 }
2002 }
2003
2004 // close import directory
2005 $cdir->close();
2006 }
2007
2008 // sort files
2009 ksort ($file);
2010 reset ($file);
2011 return $file;
2012 }

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

+ Here is the call graph for this function:

◆ getFooterPage()

ilObjContentObject::getFooterPage ( )

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

1135 {
1136 return $this->footer_page;
1137 }

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

+ Here is the caller graph for this function:

◆ getForTranslation()

ilObjContentObject::getForTranslation ( )

Get for translation.

Returns
bool lm has been imported for translation purposes

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

References $for_translation.

Referenced by updateProperties().

+ Here is the caller graph for this function:

◆ getHeaderPage()

ilObjContentObject::getHeaderPage ( )

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

1125 {
1126 return $this->header_page;
1127 }

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

+ 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 1059 of file class.ilObjContentObject.php.

1060 {
1061 return $this->hide_header_footer_print;
1062 }

Referenced by updateProperties().

+ Here is the caller graph for this function:

◆ getImportDirectory()

ilObjContentObject::getImportDirectory ( )

get import directory of lm

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

495 {
496 if(strlen($this->import_dir))
497 {
498 return $this->import_dir;
499 }
500
501 $import_dir = ilUtil::getDataDir()."/lm_data".
502 "/lm_".$this->getId()."/import";
503 if(@is_dir($import_dir))
504 {
505 return $import_dir;
506 }
507 else
508 {
509 return false;
510 }
511 }

References $import_dir, and ilUtil\getDataDir().

Referenced by importFromZipFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImportId()

ilObjContentObject::getImportId ( )

get import id

@access public

Returns
string import id

Reimplemented from ilObject.

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

150 {
151 return $this->import_id;
152 }

References ilObject\$import_id.

Referenced by importFromDirectory().

+ 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 664 of file class.ilObjContentObject.php.

References $layout.

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

+ Here is the caller graph for this function:

◆ getLayoutPerPage()

ilObjContentObject::getLayoutPerPage ( )

Get layout per page.

Returns
boolean layout per page

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

175 {
176 return $this->layout_per_page;
177 }

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

+ Here is the caller graph for this function:

◆ getLMTree()

& ilObjContentObject::getLMTree ( )

get content object tree

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

446 {
447 return $this->lm_tree;
448 }

References $lm_tree.

Referenced by exportHTMLPages(), and fixTree().

+ Here is the caller graph for this function:

◆ getOfflineFiles()

ilObjContentObject::getOfflineFiles (   $dir)

get offline files

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

2041 {
2042 // quit if offline dir not available
2043 if (!@is_dir($dir) or
2044 !is_writeable($dir))
2045 {
2046 return array();
2047 }
2048
2049 // open directory
2050 $dir = dir($dir);
2051
2052 // initialize array
2053 $file = array();
2054
2055 // get files and save the in the array
2056 while ($entry = $dir->read())
2057 {
2058 if ($entry != "." and
2059 $entry != ".." and
2060 substr($entry, -4) == ".pdf" and
2061 ereg("^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.pdf\$", $entry))
2062 {
2063 $file[] = $entry;
2064 }
2065 }
2066
2067 // close import directory
2068 $dir->close();
2069
2070 // sort files
2071 sort ($file);
2072 reset ($file);
2073
2074 return $file;
2075 }

References $file.

◆ getOnline()

ilObjContentObject::getOnline ( )

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

References $online.

Referenced by cloneObject(), and updateProperties().

+ 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 943 of file class.ilObjContentObject.php.

References $pg_header.

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

+ Here is the caller graph for this function:

◆ getProgressIcons()

ilObjContentObject::getProgressIcons ( )

Get progress icons.

Returns
bool show progress icons

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

215 {
216 return $this->progr_icons;
217 }

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

+ Here is the caller graph for this function:

◆ getPublicAccessMode()

ilObjContentObject::getPublicAccessMode ( )

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

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

970 {
971 return $this->public_access_mode;
972 }

Referenced by cloneObject(), and updateProperties().

+ 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 2032 of file class.ilObjContentObject.php.

2033 {
2034 return $this->public_export_file[$a_type];
2035 }

Referenced by updateProperties().

+ Here is the caller graph for this function:

◆ getRestrictForwardNavigation()

ilObjContentObject::getRestrictForwardNavigation ( )

Get restrict forward navigation.

Returns
bool restrict forward navigation

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

255 {
256 return $this->restrict_forw_nav;
257 }

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

+ Here is the caller graph for this function:

◆ getStoreTries()

ilObjContentObject::getStoreTries ( )

Get store tries.

Returns
bool store tries

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

235 {
236 return $this->store_tries;
237 }

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

+ Here is the caller graph for this function:

◆ getStyleSheetId()

ilObjContentObject::getStyleSheetId ( )

get ID of assigned style sheet object

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

683 {
684 return $this->style_id;
685 }

References $style_id.

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

+ Here is the caller graph for this function:

◆ getSupplyingExportFiles()

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

Get supplying export files.

Parameters

return

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

2435 {
2436 include_once("./Services/YUI/classes/class.ilYuiUtil.php");
2437 include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
2438 include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
2439 include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
2440 $scripts = array(
2441 array("source" => ilYuiUtil::getLocalPath('yahoo/yahoo-min.js'),
2442 "target" => $a_target_dir.'/js/yahoo/yahoo-min.js',
2443 "type" => "js"),
2444 array("source" => ilYuiUtil::getLocalPath('yahoo-dom-event/yahoo-dom-event.js'),
2445 "target" => $a_target_dir.'/js/yahoo/yahoo-dom-event.js',
2446 "type" => "js"),
2447 array("source" => ilYuiUtil::getLocalPath('animation/animation-min.js'),
2448 "target" => $a_target_dir.'/js/yahoo/animation-min.js',
2449 "type" => "js"),
2450 array("source" => './Services/JavaScript/js/Basic.js',
2451 "target" => $a_target_dir.'/js/Basic.js',
2452 "type" => "js"),
2453 array("source" => './Services/Accordion/js/accordion.js',
2454 "target" => $a_target_dir.'/js/accordion.js',
2455 "type" => "js"),
2456 array("source" => './Services/Accordion/css/accordion.css',
2457 "target" => $a_target_dir.'/css/accordion.css',
2458 "type" => "css"),
2459 array("source" => iljQueryUtil::getLocaljQueryPath(),
2460 "target" => $a_target_dir.'/js/jquery.js',
2461 "type" => "js"),
2462 array("source" => iljQueryUtil::getLocalMaphilightPath(),
2463 "target" => $a_target_dir.'/js/maphilight.js',
2464 "type" => "js"),
2465 array("source" => iljQueryUtil::getLocaljQueryUIPath(),
2466 "target" => $a_target_dir.'/js/jquery-ui-min.js',
2467 "type" => "js"),
2468 array("source" => './Services/COPage/js/ilCOPagePres.js',
2469 "target" => $a_target_dir.'/js/ilCOPagePres.js',
2470 "type" => "js"),
2471 array("source" => './Modules/Scorm2004/scripts/questions/pure.js',
2472 "target" => $a_target_dir.'/js/pure.js',
2473 "type" => "js"),
2474 array("source" => './Modules/Scorm2004/scripts/questions/question_handling.js',
2475 "target" => $a_target_dir.'/js/question_handling.js',
2476 "type" => "js"),
2477 array("source" => './Modules/TestQuestionPool/js/ilMatchingQuestion.js',
2478 "target" => $a_target_dir.'/js/ilMatchingQuestion.js',
2479 "type" => "js"),
2480 array("source" => './Modules/Scorm2004/templates/default/question_handling.css',
2481 "target" => $a_target_dir.'/css/question_handling.css',
2482 "type" => "css"),
2483 array("source" => './Modules/TestQuestionPool/templates/default/test_javascript.css',
2484 "target" => $a_target_dir.'/css/test_javascript.css',
2485 "type" => "css"),
2486 array("source" => ilPlayerUtil::getLocalMediaElementJsPath(),
2487 "target" => $a_target_dir."/".ilPlayerUtil::getLocalMediaElementJsPath(),
2488 "type" => "js"),
2490 "target" => $a_target_dir."/".ilPlayerUtil::getLocalMediaElementCssPath(),
2491 "type" => "css"),
2493 "target" => $a_target_dir."/".ilExplorerBaseGUI::getLocalExplorerJsPath(),
2494 "type" => "js"),
2495 array("source" => ilExplorerBaseGUI::getLocalJsTreeJsPath(),
2496 "target" => $a_target_dir."/".ilExplorerBaseGUI::getLocalJsTreeJsPath(),
2497 "type" => "js"),
2498 array("source" => './Modules/LearningModule/js/LearningModule.js',
2499 "target" => $a_target_dir.'/js/LearningModule.js',
2500 "type" => "js")
2501 );
2502
2503 $mathJaxSetting = new ilSetting("MathJax");
2504 $use_mathjax = $mathJaxSetting->get("enable");
2505 if ($use_mathjax)
2506 {
2507 $scripts[] = array("source" => "",
2508 "target" => $mathJaxSetting->get("path_to_mathjax"),
2509 "type" => "js");
2510 }
2511
2512 // auto linking js
2513 include_once("./Services/Link/classes/class.ilLinkifyUtil.php");
2514 foreach (ilLinkifyUtil::getLocalJsPaths() as $p)
2515 {
2516 if (is_int(strpos($p, "ExtLink")))
2517 {
2518 $scripts[] = array("source" => $p,
2519 "target" => $a_target_dir.'/js/ilExtLink.js',
2520 "type" => "js");
2521 }
2522 if (is_int(strpos($p, "linkify")))
2523 {
2524 $scripts[] = array("source" => $p,
2525 "target" => $a_target_dir.'/js/linkify.js',
2526 "type" => "js");
2527 }
2528 }
2529
2530 return $scripts;
2531
2532 }
static getLocalExplorerJsPath()
Get local path of explorer js.
static getLocalJsTreeJsPath()
Get local path of jsTree js.
static getLocalJsPaths()
Get paths of necessary js files.
getLocalMediaElementCssPath()
Get local path of jQuery file.
getLocalMediaElementJsPath()
Get local path of jQuery file.
static getLocalPath($a_name="")
Get local path of a YUI js file.
getLocalMaphilightPath()
Get local path of maphilight file.
getLocaljQueryPath()
Get local path of jQuery file.
getLocaljQueryUIPath()
Get local path of jQuery UI file.
if(strpos( $jquery_path, './')===0) else if(strpos($jquery_path, '.')===0) $mathJaxSetting
Definition: latex.php:34

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

Referenced by ilLMPresentationGUI\layout().

+ 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

Reimplemented from ilObject.

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

116 {
117 return parent::getTitle();
118 }

◆ getTOCMode()

ilObjContentObject::getTOCMode ( )

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

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

962 {
963 return $this->toc_mode;
964 }

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

+ Here is the caller graph for this function:

◆ getTree()

& ilObjContentObject::getTree ( )

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

261 {
262 return $this->lm_tree;
263 }

References $lm_tree.

◆ getXMLZip()

ilObjContentObject::getXMLZip ( )

Reimplemented from ilObject.

Reimplemented in ilObjDlBook.

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

2980 {
2981 include_once("./Modules/LearningModule/classes/class.ilContObjectExport.php");
2982
2983 $cont_exp = new ilContObjectExport($this,'xml');
2984
2985 $export_file = $cont_exp->buildExportFile();
2986 return $export_file;
2987 }
Export class for content objects.

◆ hasRating()

ilObjContentObject::hasRating ( )

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

3609 {
3610 return $this->rating;
3611 }

References $rating.

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

+ Here is the caller graph for this function:

◆ hasRatingPages()

ilObjContentObject::hasRatingPages ( )

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

3619 {
3620 return $this->rating_pages;
3621 }

References $rating_pages.

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

+ 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 1482 of file class.ilObjContentObject.php.

1483 {
1484 $tree = new ilTree($a_cont_obj_id);
1485 $tree->setTableNames('lm_tree','lm_data');
1486 $tree->setTreeTablePK("lm_id");
1487 if ($tree->isInTree($a_page_id))
1488 {
1489 $succ = $tree->fetchSuccessorNode($a_page_id, "pg");
1490 if ($succ > 0)
1491 {
1492 return true;
1493 }
1494 }
1495 return false;
1496 }

Referenced by ilPageObjectGUI\showPage().

+ Here is the caller graph for this function:

◆ ilObjContentObject()

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

Constructor @access public.

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

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

47 {
48 // this also calls read() method! (if $a_id is set)
49 $this->ilObject($a_id,$a_call_by_reference);
50
51 $this->log = ilLoggerFactory::getLogger('lm');
52
53 $this->mob_ids = array();
54 $this->file_ids = array();
55 $this->q_ids = array();
56 }
static getLogger($a_component_id)
Get component logger.
ilObject($a_id=0, $a_reference=true)
Constructor @access public.

References ilLoggerFactory\getLogger(), and ilObject\ilObject().

+ 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 304 of file class.ilObjContentObject.php.

305 {
306 // nothing to do. just display the dialogue in Out
307 return;
308 }

◆ importFromDirectory()

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

Import lm from directory.

Parameters

return

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

3274 {
3275 global $lng;
3276
3277 $this->log->debug("import from directory ".$a_directory);
3278
3279 // determine filename of xml file
3280 $subdir = basename($a_directory);
3281 $xml_file = $a_directory."/".$subdir.".xml";
3282
3283 // check directory exists within zip file
3284 if (!is_dir($a_directory))
3285 {
3286 $this->log->error(sprintf($lng->txt("cont_no_subdir_in_zip"), $subdir));
3287 return sprintf($lng->txt("cont_no_subdir_in_zip"), $subdir);
3288 }
3289
3290 // check whether xml file exists within zip file
3291 if (!is_file($xml_file))
3292 {
3293 $this->log->error(sprintf($lng->txt("cont_zip_file_invalid"), $subdir."/".$subdir.".xml"));
3294 return sprintf($lng->txt("cont_zip_file_invalid"), $subdir."/".$subdir.".xml");
3295 }
3296
3297 // import questions
3298 $this->log->debug("import qti");
3299 $qti_file = $a_directory."/qti.xml";
3300 $qtis = array();
3301 if (is_file($qti_file))
3302 {
3303 include_once "./Services/QTI/classes/class.ilQTIParser.php";
3304 include_once("./Modules/Test/classes/class.ilObjTest.php");
3305 $qtiParser = new ilQTIParser ($qti_file,
3306 IL_MO_VERIFY_QTI, 0, "");
3307 $result = $qtiParser->startParsing ();
3308 $founditems = & $qtiParser->getFoundItems ();
3309 $testObj = new ilObjTest(0, true);
3310 if (count($founditems) > 0)
3311 {
3312 $qtiParser = new ilQTIParser($qti_file, IL_MO_PARSE_QTI, 0, "");
3313 $qtiParser->setTestObject($testObj);
3314 $result = $qtiParser->startParsing();
3315 $qtis = array_merge($qtis, $qtiParser->getImportMapping());
3316 }
3317 }
3318
3319 $this->log->debug("get ilContObjParser");
3320 include_once ("./Modules/LearningModule/classes/class.ilContObjParser.php");
3321 $subdir = ".";
3322 $contParser = new ilContObjParser($this, $xml_file, $subdir, $a_directory);
3323 // smeyer: added \ilImportMapping lok im/export
3324 $contParser->setImportMapping($a_mapping);
3325 $contParser->setQuestionMapping($qtis);
3326 $contParser->startParsing();
3327 ilObject::_writeImportId($this->getId(), $this->getImportId());
3328 $this->MDUpdateListener('General');
3329
3330 // import style
3331 $style_file = $a_directory."/style.xml";
3332 $style_zip_file = $a_directory."/style.zip";
3333 if (is_file($style_zip_file)) // try to import style.zip first
3334 {
3335 require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
3336 $style = new ilObjStyleSheet();
3337 $style->import($style_zip_file);
3338 $this->writeStyleSheetId($style->getId());
3339 }
3340 else if (is_file($style_file)) // try to import style.xml
3341 {
3342 require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
3343 $style = new ilObjStyleSheet();
3344 $style->import($style_file);
3345 $this->writeStyleSheetId($style->getId());
3346 }
3347
3348// // validate
3349 if ($a_validate)
3350 {
3351 $mess = $this->validatePages();
3352 }
3353
3354 if ($mess == "")
3355 {
3356 // handle internal links to this learning module
3357 include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
3359 $this->getType(), $this->getRefId());
3360 }
3361
3362 return $mess;
3363 }
$result
const IL_MO_VERIFY_QTI
const IL_MO_PARSE_QTI
Content Object Parser.
writeStyleSheetId($a_style_id)
write ID of assigned style sheet object to db
MDUpdateListener($a_element)
Meta data update listener.
validatePages()
Validate all pages.
_writeImportId($a_obj_id, $a_import_id)
write import id to db (static)
static _handleImportRepositoryLinks($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
Change targest of repository links.

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

Referenced by importFromZipFile().

+ 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

return

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

3236 {
3237 global $lng;
3238
3239 // create import directory
3240 $this->createImportDirectory();
3241
3242 // copy uploaded file to import directory
3243 $file = pathinfo($a_filename);
3244 $full_path = $this->getImportDirectory()."/".$a_filename;
3245
3246 ilUtil::moveUploadedFile($a_tmp_file,
3247 $a_filename, $full_path);
3248
3249 // unzip file
3250 ilUtil::unzip($full_path);
3251
3252 $subdir = basename($file["basename"],".".$file["extension"]);
3253
3254 $mess = $this->importFromDirectory(
3255 $this->getImportDirectory()."/".$subdir, $a_validate);
3256
3257
3258 // delete import directory
3260
3261 return $mess;
3262 }
importFromDirectory($a_directory, $a_validate=true, $a_mapping=null)
Import lm from directory.
createImportDirectory()
creates data directory for import files (data_dir/lm_data/lm_<id>/import, depending on data directory...
getImportDirectory()
get import directory of lm
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file

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

+ Here is the call graph for this function:

◆ isActiveDownloads()

ilObjContentObject::isActiveDownloads ( )

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

1070 {
1071 return $this->downloads_active;
1072 }

Referenced by cloneObject(), and updateProperties().

+ Here is the caller graph for this function:

◆ isActiveDownloadsPublic()

ilObjContentObject::isActiveDownloadsPublic ( )

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

1080 {
1081 return $this->downloads_public_active;
1082 }

Referenced by cloneObject(), and updateProperties().

+ Here is the caller graph for this function:

◆ isActiveHistoryUserComments()

ilObjContentObject::isActiveHistoryUserComments ( )

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

1115 {
1116 return $this->user_comments;
1117 }

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

+ Here is the caller graph for this function:

◆ isActiveLMMenu()

ilObjContentObject::isActiveLMMenu ( )

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

1000 {
1001 return $this->lm_menu_active;
1002 }

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

+ Here is the caller graph for this function:

◆ isActiveNumbering()

ilObjContentObject::isActiveNumbering ( )

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

1020 {
1021 return $this->numbering;
1022 }

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

+ Here is the caller graph for this function:

◆ isActivePreventGlossaryAppendix()

ilObjContentObject::isActivePreventGlossaryAppendix ( )

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

1040 {
1041 return $this->prevent_glossary_appendix_active;
1042 }

Referenced by cloneObject(), and updateProperties().

+ Here is the caller graph for this function:

◆ isActivePrintView()

ilObjContentObject::isActivePrintView ( )

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

1030 {
1031 return $this->print_view_active;
1032 }

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

+ Here is the caller graph for this function:

◆ isActiveTOC()

ilObjContentObject::isActiveTOC ( )

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

1010 {
1011 return $this->toc_active;
1012 }

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

+ 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 3590 of file class.ilObjContentObject.php.

3591 {
3592 if (!$a_as_obj_id && $a_id > 0 && $a_id == OH_REF_ID)
3593 {
3594 return true;
3595 }
3596 if ($a_as_obj_id && $a_id > 0 && $a_id == ilObject::_lookupObjId(OH_REF_ID))
3597 {
3598 return true;
3599 }
3600 return false;
3601 }
static _lookupObjId($a_id)

References ilObject\_lookupObjId().

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

+ 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

return

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

3519 {
3520 global $ilDB;
3521
3522 // read auto glossaries
3523 $set = $ilDB->query("SELECT * FROM lm_glossaries ".
3524 " WHERE lm_id = ".$ilDB->quote($a_lm_id, "integer")
3525 );
3526 $glos = array();
3527 while ($rec = $ilDB->fetchAssoc($set))
3528 {
3529 $glos[] = $rec["glo_id"];
3530 }
3531 return $glos;
3532 }

References $ilDB.

Referenced by ilLMPage\beforePageContentUpdate().

+ Here is the caller graph for this function:

◆ MDUpdateListener()

ilObjContentObject::MDUpdateListener (   $a_element)

Meta data update listener.

Important note: Do never call create() or update() method of ilObject here. It would result in an endless loop: update object -> update meta -> update object -> ... Use static _writeTitle() ... methods instead.

Parameters
string$a_element

Reimplemented from ilObject.

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

3625 {
3626 parent::MDUpdateListener($a_element);
3627
3628 include_once 'Services/MetaData/classes/class.ilMD.php';
3629
3630 switch($a_element)
3631 {
3632 case 'Educational':
3633 include_once("./Services/Object/classes/class.ilObjectLP.php");
3634 $obj_lp = ilObjectLP::getInstance($this->getId());
3635 if(in_array($obj_lp->getCurrentMode(),
3637 {
3638 include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
3640 }
3641 break;
3642
3643 case 'General':
3644
3645 // Update Title and description
3646 $md = new ilMD($this->getId(),0, $this->getType());
3647 if(!is_object($md_gen = $md->getGeneral()))
3648 {
3649 return false;
3650 }
3651
3652 include_once("./Services/Object/classes/class.ilObjectTranslation.php");
3654 if ($ot->getContentActivated())
3655 {
3656 $ot->setDefaultTitle($md_gen->getTitle());
3657
3658 foreach($md_gen->getDescriptionIds() as $id)
3659 {
3660 $md_des = $md_gen->getDescription($id);
3661 $ot->setDefaultDescription($md_des->getDescription());
3662 break;
3663 }
3664 $ot->save();
3665 }
3666 break;
3667
3668 }
3669 return true;
3670 }
_refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static getInstance($a_obj_id)

References ilObject\$id, ilLPStatusWrapper\_refreshStatus(), ilObject\getId(), ilObjectLP\getInstance(), ilObjectTranslation\getInstance(), ilObject\getType(), ilLPObjSettings\LP_MODE_COLLECTION_TLT, and ilLPObjSettings\LP_MODE_TLT.

Referenced by importFromDirectory().

+ Here is the call graph for this function:
+ 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.

@access public

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

Reimplemented from ilObject.

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

1426 {
1427 global $tree;
1428
1429 switch ($a_event)
1430 {
1431 case "link":
1432
1433 //var_dump("<pre>",$a_params,"</pre>");
1434 //echo "Content Object ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
1435 //exit;
1436 break;
1437
1438 case "cut":
1439
1440 //echo "Content Object ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
1441 //exit;
1442 break;
1443
1444 case "copy":
1445
1446 //var_dump("<pre>",$a_params,"</pre>");
1447 //echo "Content Object ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
1448 //exit;
1449 break;
1450
1451 case "paste":
1452
1453 //echo "Content Object ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
1454 //exit;
1455 break;
1456
1457 case "new":
1458
1459 //echo "Content Object ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
1460 //exit;
1461 break;
1462 }
1463
1464 // At the beginning of the recursive process it avoids second call of the notify function with the same parameter
1465 if ($a_node_id==$_GET["ref_id"])
1466 {
1467 $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
1468 $parent_type = $parent_obj->getType();
1469 if($parent_type == $this->getType())
1470 {
1471 $a_node_id = (int) $tree->getParentId($a_node_id);
1472 }
1473 }
1474
1475 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
1476 }

References $_GET, and ilObject\getType().

+ Here is the call graph for this function:

◆ publicNotes()

ilObjContentObject::publicNotes ( )

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

1090 {
1091 return $this->pub_notes;
1092 }

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

+ Here is the caller graph for this function:

◆ putInTree()

ilObjContentObject::putInTree (   $a_parent)

put content object in main tree

Reimplemented from ilObject.

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

316 {
317 global $tree;
318
319 // put this object in tree under $a_parent
320 parent::putInTree($a_parent);
321
322 // make new tree for this object
323 //$tree->addTree($this->getId());
324 }

◆ read()

ilObjContentObject::read ( )

read data of content object

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

84 {
85 global $ilDB;
86
87 parent::read();
88# echo "Content<br>\n";
89
90 $this->lm_tree = new ilTree($this->getId());
91 $this->lm_tree->setTableNames('lm_tree','lm_data');
92 $this->lm_tree->setTreeTablePK("lm_id");
93
94 $this->readProperties();
95
96 // read auto glossaries
97 $set = $ilDB->query("SELECT * FROM lm_glossaries ".
98 " WHERE lm_id = ".$ilDB->quote($this->getId(), "integer")
99 );
100 $glos = array();
101 while ($rec = $ilDB->fetchAssoc($set))
102 {
103 $glos[] = $rec["glo_id"];
104 }
105 $this->setAutoGlossaries($glos);
106
107 //parent::read();
108 }
setAutoGlossaries($a_val)
Set auto glossaries.

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

+ Here is the call graph for this function:

◆ readProperties()

ilObjContentObject::readProperties ( )

read content object properties

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

1143 {
1144 global $ilDB;
1145
1146 $q = "SELECT * FROM content_object WHERE id = ".
1147 $ilDB->quote($this->getId(), "integer");
1148 $lm_set = $ilDB->query($q);
1149 $lm_rec = $ilDB->fetchAssoc($lm_set);
1150 $this->setLayout($lm_rec["default_layout"]);
1151 $this->setStyleSheetId((int) $lm_rec["stylesheet"]);
1152 $this->setPageHeader($lm_rec["page_header"]);
1153 $this->setTOCMode($lm_rec["toc_mode"]);
1154 $this->setOnline(ilUtil::yn2tf($lm_rec["is_online"]));
1155 $this->setActiveTOC(ilUtil::yn2tf($lm_rec["toc_active"]));
1156 $this->setActiveNumbering(ilUtil::yn2tf($lm_rec["numbering"]));
1157 $this->setActivePrintView(ilUtil::yn2tf($lm_rec["print_view_active"]));
1158 $this->setActivePreventGlossaryAppendix(ilUtil::yn2tf($lm_rec["no_glo_appendix"]));
1159 $this->setHideHeaderFooterPrint($lm_rec["hide_head_foot_print"]);
1160 $this->setActiveDownloads(ilUtil::yn2tf($lm_rec["downloads_active"]));
1161 $this->setActiveDownloadsPublic(ilUtil::yn2tf($lm_rec["downloads_public_active"]));
1162 $this->setActiveLMMenu(ilUtil::yn2tf($lm_rec["lm_menu_active"]));
1163 $this->setCleanFrames(ilUtil::yn2tf($lm_rec["clean_frames"]));
1164 $this->setHeaderPage((int) $lm_rec["header_page"]);
1165 $this->setFooterPage((int) $lm_rec["footer_page"]);
1166 $this->setHistoryUserComments(ilUtil::yn2tf($lm_rec["hist_user_comments"]));
1167 $this->setPublicAccessMode($lm_rec["public_access_mode"]);
1168 $this->setPublicExportFile("xml", $lm_rec["public_xml_file"]);
1169 $this->setPublicExportFile("html", $lm_rec["public_html_file"]);
1170 $this->setPublicExportFile("scorm", $lm_rec["public_scorm_file"]);
1171 $this->setLayoutPerPage($lm_rec["layout_per_page"]);
1172 $this->setRating($lm_rec["rating"]);
1173 $this->setRatingPages($lm_rec["rating_pages"]);
1174 $this->setDisableDefaultFeedback($lm_rec["disable_def_feedback"]);
1175 $this->setProgressIcons($lm_rec["progr_icons"]);
1176 $this->setStoreTries($lm_rec["store_tries"]);
1177 $this->setRestrictForwardNavigation($lm_rec["restrict_forw_nav"]);
1178
1179 // #14661
1180 include_once("./Services/Notes/classes/class.ilNote.php");
1181 $this->setPublicNotes(ilNote::commentsActivated($this->getId(), 0, $this->getType()));
1182
1183 $this->setForTranslation($lm_rec["for_translation"]);
1184 }
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type)
Are comments activated for object?
setForTranslation($a_val)
Set for translation.
setPageHeader($a_pg_header=IL_CHAPTER_TITLE)
set page header mode
setProgressIcons($a_val)
Set progress icons.
setLayoutPerPage($a_val)
Set layout per page.
setRestrictForwardNavigation($a_val)
Set restrict forward navigation.
setDisableDefaultFeedback($a_val)
Set disable default feedback for questions.
setHideHeaderFooterPrint($a_val)
Set hide header footer in print mode.
setPublicExportFile($a_type, $a_file)
specify public export file for type
setStoreTries($a_val)
Set store tries.
setTOCMode($a_toc_mode="chapters")
set toc mode
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
setLayout($a_layout)
set default page layout

References $ilDB, $lm_set, ilNote\commentsActivated(), ilObject\getId(), ilObject\getType(), setActiveDownloads(), setActiveDownloadsPublic(), setActiveLMMenu(), setActiveNumbering(), setActivePreventGlossaryAppendix(), setActivePrintView(), setActiveTOC(), setCleanFrames(), setDisableDefaultFeedback(), setFooterPage(), setForTranslation(), 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().

+ 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

return

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

379 {
380 $glo_ids = array();
381 foreach($this->getAutoGlossaries() as $g)
382 {
383 if ($g != $a_glo_id)
384 {
385 $glo_ids[] = $g;
386 }
387 }
388 $this->setAutoGlossaries($glo_ids);
389 }

References getAutoGlossaries(), and setAutoGlossaries().

+ Here is the call graph for this function:

◆ setActiveDownloads()

ilObjContentObject::setActiveDownloads (   $a_down)

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

1065 {
1066 $this->downloads_active = $a_down;
1067 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setActiveDownloadsPublic()

ilObjContentObject::setActiveDownloadsPublic (   $a_down)

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

1075 {
1076 $this->downloads_public_active = $a_down;
1077 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setActiveLMMenu()

ilObjContentObject::setActiveLMMenu (   $a_act_lm_menu)

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

995 {
996 $this->lm_menu_active = $a_act_lm_menu;
997 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setActiveNumbering()

ilObjContentObject::setActiveNumbering (   $a_num)

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

1015 {
1016 $this->numbering = $a_num;
1017 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setActivePreventGlossaryAppendix()

ilObjContentObject::setActivePreventGlossaryAppendix (   $a_print)

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

1035 {
1036 $this->prevent_glossary_appendix_active = $a_print;
1037 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setActivePrintView()

ilObjContentObject::setActivePrintView (   $a_print)

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

1025 {
1026 $this->print_view_active = $a_print;
1027 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setActiveTOC()

ilObjContentObject::setActiveTOC (   $a_toc)

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

1005 {
1006 $this->toc_active = $a_toc;
1007 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setAutoGlossaries()

ilObjContentObject::setAutoGlossaries (   $a_val)

Set auto glossaries.

Parameters
array$a_valint

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

346 {
347 $this->auto_glossaries = array();
348 if (is_array($a_val))
349 {
350 foreach ($a_val as $v)
351 {
352 $v = (int) $v;
353 if ($v > 0 && ilObject::_lookupType($v) == "glo" &&
354 !in_array($v, $this->auto_glossaries))
355 {
356 $this->auto_glossaries[] = $v;
357 }
358 }
359 }
360 }

References ilObject\_lookupType().

Referenced by read(), and removeAutoGlossary().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCleanFrames()

ilObjContentObject::setCleanFrames (   $a_clean)

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

1095 {
1096 $this->clean_frames = $a_clean;
1097 }

Referenced by readProperties(), and updateProperties().

+ Here is the caller graph for this function:

◆ setDescription()

ilObjContentObject::setDescription (   $a_description)

set description of content object

Reimplemented from ilObject.

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

143 {
144 parent::setDescription($a_description);
145// $this->meta_data->setDescription($a_description);
146 }

◆ setDisableDefaultFeedback()

ilObjContentObject::setDisableDefaultFeedback (   $a_val)

Set disable default feedback for questions.

Parameters
bool$a_valdisable default feedback

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

185 {
186 $this->disable_def_feedback = $a_val;
187 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setFooterPage()

ilObjContentObject::setFooterPage (   $a_pg)

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

1130 {
1131 $this->footer_page = $a_pg;
1132 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setForTranslation()

ilObjContentObject::setForTranslation (   $a_val)

Set for translation.

Parameters
bool$a_vallm has been imported for translation purposes

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

428 {
429 $this->for_translation = $a_val;
430 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setHeaderPage()

ilObjContentObject::setHeaderPage (   $a_pg)

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

1120 {
1121 $this->header_page = $a_pg;
1122 }

Referenced by readProperties().

+ 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 1049 of file class.ilObjContentObject.php.

1050 {
1051 $this->hide_header_footer_print = $a_val;
1052 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setHistoryUserComments()

ilObjContentObject::setHistoryUserComments (   $a_comm)

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

1105 {
1106 $this->user_comments = $a_comm;
1107 }

Referenced by readProperties().

+ 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 519 of file class.ilObjContentObject.php.

520 {
521 $this->import_dir = $a_import_dir;
522 }

◆ setImportId()

ilObjContentObject::setImportId (   $a_import_id)

set import id

@access public

Parameters
string$a_import_idimport id

Reimplemented from ilObject.

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

155 {
156 $this->import_id = $a_id;
157 }

◆ setLayout()

ilObjContentObject::setLayout (   $a_layout)

set default page layout

Parameters
string$a_layoutdefault page layout

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

675 {
676 $this->layout = $a_layout;
677 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setLayoutPerPage()

ilObjContentObject::setLayoutPerPage (   $a_val)

Set layout per page.

Parameters
booleanlayout per page

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

165 {
166 $this->layout_per_page = $a_val;
167 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setOnline()

ilObjContentObject::setOnline (   $a_online)

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

985 {
986 $this->online = $a_online;
987 }

Referenced by readProperties().

+ 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 953 of file class.ilObjContentObject.php.

954 {
955 $this->pg_header = $a_pg_header;
956 }

Referenced by readProperties().

+ 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 204 of file class.ilObjContentObject.php.

205 {
206 $this->progr_icons = $a_val;
207 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setPublicAccessMode()

ilObjContentObject::setPublicAccessMode (   $a_mode)

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

1110 {
1111 $this->public_access_mode = $a_mode;
1112 }

Referenced by readProperties().

+ 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 2020 of file class.ilObjContentObject.php.

2021 {
2022 $this->public_export_file[$a_type] = $a_file;
2023 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setPublicNotes()

ilObjContentObject::setPublicNotes (   $a_pub_notes)

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

1085 {
1086 $this->pub_notes = $a_pub_notes;
1087 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setRating()

ilObjContentObject::setRating (   $a_value)

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

3604 {
3605 $this->rating = (bool)$a_value;
3606 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setRatingPages()

ilObjContentObject::setRatingPages (   $a_value)

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

3614 {
3615 $this->rating_pages = (bool)$a_value;
3616 }

Referenced by readProperties().

+ 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 244 of file class.ilObjContentObject.php.

245 {
246 $this->restrict_forw_nav = $a_val;
247 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setStoreTries()

ilObjContentObject::setStoreTries (   $a_val)

Set store tries.

Parameters
bool$a_valstore tries

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

225 {
226 $this->store_tries = $a_val;
227 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setStyleSheetId()

ilObjContentObject::setStyleSheetId (   $a_style_id)

set ID of assigned style sheet object

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

691 {
692 $this->style_id = $a_style_id;
693 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ setTitle()

ilObjContentObject::setTitle (   $a_title)

set title of content object

Reimplemented from ilObject.

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

124 {
125 parent::setTitle($a_title);
126// $this->meta_data->setTitle($a_title);
127 }

◆ setTOCMode()

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

set toc mode

Parameters
string$a_toc_mode"chapters" | "pages"

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

980 {
981 $this->toc_mode = $a_toc_mode;
982 }

Referenced by readProperties().

+ Here is the caller graph for this function:

◆ update()

ilObjContentObject::update ( )

update complete object (meta data and properties)

Reimplemented from ilObject.

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

269 {
270 $this->updateMetaData();
271 parent::update();
272 $this->updateProperties();
273 $this->updateAutoGlossaries();
274 }
updateProperties()
Update content object properties.
updateMetaData()
update meta data entry

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

+ Here is the call graph for this function:

◆ updateAutoGlossaries()

ilObjContentObject::updateAutoGlossaries ( )

Update auto glossaries.

Parameters

return

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

283 {
284 global $ilDB;
285
286 // update auto glossaries
287 $ilDB->manipulate("DELETE FROM lm_glossaries WHERE ".
288 " lm_id = ".$ilDB->quote($this->getId(), "integer")
289 );
290 foreach ($this->getAutoGlossaries() as $glo_id)
291 {
292 $ilDB->manipulate("INSERT INTO lm_glossaries ".
293 "(lm_id, glo_id) VALUES (".
294 $ilDB->quote($this->getId(), "integer").",".
295 $ilDB->quote($glo_id, "integer").
296 ")");
297 }
298 }

References $ilDB, and getAutoGlossaries().

Referenced by create(), and update().

+ 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 1189 of file class.ilObjContentObject.php.

1190 {
1191 global $ilDB;
1192
1193 // force clean_frames to be set, if layout per page is activated
1194 if ($this->getLayoutPerPage())
1195 {
1196 $this->setCleanFrames(true);
1197 }
1198
1199 $q = "UPDATE content_object SET ".
1200 " default_layout = ".$ilDB->quote($this->getLayout(), "text").", ".
1201 " stylesheet = ".$ilDB->quote($this->getStyleSheetId(), "integer").",".
1202 " page_header = ".$ilDB->quote($this->getPageHeader(), "text").",".
1203 " toc_mode = ".$ilDB->quote($this->getTOCMode(), "text").",".
1204 " is_online = ".$ilDB->quote(ilUtil::tf2yn($this->getOnline()), "text").",".
1205 " toc_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveTOC()), "text").",".
1206 " numbering = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveNumbering()), "text").",".
1207 " print_view_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActivePrintView()), "text").",".
1208 " no_glo_appendix = ".$ilDB->quote(ilUtil::tf2yn($this->isActivePreventGlossaryAppendix()), "text").",".
1209 " hide_head_foot_print = ".$ilDB->quote($this->getHideHeaderFooterPrint(), "integer").",".
1210 " downloads_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveDownloads()), "text").",".
1211 " downloads_public_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveDownloadsPublic()), "text").",".
1212 " clean_frames = ".$ilDB->quote(ilUtil::tf2yn($this->cleanFrames()), "text").",".
1213 " hist_user_comments = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveHistoryUserComments()), "text").",".
1214 " public_access_mode = ".$ilDB->quote($this->getPublicAccessMode(), "text").",".
1215 " public_xml_file = ".$ilDB->quote($this->getPublicExportFile("xml"), "text").",".
1216 " public_html_file = ".$ilDB->quote($this->getPublicExportFile("html"), "text").",".
1217 " public_scorm_file = ".$ilDB->quote($this->getPublicExportFile("scorm"), "text").",".
1218 " header_page = ".$ilDB->quote($this->getHeaderPage(), "integer").",".
1219 " footer_page = ".$ilDB->quote($this->getFooterPage(), "integer").",".
1220 " lm_menu_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveLMMenu()), "text").", ".
1221 " layout_per_page = ".$ilDB->quote($this->getLayoutPerPage(), "integer").", ".
1222 " rating = ".$ilDB->quote($this->hasRating(), "integer").", ".
1223 " rating_pages = ".$ilDB->quote($this->hasRatingPages(), "integer").", ".
1224 " disable_def_feedback = ".$ilDB->quote($this->getDisableDefaultFeedback(), "integer").", ".
1225 " progr_icons = ".$ilDB->quote($this->getProgressIcons(), "integer").", ".
1226 " store_tries = ".$ilDB->quote($this->getStoreTries(), "integer").", ".
1227 " restrict_forw_nav = ".$ilDB->quote($this->getRestrictForwardNavigation(), "integer").", ".
1228 " for_translation = ".$ilDB->quote((int) $this->getForTranslation(), "integer")." ".
1229 " WHERE id = ".$ilDB->quote($this->getId(), "integer");
1230 $ilDB->manipulate($q);
1231
1232 // #14661
1233 include_once("./Services/Notes/classes/class.ilNote.php");
1234 ilNote::activateComments($this->getId(), 0, $this->getType(), $this->publicNotes());
1235 }
getHideHeaderFooterPrint()
Get hide header footer in print mode.
getForTranslation()
Get for translation.
getPublicExportFile($a_type)
get public export file

References $ilDB, ilNote\activateComments(), cleanFrames(), getDisableDefaultFeedback(), getFooterPage(), getForTranslation(), 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().

+ 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 3187 of file class.ilObjContentObject.php.

3188 {
3189 include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
3190 include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
3191
3192 $mess = "";
3193
3194 $pages = ilLMPageObject::getPageList($this->getId());
3195 foreach ($pages as $page)
3196 {
3197 if (ilLMPage::_exists($this->getType(), $page["obj_id"]))
3198 {
3199 $cpage = new ilLMPage($page["obj_id"]);
3200 $cpage->buildDom();
3201 $error = @$cpage->validateDom();
3202
3203 if ($error != "")
3204 {
3205 $this->lng->loadLanguageModule("content");
3206 ilUtil::sendInfo($this->lng->txt("cont_import_validation_errors"));
3207 $title = ilLMObject::_lookupTitle($page["obj_id"]);
3208 $page_obj = new ilLMPageObject($this, $page["obj_id"]);
3209 $mess.= $this->lng->txt("obj_pg").": ".$title;
3210 $mess.= '<div class="small">';
3211 foreach ($error as $e)
3212 {
3213 $err_mess = implode($e, " - ");
3214 if (!is_int(strpos($err_mess, ":0:")))
3215 {
3216 $mess.= htmlentities($err_mess)."<br />";
3217 }
3218 }
3219 $mess.= '</div>';
3220 $mess.= "<br />";
3221 }
3222 }
3223 }
3224
3225 return $mess;
3226 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

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

Referenced by importFromDirectory().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeFooterPage()

static ilObjContentObject::writeFooterPage (   $a_lm_id,
  $a_page_id 
)
static

Write footer page.

Parameters
int$a_lm_idlearning module id
int$a_page_idpage

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

733 {
734 global $ilDB;
735
736 $ilDB->manipulate("UPDATE content_object SET ".
737 " footer_page = ".$ilDB->quote($a_page_id, "integer").
738 " WHERE id = ".$ilDB->quote($a_lm_id, "integer")
739 );
740 }

References $ilDB.

Referenced by ilLearningModuleImporter\finalProcessing().

+ Here is the caller graph for this function:

◆ writeHeaderPage()

static ilObjContentObject::writeHeaderPage (   $a_lm_id,
  $a_page_id 
)
static

Write header page.

Parameters
int$a_lm_idlearning module id
int$a_page_idpage

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

717 {
718 global $ilDB;
719
720 $ilDB->manipulate("UPDATE content_object SET ".
721 " header_page = ".$ilDB->quote($a_page_id, "integer").
722 " WHERE id = ".$ilDB->quote($a_lm_id, "integer")
723 );
724 }

References $ilDB.

Referenced by ilLearningModuleImporter\finalProcessing().

+ 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 698 of file class.ilObjContentObject.php.

699 {
700 global $ilDB;
701
702 $q = "UPDATE content_object SET ".
703 " stylesheet = ".$ilDB->quote((int) $a_style_id, "integer").
704 " WHERE id = ".$ilDB->quote($this->getId(), "integer");
705 $ilDB->manipulate($q);
706
707 $this->style_id = $a_style_id;
708 }

References $ilDB, and ilObject\getId().

Referenced by importFromDirectory().

+ 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 32 of file class.ilObjContentObject.php.

Referenced by getAutoGlossaries().

◆ $for_translation

ilObjContentObject::$for_translation = 0

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

Referenced by getForTranslation().

◆ $import_dir

ilObjContentObject::$import_dir = ''
private

Definition at line 34 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

◆ $log

ilObjContentObject::$log
protected

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

Referenced by exportSCORM().

◆ $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 30 of file class.ilObjContentObject.php.

Referenced by hasRating().

◆ $rating_pages

ilObjContentObject::$rating_pages
protected

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

Referenced by hasRatingPages().

◆ $style_id

ilObjContentObject::$style_id

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

Referenced by cloneObject(), and getStyleSheetId().


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