ILIAS  release_4-4 Revision
ilObjContentObject Class Reference

Class ilObjContentObject. More...

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

Public Member Functions

 ilObjContentObject ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 create ($a_no_meta_data=false)
 create content object More...
 
 initDefaultRoles ()
 init default roles settings OBSOLETE. More...
 
 read ()
 read data of content object More...
 
 getTitle ()
 get title of content object More...
 
 setTitle ($a_title)
 set title of content object More...
 
 getDescription ()
 get description of content object More...
 
 setDescription ($a_description)
 set description of content object More...
 
 getImportId ()
 
 setImportId ($a_id)
 
 setLayoutPerPage ($a_val)
 Set layout per page. More...
 
 getLayoutPerPage ()
 Get layout per page. More...
 
 setDisableDefaultFeedback ($a_val)
 Set disable default feedback for questions. More...
 
 getDisableDefaultFeedback ()
 Get disable default feedback for questions. More...
 
getTree ()
 
 update ()
 update complete object (meta data and properties) More...
 
 updateAutoGlossaries ()
 Update auto glossaries. More...
 
 import ()
 if implemented, this function should be called from an Out/GUI-Object More...
 
 putInTree ($a_parent)
 put content object in main tree More...
 
 createLMTree ()
 create content object tree (that stores structure object hierarchie) More...
 
 setAutoGlossaries ($a_val)
 Set auto glossaries. More...
 
 getAutoGlossaries ()
 Get auto glossaries. More...
 
 removeAutoGlossary ($a_glo_id)
 Remove auto glossary. More...
 
 addFirstChapterAndPage ()
 Add first chapter and page. More...
 
getLMTree ()
 get content object tree More...
 
 createImportDirectory ()
 creates data directory for import files (data_dir/lm_data/lm_<id>/import, depending on data directory that is set in ILIAS setup/ini) More...
 
 getDataDirectory ()
 get data directory More...
 
 getImportDirectory ()
 get import directory of lm More...
 
 setImportDirectory ($a_import_dir)
 Set import directory for further use in ilContObjParser. More...
 
 createExportDirectory ($a_type="xml")
 creates data directory for export files (data_dir/lm_data/lm_<id>/export, depending on data directory that is set in ILIAS setup/ini) More...
 
 getExportDirectory ($a_type="xml")
 get export directory of lm More...
 
 delete ()
 delete learning module and all related data More...
 
 getLayout ()
 get default page layout of content object (see directory layouts/) More...
 
 setLayout ($a_layout)
 set default page layout More...
 
 getStyleSheetId ()
 get ID of assigned style sheet object More...
 
 setStyleSheetId ($a_style_id)
 set ID of assigned style sheet object More...
 
 writeStyleSheetId ($a_style_id)
 write ID of assigned style sheet object to db More...
 
 _moveLMStyles ($a_from_style, $a_to_style)
 move learning modules from one style to another More...
 
 _lookupStyleSheetId ($a_cont_obj_id)
 lookup style sheet ID More...
 
 _lookupContObjIdByStyleId ($a_style_id)
 lookup style sheet ID More...
 
 _getNrOfAssignedLMs ($a_style_id)
 gets the number of learning modules assigned to a content style More...
 
 _getNrLMsIndividualStyles ()
 get number of learning modules with individual styles More...
 
 _getNrLMsNoStyle ()
 get number of learning modules assigned no style More...
 
 _deleteStyleAssignments ($a_style_id)
 delete all style references to style More...
 
 getPageHeader ()
 get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER) More...
 
 setPageHeader ($a_pg_header=IL_CHAPTER_TITLE)
 set page header mode More...
 
 getTOCMode ()
 get toc mode ("chapters" | "pages") More...
 
 getPublicAccessMode ()
 get public access mode ("complete" | "selected") More...
 
 setTOCMode ($a_toc_mode="chapters")
 set toc mode More...
 
 setOnline ($a_online)
 
 getOnline ()
 
 setActiveLMMenu ($a_act_lm_menu)
 
 isActiveLMMenu ()
 
 setActiveTOC ($a_toc)
 
 isActiveTOC ()
 
 setActiveNumbering ($a_num)
 
 isActiveNumbering ()
 
 setActivePrintView ($a_print)
 
 isActivePrintView ()
 
 setActivePreventGlossaryAppendix ($a_print)
 
 isActivePreventGlossaryAppendix ()
 
 setHideHeaderFooterPrint ($a_val)
 Set hide header footer in print mode. More...
 
 getHideHeaderFooterPrint ()
 Get hide header footer in print mode. More...
 
 setActiveDownloads ($a_down)
 
 isActiveDownloads ()
 
 setActiveDownloadsPublic ($a_down)
 
 isActiveDownloadsPublic ()
 
 setPublicNotes ($a_pub_notes)
 
 publicNotes ()
 
 setCleanFrames ($a_clean)
 
 cleanFrames ()
 
 setHistoryUserComments ($a_comm)
 
 setPublicAccessMode ($a_mode)
 
 isActiveHistoryUserComments ()
 
 setHeaderPage ($a_pg)
 
 getHeaderPage ()
 
 setFooterPage ($a_pg)
 
 getFooterPage ()
 
 readProperties ()
 read content object properties More...
 
 updateProperties ()
 Update content object properties. More...
 
 createProperties ()
 create new properties record More...
 
 _lookupOnline ($a_id)
 check wether content object is online More...
 
 getAvailableLayouts ()
 get all available lm layouts More...
 
 _checkPreconditionsOfPage ($cont_ref_id, $cont_obj_id, $page_id)
 checks wether the preconditions of a page are fulfilled or not More...
 
 _getMissingPreconditionsOfPage ($cont_ref_id, $cont_obj_id, $page_id)
 gets all missing preconditions of page More...
 
 _getMissingPreconditionsTopChapter ($cont_obj_ref_id, $cont_obj_id, $page_id)
 get top chapter of page for that any precondition is missing More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event happend, each object may decide how it reacts. More...
 
 hasSuccessorPage ($a_cont_obj_id, $a_page_id)
 checks if page has a successor page More...
 
 checkTree ()
 
 fixTree ()
 fix tree More...
 
 exportXML (&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
 export object to xml (see ilias_co.dtd) More...
 
 exportXMLMetaData (&$a_xml_writer)
 export content objects meta data to xml (see ilias_co.dtd) More...
 
 exportXMLStructureObjects (&$a_xml_writer, $a_inst, &$expLog)
 export structure objects to xml (see ilias_co.dtd) More...
 
 exportXMLPageObjects (&$a_xml_writer, $a_inst, &$expLog)
 export page objects to xml (see ilias_co.dtd) More...
 
 exportXMLMediaObjects (&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
 export media objects to xml (see ilias_co.dtd) More...
 
 exportFileItems ($a_target_dir, &$expLog)
 export files of file itmes More...
 
 exportXMLProperties ($a_xml_writer, &$expLog)
 export properties of content object More...
 
 getExportFiles ()
 get export files More...
 
 setPublicExportFile ($a_type, $a_file)
 specify public export file for type More...
 
 getPublicExportFile ($a_type)
 get public export file More...
 
 getOfflineFiles ($dir)
 get offline files More...
 
 exportSCORM ($a_target_dir, $log)
 export scorm package More...
 
 exportHTML ($a_target_dir, $log, $a_zip_file=true, $a_export_format="html", $a_lang="")
 export html package More...
 
 exportHTMLFile ($a_target_dir, $a_file_id)
 export file object More...
 
 exportHTMLMOB ($a_target_dir, &$a_lm_gui, $a_mob_id, $a_frame, &$a_linked_mobs)
 export media object to html More...
 
 exportHTMLGlossaryTerms (&$a_lm_gui, $a_target_dir)
 export glossary terms More...
 
 exportHTMLPages (&$a_lm_gui, $a_target_dir, $a_lang="")
 export all pages of learning module to html file More...
 
 exportPageHTML (&$a_lm_gui, $a_target_dir, $a_lm_page_id, $a_frame="", $a_exp_id_map=array())
 export page html More...
 
 exportFO (&$a_xml_writer, $a_target_dir)
 export object to fo More...
 
 exportFOStructureObjects (&$a_xml_writer)
 export structure objects to fo More...
 
 getXMLZip ()
 
 executeDragDrop ($source_id, $target_id, $first_child, $as_subitem=false, $movecopy="move")
 Execute Drag Drop Action. More...
 
 validatePages ()
 Validate all pages. More...
 
 importFromZipFile ($a_tmp_file, $a_filename, $a_validate=true, $a_import_into_help_module=0)
 Import lm from zip file. More...
 
 importFromDirectory ($a_directory, $a_validate=true)
 Import lm from directory. More...
 
 cloneObject ($a_target_id, $a_copy_id=0)
 Clone learning module. More...
 
 copyAllPagesAndChapters ($a_target_obj)
 Copy all pages and chapters. More...
 
 lookupAutoGlossaries ($a_lm_id)
 Lookup auto glossaries. More...
 
 autoLinkGlossaryTerms ($a_glo_id)
 Auto link glossary terms. More...
 
 setRating ($a_value)
 
 hasRating ()
 
 setRatingPages ($a_value)
 
 hasRatingPages ()
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 createRoleFolder ()
 creates a local role folder More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. More...
 

Static Public Member Functions

static _lookupDisableDefaultFeedback ($a_id)
 Lookup disable default feedback. More...
 
static getSupplyingExportFiles ($a_target_dir=".")
 Get supplying export files. More...
 
static isOnlineHelpModule ($a_id, $a_as_obj_id=false)
 Is module an online module. More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Data Fields

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

Protected Attributes

 $rating
 
 $rating_pages
 

Private Attributes

 $import_dir = ''
 

Detailed Description

Member Function Documentation

◆ _checkPreconditionsOfPage()

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

checks wether the preconditions of a page are fulfilled or not

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

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

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

1169  {
1170  global $ilUser,$ilErr;
1171 
1172  $lm_tree = new ilTree($cont_obj_id);
1173  $lm_tree->setTableNames('lm_tree','lm_data');
1174  $lm_tree->setTreeTablePK("lm_id");
1175 
1176  if ($lm_tree->isInTree($page_id))
1177  {
1178  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1179  foreach ($path as $node)
1180  {
1181  if ($node["type"] == "st")
1182  {
1183  if (!ilConditionHandler::_checkAllConditionsOfTarget($cont_ref_id,$node["child"], "st"))
1184  {
1185  return false;
1186  }
1187  }
1188  }
1189  }
1190 
1191  return true;
1192  }
_checkAllConditionsOfTarget($a_target_ref_id, $a_target_id, $a_target_type="", $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
global $ilUser
Definition: imgupload.php:15
$path
Definition: index.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteStyleAssignments()

ilObjContentObject::_deleteStyleAssignments (   $a_style_id)

delete all style references to style

Parameters
int$a_style_idstyle_id

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

References ilObject\getId().

Referenced by ilObjStyleSheet\delete().

799  {
800  global $ilDB;
801 
802  $q = "UPDATE content_object SET ".
803  " stylesheet = ".$ilDB->quote(0, "integer").
804  " WHERE stylesheet = ".$ilDB->quote((int) $this->getId($a_style_id), "integer");
805 
806  $ilDB->manipulate($q);
807  }
getId()
get object id public
+ 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 1197 of file class.ilObjContentObject.php.

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

Referenced by ilLMPresentationGUI\showPreconditionsOfPage().

1198  {
1199  $lm_tree = new ilTree($cont_obj_id);
1200  $lm_tree->setTableNames('lm_tree','lm_data');
1201  $lm_tree->setTreeTablePK("lm_id");
1202 
1203  $conds = array();
1204  if ($lm_tree->isInTree($page_id))
1205  {
1206  // get full path of page
1207  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1208  foreach ($path as $node)
1209  {
1210  if ($node["type"] == "st")
1211  {
1212  // get all preconditions of upper chapters
1213  $tconds = ilConditionHandler::_getConditionsOfTarget($cont_ref_id,$node["child"], "st");
1214  foreach ($tconds as $tcond)
1215  {
1216  // store all missing preconditions
1217  if (!ilConditionHandler::_checkCondition($tcond["id"]))
1218  {
1219  $conds[] = $tcond;
1220  }
1221  }
1222  }
1223  }
1224  }
1225 
1226  return $conds;
1227  }
static _getConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_target_type="")
get all conditions of target object
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
_checkCondition($a_id, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
$path
Definition: index.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getMissingPreconditionsTopChapter()

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

get top chapter of page for that any precondition is missing

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

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

Referenced by ilLMPresentationGUI\showPreconditionsOfPage().

1233  {
1234  $lm_tree = new ilTree($cont_obj_id);
1235  $lm_tree->setTableNames('lm_tree','lm_data');
1236  $lm_tree->setTreeTablePK("lm_id");
1237 
1238  $conds = array();
1239  if ($lm_tree->isInTree($page_id))
1240  {
1241  // get full path of page
1242  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1243  foreach ($path as $node)
1244  {
1245  if ($node["type"] == "st")
1246  {
1247  // get all preconditions of upper chapters
1248  $tconds = ilConditionHandler::_getConditionsOfTarget($cont_obj_ref_id,$node["child"], "st");
1249  foreach ($tconds as $tcond)
1250  {
1251  // look for missing precondition
1252  if (!ilConditionHandler::_checkCondition($tcond["id"]))
1253  {
1254  return $node["child"];
1255  }
1256  }
1257  }
1258  }
1259  }
1260 
1261  return "";
1262  }
static _getConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_target_type="")
get all conditions of target object
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
_checkCondition($a_id, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
$path
Definition: index.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getNrLMsIndividualStyles()

ilObjContentObject::_getNrLMsIndividualStyles ( )

get number of learning modules with individual styles

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

Referenced by ilObjStyleSettingsGUI\editContentStylesObject().

765  {
766  global $ilDB;
767 
768  // joining with style table (not perfectly nice)
769  $q = "SELECT count(*) as cnt FROM content_object, style_data ".
770  " WHERE stylesheet = style_data.id ".
771  " AND standard = ".$ilDB->quote(0, "integer");
772  $cset = $ilDB->query($q);
773  $crow = $ilDB->fetchAssoc($cset);
774 
775  return (int) $crow["cnt"];
776  }
+ Here is the caller graph for this function:

◆ _getNrLMsNoStyle()

ilObjContentObject::_getNrLMsNoStyle ( )

get number of learning modules assigned no style

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

Referenced by ilObjStyleSettingsGUI\editContentStylesObject().

782  {
783  global $ilDB;
784 
785  $q = "SELECT count(*) as cnt FROM content_object ".
786  " WHERE stylesheet = ".$ilDB->quote(0, "integer");
787  $cset = $ilDB->query($q);
788  $crow = $ilDB->fetchAssoc($cset);
789 
790  return (int) $crow["cnt"];
791  }
+ 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 748 of file class.ilObjContentObject.php.

Referenced by ilObjStyleSettingsGUI\editContentStylesObject().

749  {
750  global $ilDB;
751 
752  $q = "SELECT count(*) as cnt FROM content_object ".
753  " WHERE stylesheet = ".$ilDB->quote($a_style_id, "integer");
754  $cset = $ilDB->query($q);
755  $crow = $ilDB->fetchAssoc($cset);
756 
757  return (int) $crow["cnt"];
758  }
+ Here is the caller graph for this function:

◆ _lookupContObjIdByStyleId()

ilObjContentObject::_lookupContObjIdByStyleId (   $a_style_id)

lookup style sheet ID

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

References $res.

Referenced by ilObjStyleSheet\_getClonableContentStyles().

713  {
714  global $ilDB;
715 
716  $q = "SELECT id FROM content_object ".
717  " WHERE stylesheet = ".$ilDB->quote($a_style_id, "integer");
718  $res = $ilDB->query($q);
719  $obj_ids = array();
720  while($cont = $ilDB->fetchAssoc($res))
721  {
722  $obj_ids[] = $cont["id"];
723  }
724  return $obj_ids;
725  }
+ Here is the caller graph for this function:

◆ _lookupDisableDefaultFeedback()

static ilObjContentObject::_lookupDisableDefaultFeedback (   $a_id)
static

Lookup disable default feedback.

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

References $res.

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

731  {
732  global $ilDB;
733 
734  $q = "SELECT disable_def_feedback FROM content_object ".
735  " WHERE id = ".$ilDB->quote($a_id, "integer");
736  $res = $ilDB->query($q);
737  $rec = $ilDB->fetchAssoc($res);
738 
739  return $rec["disable_def_feedback"];
740  }
+ Here is the caller graph for this function:

◆ _lookupOnline()

ilObjContentObject::_lookupOnline (   $a_id)

check wether content object is online

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

References $lm_set, and ilUtil\yn2tf().

1107  {
1108  global $ilDB;
1109 
1110 //echo "class ilObjContentObject::_lookupOnline($a_id) called. Use Access class instead.";
1111 
1112  $q = "SELECT is_online FROM content_object WHERE id = ".$ilDB->quote($a_id, "integer");
1113  $lm_set = $ilDB->query($q);
1114  $lm_rec = $ilDB->fetchAssoc($lm_set);
1115 
1116  return ilUtil::yn2tf($lm_rec["is_online"]);
1117  }
$lm_set
static yn2tf($a_yn)
convert "y"/"n" to true/false
+ Here is the call graph for this function:

◆ _lookupStyleSheetId()

ilObjContentObject::_lookupStyleSheetId (   $a_cont_obj_id)

lookup style sheet ID

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

References $res.

Referenced by ilPCParagraphGUI\setStyle().

698  {
699  global $ilDB;
700 
701  $q = "SELECT stylesheet FROM content_object ".
702  " WHERE id = ".$ilDB->quote($a_cont_obj_id, "integer");
703  $res = $ilDB->query($q);
704  $sheet = $ilDB->fetchAssoc($res);
705 
706  return $sheet["stylesheet"];
707  }
+ 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 661 of file class.ilObjContentObject.php.

References ilObject\$ilias.

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

662  {
663  global $ilDB, $ilias;
664 
665  if ($a_from_style < 0) // change / delete all individual styles
666  {
667  $q = "SELECT stylesheet FROM content_object, style_data ".
668  " WHERE content_object.stylesheet = style_data.id ".
669  " AND style_data.standard = ".$ilDB->quote(0, "integer").
670  " AND content_object.stylesheet > ".$ilDB->quote(0, "integer");
671  $style_set = $ilDB->query($q);
672  while($style_rec = $ilDB->fetchAssoc($style_set))
673  {
674  // assign learning modules to new style
675  $q = "UPDATE content_object SET ".
676  " stylesheet = ".$ilDB->quote((int) $a_to_style, "integer").
677  " WHERE stylesheet = ".$ilDB->quote($style_rec["stylesheet"], "integer");
678  $ilDB->manipulate($q);
679 
680  // delete style
681  $style_obj =& $ilias->obj_factory->getInstanceByObjId($style_rec["stylesheet"]);
682  $style_obj->delete();
683  }
684  }
685  else
686  {
687  $q = "UPDATE content_object SET ".
688  " stylesheet = ".$ilDB->quote((int) $a_to_style, "integer").
689  " WHERE stylesheet = ".$ilDB->quote($a_from_style, "integer");
690  $ilDB->manipulate($q);
691  }
692  }
+ Here is the caller graph for this function:

◆ addFirstChapterAndPage()

ilObjContentObject::addFirstChapterAndPage ( )

Add first chapter and page.

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

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

363  {
364  global $lng;
365 
366  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
367  include_once("./Modules/LearningModule/classes/class.ilStructureObject.php");
368  include_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
369 
370  $root_id = $this->lm_tree->getRootId();
371 
372  // chapter
373  $chap = new ilStructureObject($this);
374  $chap->setType("st");
375  $chap->setTitle($lng->txt("cont_new_chap"));
376  $chap->setLMId($this->getId());
377  $chap->create();
378  ilLMObject::putInTree($chap, $root_id, IL_FIRST_NODE);
379 
380  // page
381  $page = new ilLMPageObject($this);
382  $page->setType("pg");
383  $page->setTitle($lng->txt("cont_new_page"));
384  $page->setLMId($this->getId());
385  $page->create();
386  ilLMObject::putInTree($page, $chap->getId(), IL_FIRST_NODE);
387  }
Class ilLMPageObject.
getId()
get object id public
const IL_FIRST_NODE
Definition: class.ilTree.php:5
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
put this object into content object tree
Class ilStructreObject.
+ Here is the call graph for this function:

◆ autoLinkGlossaryTerms()

ilObjContentObject::autoLinkGlossaryTerms (   $a_glo_id)

Auto link glossary terms.

Parameters

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

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

3265  {
3266  // get terms
3267  include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
3268  $terms = ilGlossaryTerm::getTermList($a_glo_id);
3269 
3270  // each get page: get content
3271  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
3272  $pages = ilLMPage::getAllPages($this->getType(), $this->getId());
3273 
3274  // determine terms that occur in the page
3275  $found_pages = array();
3276  foreach ($pages as $p)
3277  {
3278  $pg = new ilLMPage($p["id"]);
3279  $c = $pg->getXMLContent();
3280  foreach ($terms as $t)
3281  {
3282  if (is_int(stripos($c, $t["term"])))
3283  {
3284  $found_pages[$p["id"]]["terms"][] = $t;
3285  if (!is_object($found_pages[$p["id"]]["page"]))
3286  {
3287  $found_pages[$p["id"]]["page"] = $pg;
3288  }
3289  }
3290  }
3291  reset($terms);
3292  }
3293 
3294  // ilPCParagraph autoLinkGlossariesPage with page and terms
3295  include_once("./Services/COPage/classes/class.ilPCParagraph.php");
3296  foreach ($found_pages as $id => $fp)
3297  {
3298  ilPCParagraph::autoLinkGlossariesPage($fp["page"], $fp["terms"]);
3299  }
3300 
3301 
3302  }
static getTermList($a_glo_id, $searchterm="", $a_first_letter="", $a_def="", $a_tax_node=0, $a_add_amet_fields=false, $a_amet_filter="")
Get all terms for given set of glossary ids.
static getAllPages($a_parent_type, $a_parent_id, $a_lang="-")
Get all pages for parent object.
static autoLinkGlossariesPage($a_page, $a_terms)
Auto link glossary of whole page.
getId()
get object id public
getType()
get object type public
Extension of ilPageObject for learning modules.
+ Here is the call graph for this function:

◆ checkTree()

ilObjContentObject::checkTree ( )

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

References ilObject\getId().

Referenced by executeDragDrop().

1349  {
1350  $tree = new ilTree($this->getId());
1351  $tree->setTableNames('lm_tree','lm_data');
1352  $tree->setTreeTablePK("lm_id");
1353  $tree->checkTree();
1354  $tree->checkTreeChilds();
1355 //echo "checked";
1356  }
getId()
get object id public
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanFrames()

ilObjContentObject::cleanFrames ( )

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

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

969  {
970  return $this->clean_frames;
971  }
+ Here is the caller graph for this function:

◆ cloneObject()

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

Clone learning module.

public

Parameters
inttarget ref_id
intcopy id

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

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

3134  {
3135  global $ilDB, $ilUser, $ilias;
3136 
3137  $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
3138  $this->cloneMetaData($new_obj);
3139  //$new_obj->createProperties();
3140 
3141  $new_obj->setTitle($this->getTitle());
3142  $new_obj->setDescription($this->getDescription());
3143  $new_obj->setLayoutPerPage($this->getLayoutPerPage());
3144  $new_obj->setLayout($this->getLayout());
3145  $new_obj->setTOCMode($this->getTOCMode());
3146  $new_obj->setActiveLMMenu($this->isActiveLMMenu());
3147  $new_obj->setActiveTOC($this->isActiveTOC());
3148  $new_obj->setActiveNumbering($this->isActiveNumbering());
3149  $new_obj->setActivePrintView($this->isActivePrintView());
3150  $new_obj->setActivePreventGlossaryAppendix($this->isActivePreventGlossaryAppendix());
3151  $new_obj->setActiveDownloads($this->isActiveDownloads());
3152  $new_obj->setActiveDownloadsPublic($this->isActiveDownloadsPublic());
3153  $new_obj->setPublicNotes($this->publicNotes());
3154  $new_obj->setCleanFrames($this->cleanFrames());
3155  $new_obj->setHistoryUserComments($this->isActiveHistoryUserComments());
3156  $new_obj->setPublicAccessMode($this->getPublicAccessMode());
3157  $new_obj->setPageHeader($this->getPageHeader());
3158  $new_obj->setRating($this->hasRating());
3159  $new_obj->setRatingPages($this->hasRatingPages());
3160 
3161  $new_obj->update();
3162 
3163  $new_obj->createLMTree();
3164 
3165  // copy style
3166  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
3167  $style_id = $this->getStyleSheetId();
3168  if ($style_id > 0 &&
3170  {
3171  $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
3172  $new_id = $style_obj->ilClone();
3173  $new_obj->setStyleSheetId($new_id);
3174  $new_obj->update();
3175  }
3176 
3177  // copy content
3178  $this->copyAllPagesAndChapters($new_obj);
3179 
3180  // Copy learning progress settings
3181  include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
3182  $obj_settings = new ilLPObjSettings($this->getId());
3183  $obj_settings->cloneSettings($new_obj->getId());
3184  unset($obj_settings);
3185 
3186  // copy (page) multilang settings
3187  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
3188  $ot = ilObjectTranslation::getInstance($this->getId());
3189  $ot->copy($new_obj->getId());
3190 
3191  return $new_obj;
3192  }
getStyleSheetId()
get ID of assigned style sheet object
getLayout()
get default page layout of content object (see directory layouts/)
getPublicAccessMode()
get public access mode ("complete" | "selected")
getLayoutPerPage()
Get layout per page.
copyAllPagesAndChapters($a_target_obj)
Copy all pages and chapters.
getPageHeader()
get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER)
getId()
get object id public
getTOCMode()
get toc mode ("chapters" | "pages")
cloneMetaData($target_obj)
Copy meta data.
_lookupStandard($a_id)
Lookup standard flag.
global $ilUser
Definition: imgupload.php:15
static getInstance($a_obj_id)
Get instance.
getTitle()
get title of content object
getDescription()
get description of content object
+ Here is the call graph for this function:

◆ copyAllPagesAndChapters()

ilObjContentObject::copyAllPagesAndChapters (   $a_target_obj)

Copy all pages and chapters.

Parameters
object$a_target_objtarget learning module

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

References ilObject\getId(), ilLMPageObject\getPageList(), IL_LAST_NODE, ilLMObject\pasteTree(), and ilLMObject\updateInternalLinks().

Referenced by cloneObject().

3200  {
3201  $parent_id = $a_target_obj->lm_tree->readRootId();
3202 
3203  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
3204  include_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
3205 
3206  // get all chapters of root lm
3207  $chapters = $this->lm_tree->getChildsByType($this->lm_tree->readRootId(), "st");
3208  $copied_nodes = array();
3209  //$time = time();
3210  foreach ($chapters as $chap)
3211  {
3212  $cid = ilLMObject::pasteTree($a_target_obj, $chap["child"], $parent_id,
3213  IL_LAST_NODE, $time, $copied_nodes, true, $this);
3214  $target = $cid;
3215  }
3216 
3217  // copy free pages
3218  $pages = ilLMPageObject::getPageList($this->getId());
3219  foreach ($pages as $p)
3220  {
3221  if (!$this->lm_tree->isInTree($p["obj_id"]))
3222  {
3223  $item = new ilLMPageObject($this, $p["obj_id"]);
3224  $target_item = $item->copy($a_target_obj);
3225  $copied_nodes[$item->getId()] = $target_item->getId();
3226  }
3227  }
3228 
3229  ilLMObject::updateInternalLinks($copied_nodes);
3230 
3231  $a_target_obj->checkTree();
3232 
3233  }
static updateInternalLinks($a_copied_nodes, $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
static pasteTree($a_target_lm, $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_source_lm=null)
Paste item (tree) from clipboard to current lm.
Class ilLMPageObject.
getId()
get object id public
getPageList($lm_id)
static
const IL_LAST_NODE
Definition: class.ilTree.php:4
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilObjContentObject::create (   $a_no_meta_data = false)

create content object

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

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

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

◆ createExportDirectory()

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

creates data directory for export files (data_dir/lm_data/lm_<id>/export, depending on data directory that is set in ILIAS setup/ini)

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

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

Referenced by ilObjDlBook\export().

479  {
480  $lm_data_dir = ilUtil::getDataDir()."/lm_data";
481  if(!is_writable($lm_data_dir))
482  {
483  $this->ilias->raiseError("Content object Data Directory (".$lm_data_dir
484  .") not writeable.",$this->ilias->error_obj->FATAL);
485  }
486  // create learning module directory (data_dir/lm_data/lm_<id>)
487  $lm_dir = $lm_data_dir."/lm_".$this->getId();
488  ilUtil::makeDir($lm_dir);
489  if(!@is_dir($lm_dir))
490  {
491  $this->ilias->raiseError("Creation of Learning Module Directory failed.",$this->ilias->error_obj->FATAL);
492  }
493  // create Export subdirectory (data_dir/lm_data/lm_<id>/Export)
494  switch ($a_type)
495  {
496  // scorm
497  case "scorm":
498  $export_dir = $lm_dir."/export_scorm";
499  break;
500 
501  default: // = xml
502  if (substr($a_type, 0, 4) == "html")
503  {
504  $export_dir = $lm_dir."/export_".$a_type;
505  }
506  else
507  {
508  $export_dir = $lm_dir."/export";
509  }
510  break;
511  }
512  ilUtil::makeDir($export_dir);
513 
514  if(!@is_dir($export_dir))
515  {
516  $this->ilias->raiseError("Creation of Export Directory failed.",$this->ilias->error_obj->FATAL);
517  }
518  }
getId()
get object id public
redirection script todo: (a better solution should control the processing via a xml file) ...
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createImportDirectory()

ilObjContentObject::createImportDirectory ( )

creates data directory for import files (data_dir/lm_data/lm_<id>/import, depending on data directory that is set in ILIAS setup/ini)

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

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

Referenced by importFromZipFile().

405  {
406  $lm_data_dir = ilUtil::getDataDir()."/lm_data";
407  if(!is_writable($lm_data_dir))
408  {
409  $this->ilias->raiseError("Content object Data Directory (".$lm_data_dir
410  .") not writeable.",$this->ilias->error_obj->FATAL);
411  }
412 
413  // create learning module directory (data_dir/lm_data/lm_<id>)
414  $lm_dir = $lm_data_dir."/lm_".$this->getId();
415  ilUtil::makeDir($lm_dir);
416  if(!@is_dir($lm_dir))
417  {
418  $this->ilias->raiseError("Creation of Learning Module Directory failed.",$this->ilias->error_obj->FATAL);
419  }
420 
421  // create import subdirectory (data_dir/lm_data/lm_<id>/import)
422  $import_dir = $lm_dir."/import";
424  if(!@is_dir($import_dir))
425  {
426  $this->ilias->raiseError("Creation of Import Directory failed.",$this->ilias->error_obj->FATAL);
427  }
428  }
getId()
get object id public
redirection script todo: (a better solution should control the processing via a xml file) ...
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createLMTree()

ilObjContentObject::createLMTree ( )

create content object tree (that stores structure object hierarchie)

todo: rename LM to ConOb

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

References ilObject\getId().

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

◆ createProperties()

ilObjContentObject::createProperties ( )

create new properties record

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

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

Referenced by create().

1095  {
1096  global $ilDB;
1097 
1098  $q = "INSERT INTO content_object (id) VALUES (".$ilDB->quote($this->getId(), "integer").")";
1099  $ilDB->manipulate($q);
1100  $this->readProperties(); // to get db default values
1101  }
getId()
get object id public
readProperties()
read content object properties
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilObjContentObject::delete ( )

delete learning module and all related data

this method has been tested on may 9th 2004 meta data, content object data, data directory, bib items learning module tree and pages have been deleted correctly as desired

public

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

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

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

557  {
558  global $ilDB;
559 
560  global $ilBench;
561 
562  // always call parent delete function first!!
563  if (!parent::delete())
564  {
565  return false;
566  }
567 
568  // delete lm object data
569  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
571 
572  // delete meta data of content object
573  $this->deleteMetaData();
574 
575  // delete bibitem data
576  $nested = new ilNestedSetXML();
577  $nested->init($this->getId(), "bib");
578  $nested->deleteAllDBData();
579 
580 
581  // delete learning module tree
582  $this->lm_tree->removeTree($this->lm_tree->getTreeId());
583 
584  // delete data directory
586 
587  // delete content object record
588  $q = "DELETE FROM content_object WHERE id = ".
589  $ilDB->quote($this->getId(), "integer");
590  $ilDB->manipulate($q);
591 
592  // delete lm menu entries
593  $q = "DELETE FROM lm_menu WHERE lm_id = ".
594  $ilDB->quote($this->getId(), "integer");
595  $ilDB->manipulate($q);
596 
597  // remove auto glossary entries
598  $ilDB->manipulate("DELETE FROM lm_glossaries WHERE ".
599  " lm_id = ".$ilDB->quote($this->getId(), "integer")
600  );
601 
602 
603  return true;
604  }
Class NestedSetXML functions for storing XML-Data into nested-set-database-strcture.
getId()
get object id public
getDataDirectory()
get data directory
global $ilBench
Definition: ilias.php:18
deleteMetaData()
delete meta data entry
_deleteAllObjectData(&$a_cobj)
delete all objects of content object (digi book / learning module)
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ executeDragDrop()

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

Execute Drag Drop Action.

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

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

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

2742  {
2743  $lmtree = new ilTree($this->getId());
2744  $lmtree->setTableNames('lm_tree','lm_data');
2745  $lmtree->setTreeTablePK("lm_id");
2746 //echo "-".$source_id."-".$target_id."-".$first_child."-".$as_subitem."-";
2747  $source_obj = ilLMObjectFactory::getInstance($this, $source_id, true);
2748  $source_obj->setLMId($this->getId());
2749 
2750  if (!$first_child)
2751  {
2752  $target_obj = ilLMObjectFactory::getInstance($this, $target_id, true);
2753  $target_obj->setLMId($this->getId());
2754  $target_parent = $lmtree->getParentId($target_id);
2755  }
2756 
2757  // handle pages
2758  if ($source_obj->getType() == "pg")
2759  {
2760 //echo "1";
2761  if ($lmtree->isInTree($source_obj->getId()))
2762  {
2763  $node_data = $lmtree->getNodeData($source_obj->getId());
2764 
2765  // cut on move
2766  if ($movecopy == "move")
2767  {
2768  $parent_id = $lmtree->getParentId($source_obj->getId());
2769  $lmtree->deleteTree($node_data);
2770 
2771  // write history entry
2772  require_once("./Services/History/classes/class.ilHistory.php");
2773  ilHistory::_createEntry($source_obj->getId(), "cut",
2774  array(ilLMObject::_lookupTitle($parent_id), $parent_id),
2775  $this->getType().":pg");
2776  ilHistory::_createEntry($parent_id, "cut_page",
2777  array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
2778  $this->getType().":st");
2779  }
2780  else
2781  {
2782  // copy page
2783  $new_page =& $source_obj->copy();
2784  $source_id = $new_page->getId();
2785  $source_obj =& $new_page;
2786  }
2787 
2788  // paste page
2789  if(!$lmtree->isInTree($source_obj->getId()))
2790  {
2791  if ($first_child) // as first child
2792  {
2793  $target_pos = IL_FIRST_NODE;
2794  $parent = $target_id;
2795  }
2796  else if ($as_subitem) // as last child
2797  {
2798  $parent = $target_id;
2799  $target_pos = IL_FIRST_NODE;
2800  $pg_childs =& $lmtree->getChildsByType($parent, "pg");
2801  if (count($pg_childs) != 0)
2802  {
2803  $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
2804  }
2805  }
2806  else // at position
2807  {
2808  $target_pos = $target_id;
2809  $parent = $target_parent;
2810  }
2811 
2812  // insert page into tree
2813  $lmtree->insertNode($source_obj->getId(),
2814  $parent, $target_pos);
2815 
2816  // write history entry
2817  if ($movecopy == "move")
2818  {
2819  // write history comments
2820  include_once("./Services/History/classes/class.ilHistory.php");
2821  ilHistory::_createEntry($source_obj->getId(), "paste",
2822  array(ilLMObject::_lookupTitle($parent), $parent),
2823  $this->getType().":pg");
2824  ilHistory::_createEntry($parent, "paste_page",
2825  array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
2826  $this->getType().":st");
2827  }
2828 
2829  }
2830  }
2831  }
2832 
2833  // handle chapters
2834  if ($source_obj->getType() == "st")
2835  {
2836 //echo "2";
2837  $source_node = $lmtree->getNodeData($source_id);
2838  $subnodes = $lmtree->getSubtree($source_node);
2839 
2840  // check, if target is within subtree
2841  foreach ($subnodes as $subnode)
2842  {
2843  if($subnode["obj_id"] == $target_id)
2844  {
2845  return;
2846  }
2847  }
2848 
2849  $target_pos = $target_id;
2850 
2851  if ($first_child) // as first subchapter
2852  {
2853  $target_pos = IL_FIRST_NODE;
2854  $target_parent = $target_id;
2855 
2856  $pg_childs =& $lmtree->getChildsByType($target_parent, "pg");
2857  if (count($pg_childs) != 0)
2858  {
2859  $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
2860  }
2861  }
2862  else if ($as_subitem) // as last subchapter
2863  {
2864  $target_parent = $target_id;
2865  $target_pos = IL_FIRST_NODE;
2866  $childs =& $lmtree->getChilds($target_parent);
2867  if (count($childs) != 0)
2868  {
2869  $target_pos = $childs[count($childs) - 1]["obj_id"];
2870  }
2871  }
2872 
2873  // insert into
2874 /*
2875  if ($position == "into")
2876  {
2877  $target_parent = $target_id;
2878  $target_pos = IL_FIRST_NODE;
2879 
2880  // if target_pos is still first node we must skip all pages
2881  if ($target_pos == IL_FIRST_NODE)
2882  {
2883  $pg_childs =& $lmtree->getChildsByType($target_parent, "pg");
2884  if (count($pg_childs) != 0)
2885  {
2886  $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
2887  }
2888  }
2889  }
2890 */
2891 
2892 
2893  // delete source tree
2894  if ($movecopy == "move")
2895  {
2896  $lmtree->deleteTree($source_node);
2897  }
2898  else
2899  {
2900  // copy chapter (incl. subcontents)
2901  $new_chapter =& $source_obj->copy($lmtree, $target_parent, $target_pos);
2902  }
2903 
2904  if (!$lmtree->isInTree($source_id))
2905  {
2906  $lmtree->insertNode($source_id, $target_parent, $target_pos);
2907 
2908  // insert moved tree
2909  if ($movecopy == "move")
2910  {
2911  foreach ($subnodes as $node)
2912  {
2913  if($node["obj_id"] != $source_id)
2914  {
2915  $lmtree->insertNode($node["obj_id"], $node["parent"]);
2916  }
2917  }
2918  }
2919  }
2920 
2921  // check the tree
2922  $this->checkTree();
2923  }
2924 
2925  $this->checkTree();
2926  }
getInstance(&$a_content_obj, $a_id=0, $a_halt=true)
$target_id
Definition: goto.php:88
static _lookupTitle($a_obj_id)
Lookup title.
_createEntry($a_obj_id, $a_action, $a_info_params="", $a_obj_type="", $a_user_comment="", $a_update_last=false)
Creates a new history entry for an object.
getId()
get object id public
const IL_FIRST_NODE
Definition: class.ilTree.php:5
getType()
get object type public
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
+ Here is the call graph for this function:

◆ exportFileItems()

ilObjContentObject::exportFileItems (   $a_target_dir,
$expLog 
)

export files of file itmes

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

Referenced by exportXML().

1693  {
1694  include_once("./Modules/File/classes/class.ilObjFile.php");
1695 
1696  foreach ($this->file_ids as $file_id)
1697  {
1698  $expLog->write(date("[y-m-d H:i:s] ")."File Item ".$file_id);
1699  $file_obj = new ilObjFile($file_id, false);
1700  $file_obj->export($a_target_dir);
1701  unset($file_obj);
1702  }
1703  }
Class ilObjFile.
+ Here is the caller graph for this function:

◆ exportFO()

ilObjContentObject::exportFO ( $a_xml_writer,
  $a_target_dir 
)

export object to fo

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

References $ilBench, and exportFOStructureObjects().

2628  {
2629  global $ilBench;
2630 
2631  // fo:root (start)
2632  $attrs = array();
2633  $attrs["xmlns:fo"] = "http://www.w3.org/1999/XSL/Format";
2634  $a_xml_writer->xmlStartTag("fo:root", $attrs);
2635 
2636  // fo:layout-master-set (start)
2637  $attrs = array();
2638  $a_xml_writer->xmlStartTag("fo:layout-master-set", $attrs);
2639 
2640  // fo:simple-page-master (start)
2641  $attrs = array();
2642  $attrs["master-name"] = "DinA4";
2643  $attrs["page-height"] = "29.7cm";
2644  $attrs["page-width"] = "21cm";
2645  $attrs["margin-top"] = "4cm";
2646  $attrs["margin-bottom"] = "1cm";
2647  $attrs["margin-left"] = "2.8cm";
2648  $attrs["margin-right"] = "7.3cm";
2649  $a_xml_writer->xmlStartTag("fo:simple-page-master", $attrs);
2650 
2651  // fo:region-body (complete)
2652  $attrs = array();
2653  $attrs["margin-top"] = "0cm";
2654  $attrs["margin-bottom"] = "1.25cm";
2655  $a_xml_writer->xmlElement("fo:region-body", $attrs);
2656 
2657  // fo:region-before (complete)
2658  $attrs = array();
2659  $attrs["extent"] = "1cm";
2660  $a_xml_writer->xmlElement("fo:region-before", $attrs);
2661 
2662  // fo:region-after (complete)
2663  $attrs = array();
2664  $attrs["extent"] = "1cm";
2665  $a_xml_writer->xmlElement("fo:region-after", $attrs);
2666 
2667  // fo:simple-page-master (end)
2668  $a_xml_writer->xmlEndTag("fo:simple-page-master");
2669 
2670  // fo:layout-master-set (end)
2671  $a_xml_writer->xmlEndTag("fo:layout-master-set");
2672 
2673  // fo:page-sequence (start)
2674  $attrs = array();
2675  $attrs["master-reference"] = "DinA4";
2676  $a_xml_writer->xmlStartTag("fo:page-sequence", $attrs);
2677 
2678  // fo:flow (start)
2679  $attrs = array();
2680  $attrs["flow-name"] = "xsl-region-body";
2681  $a_xml_writer->xmlStartTag("fo:flow", $attrs);
2682 
2683 
2684  // StructureObjects
2685  //$expLog->write(date("[y-m-d H:i:s] ")."Start Export Structure Objects");
2686  $ilBench->start("ContentObjectExport", "exportFOStructureObjects");
2687  $this->exportFOStructureObjects($a_xml_writer, $expLog);
2688  $ilBench->stop("ContentObjectExport", "exportFOStructureObjects");
2689  //$expLog->write(date("[y-m-d H:i:s] ")."Finished Export Structure Objects");*/
2690 
2691  // fo:flow (end)
2692  $a_xml_writer->xmlEndTag("fo:flow");
2693 
2694  // fo:page-sequence (end)
2695  $a_xml_writer->xmlEndTag("fo:page-sequence");
2696 
2697  // fo:root (end)
2698  $a_xml_writer->xmlEndTag("fo:root");
2699  }
exportFOStructureObjects(&$a_xml_writer)
export structure objects to fo
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ exportFOStructureObjects()

ilObjContentObject::exportFOStructureObjects ( $a_xml_writer)

export structure objects to fo

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

Referenced by exportFO().

2708  {
2709  $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
2710  foreach ($childs as $child)
2711  {
2712  if($child["type"] != "st")
2713  {
2714  continue;
2715  }
2716 
2717  $structure_obj = new ilStructureObject($this, $child["obj_id"]);
2718  $structure_obj->exportFO($a_xml_writer, $expLog);
2719  unset($structure_obj);
2720  }
2721  }
Class ilStructreObject.
+ Here is the caller graph for this function:

◆ exportHTML()

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

export html package

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

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

Referenced by exportSCORM().

1951  {
1952  global $tpl, $ilBench, $ilLocator, $ilUser, $ilObjDataCache, $ilias;
1953 
1954  $user_lang = $ilUser->getLanguage();
1955  if ($a_lang != "")
1956  {
1957  $ilUser->setLanguage($a_lang);
1958  $ilUser->setCurrentLanguage($a_lang);
1959  $ilObjDataCache->deleteCachedEntry($this->getId());
1960  }
1961 
1962  // initialize temporary target directory
1963  ilUtil::delDir($a_target_dir);
1964  ilUtil::makeDir($a_target_dir);
1965  $mob_dir = $a_target_dir."/mobs";
1966  ilUtil::makeDir($mob_dir);
1967  $file_dir = $a_target_dir."/files";
1968  ilUtil::makeDir($file_dir);
1969  $teximg_dir = $a_target_dir."/teximg";
1970  ilUtil::makeDir($teximg_dir);
1971  $style_dir = $a_target_dir."/style";
1972  ilUtil::makeDir($style_dir);
1973  $style_img_dir = $a_target_dir."/style/images";
1974  ilUtil::makeDir($style_img_dir);
1975  $content_style_dir = $a_target_dir."/content_style";
1976  ilUtil::makeDir($content_style_dir);
1977  $content_style_img_dir = $a_target_dir."/content_style/images";
1978  ilUtil::makeDir($content_style_img_dir);
1979  $GLOBALS["teximgcnt"] = 0;
1980 
1981  // export system style sheet
1982  $location_stylesheet = ilUtil::getStyleSheetLocation("filesystem");
1983  $style_name = $ilUser->prefs["style"].".css";
1984  copy($location_stylesheet, $style_dir."/".$style_name);
1985  $fh = fopen($location_stylesheet, "r");
1986  $css = fread($fh, filesize($location_stylesheet));
1987  preg_match_all("/url\(([^\)]*)\)/",$css,$files);
1988  foreach (array_unique($files[1]) as $fileref)
1989  {
1990  $fileref = dirname($location_stylesheet)."/".$fileref;
1991  if (is_file($fileref))
1992  {
1993  copy($fileref, $style_img_dir."/".basename($fileref));
1994  }
1995  }
1996  fclose($fh);
1997  $location_stylesheet = ilUtil::getStyleSheetLocation();
1998 
1999  // export content style sheet
2000  $ilBench->start("ExportHTML", "exportContentStyle");
2001  if ($this->getStyleSheetId() < 1)
2002  {
2003  $cont_stylesheet = "./Services/COPage/css/content.css";
2004 
2005  $css = fread(fopen($cont_stylesheet,'r'),filesize($cont_stylesheet));
2006  preg_match_all("/url\(([^\)]*)\)/",$css,$files);
2007  foreach (array_unique($files[1]) as $fileref)
2008  {
2009  if (is_file(str_replace("..", ".", $fileref)))
2010  {
2011  copy(str_replace("..", ".", $fileref), $content_style_img_dir."/".basename($fileref));
2012  }
2013  $css = str_replace($fileref, "images/".basename($fileref),$css);
2014  }
2015  fwrite(fopen($content_style_dir."/content.css",'w'),$css);
2016  }
2017  else
2018  {
2019  $style = new ilObjStyleSheet($this->getStyleSheetId());
2020  $style->writeCSSFile($content_style_dir."/content.css", "images");
2021  $style->copyImagesToDir($content_style_img_dir);
2022  }
2023  $ilBench->stop("ExportHTML", "exportContentStyle");
2024 
2025  // export syntax highlighting style
2026  $syn_stylesheet = ilObjStyleSheet::getSyntaxStylePath();
2027  copy($syn_stylesheet, $a_target_dir."/syntaxhighlight.css");
2028 
2029  // get learning module presentation gui class
2030  include_once("./Modules/LearningModule/classes/class.ilLMPresentationGUI.php");
2031  $_GET["cmd"] = "nop";
2032  $lm_gui =& new ilLMPresentationGUI();
2033  $lm_gui->setOfflineMode(true);
2034  $lm_gui->setOfflineDirectory($a_target_dir);
2035  $lm_gui->setExportFormat($a_export_format);
2036  $ot = ilObjectTranslation::getInstance($this->getId());
2037  if ($a_lang != "")
2038  {
2039  if ($a_lang == $ot->getMasterLanguage())
2040  {
2041  $lm_gui->lang = "";
2042  }
2043  else
2044  {
2045  $lm_gui->lang = $a_lang;
2046  }
2047  }
2048 
2049  // export pages
2050  $ilBench->start("ExportHTML", "exportHTMLPages");
2051  $this->exportHTMLPages($lm_gui, $a_target_dir, $lm_gui->lang);
2052  $ilBench->stop("ExportHTML", "exportHTMLPages");
2053 
2054  // export glossary terms
2055  $ilBench->start("ExportHTML", "exportHTMLGlossaryTerms");
2056  $this->exportHTMLGlossaryTerms($lm_gui, $a_target_dir);
2057  $ilBench->stop("ExportHTML", "exportHTMLGlossaryTerms");
2058 
2059  // export all media objects
2060  $ilBench->start("ExportHTML", "exportHTMLMediaObjects");
2061  $linked_mobs = array();
2062  foreach ($this->offline_mobs as $mob)
2063  {
2064  if (ilObject::_exists($mob) && ilObject::_lookupType($mob) == "mob")
2065  {
2066  $this->exportHTMLMOB($a_target_dir, $lm_gui, $mob, "_blank", $linked_mobs);
2067  }
2068  }
2069  $linked_mobs2 = array(); // mobs linked in link areas
2070  foreach ($linked_mobs as $mob)
2071  {
2072  if (ilObject::_exists($mob))
2073  {
2074  $this->exportHTMLMOB($a_target_dir, $lm_gui, $mob, "_blank", $linked_mobs2);
2075  }
2076  }
2077  $_GET["obj_type"] = "MediaObject";
2078  $_GET["obj_id"] = $a_mob_id;
2079  $_GET["cmd"] = "";
2080  $ilBench->stop("ExportHTML", "exportHTMLMediaObjects");
2081 
2082  // export all file objects
2083  $ilBench->start("ExportHTML", "exportHTMLFileObjects");
2084  foreach ($this->offline_files as $file)
2085  {
2086  $this->exportHTMLFile($a_target_dir, $file);
2087  }
2088  $ilBench->stop("ExportHTML", "exportHTMLFileObjects");
2089 
2090  // export questions (images)
2091  if (count($this->q_ids) > 0)
2092  {
2093  foreach ($this->q_ids as $q_id)
2094  {
2095  ilUtil::makeDirParents($a_target_dir."/assessment/0/".$q_id."/images");
2096  ilUtil::rCopy(ilUtil::getWebspaceDir()."/assessment/0/".$q_id."/images",
2097  $a_target_dir."/assessment/0/".$q_id."/images");
2098  }
2099  }
2100 
2101  // export table of contents
2102  $ilBench->start("ExportHTML", "exportHTMLTOC");
2103  $ilLocator->clearItems();
2104  if ($this->isActiveTOC())
2105  {
2106  $tpl = new ilTemplate("tpl.main.html", true, true);
2107  //$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2108  $content =& $lm_gui->showTableOfContents();
2109  $file = $a_target_dir."/table_of_contents.html";
2110 
2111  // open file
2112  if (!($fp = @fopen($file,"w+")))
2113  {
2114  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2115  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2116  }
2117  chmod($file, 0770);
2118  fwrite($fp, $content);
2119  fclose($fp);
2120  }
2121  $ilBench->stop("ExportHTML", "exportHTMLTOC");
2122 
2123  // export images
2124  $ilBench->start("ExportHTML", "exportHTMLImages");
2125  $image_dir = $a_target_dir."/images";
2126  ilUtil::makeDir($image_dir);
2127  ilUtil::makeDir($image_dir."/browser");
2128  copy(ilUtil::getImagePath("enlarge.png", false, "filesystem"),
2129  $image_dir."/enlarge.png");
2130  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
2131  $image_dir."/browser/plus.png");
2132  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
2133  $image_dir."/browser/minus.png");
2134  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
2135  $image_dir."/browser/blank.png");
2136  copy(ilUtil::getImagePath("spacer.png", false, "filesystem"),
2137  $image_dir."/spacer.png");
2138  copy(ilUtil::getImagePath("icon_st.png", false, "filesystem"),
2139  $image_dir."/icon_st.png");
2140  copy(ilUtil::getImagePath("icon_pg.png", false, "filesystem"),
2141  $image_dir."/icon_pg.png");
2142  copy(ilUtil::getImagePath("icon_st_s.png", false, "filesystem"),
2143  $image_dir."/icon_st_s.png");
2144  copy(ilUtil::getImagePath("icon_pg_s.png", false, "filesystem"),
2145  $image_dir."/icon_pg_s.png");
2146  copy(ilUtil::getImagePath("icon_lm.png", false, "filesystem"),
2147  $image_dir."/icon_lm.png");
2148  copy(ilUtil::getImagePath("icon_lm_s.png", false, "filesystem"),
2149  $image_dir."/icon_lm_s.png");
2150  copy(ilUtil::getImagePath("nav_arr_L.png", false, "filesystem"),
2151  $image_dir."/nav_arr_L.png");
2152  copy(ilUtil::getImagePath("nav_arr_R.png", false, "filesystem"),
2153  $image_dir."/nav_arr_R.png");
2154  copy(ilUtil::getImagePath("browser/forceexp.png", false, "filesystem"),
2155  $image_dir."/browser/forceexp.png");
2156 
2157  copy(ilUtil::getImagePath("download.png", false, "filesystem"),
2158  $image_dir."/download.png");
2159  $ilBench->stop("ExportHTML", "exportHTMLImages");
2160 
2161  // export flv/mp3 player
2162  $services_dir = $a_target_dir."/Services";
2163  ilUtil::makeDir($services_dir);
2164  $media_service_dir = $services_dir."/MediaObjects";
2165  ilUtil::makeDir($media_service_dir);
2166  include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
2167  $flv_dir = $a_target_dir."/".ilPlayerUtil::getFlashVideoPlayerDirectory();
2168  ilUtil::makeDir($flv_dir);
2169  $mp3_dir = $media_service_dir."/flash_mp3_player";
2170  ilUtil::makeDir($mp3_dir);
2171 // copy(ilPlayerUtil::getFlashVideoPlayerFilename(true),
2172 // $flv_dir."/".ilPlayerUtil::getFlashVideoPlayerFilename());
2174  include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
2177 
2178  // js files
2179  ilUtil::makeDir($a_target_dir.'/js');
2180  ilUtil::makeDir($a_target_dir.'/js/yahoo');
2181  ilUtil::makeDir($a_target_dir.'/css');
2182  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
2183  foreach (self::getSupplyingExportFiles($a_target_dir) as $f)
2184  {
2185  if ($f["source"] != "")
2186  {
2187  copy($f["source"], $f["target"]);
2188  }
2189  }
2190 
2191  // template workaround: reset of template
2192  $tpl = new ilTemplate("tpl.main.html", true, true);
2193  $tpl->setVariable("LOCATION_STYLESHEET",$location_stylesheet);
2194  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2195 
2196  if ($a_lang != "")
2197  {
2198  $ilUser->setLanguage($user_lang);
2199  $ilUser->setCurrentLanguage($user_lang);
2200  }
2201 
2202  // zip everything
2203  if ($a_zip_file)
2204  {
2205  if ($a_lang == "")
2206  {
2207  $zip_target_dir = $this->getExportDirectory("html");
2208  }
2209  else
2210  {
2211  $zip_target_dir = $this->getExportDirectory("html_".$a_lang);
2212  ilUtil::makeDir($zip_target_dir);
2213  }
2214 
2215  // zip it all
2216  $date = time();
2217  $zip_file = $zip_target_dir."/".$date."__".IL_INST_ID."__".
2218  $this->getType()."_".$this->getId().".zip";
2219 //echo "-".$a_target_dir."-".$zip_file."-"; exit;
2220  ilUtil::zip($a_target_dir, $zip_file);
2221  ilUtil::delDir($a_target_dir);
2222  }
2223  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
print $file
exportHTMLGlossaryTerms(&$a_lm_gui, $a_target_dir)
export glossary terms
getStyleSheetId()
get ID of assigned style sheet object
getExportDirectory($a_type="xml")
get export directory of lm
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
copyPlayerFilesToTargetDirectory($a_target_dir)
Copy css files to target dir.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
exportHTMLFile($a_target_dir, $a_file_id)
export file object
getSyntaxStylePath()
get syntax style path
Class ilLMPresentationGUI.
static createHTMLExportDirs($a_target_dir)
Create html export directories.
getId()
get object id public
$GLOBALS['ct_recipient']
exportHTMLMOB($a_target_dir, &$a_lm_gui, $a_mob_id, $a_frame, &$a_linked_mobs)
export media object to html
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
static getFlashVideoPlayerDirectory()
Get flash video player directory.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
getType()
get object type public
static _lookupType($a_id, $a_reference=false)
lookup object type
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
global $ilUser
Definition: imgupload.php:15
static getInstance($a_obj_id)
Get instance.
global $ilBench
Definition: ilias.php:18
Class ilObjStyleSheet.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static getWebspaceDir($mode="filesystem")
get webspace directory
exportHTMLPages(&$a_lm_gui, $a_target_dir, $a_lang="")
export all pages of learning module to html file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportHTMLFile()

ilObjContentObject::exportHTMLFile (   $a_target_dir,
  $a_file_id 
)

export file object

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

References ilUtil\makeDir().

Referenced by exportHTML().

2311  {
2312  $file_dir = $a_target_dir."/files/file_".$a_file_id;
2313  ilUtil::makeDir($file_dir);
2314  include_once("./Modules/File/classes/class.ilObjFile.php");
2315  $file_obj = new ilObjFile($a_file_id, false);
2316  $source_file = $file_obj->getDirectory($file_obj->getVersion())."/".$file_obj->getFileName();
2317  if (!is_file($source_file))
2318  {
2319  $source_file = $file_obj->getDirectory()."/".$file_obj->getFileName();
2320  }
2321  if (is_file($source_file))
2322  {
2323  copy($source_file, $file_dir."/".$file_obj->getFileName());
2324  }
2325  }
Class ilObjFile.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportHTMLGlossaryTerms()

ilObjContentObject::exportHTMLGlossaryTerms ( $a_lm_gui,
  $a_target_dir 
)

export glossary terms

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

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

Referenced by exportHTML().

2394  {
2395  global $ilLocator;
2396 
2397  foreach($this->offline_int_links as $int_link)
2398  {
2399  $ilLocator->clearItems();
2400  if ($int_link["type"] == "git")
2401  {
2402  $tpl = new ilTemplate("tpl.main.html", true, true);
2403  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2404 
2405  $_GET["obj_id"] = $int_link["id"];
2406  $_GET["frame"] = "_blank";
2407  $content =& $a_lm_gui->glossary();
2408  $file = $a_target_dir."/term_".$int_link["id"].".html";
2409 
2410  // open file
2411  if (!($fp = @fopen($file,"w+")))
2412  {
2413  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2414  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2415  }
2416  chmod($file, 0770);
2417  fwrite($fp, $content);
2418  fclose($fp);
2419 
2420  // store linked/embedded media objects of glosssary term
2421  include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
2422  $defs = ilGlossaryDefinition::getDefinitionList($int_link["id"]);
2423  foreach($defs as $def)
2424  {
2425  $def_mobs = ilObjMediaObject::_getMobsOfObject("gdf:pg", $def["id"]);
2426  foreach($def_mobs as $def_mob)
2427  {
2428  $this->offline_mobs[$def_mob] = $def_mob;
2429  }
2430 
2431  // get all files of page
2432  $def_files = ilObjFile::_getFilesOfObject("gdf:pg", $page["obj_id"]);
2433  $this->offline_files = array_merge($this->offline_files, $def_files);
2434 
2435  }
2436 
2437  }
2438  }
2439  }
print $file
getDefinitionList($a_term_id)
static
$_GET["client_id"]
_getFilesOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_usage_lang="-")
get all files of an object
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
_getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportHTMLMOB()

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

export media object to html

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

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

Referenced by exportHTML().

2331  {
2332  global $tpl;
2333 
2334  $mob_dir = $a_target_dir."/mobs";
2335 
2336  $source_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob_id;
2337  if (@is_dir($source_dir))
2338  {
2339  ilUtil::makeDir($mob_dir."/mm_".$a_mob_id);
2340  ilUtil::rCopy($source_dir, $mob_dir."/mm_".$a_mob_id);
2341  }
2342 
2343  $tpl = new ilTemplate("tpl.main.html", true, true);
2344  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2345  $_GET["obj_type"] = "MediaObject";
2346  $_GET["mob_id"] = $a_mob_id;
2347  $_GET["frame"] = $a_frame;
2348  $_GET["cmd"] = "";
2349  $content =& $a_lm_gui->media();
2350  $file = $a_target_dir."/media_".$a_mob_id.".html";
2351 
2352  // open file
2353  if (!($fp = @fopen($file,"w+")))
2354  {
2355  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2356  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2357  }
2358  chmod($file, 0770);
2359  fwrite($fp, $content);
2360  fclose($fp);
2361 
2362  // fullscreen
2363  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2364  $mob_obj = new ilObjMediaObject($a_mob_id);
2365  if ($mob_obj->hasFullscreenItem())
2366  {
2367  $tpl = new ilTemplate("tpl.main.html", true, true);
2368  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2369  $_GET["obj_type"] = "";
2370  $_GET["frame"] = "";
2371  $_GET["mob_id"] = $a_mob_id;
2372  $_GET["cmd"] = "fullscreen";
2373  $content =& $a_lm_gui->fullscreen();
2374  $file = $a_target_dir."/fullscreen_".$a_mob_id.".html";
2375 
2376  // open file
2377  if (!($fp = @fopen($file,"w+")))
2378  {
2379  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2380  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2381  }
2382  chmod($file, 0770);
2383  fwrite($fp, $content);
2384  fclose($fp);
2385  }
2386  $linked_mobs = $mob_obj->getLinkedMediaObjects();
2387  $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
2388  }
print $file
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
$_GET["client_id"]
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
Class ilObjMediaObject.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static getWebspaceDir($mode="filesystem")
get webspace directory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportHTMLPages()

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

export all pages of learning module to html file

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

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

Referenced by exportHTML().

2445  {
2446  global $tpl, $ilBench, $ilLocator;
2447 
2448  $pages = ilLMPageObject::getPageList($this->getId());
2449 
2450  $lm_tree =& $this->getLMTree();
2451  $first_page = $lm_tree->fetchSuccessorNode($lm_tree->getRootId(), "pg");
2452  $this->first_page_id = $first_page["child"];
2453 
2454  // iterate all learning module pages
2455  $mobs = array();
2456  $int_links = array();
2457  $this->offline_files = array();
2458 
2459  include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
2460  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2461 
2462  // get html export id mapping
2463  $lm_set = new ilSetting("lm");
2464  $exp_id_map = array();
2465 
2466  if ($lm_set->get("html_export_ids"))
2467  {
2468  foreach ($pages as $page)
2469  {
2470  $exp_id = ilLMPageObject::getExportId($this->getId(), $page["obj_id"]);
2471  if (trim($exp_id) != "")
2472  {
2473  $exp_id_map[$page["obj_id"]] = trim($exp_id);
2474  }
2475  }
2476  }
2477 //exit;
2478  if ($a_lang == "")
2479  {
2480  $a_lang = "-";
2481  }
2482 
2483  reset($pages);
2484  foreach ($pages as $page)
2485  {
2486  if (ilLMPage::_exists($this->getType(), $page["obj_id"]))
2487  {
2488  $ilLocator->clearItems();
2489  $ilBench->start("ExportHTML", "exportHTMLPage");
2490  $ilBench->start("ExportHTML", "exportPageHTML");
2491  $this->exportPageHTML($a_lm_gui, $a_target_dir, $page["obj_id"],
2492  "", $exp_id_map);
2493  $ilBench->stop("ExportHTML", "exportPageHTML");
2494 
2495  // get all snippets of page
2496  $pcs = ilPageContentUsage::getUsagesOfPage($page["obj_id"], $this->getType().":pg", 0, false, $a_lang);
2497  foreach ($pcs as $pc)
2498  {
2499  if ($pc["type"] == "incl")
2500  {
2501  $incl_mobs = ilObjMediaObject::_getMobsOfObject("mep:pg", $pc["id"]);
2502  foreach($incl_mobs as $incl_mob)
2503  {
2504  $mobs[$incl_mob] = $incl_mob;
2505  }
2506  }
2507  }
2508 
2509  // get all media objects of page
2510  $pg_mobs = ilObjMediaObject::_getMobsOfObject($this->getType().":pg", $page["obj_id"], 0, $a_lang);
2511  foreach($pg_mobs as $pg_mob)
2512  {
2513  $mobs[$pg_mob] = $pg_mob;
2514  }
2515 
2516  // get all internal links of page
2517  $pg_links = ilInternalLink::_getTargetsOfSource($this->getType().":pg", $page["obj_id"], $a_lang);
2518  $int_links = array_merge($int_links, $pg_links);
2519 
2520  // get all files of page
2521  include_once("./Modules/File/classes/class.ilObjFile.php");
2522  $pg_files = ilObjFile::_getFilesOfObject($this->getType().":pg", $page["obj_id"], 0, $a_lang);
2523  $this->offline_files = array_merge($this->offline_files, $pg_files);
2524 
2525  // collect all questions
2526  include_once("./Services/COPage/classes/class.ilPCQuestion.php");
2527  $q_ids = ilPCQuestion::_getQuestionIdsForPage($this->getType(), $page["obj_id"], $a_lang);
2528  foreach($q_ids as $q_id)
2529  {
2530  $this->q_ids[$q_id] = $q_id;
2531  }
2532 
2533  $ilBench->stop("ExportHTML", "exportHTMLPage");
2534  }
2535  }
2536  $this->offline_mobs = $mobs;
2537  $this->offline_int_links = $int_links;
2538  }
ILIAS Setting Class.
static _getQuestionIdsForPage($a_parent_type, $a_page_id, $a_lang="-")
Get all questions of a page.
_getFilesOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_usage_lang="-")
get all files of an object
$mobs
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="")
Checks whether page exists.
getId()
get object id public
& getLMTree()
get content object tree
getPageList($lm_id)
static
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
static getExportId($a_lm_id, $a_lmobj_id, $a_type="pg")
Get export ID.
getType()
get object type public
_getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
exportPageHTML(&$a_lm_gui, $a_target_dir, $a_lm_page_id, $a_frame="", $a_exp_id_map=array())
export page html
$lm_set
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportPageHTML()

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

export page html

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

References $_GET, $file, $ilBench, and $tpl.

Referenced by exportHTMLPages().

2547  {
2548  global $tpl, $ilBench;
2549 
2550 //echo "<br>B: export Page HTML ($a_lm_page_id)"; flush();
2551  // template workaround: reset of template
2552  $tpl = new ilTemplate("tpl.main.html", true, true);
2553  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2554 
2555  $_GET["obj_id"] = $a_lm_page_id;
2556  $_GET["frame"] = $a_frame;
2557 
2558  if ($a_frame == "")
2559  {
2560  //if ($nid = ilLMObject::_lookupNID($a_lm_gui->lm->getId(), $a_lm_page_id, "pg"))
2561  if (is_array($a_exp_id_map) && isset($a_exp_id_map[$a_lm_page_id]))
2562  {
2563  $file = $a_target_dir."/lm_pg_".$a_exp_id_map[$a_lm_page_id].".html";
2564  }
2565  else
2566  {
2567  $file = $a_target_dir."/lm_pg_".$a_lm_page_id.".html";
2568  }
2569  }
2570  else
2571  {
2572  if ($a_frame != "toc")
2573  {
2574  $file = $a_target_dir."/frame_".$a_lm_page_id."_".$a_frame.".html";
2575  }
2576  else
2577  {
2578  $file = $a_target_dir."/frame_".$a_frame.".html";
2579  }
2580  }
2581 
2582  // return if file is already existing
2583  if (@is_file($file))
2584  {
2585  return;
2586  }
2587 
2588  $content =& $a_lm_gui->layout("main.xml", false);
2589 
2590  // open file
2591  if (!($fp = @fopen($file,"w+")))
2592  {
2593  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2594  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2595  }
2596 
2597  // set file permissions
2598  chmod($file, 0770);
2599 
2600  // write xml data into the file
2601  fwrite($fp, $content);
2602 
2603  // close file
2604  fclose($fp);
2605 
2606  if ($this->first_page_id == $a_lm_page_id && $a_frame == "")
2607  {
2608  copy($file, $a_target_dir."/index.html");
2609  }
2610 
2611  // write frames of frameset
2612  $frameset = $a_lm_gui->getCurrentFrameSet();
2613 
2614  foreach ($frameset as $frame)
2615  {
2616  $this->exportPageHTML($a_lm_gui, $a_target_dir, $a_lm_page_id, $frame);
2617  }
2618 
2619  }
print $file
$_GET["client_id"]
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
exportPageHTML(&$a_lm_gui, $a_target_dir, $a_lm_page_id, $a_frame="", $a_exp_id_map=array())
export page html
global $ilBench
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ exportSCORM()

ilObjContentObject::exportSCORM (   $a_target_dir,
  $log 
)

export scorm package

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

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

1905  {
1906  ilUtil::delDir($a_target_dir);
1907  ilUtil::makeDir($a_target_dir);
1908  //ilUtil::makeDir($a_target_dir."/res");
1909 
1910  // export everything to html
1911  $this->exportHTML($a_target_dir."/res", $log, false, "scorm");
1912 
1913  // build manifest file
1914  include("./Modules/LearningModule/classes/class.ilContObjectManifestBuilder.php");
1915  $man_builder = new ilContObjectManifestBuilder($this);
1916  $man_builder->buildManifest();
1917  $man_builder->dump($a_target_dir);
1918 
1919  // copy scorm 1.2 schema definitions
1920  copy("Modules/LearningModule/scorm_xsd/adlcp_rootv1p2.xsd", $a_target_dir."/adlcp_rootv1p2.xsd");
1921  copy("Modules/LearningModule/scorm_xsd/imscp_rootv1p1p2.xsd", $a_target_dir."/imscp_rootv1p1p2.xsd");
1922  copy("Modules/LearningModule/scorm_xsd/imsmd_rootv1p2p1.xsd", $a_target_dir."/imsmd_rootv1p2p1.xsd");
1923  copy("Modules/LearningModule/scorm_xsd/ims_xml.xsd", $a_target_dir."/ims_xml.xsd");
1924 
1925  // zip it all
1926  $date = time();
1927  $zip_file = $a_target_dir."/".$date."__".IL_INST_ID."__".
1928  $this->getType()."_".$this->getId().".zip";
1929  //echo "zip-".$a_target_dir."-to-".$zip_file;
1930  ilUtil::zip(array($a_target_dir."/res",
1931  $a_target_dir."/imsmanifest.xml",
1932  $a_target_dir."/adlcp_rootv1p2.xsd",
1933  $a_target_dir."/imscp_rootv1p1p2.xsd",
1934  $a_target_dir."/ims_xml.xsd",
1935  $a_target_dir."/imsmd_rootv1p2p1.xsd")
1936  , $zip_file);
1937 
1938  $dest_file = $this->getExportDirectory("scorm")."/".$date."__".IL_INST_ID."__".
1939  $this->getType()."_".$this->getId().".zip";
1940 
1941  rename($zip_file, $dest_file);
1942  ilUtil::delDir($a_target_dir);
1943 
1944  }
getExportDirectory($a_type="xml")
get export directory of lm
exportHTML($a_target_dir, $log, $a_zip_file=true, $a_export_format="html", $a_lang="")
export html package
getId()
get object id public
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
getType()
get object type public
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
Content Object (ILIAS native learning module / digilib book) Manifest export class.
+ Here is the call graph for this function:

◆ exportXML()

ilObjContentObject::exportXML ( $a_xml_writer,
  $a_inst,
  $a_target_dir,
$expLog 
)

export object to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

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

1487  {
1488  global $ilBench;
1489 
1490  $attrs = array();
1491  switch($this->getType())
1492  {
1493  case "lm":
1494  $attrs["Type"] = "LearningModule";
1495  break;
1496 
1497  case "dbk":
1498  $attrs["Type"] = "LibObject";
1499  break;
1500  }
1501  $a_xml_writer->xmlStartTag("ContentObject", $attrs);
1502 
1503  // MetaData
1504  $this->exportXMLMetaData($a_xml_writer);
1505 
1506  // StructureObjects
1507 //echo "ContObj:".$a_inst.":<br>";
1508  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Structure Objects");
1509  $ilBench->start("ContentObjectExport", "exportStructureObjects");
1510  $this->exportXMLStructureObjects($a_xml_writer, $a_inst, $expLog);
1511  $ilBench->stop("ContentObjectExport", "exportStructureObjects");
1512  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Structure Objects");
1513 
1514  // PageObjects
1515  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Page Objects");
1516  $ilBench->start("ContentObjectExport", "exportPageObjects");
1517  $this->exportXMLPageObjects($a_xml_writer, $a_inst, $expLog);
1518  $ilBench->stop("ContentObjectExport", "exportPageObjects");
1519  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Page Objects");
1520 
1521  // MediaObjects
1522  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Media Objects");
1523  $ilBench->start("ContentObjectExport", "exportMediaObjects");
1524  $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
1525  $ilBench->stop("ContentObjectExport", "exportMediaObjects");
1526  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Media Objects");
1527 
1528  // FileItems
1529  $expLog->write(date("[y-m-d H:i:s] ")."Start Export File Items");
1530  $ilBench->start("ContentObjectExport", "exportFileItems");
1531  $this->exportFileItems($a_target_dir, $expLog);
1532  $ilBench->stop("ContentObjectExport", "exportFileItems");
1533  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export File Items");
1534 
1535  // Questions
1536  if (count($this->q_ids) > 0)
1537  {
1538  $qti_file = fopen($a_target_dir."/qti.xml", "w");
1539  include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
1540  $pool = new ilObjQuestionPool();
1541  fwrite($qti_file, $pool->toXML($this->q_ids));
1542  fclose($qti_file);
1543  }
1544 
1545  // To do: implement version selection/detection
1546  // Properties
1547  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Properties");
1548  $this->exportXMLProperties($a_xml_writer, $expLog);
1549  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Properties");
1550 
1551  $a_xml_writer->xmlEndTag("ContentObject");
1552  }
exportFileItems($a_target_dir, &$expLog)
export files of file itmes
exportXMLPageObjects(&$a_xml_writer, $a_inst, &$expLog)
export page objects to xml (see ilias_co.dtd)
exportXMLMetaData(&$a_xml_writer)
export content objects meta data to xml (see ilias_co.dtd)
exportXMLMediaObjects(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
export media objects to xml (see ilias_co.dtd)
exportXMLStructureObjects(&$a_xml_writer, $a_inst, &$expLog)
export structure objects to xml (see ilias_co.dtd)
exportXMLProperties($a_xml_writer, &$expLog)
export properties of content object
getType()
get object type public
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ exportXMLMediaObjects()

ilObjContentObject::exportXMLMediaObjects ( $a_xml_writer,
  $a_inst,
  $a_target_dir,
$expLog 
)

export media objects to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

References ilObject\_lookupType().

Referenced by exportXML().

1651  {
1652  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1653 
1654  $linked_mobs = array();
1655 
1656  // mobs directly embedded into pages
1657  foreach ($this->mob_ids as $mob_id)
1658  {
1659  if ($mob_id > 0 && ilObject::_lookupType($mob_id) == "mob")
1660  {
1661  $expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
1662  $media_obj = new ilObjMediaObject($mob_id);
1663  $media_obj->exportXML($a_xml_writer, $a_inst);
1664  $media_obj->exportFiles($a_target_dir);
1665 
1666  $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
1667  $linked_mobs = array_merge($linked_mobs, $lmobs);
1668 
1669  unset($media_obj);
1670  }
1671  }
1672 
1673  // linked mobs (in map areas)
1674  foreach ($linked_mobs as $mob_id)
1675  {
1676  if ($mob_id > 0)
1677  {
1678  $expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
1679  $media_obj = new ilObjMediaObject($mob_id);
1680  $media_obj->exportXML($a_xml_writer, $a_inst);
1681  $media_obj->exportFiles($a_target_dir);
1682  unset($media_obj);
1683  }
1684  }
1685 
1686  }
Class ilObjMediaObject.
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLMetaData()

ilObjContentObject::exportXMLMetaData ( $a_xml_writer)

export content objects meta data to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

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

Referenced by exportXML().

1561  {
1562  include_once("Services/MetaData/classes/class.ilMD2XML.php");
1563  $md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
1564  $md2xml->setExportMode(true);
1565  $md2xml->startExport();
1566  $a_xml_writer->appendXML($md2xml->getXML());
1567  }
getId()
get object id public
getType()
get object type public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLPageObjects()

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

export page objects to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

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

Referenced by exportXML().

1601  {
1602  global $ilBench;
1603 
1604  include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
1605  include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
1606 
1607  $pages = ilLMPageObject::getPageList($this->getId());
1608  foreach ($pages as $page)
1609  {
1610  if (ilLMPage::_exists($this->getType(), $page["obj_id"]))
1611  {
1612  $expLog->write(date("[y-m-d H:i:s] ")."Page Object ".$page["obj_id"]);
1613 
1614  // export xml to writer object
1615  $page_obj = new ilLMPageObject($this, $page["obj_id"]);
1616  $page_obj->exportXML($a_xml_writer, "normal", $a_inst);
1617 
1618  // collect media objects
1619  $mob_ids = $page_obj->getMediaObjectIDs();
1620  foreach($mob_ids as $mob_id)
1621  {
1622  $this->mob_ids[$mob_id] = $mob_id;
1623  }
1624 
1625  // collect all file items
1626  $file_ids = $page_obj->getFileItemIds();
1627  foreach($file_ids as $file_id)
1628  {
1629  $this->file_ids[$file_id] = $file_id;
1630  }
1631 
1632  // collect all questions
1633  $q_ids = $page_obj->getQuestionIds();
1634  foreach($q_ids as $q_id)
1635  {
1636  $this->q_ids[$q_id] = $q_id;
1637  }
1638 
1639  unset($page_obj);
1640  }
1641  }
1642  }
Class ilLMPageObject.
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
getId()
get object id public
getPageList($lm_id)
static
getType()
get object type public
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLProperties()

ilObjContentObject::exportXMLProperties (   $a_xml_writer,
$expLog 
)

export properties of content object

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

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

Referenced by exportXML().

1710  {
1711  $attrs = array();
1712  $a_xml_writer->xmlStartTag("Properties", $attrs);
1713 
1714  // Layout
1715  $attrs = array("Name" => "Layout", "Value" => $this->getLayout());
1716  $a_xml_writer->xmlElement("Property", $attrs);
1717 
1718  // Page Header
1719  $attrs = array("Name" => "PageHeader", "Value" => $this->getPageHeader());
1720  $a_xml_writer->xmlElement("Property", $attrs);
1721 
1722  // TOC Mode
1723  $attrs = array("Name" => "TOCMode", "Value" => $this->getTOCMode());
1724  $a_xml_writer->xmlElement("Property", $attrs);
1725 
1726  // LM Menu Activation
1727  $attrs = array("Name" => "ActiveLMMenu", "Value" =>
1728  ilUtil::tf2yn($this->isActiveLMMenu()));
1729  $a_xml_writer->xmlElement("Property", $attrs);
1730 
1731  // Numbering Activation
1732  $attrs = array("Name" => "ActiveNumbering", "Value" =>
1733  ilUtil::tf2yn($this->isActiveNumbering()));
1734  $a_xml_writer->xmlElement("Property", $attrs);
1735 
1736  // Table of contents button activation
1737  $attrs = array("Name" => "ActiveTOC", "Value" =>
1738  ilUtil::tf2yn($this->isActiveTOC()));
1739  $a_xml_writer->xmlElement("Property", $attrs);
1740 
1741  // Print view button activation
1742  $attrs = array("Name" => "ActivePrintView", "Value" =>
1743  ilUtil::tf2yn($this->isActivePrintView()));
1744  $a_xml_writer->xmlElement("Property", $attrs);
1745 
1746  // Note that download button is not saved, because
1747  // download files do not exist after import
1748 
1749  // Clean frames
1750  $attrs = array("Name" => "CleanFrames", "Value" =>
1751  ilUtil::tf2yn($this->cleanFrames()));
1752  $a_xml_writer->xmlElement("Property", $attrs);
1753 
1754  // Public notes activation
1755  $attrs = array("Name" => "PublicNotes", "Value" =>
1756  ilUtil::tf2yn($this->publicNotes()));
1757  $a_xml_writer->xmlElement("Property", $attrs);
1758 
1759  // History comments for authors activation
1760  $attrs = array("Name" => "HistoryUserComments", "Value" =>
1762  $a_xml_writer->xmlElement("Property", $attrs);
1763 
1764  // Rating
1765  $attrs = array("Name" => "Rating", "Value" =>
1766  ilUtil::tf2yn($this->hasRating()));
1767  $a_xml_writer->xmlElement("Property", $attrs);
1768  $attrs = array("Name" => "RatingPages", "Value" =>
1769  ilUtil::tf2yn($this->hasRatingPages()));
1770  $a_xml_writer->xmlElement("Property", $attrs);
1771 
1772  // Header Page
1773  if ($this->getHeaderPage() > 0)
1774  {
1775  $attrs = array("Name" => "HeaderPage", "Value" =>
1776  "il_".IL_INST_ID."_pg_".$this->getHeaderPage());
1777  $a_xml_writer->xmlElement("Property", $attrs);
1778  }
1779 
1780  // Footer Page
1781  if ($this->getFooterPage() > 0)
1782  {
1783  $attrs = array("Name" => "FooterPage", "Value" =>
1784  "il_".IL_INST_ID."_pg_".$this->getFooterPage());
1785  $a_xml_writer->xmlElement("Property", $attrs);
1786  }
1787 
1788  $a_xml_writer->xmlEndTag("Properties");
1789  }
static tf2yn($a_tf)
convert true/false to "y"/"n"
getLayout()
get default page layout of content object (see directory layouts/)
getPageHeader()
get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER)
getTOCMode()
get toc mode ("chapters" | "pages")
+ 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 1575 of file class.ilObjContentObject.php.

Referenced by exportXML().

1576  {
1577  include_once './Modules/LearningModule/classes/class.ilStructureObject.php';
1578 
1579  $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
1580  foreach ($childs as $child)
1581  {
1582  if($child["type"] != "st")
1583  {
1584  continue;
1585  }
1586 
1587  $structure_obj = new ilStructureObject($this, $child["obj_id"]);
1588  $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
1589  unset($structure_obj);
1590  }
1591  }
Class ilStructreObject.
+ Here is the caller graph for this function:

◆ fixTree()

ilObjContentObject::fixTree ( )

fix tree

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

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

1362  {
1363  global $ilDB;
1364 
1365  $tree =& $this->getLMTree();
1366 
1367  // check numbering, if errors, renumber
1368  // it is very important to keep this step before deleting subtrees
1369  // in the following steps
1370  $set = $ilDB->query("SELECT DISTINCT l1.lm_id".
1371  " FROM lm_tree l1".
1372  " JOIN lm_tree l2 ON ( l1.child = l2.parent".
1373  " AND l1.lm_id = l2.lm_id )".
1374  " JOIN lm_data ON ( l1.child = lm_data.obj_id )".
1375  " WHERE (l2.lft < l1.lft".
1376  " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)".
1377  " AND l1.lm_id = ".$ilDB->quote($this->getId(), "integer").
1378  " ORDER BY lm_data.create_date DESC"
1379  );
1380  if ($rec = $ilDB->fetchAssoc($set))
1381  {
1382  $tree->renumber();
1383  }
1384 
1385  // delete subtrees that have no lm_data records
1386  $nodes = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1387  foreach ($nodes as $node)
1388  {
1389  $q = "SELECT * FROM lm_data WHERE obj_id = ".
1390  $ilDB->quote($node["child"], "integer");
1391  $obj_set = $ilDB->query($q);
1392  $obj_rec = $ilDB->fetchAssoc($obj_set);
1393  if (!$obj_rec)
1394  {
1395  $node_data = $tree->getNodeData($node["child"]);
1396  $tree->deleteTree($node_data);
1397  }
1398  }
1399 
1400  // delete subtrees that have pages as parent
1401  $nodes = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1402  foreach ($nodes as $node)
1403  {
1404  $q = "SELECT * FROM lm_data WHERE obj_id = ".
1405  $ilDB->quote($node["parent"], "integer");
1406  $obj_set = $ilDB->query($q);
1407  $obj_rec = $ilDB->fetchAssoc($obj_set);
1408  if ($obj_rec["type"] == "pg")
1409  {
1410  $node_data = $tree->getNodeData($node["child"]);
1411  if ($tree->isInTree($node["child"]))
1412  {
1413  $tree->deleteTree($node_data);
1414  }
1415  }
1416  }
1417 
1418  // check for multi-references pages or chapters
1419  // if errors -> create copies of them here
1420  $set = $ilDB->query("SELECT DISTINCT l1.lm_id".
1421  " FROM lm_tree l1".
1422  " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )".
1423  " JOIN lm_data ON (l1.child = lm_data.obj_id)".
1424  " WHERE l1.child <> 1".
1425  " AND l1.lm_id <> lm_data.lm_id".
1426  " AND l1.lm_id = ".$ilDB->quote($this->getId(), "integer"));
1427  if ($rec = $ilDB->fetchAssoc($set))
1428  {
1429  $set = $ilDB->query("SELECT DISTINCT l1.child ".
1430  " FROM lm_tree l1".
1431  " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )".
1432  " JOIN lm_data ON (l1.child = lm_data.obj_id)".
1433  " WHERE l1.child <> 1".
1434  " AND l1.lm_id <> lm_data.lm_id".
1435  " AND l1.lm_id = ".$ilDB->quote($this->getId(), "integer"));
1436  include_once("./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
1437  while ($rec = $ilDB->fetchAssoc($set))
1438  {
1439  $cobj = ilLMObjectFactory::getInstance($this, $rec["child"]);
1440 
1441  if (is_object($cobj))
1442  {
1443  if ($cobj->getType() == "pg")
1444  {
1445  // make a copy of it
1446  $pg_copy = $cobj->copy($this);
1447 
1448  // replace the child in the tree with the copy (id)
1449  $ilDB->manipulate("UPDATE lm_tree SET ".
1450  " child = ".$ilDB->quote($pg_copy->getId(), "integer").
1451  " WHERE child = ".$ilDB->quote($cobj->getId(), "integer").
1452  " AND lm_id = ".$ilDB->quote($this->getId(), "integer")
1453  );
1454  }
1455  else if ($cobj->getType() == "st")
1456  {
1457  // make a copy of it
1458  $st_copy = $cobj->copy($this);
1459 
1460  // replace the child in the tree with the copy (id)
1461  $ilDB->manipulate("UPDATE lm_tree SET ".
1462  " child = ".$ilDB->quote($st_copy->getId(), "integer").
1463  " WHERE child = ".$ilDB->quote($cobj->getId(), "integer").
1464  " AND lm_id = ".$ilDB->quote($this->getId(), "integer")
1465  );
1466 
1467  // make all childs refer to the copy now
1468  $ilDB->manipulate("UPDATE lm_tree SET ".
1469  " parent = ".$ilDB->quote($st_copy->getId(), "integer").
1470  " WHERE parent = ".$ilDB->quote($cobj->getId(), "integer").
1471  " AND lm_id = ".$ilDB->quote($this->getId(), "integer")
1472  );
1473  }
1474  }
1475  }
1476  }
1477  }
getInstance(&$a_content_obj, $a_id=0, $a_halt=true)
& getLMTree()
get content object tree
+ Here is the call graph for this function:

◆ getAutoGlossaries()

ilObjContentObject::getAutoGlossaries ( )

Get auto glossaries.

Returns
array int

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

References $auto_glossaries.

Referenced by removeAutoGlossary(), and updateAutoGlossaries().

335  {
336  return $this->auto_glossaries;
337  }
+ Here is the caller graph for this function:

◆ getAvailableLayouts()

ilObjContentObject::getAvailableLayouts ( )

get all available lm layouts

static

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

References $file, and $ret.

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

1125  {
1126  $dir = opendir("./Modules/LearningModule/layouts/lm");
1127 
1128  $layouts = array();
1129 
1130  while($file = readdir($dir))
1131  {
1132  if ($file != "." && $file != ".." && $file != "CVS" && $file != ".svn")
1133  {
1134  // directories
1135  if (@is_dir("./Modules/LearningModule/layouts/lm/".$file))
1136  {
1137  $layouts[$file] = $file;
1138  }
1139  }
1140  }
1141  asort($layouts);
1142 
1143  // workaround: fix ordering
1144  $ret = array(
1145  'toc2win' => 'toc2win',
1146  'toc2windyn' => 'toc2windyn',
1147  '1window' => '1window',
1148  '2window' => '2window',
1149  '3window' => '3window',
1150  'presentation' => 'presentation',
1151  'fullscreen' => 'fullscreen'
1152  );
1153 
1154  foreach ($layouts as $l)
1155  {
1156  if (!in_array($l, $ret))
1157  {
1158  $ret[$l] = $l;
1159  }
1160  }
1161 
1162  return $ret;
1163  }
print $file
+ Here is the caller graph for this function:

◆ getDataDirectory()

ilObjContentObject::getDataDirectory ( )

get data directory

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

References ilUtil\getDataDir().

Referenced by delete().

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

◆ getDescription()

ilObjContentObject::getDescription ( )

get description of content object

Returns
string description

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

Referenced by cloneObject().

163  {
164  return parent::getDescription();
165  }
+ 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 222 of file class.ilObjContentObject.php.

Referenced by updateProperties().

223  {
224  return $this->disable_def_feedback;
225  }
+ Here is the caller graph for this function:

◆ getExportDirectory()

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

get export directory of lm

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

References ilUtil\getDataDir().

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

524  {
525  switch ($a_type)
526  {
527  case "scorm":
528  $export_dir = ilUtil::getDataDir()."/lm_data"."/lm_".$this->getId()."/export_scorm";
529  break;
530 
531  default: // = xml
532  if (substr($a_type, 0, 4) == "html")
533  {
534  $export_dir = ilUtil::getDataDir()."/lm_data"."/lm_".$this->getId()."/export_".$a_type;
535  }
536  else
537  {
538  $export_dir = ilUtil::getDataDir()."/lm_data"."/lm_".$this->getId()."/export";
539  }
540  break;
541  }
542  return $export_dir;
543  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExportFiles()

ilObjContentObject::getExportFiles ( )

get export files

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

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

1795  {
1796  $file = array();
1797 
1798  $types = array("xml", "html", "scorm");
1799 
1800  foreach ($types as $type)
1801  {
1802  $dir = $this->getExportDirectory($type);
1803  // quit if import dir not available
1804  if (!@is_dir($dir) or
1805  !is_writeable($dir))
1806  {
1807  continue;
1808  }
1809 
1810  // open directory
1811  $cdir = dir($dir);
1812 
1813  // initialize array
1814 
1815  // get files and save the in the array
1816  while ($entry = $cdir->read())
1817  {
1818  if ($entry != "." and
1819  $entry != ".." and
1820  substr($entry, -4) == ".zip" and
1821  ereg("^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.zip\$", $entry))
1822  {
1823  $file[$entry.$type] = array("type" => $type, "file" => $entry,
1824  "size" => filesize($dir."/".$entry));
1825  }
1826  }
1827 
1828  // close import directory
1829  $cdir->close();
1830  }
1831 
1832  // sort files
1833  ksort ($file);
1834  reset ($file);
1835  return $file;
1836  }
print $file
getExportDirectory($a_type="xml")
get export directory of lm
+ Here is the call graph for this function:

◆ getFooterPage()

ilObjContentObject::getFooterPage ( )

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

Referenced by exportXMLProperties(), and updateProperties().

1004  {
1005  return $this->footer_page;
1006  }
+ Here is the caller graph for this function:

◆ getHeaderPage()

ilObjContentObject::getHeaderPage ( )

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

Referenced by exportXMLProperties(), and updateProperties().

994  {
995  return $this->header_page;
996  }
+ 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 928 of file class.ilObjContentObject.php.

Referenced by updateProperties().

929  {
930  return $this->hide_header_footer_print;
931  }
+ Here is the caller graph for this function:

◆ getImportDirectory()

ilObjContentObject::getImportDirectory ( )

get import directory of lm

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

References $import_dir, and ilUtil\getDataDir().

Referenced by importFromZipFile().

443  {
444  if(strlen($this->import_dir))
445  {
446  return $this->import_dir;
447  }
448 
449  $import_dir = ilUtil::getDataDir()."/lm_data".
450  "/lm_".$this->getId()."/import";
451  if(@is_dir($import_dir))
452  {
453  return $import_dir;
454  }
455  else
456  {
457  return false;
458  }
459  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImportId()

ilObjContentObject::getImportId ( )

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

References ilObject\$import_id.

Referenced by importFromDirectory().

178  {
179  return $this->import_id;
180  }
+ 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 612 of file class.ilObjContentObject.php.

References $layout.

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

613  {
614  return $this->layout;
615  }
+ Here is the caller graph for this function:

◆ getLayoutPerPage()

ilObjContentObject::getLayoutPerPage ( )

Get layout per page.

Returns
boolean layout per page

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

Referenced by cloneObject(), and updateProperties().

203  {
204  return $this->layout_per_page;
205  }
+ Here is the caller graph for this function:

◆ getLMTree()

& ilObjContentObject::getLMTree ( )

get content object tree

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

References $lm_tree.

Referenced by exportHTMLPages(), and fixTree().

394  {
395  return $this->lm_tree;
396  }
+ Here is the caller graph for this function:

◆ getOfflineFiles()

ilObjContentObject::getOfflineFiles (   $dir)

get offline files

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

References $file.

1865  {
1866  // quit if offline dir not available
1867  if (!@is_dir($dir) or
1868  !is_writeable($dir))
1869  {
1870  return array();
1871  }
1872 
1873  // open directory
1874  $dir = dir($dir);
1875 
1876  // initialize array
1877  $file = array();
1878 
1879  // get files and save the in the array
1880  while ($entry = $dir->read())
1881  {
1882  if ($entry != "." and
1883  $entry != ".." and
1884  substr($entry, -4) == ".pdf" and
1885  ereg("^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.pdf\$", $entry))
1886  {
1887  $file[] = $entry;
1888  }
1889  }
1890 
1891  // close import directory
1892  $dir->close();
1893 
1894  // sort files
1895  sort ($file);
1896  reset ($file);
1897 
1898  return $file;
1899  }
print $file

◆ getOnline()

ilObjContentObject::getOnline ( )

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

References $online.

Referenced by updateProperties().

859  {
860  return $this->online;
861  }
+ 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 812 of file class.ilObjContentObject.php.

References $pg_header.

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

813  {
814  return $this->pg_header;
815  }
+ Here is the caller graph for this function:

◆ getPublicAccessMode()

ilObjContentObject::getPublicAccessMode ( )

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

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

Referenced by cloneObject(), and updateProperties().

839  {
840  return $this->public_access_mode;
841  }
+ 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 1856 of file class.ilObjContentObject.php.

Referenced by updateProperties().

1857  {
1858  return $this->public_export_file[$a_type];
1859  }
+ Here is the caller graph for this function:

◆ getStyleSheetId()

ilObjContentObject::getStyleSheetId ( )

get ID of assigned style sheet object

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

References $style_id.

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

631  {
632  return $this->style_id;
633  }
+ Here is the caller graph for this function:

◆ getSupplyingExportFiles()

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

Get supplying export files.

Parameters

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

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

Referenced by ilLMPresentationGUI\layout().

2232  {
2233  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
2234  include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
2235  include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
2236  include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
2237  $scripts = array(
2238  array("source" => ilYuiUtil::getLocalPath('yahoo/yahoo-min.js'),
2239  "target" => $a_target_dir.'/js/yahoo/yahoo-min.js',
2240  "type" => "js"),
2241  array("source" => ilYuiUtil::getLocalPath('yahoo-dom-event/yahoo-dom-event.js'),
2242  "target" => $a_target_dir.'/js/yahoo/yahoo-dom-event.js',
2243  "type" => "js"),
2244  array("source" => ilYuiUtil::getLocalPath('animation/animation-min.js'),
2245  "target" => $a_target_dir.'/js/yahoo/animation-min.js',
2246  "type" => "js"),
2247  array("source" => './Services/JavaScript/js/Basic.js',
2248  "target" => $a_target_dir.'/js/Basic.js',
2249  "type" => "js"),
2250  array("source" => './Services/Accordion/js/accordion.js',
2251  "target" => $a_target_dir.'/js/accordion.js',
2252  "type" => "js"),
2253  array("source" => './Services/Accordion/css/accordion.css',
2254  "target" => $a_target_dir.'/css/accordion.css',
2255  "type" => "css"),
2256  array("source" => iljQueryUtil::getLocaljQueryPath(),
2257  "target" => $a_target_dir.'/js/jquery.js',
2258  "type" => "js"),
2259  array("source" => iljQueryUtil::getLocalMaphilightPath(),
2260  "target" => $a_target_dir.'/js/maphilight.js',
2261  "type" => "js"),
2262  array("source" => iljQueryUtil::getLocaljQueryUIPath(),
2263  "target" => $a_target_dir.'/js/jquery-ui-min.js',
2264  "type" => "js"),
2265  array("source" => './Services/COPage/js/ilCOPagePres.js',
2266  "target" => $a_target_dir.'/js/ilCOPagePres.js',
2267  "type" => "js"),
2268  array("source" => './Modules/Scorm2004/scripts/questions/pure.js',
2269  "target" => $a_target_dir.'/js/pure.js',
2270  "type" => "js"),
2271  array("source" => './Modules/Scorm2004/scripts/questions/question_handling.js',
2272  "target" => $a_target_dir.'/js/question_handling.js',
2273  "type" => "js"),
2274  array("source" => './Modules/Scorm2004/templates/default/question_handling.css',
2275  "target" => $a_target_dir.'/css/question_handling.css',
2276  "type" => "css"),
2277  array("source" => ilPlayerUtil::getLocalMediaElementJsPath(),
2278  "target" => $a_target_dir."/".ilPlayerUtil::getLocalMediaElementJsPath(),
2279  "type" => "js"),
2280  array("source" => ilPlayerUtil::getLocalMediaElementCssPath(),
2281  "target" => $a_target_dir."/".ilPlayerUtil::getLocalMediaElementCssPath(),
2282  "type" => "css"),
2283  array("source" => ilExplorerBaseGUI::getLocalExplorerJsPath(),
2284  "target" => $a_target_dir."/".ilExplorerBaseGUI::getLocalExplorerJsPath(),
2285  "type" => "js"),
2286  array("source" => ilExplorerBaseGUI::getLocalJsTreeJsPath(),
2287  "target" => $a_target_dir."/".ilExplorerBaseGUI::getLocalJsTreeJsPath(),
2288  "type" => "js"),
2289  array("source" => './Modules/LearningModule/js/LearningModule.js',
2290  "target" => $a_target_dir.'/js/LearningModule.js',
2291  "type" => "js")
2292  );
2293 
2294  $mathJaxSetting = new ilSetting("MathJax");
2295  $use_mathjax = $mathJaxSetting->get("enable");
2296  if ($use_mathjax)
2297  {
2298  $scripts[] = array("source" => "",
2299  "target" => $mathJaxSetting->get("path_to_mathjax"),
2300  "type" => "js");
2301  }
2302 
2303  return $scripts;
2304 
2305  }
ILIAS Setting Class.
getLocalMediaElementCssPath()
Get local path of jQuery file.
getLocalMediaElementJsPath()
Get local path of jQuery file.
static getLocalJsTreeJsPath()
Get local path of jsTree js.
getLocaljQueryPath()
Get local path of jQuery file.
static getLocalExplorerJsPath()
Get local path of explorer js.
getLocalMaphilightPath()
Get local path of maphilight file.
static getLocalPath($a_name="")
Get local path of a YUI js file.
getLocaljQueryUIPath()
Get local path of jQuery UI file.
if(strpos($jquery_path, './')===0) else if(strpos($jquery_path, '.')===0) $mathJaxSetting
Definition: latex.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTitle()

ilObjContentObject::getTitle ( )

get title of content object

Returns
string title

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

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

144  {
145  return parent::getTitle();
146  }
+ Here is the caller graph for this function:

◆ getTOCMode()

ilObjContentObject::getTOCMode ( )

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

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

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

831  {
832  return $this->toc_mode;
833  }
+ Here is the caller graph for this function:

◆ getTree()

& ilObjContentObject::getTree ( )

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

References $lm_tree.

228  {
229  return $this->lm_tree;
230  }

◆ getXMLZip()

ilObjContentObject::getXMLZip ( )

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

2724  {
2725  include_once("./Modules/LearningModule/classes/class.ilContObjectExport.php");
2726 
2727  $cont_exp = new ilContObjectExport($this,'xml');
2728 
2729  $export_file = $cont_exp->buildExportFile();
2730  return $export_file;
2731  }
Export class for content objects.

◆ hasRating()

ilObjContentObject::hasRating ( )

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

References $rating.

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

3333  {
3334  return $this->rating;
3335  }
+ Here is the caller graph for this function:

◆ hasRatingPages()

ilObjContentObject::hasRatingPages ( )

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

References $rating_pages.

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

3343  {
3344  return $this->rating_pages;
3345  }
+ 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 1331 of file class.ilObjContentObject.php.

Referenced by ilPageObjectGUI\showPage().

1332  {
1333  $tree = new ilTree($a_cont_obj_id);
1334  $tree->setTableNames('lm_tree','lm_data');
1335  $tree->setTreeTablePK("lm_id");
1336  if ($tree->isInTree($a_page_id))
1337  {
1338  $succ = $tree->fetchSuccessorNode($a_page_id, "pg");
1339  if ($succ > 0)
1340  {
1341  return true;
1342  }
1343  }
1344  return false;
1345  }
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
+ Here is the caller graph for this function:

◆ ilObjContentObject()

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

Constructor public.

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

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

References ilObject\ilObject().

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

◆ import()

ilObjContentObject::import ( )

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

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

272  {
273  // nothing to do. just display the dialogue in Out
274  return;
275  }

◆ importFromDirectory()

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

Import lm from directory.

Parameters

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

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

Referenced by importFromZipFile().

3043  {
3044  global $lng;
3045 
3046  // determine filename of xml file
3047  $subdir = basename($a_directory);
3048  $xml_file = $a_directory."/".$subdir.".xml";
3049 
3050  // check directory exists within zip file
3051  if (!is_dir($a_directory))
3052  {
3053  return sprintf($lng->txt("cont_no_subdir_in_zip"), $subdir);
3054  }
3055 
3056  // check whether xml file exists within zip file
3057  if (!is_file($xml_file))
3058  {
3059  return sprintf($lng->txt("cont_zip_file_invalid"), $subdir."/".$subdir.".xml");
3060  }
3061 
3062  // import questions
3063  $qti_file = $a_directory."/qti.xml";
3064  $qtis = array();
3065  if (is_file($qti_file))
3066  {
3067  include_once "./Services/QTI/classes/class.ilQTIParser.php";
3068  include_once("./Modules/Test/classes/class.ilObjTest.php");
3069  $qtiParser = new ilQTIParser ($qti_file,
3070  IL_MO_VERIFY_QTI, 0, "");
3071  $result = $qtiParser->startParsing ();
3072  $founditems = & $qtiParser->getFoundItems ();
3073  $testObj = new ilObjTest(0, true);
3074  if (count($founditems) > 0)
3075  {
3076  $qtiParser = new ilQTIParser($qti_file, IL_MO_PARSE_QTI, 0, "");
3077  $qtiParser->setTestObject($testObj);
3078  $result = $qtiParser->startParsing();
3079  $qtis = array_merge($qtis, $qtiParser->getImportMapping());
3080  }
3081  }
3082 
3083  include_once ("./Modules/LearningModule/classes/class.ilContObjParser.php");
3084  $contParser = new ilContObjParser($this, $xml_file, $subdir, $qmapping);
3085  $contParser->setQuestionMapping($qtis);
3086  $contParser->startParsing();
3087  ilObject::_writeImportId($this->getId(), $this->getImportId());
3088  $this->MDUpdateListener('General');
3089 
3090  // import style
3091  $style_file = $a_directory."/style.xml";
3092  $style_zip_file = $a_directory."/style.zip";
3093  if (is_file($style_zip_file)) // try to import style.zip first
3094  {
3095  require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
3096  $style = new ilObjStyleSheet();
3097  $style->import($style_zip_file);
3098  $this->writeStyleSheetId($style->getId());
3099  }
3100  else if (is_file($style_file)) // try to import style.xml
3101  {
3102  require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
3103  $style = new ilObjStyleSheet();
3104  $style->import($style_file);
3105  $this->writeStyleSheetId($style->getId());
3106  }
3107 
3108 // // validate
3109  if ($a_validate)
3110  {
3111  $mess = $this->validatePages();
3112  }
3113 
3114  if ($mess == "")
3115  {
3116  // handle internal links to this learning module
3117  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
3119  $this->getType(), $this->getRefId());
3120  }
3121 
3122  return $mess;
3123  }
Content Object Parser.
$result
validatePages()
Validate all pages.
writeStyleSheetId($a_style_id)
write ID of assigned style sheet object to db
_writeImportId($a_obj_id, $a_import_id)
write import id to db (static)
getId()
get object id public
const IL_MO_PARSE_QTI
static _handleImportRepositoryLinks($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
Change targest of repository links.
getType()
get object type public
Class ilObjStyleSheet.
getRefId()
get reference id public
const IL_MO_VERIFY_QTI
MDUpdateListener($a_element)
Meta data update listener.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importFromZipFile()

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

Import lm from zip file.

Parameters

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

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

2980  {
2981  global $lng;
2982 
2983  // create import directory
2984  $this->createImportDirectory();
2985 
2986  // copy uploaded file to import directory
2987  $file = pathinfo($a_filename);
2988  $full_path = $this->getImportDirectory()."/".$a_filename;
2989 
2990  ilUtil::moveUploadedFile($a_tmp_file,
2991  $a_filename, $full_path);
2992 
2993  // unzip file
2994  ilUtil::unzip($full_path);
2995 
2996  $subdir = basename($file["basename"],".".$file["extension"]);
2997 
2998  $mess = $this->importFromDirectory(
2999  $this->getImportDirectory()."/".$subdir, $a_validate);
3000 
3001  // this should only be true for help modules
3002  if ($a_import_into_help_module > 0)
3003  {
3004  // search the zip file
3005  $dir = $this->getImportDirectory()."/".$subdir;
3006  $files = ilUtil::getDir($dir);
3007  foreach ($files as $file)
3008  {
3009  if (is_int(strpos($file["entry"], "__help_")) &&
3010  is_int(strpos($file["entry"], ".zip")))
3011  {
3012  include_once("./Services/Export/classes/class.ilImport.php");
3013  $imp = new ilImport();
3014  $imp->getMapping()->addMapping('Services/Help', 'help_module', 0, $a_import_into_help_module);
3015  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
3016  $chaps = ilLMObject::getObjectList($this->getId(), "st");
3017  foreach ($chaps as $chap)
3018  {
3019  $chap_arr = explode("_", $chap["import_id"]);
3020  $imp->getMapping()->addMapping('Services/Help', 'help_chap',
3021  $chap_arr[count($chap_arr) - 1], $chap["obj_id"]);
3022  }
3023  $imp->importEntity($dir."/".$file["entry"], $file["entry"],
3024  "help", "Services/Help", true);
3025  }
3026  }
3027  }
3028 
3029  // delete import directory
3031 
3032  return $mess;
3033  }
print $file
getImportDirectory()
get import directory of lm
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
Import class.
importFromDirectory($a_directory, $a_validate=true)
Import lm from directory.
getId()
get object id public
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
createImportDirectory()
creates data directory for import files (data_dir/lm_data/lm_<id>/import, depending on data directory...
getObjectList($lm_id, $type="")
static
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ initDefaultRoles()

ilObjContentObject::initDefaultRoles ( )

init default roles settings OBSOLETE.

DON'T USE, READ TEXT BELOW public

Returns
array object IDs of created local roles.

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

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

78  {
79  return array();
80 
81  global $rbacadmin, $rbacreview;
82 
83  // create a local role folder
84  $rfoldObj = $this->createRoleFolder("Local roles","Role Folder of content object ".$this->getId());
85 
86  // note: we don't need any roles here, local "author" roles must
87  // be created manually. subscription roles have been abandoned.
88  /*
89  // create author role and assign role to rolefolder...
90  $roleObj = $rfoldObj->createRole("author object ".$this->getRefId(),"author of content object ref id ".$this->getRefId());
91  $roles[] = $roleObj->getId();
92 
93  // copy permissions from author template to new role
94  $rbacadmin->copyRolePermissions($this->getAuthorRoleTemplateId(), 8, $rfoldObj->getRefId(), $roleObj->getId());
95 
96  // grant all allowed operations of role to current learning module
97  $rbacadmin->grantPermission($roleObj->getId(),
98  $rbacreview->getOperationsOfRole($roleObj->getId(), "lm", $rfoldObj->getRefId()),
99  $this->getRefId());*/
100 
101  unset($rfoldObj);
102  //unset($roleObj);
103 
104  return $roles ? $roles : array();
105  }
getId()
get object id public
createRoleFolder()
creates a local role folder
+ Here is the call graph for this function:

◆ isActiveDownloads()

ilObjContentObject::isActiveDownloads ( )

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

Referenced by cloneObject(), and updateProperties().

939  {
940  return $this->downloads_active;
941  }
+ Here is the caller graph for this function:

◆ isActiveDownloadsPublic()

ilObjContentObject::isActiveDownloadsPublic ( )

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

Referenced by cloneObject(), and updateProperties().

949  {
950  return $this->downloads_public_active;
951  }
+ Here is the caller graph for this function:

◆ isActiveHistoryUserComments()

ilObjContentObject::isActiveHistoryUserComments ( )

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

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

984  {
985  return $this->user_comments;
986  }
+ Here is the caller graph for this function:

◆ isActiveLMMenu()

ilObjContentObject::isActiveLMMenu ( )

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

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

869  {
870  return $this->lm_menu_active;
871  }
+ Here is the caller graph for this function:

◆ isActiveNumbering()

ilObjContentObject::isActiveNumbering ( )

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

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

889  {
890  return $this->numbering;
891  }
+ Here is the caller graph for this function:

◆ isActivePreventGlossaryAppendix()

ilObjContentObject::isActivePreventGlossaryAppendix ( )

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

Referenced by cloneObject(), and updateProperties().

909  {
910  return $this->prevent_glossary_appendix_active;
911  }
+ Here is the caller graph for this function:

◆ isActivePrintView()

ilObjContentObject::isActivePrintView ( )

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

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

899  {
900  return $this->print_view_active;
901  }
+ Here is the caller graph for this function:

◆ isActiveTOC()

ilObjContentObject::isActiveTOC ( )

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

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

879  {
880  return $this->toc_active;
881  }
+ 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 3314 of file class.ilObjContentObject.php.

References ilObject\_lookupObjId().

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

3315  {
3316  if (!$a_as_obj_id && $a_id > 0 && $a_id == OH_REF_ID)
3317  {
3318  return true;
3319  }
3320  if ($a_as_obj_id && $a_id > 0 && $a_id == ilObject::_lookupObjId(OH_REF_ID))
3321  {
3322  return true;
3323  }
3324  return false;
3325  }
static _lookupObjId($a_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupAutoGlossaries()

ilObjContentObject::lookupAutoGlossaries (   $a_lm_id)

Lookup auto glossaries.

Parameters

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

Referenced by ilLMPage\beforePageContentUpdate().

3243  {
3244  global $ilDB;
3245 
3246  // read auto glossaries
3247  $set = $ilDB->query("SELECT * FROM lm_glossaries ".
3248  " WHERE lm_id = ".$ilDB->quote($a_lm_id, "integer")
3249  );
3250  $glos = array();
3251  while ($rec = $ilDB->fetchAssoc($set))
3252  {
3253  $glos[] = $rec["glo_id"];
3254  }
3255  return $glos;
3256  }
+ Here is the caller graph for this function:

◆ notify()

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

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

public

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

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

References $_GET, and ilObject\getType().

1275  {
1276  global $tree;
1277 
1278  switch ($a_event)
1279  {
1280  case "link":
1281 
1282  //var_dump("<pre>",$a_params,"</pre>");
1283  //echo "Content Object ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
1284  //exit;
1285  break;
1286 
1287  case "cut":
1288 
1289  //echo "Content Object ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
1290  //exit;
1291  break;
1292 
1293  case "copy":
1294 
1295  //var_dump("<pre>",$a_params,"</pre>");
1296  //echo "Content Object ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
1297  //exit;
1298  break;
1299 
1300  case "paste":
1301 
1302  //echo "Content Object ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
1303  //exit;
1304  break;
1305 
1306  case "new":
1307 
1308  //echo "Content Object ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
1309  //exit;
1310  break;
1311  }
1312 
1313  // At the beginning of the recursive process it avoids second call of the notify function with the same parameter
1314  if ($a_node_id==$_GET["ref_id"])
1315  {
1316  $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
1317  $parent_type = $parent_obj->getType();
1318  if($parent_type == $this->getType())
1319  {
1320  $a_node_id = (int) $tree->getParentId($a_node_id);
1321  }
1322  }
1323 
1324  parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
1325  }
$_GET["client_id"]
redirection script todo: (a better solution should control the processing via a xml file) ...
getType()
get object type public
+ Here is the call graph for this function:

◆ publicNotes()

ilObjContentObject::publicNotes ( )

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

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

959  {
960  return $this->pub_notes;
961  }
+ Here is the caller graph for this function:

◆ putInTree()

ilObjContentObject::putInTree (   $a_parent)

put content object in main tree

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

283  {
284  global $tree;
285 
286  // put this object in tree under $a_parent
287  parent::putInTree($a_parent);
288 
289  // make new tree for this object
290  //$tree->addTree($this->getId());
291  }

◆ read()

ilObjContentObject::read ( )

read data of content object

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

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

112  {
113  global $ilDB;
114 
115  parent::read();
116 # echo "Content<br>\n";
117 
118  $this->lm_tree = new ilTree($this->getId());
119  $this->lm_tree->setTableNames('lm_tree','lm_data');
120  $this->lm_tree->setTreeTablePK("lm_id");
121 
122  $this->readProperties();
123 
124  // read auto glossaries
125  $set = $ilDB->query("SELECT * FROM lm_glossaries ".
126  " WHERE lm_id = ".$ilDB->quote($this->getId(), "integer")
127  );
128  $glos = array();
129  while ($rec = $ilDB->fetchAssoc($set))
130  {
131  $glos[] = $rec["glo_id"];
132  }
133  $this->setAutoGlossaries($glos);
134 
135  //parent::read();
136  }
getId()
get object id public
readProperties()
read content object properties
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
setAutoGlossaries($a_val)
Set auto glossaries.
+ Here is the call graph for this function:

◆ readProperties()

ilObjContentObject::readProperties ( )

read content object properties

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

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

Referenced by createProperties(), and read().

1012  {
1013  global $ilDB;
1014 
1015  $q = "SELECT * FROM content_object WHERE id = ".
1016  $ilDB->quote($this->getId(), "integer");
1017  $lm_set = $ilDB->query($q);
1018  $lm_rec = $ilDB->fetchAssoc($lm_set);
1019  $this->setLayout($lm_rec["default_layout"]);
1020  $this->setStyleSheetId((int) $lm_rec["stylesheet"]);
1021  $this->setPageHeader($lm_rec["page_header"]);
1022  $this->setTOCMode($lm_rec["toc_mode"]);
1023  $this->setOnline(ilUtil::yn2tf($lm_rec["is_online"]));
1024  $this->setActiveTOC(ilUtil::yn2tf($lm_rec["toc_active"]));
1025  $this->setActiveNumbering(ilUtil::yn2tf($lm_rec["numbering"]));
1026  $this->setActivePrintView(ilUtil::yn2tf($lm_rec["print_view_active"]));
1027  $this->setActivePreventGlossaryAppendix(ilUtil::yn2tf($lm_rec["no_glo_appendix"]));
1028  $this->setHideHeaderFooterPrint($lm_rec["hide_head_foot_print"]);
1029  $this->setActiveDownloads(ilUtil::yn2tf($lm_rec["downloads_active"]));
1030  $this->setActiveDownloadsPublic(ilUtil::yn2tf($lm_rec["downloads_public_active"]));
1031  $this->setActiveLMMenu(ilUtil::yn2tf($lm_rec["lm_menu_active"]));
1032  $this->setCleanFrames(ilUtil::yn2tf($lm_rec["clean_frames"]));
1033  $this->setPublicNotes(ilUtil::yn2tf($lm_rec["pub_notes"]));
1034  $this->setHeaderPage((int) $lm_rec["header_page"]);
1035  $this->setFooterPage((int) $lm_rec["footer_page"]);
1036  $this->setHistoryUserComments(ilUtil::yn2tf($lm_rec["hist_user_comments"]));
1037  $this->setPublicAccessMode($lm_rec["public_access_mode"]);
1038  $this->setPublicExportFile("xml", $lm_rec["public_xml_file"]);
1039  $this->setPublicExportFile("html", $lm_rec["public_html_file"]);
1040  $this->setPublicExportFile("scorm", $lm_rec["public_scorm_file"]);
1041  $this->setLayoutPerPage($lm_rec["layout_per_page"]);
1042  $this->setRating($lm_rec["rating"]);
1043  $this->setRatingPages($lm_rec["rating_pages"]);
1044  $this->setDisableDefaultFeedback($lm_rec["disable_def_feedback"]);
1045  }
setPublicExportFile($a_type, $a_file)
specify public export file for type
setTOCMode($a_toc_mode="chapters")
set toc mode
setLayoutPerPage($a_val)
Set layout per page.
setDisableDefaultFeedback($a_val)
Set disable default feedback for questions.
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
getId()
get object id public
setPageHeader($a_pg_header=IL_CHAPTER_TITLE)
set page header mode
$lm_set
setLayout($a_layout)
set default page layout
setHideHeaderFooterPrint($a_val)
Set hide header footer in print mode.
static yn2tf($a_yn)
convert "y"/"n" to true/false
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeAutoGlossary()

ilObjContentObject::removeAutoGlossary (   $a_glo_id)

Remove auto glossary.

Parameters

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

References getAutoGlossaries(), and setAutoGlossaries().

346  {
347  $glo_ids = array();
348  foreach($this->getAutoGlossaries() as $g)
349  {
350  if ($g != $a_glo_id)
351  {
352  $glo_ids[] = $g;
353  }
354  }
355  $this->setAutoGlossaries($glo_ids);
356  }
getAutoGlossaries()
Get auto glossaries.
setAutoGlossaries($a_val)
Set auto glossaries.
+ Here is the call graph for this function:

◆ setActiveDownloads()

ilObjContentObject::setActiveDownloads (   $a_down)

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

Referenced by readProperties().

934  {
935  $this->downloads_active = $a_down;
936  }
+ Here is the caller graph for this function:

◆ setActiveDownloadsPublic()

ilObjContentObject::setActiveDownloadsPublic (   $a_down)

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

Referenced by readProperties().

944  {
945  $this->downloads_public_active = $a_down;
946  }
+ Here is the caller graph for this function:

◆ setActiveLMMenu()

ilObjContentObject::setActiveLMMenu (   $a_act_lm_menu)

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

Referenced by readProperties().

864  {
865  $this->lm_menu_active = $a_act_lm_menu;
866  }
+ Here is the caller graph for this function:

◆ setActiveNumbering()

ilObjContentObject::setActiveNumbering (   $a_num)

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

Referenced by readProperties().

884  {
885  $this->numbering = $a_num;
886  }
+ Here is the caller graph for this function:

◆ setActivePreventGlossaryAppendix()

ilObjContentObject::setActivePreventGlossaryAppendix (   $a_print)

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

Referenced by readProperties().

904  {
905  $this->prevent_glossary_appendix_active = $a_print;
906  }
+ Here is the caller graph for this function:

◆ setActivePrintView()

ilObjContentObject::setActivePrintView (   $a_print)

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

Referenced by readProperties().

894  {
895  $this->print_view_active = $a_print;
896  }
+ Here is the caller graph for this function:

◆ setActiveTOC()

ilObjContentObject::setActiveTOC (   $a_toc)

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

Referenced by readProperties().

874  {
875  $this->toc_active = $a_toc;
876  }
+ Here is the caller graph for this function:

◆ setAutoGlossaries()

ilObjContentObject::setAutoGlossaries (   $a_val)

Set auto glossaries.

Parameters
array$a_valint

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

References ilObject\_lookupType().

Referenced by read(), and removeAutoGlossary().

313  {
314  $this->auto_glossaries = array();
315  if (is_array($a_val))
316  {
317  foreach ($a_val as $v)
318  {
319  $v = (int) $v;
320  if ($v > 0 && ilObject::_lookupType($v) == "glo" &&
321  !in_array($v, $this->auto_glossaries))
322  {
323  $this->auto_glossaries[] = $v;
324  }
325  }
326  }
327  }
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCleanFrames()

ilObjContentObject::setCleanFrames (   $a_clean)

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

Referenced by readProperties(), and updateProperties().

964  {
965  $this->clean_frames = $a_clean;
966  }
+ Here is the caller graph for this function:

◆ setDescription()

ilObjContentObject::setDescription (   $a_description)

set description of content object

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

171  {
172  parent::setDescription($a_description);
173 // $this->meta_data->setDescription($a_description);
174  }

◆ setDisableDefaultFeedback()

ilObjContentObject::setDisableDefaultFeedback (   $a_val)

Set disable default feedback for questions.

Parameters
bool$a_valdisable default feedback

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

Referenced by readProperties().

213  {
214  $this->disable_def_feedback = $a_val;
215  }
+ Here is the caller graph for this function:

◆ setFooterPage()

ilObjContentObject::setFooterPage (   $a_pg)

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

Referenced by readProperties().

999  {
1000  $this->footer_page = $a_pg;
1001  }
+ Here is the caller graph for this function:

◆ setHeaderPage()

ilObjContentObject::setHeaderPage (   $a_pg)

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

Referenced by readProperties().

989  {
990  $this->header_page = $a_pg;
991  }
+ 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 918 of file class.ilObjContentObject.php.

Referenced by readProperties().

919  {
920  $this->hide_header_footer_print = $a_val;
921  }
+ Here is the caller graph for this function:

◆ setHistoryUserComments()

ilObjContentObject::setHistoryUserComments (   $a_comm)

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

Referenced by readProperties().

974  {
975  $this->user_comments = $a_comm;
976  }
+ 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 467 of file class.ilObjContentObject.php.

468  {
469  $this->import_dir = $a_import_dir;
470  }

◆ setImportId()

ilObjContentObject::setImportId (   $a_id)

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

183  {
184  $this->import_id = $a_id;
185  }

◆ setLayout()

ilObjContentObject::setLayout (   $a_layout)

set default page layout

Parameters
string$a_layoutdefault page layout

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

Referenced by readProperties().

623  {
624  $this->layout = $a_layout;
625  }
+ Here is the caller graph for this function:

◆ setLayoutPerPage()

ilObjContentObject::setLayoutPerPage (   $a_val)

Set layout per page.

Parameters
booleanlayout per page

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

Referenced by readProperties().

193  {
194  $this->layout_per_page = $a_val;
195  }
+ Here is the caller graph for this function:

◆ setOnline()

ilObjContentObject::setOnline (   $a_online)

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

Referenced by readProperties().

854  {
855  $this->online = $a_online;
856  }
+ 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 822 of file class.ilObjContentObject.php.

Referenced by readProperties().

823  {
824  $this->pg_header = $a_pg_header;
825  }
+ Here is the caller graph for this function:

◆ setPublicAccessMode()

ilObjContentObject::setPublicAccessMode (   $a_mode)

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

Referenced by readProperties().

979  {
980  $this->public_access_mode = $a_mode;
981  }
+ 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 1844 of file class.ilObjContentObject.php.

Referenced by readProperties().

1845  {
1846  $this->public_export_file[$a_type] = $a_file;
1847  }
+ Here is the caller graph for this function:

◆ setPublicNotes()

ilObjContentObject::setPublicNotes (   $a_pub_notes)

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

Referenced by readProperties().

954  {
955  $this->pub_notes = $a_pub_notes;
956  }
+ Here is the caller graph for this function:

◆ setRating()

ilObjContentObject::setRating (   $a_value)

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

Referenced by readProperties().

3328  {
3329  $this->rating = (bool)$a_value;
3330  }
+ Here is the caller graph for this function:

◆ setRatingPages()

ilObjContentObject::setRatingPages (   $a_value)

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

Referenced by readProperties().

3338  {
3339  $this->rating_pages = (bool)$a_value;
3340  }
+ Here is the caller graph for this function:

◆ setStyleSheetId()

ilObjContentObject::setStyleSheetId (   $a_style_id)

set ID of assigned style sheet object

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

Referenced by readProperties().

639  {
640  $this->style_id = $a_style_id;
641  }
+ Here is the caller graph for this function:

◆ setTitle()

ilObjContentObject::setTitle (   $a_title)

set title of content object

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

152  {
153  parent::setTitle($a_title);
154 // $this->meta_data->setTitle($a_title);
155  }

◆ setTOCMode()

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

set toc mode

Parameters
string$a_toc_mode"chapters" | "pages"

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

Referenced by readProperties().

849  {
850  $this->toc_mode = $a_toc_mode;
851  }
+ Here is the caller graph for this function:

◆ update()

ilObjContentObject::update ( )

update complete object (meta data and properties)

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

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

236  {
237  $this->updateMetaData();
238  parent::update();
239  $this->updateProperties();
240  $this->updateAutoGlossaries();
241  }
updateMetaData()
update meta data entry
updateAutoGlossaries()
Update auto glossaries.
updateProperties()
Update content object properties.
+ Here is the call graph for this function:

◆ updateAutoGlossaries()

ilObjContentObject::updateAutoGlossaries ( )

Update auto glossaries.

Parameters

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

References getAutoGlossaries().

Referenced by create(), and update().

250  {
251  global $ilDB;
252 
253  // update auto glossaries
254  $ilDB->manipulate("DELETE FROM lm_glossaries WHERE ".
255  " lm_id = ".$ilDB->quote($this->getId(), "integer")
256  );
257  foreach ($this->getAutoGlossaries() as $glo_id)
258  {
259  $ilDB->manipulate("INSERT INTO lm_glossaries ".
260  "(lm_id, glo_id) VALUES (".
261  $ilDB->quote($this->getId(), "integer").",".
262  $ilDB->quote($glo_id, "integer").
263  ")");
264  }
265  }
getAutoGlossaries()
Get auto glossaries.
+ 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 1050 of file class.ilObjContentObject.php.

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

Referenced by update().

1051  {
1052  global $ilDB;
1053 
1054  // force clean_frames to be set, if layout per page is activated
1055  if ($this->getLayoutPerPage())
1056  {
1057  $this->setCleanFrames(true);
1058  }
1059 
1060  $q = "UPDATE content_object SET ".
1061  " default_layout = ".$ilDB->quote($this->getLayout(), "text").", ".
1062  " stylesheet = ".$ilDB->quote($this->getStyleSheetId(), "integer").",".
1063  " page_header = ".$ilDB->quote($this->getPageHeader(), "text").",".
1064  " toc_mode = ".$ilDB->quote($this->getTOCMode(), "text").",".
1065  " is_online = ".$ilDB->quote(ilUtil::tf2yn($this->getOnline()), "text").",".
1066  " toc_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveTOC()), "text").",".
1067  " numbering = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveNumbering()), "text").",".
1068  " print_view_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActivePrintView()), "text").",".
1069  " no_glo_appendix = ".$ilDB->quote(ilUtil::tf2yn($this->isActivePreventGlossaryAppendix()), "text").",".
1070  " hide_head_foot_print = ".$ilDB->quote($this->getHideHeaderFooterPrint(), "integer").",".
1071  " downloads_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveDownloads()), "text").",".
1072  " downloads_public_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveDownloadsPublic()), "text").",".
1073  " clean_frames = ".$ilDB->quote(ilUtil::tf2yn($this->cleanFrames()), "text").",".
1074  " pub_notes = ".$ilDB->quote(ilUtil::tf2yn($this->publicNotes()), "text").",".
1075  " hist_user_comments = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveHistoryUserComments()), "text").",".
1076  " public_access_mode = ".$ilDB->quote($this->getPublicAccessMode(), "text").",".
1077  " public_xml_file = ".$ilDB->quote($this->getPublicExportFile("xml"), "text").",".
1078  " public_html_file = ".$ilDB->quote($this->getPublicExportFile("html"), "text").",".
1079  " public_scorm_file = ".$ilDB->quote($this->getPublicExportFile("scorm"), "text").",".
1080  " header_page = ".$ilDB->quote($this->getHeaderPage(), "integer").",".
1081  " footer_page = ".$ilDB->quote($this->getFooterPage(), "integer").",".
1082  " lm_menu_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveLMMenu()), "text").", ".
1083  " layout_per_page = ".$ilDB->quote($this->getLayoutPerPage(), "integer").", ".
1084  " rating = ".$ilDB->quote($this->hasRating(), "integer").", ".
1085  " rating_pages = ".$ilDB->quote($this->hasRatingPages(), "integer").", ".
1086  " disable_def_feedback = ".$ilDB->quote($this->getDisableDefaultFeedback(), "integer")." ".
1087  " WHERE id = ".$ilDB->quote($this->getId(), "integer");
1088  $ilDB->manipulate($q);
1089  }
getHideHeaderFooterPrint()
Get hide header footer in print mode.
static tf2yn($a_tf)
convert true/false to "y"/"n"
getStyleSheetId()
get ID of assigned style sheet object
getLayout()
get default page layout of content object (see directory layouts/)
getPublicExportFile($a_type)
get public export file
getPublicAccessMode()
get public access mode ("complete" | "selected")
getLayoutPerPage()
Get layout per page.
getPageHeader()
get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER)
getId()
get object id public
getTOCMode()
get toc mode ("chapters" | "pages")
getDisableDefaultFeedback()
Get disable default feedback for questions.
+ 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 2931 of file class.ilObjContentObject.php.

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

Referenced by importFromDirectory().

2932  {
2933  include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
2934  include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
2935 
2936  $mess = "";
2937 
2938  $pages = ilLMPageObject::getPageList($this->getId());
2939  foreach ($pages as $page)
2940  {
2941  if (ilLMPage::_exists($this->getType(), $page["obj_id"]))
2942  {
2943  $cpage = new ilLMPage($page["obj_id"]);
2944  $cpage->buildDom();
2945  $error = @$cpage->validateDom();
2946 
2947  if ($error != "")
2948  {
2949  $this->lng->loadLanguageModule("content");
2950  ilUtil::sendInfo($this->lng->txt("cont_import_validation_errors"));
2951  $title = ilLMObject::_lookupTitle($page["obj_id"]);
2952  $page_obj = new ilLMPageObject($this, $page["obj_id"]);
2953  $mess.= $this->lng->txt("obj_pg").": ".$title;
2954  $mess.= '<div class="small">';
2955  foreach ($error as $e)
2956  {
2957  $err_mess = implode($e, " - ");
2958  if (!is_int(strpos($err_mess, ":0:")))
2959  {
2960  $mess.= htmlentities($err_mess)."<br />";
2961  }
2962  }
2963  $mess.= '</div>';
2964  $mess.= "<br />";
2965  }
2966  }
2967  }
2968 
2969  return $mess;
2970  }
static _lookupTitle($a_obj_id)
Lookup title.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class ilLMPageObject.
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
getId()
get object id public
getPageList($lm_id)
static
getType()
get object type public
Extension of ilPageObject for learning modules.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeStyleSheetId()

ilObjContentObject::writeStyleSheetId (   $a_style_id)

write ID of assigned style sheet object to db

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

References ilObject\getId().

Referenced by importFromDirectory().

647  {
648  global $ilDB;
649 
650  $q = "UPDATE content_object SET ".
651  " stylesheet = ".$ilDB->quote((int) $a_style_id, "integer").
652  " WHERE id = ".$ilDB->quote($this->getId(), "integer");
653  $ilDB->manipulate($q);
654 
655  $this->style_id = $a_style_id;
656  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $auto_glossaries

ilObjContentObject::$auto_glossaries = array()

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

Referenced by getAutoGlossaries().

◆ $import_dir

ilObjContentObject::$import_dir = ''
private

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

Referenced by createImportDirectory(), and getImportDirectory().

◆ $layout

ilObjContentObject::$layout

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

Referenced by getLayout().

◆ $lm_tree

ilObjContentObject::$lm_tree

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

Referenced by getLMTree(), and getTree().

◆ $meta_data

ilObjContentObject::$meta_data

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

◆ $online

ilObjContentObject::$online

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

Referenced by getOnline().

◆ $pg_header

ilObjContentObject::$pg_header

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

Referenced by getPageHeader().

◆ $rating

ilObjContentObject::$rating
protected

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

Referenced by hasRating().

◆ $rating_pages

ilObjContentObject::$rating_pages
protected

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

Referenced by hasRatingPages().

◆ $style_id

ilObjContentObject::$style_id

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

Referenced by getStyleSheetId().


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