ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjContentObject Class Reference

Class ilObjContentObject. More...

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

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 create ($a_no_meta_data=false)
 create content object More...
 
 read ()
 read data of content object More...
 
 getTitle ()
 get title of content object More...
 
 setTitle ($a_title)
 set title of content object More...
 
 getDescription ()
 get description of content object More...
 
 setDescription ($a_description)
 set description of content object More...
 
 getImportId ()
 
 setImportId ($a_id)
 
 setLayoutPerPage ($a_val)
 Set layout per page. More...
 
 getLayoutPerPage ()
 Get layout per page. More...
 
 setDisableDefaultFeedback ($a_val)
 Set disable default feedback for questions. More...
 
 getDisableDefaultFeedback ()
 Get disable default feedback for questions. More...
 
 setProgressIcons ($a_val)
 Set progress icons. More...
 
 getProgressIcons ()
 Get progress icons. More...
 
 setStoreTries ($a_val)
 Set store tries. More...
 
 getStoreTries ()
 Get store tries. More...
 
 setRestrictForwardNavigation ($a_val)
 Set restrict forward navigation. More...
 
 getRestrictForwardNavigation ()
 Get restrict forward navigation. More...
 
getTree ()
 
 update ()
 update complete object (meta data and properties) More...
 
 updateAutoGlossaries ()
 Update auto glossaries. More...
 
 import ()
 if implemented, this function should be called from an Out/GUI-Object More...
 
 putInTree ($a_parent)
 put content object in main tree More...
 
 createLMTree ()
 create content object tree (that stores structure object hierarchie) More...
 
 setAutoGlossaries ($a_val)
 Set auto glossaries. More...
 
 getAutoGlossaries ()
 Get auto glossaries. More...
 
 removeAutoGlossary ($a_glo_id)
 Remove auto glossary. More...
 
 addFirstChapterAndPage ()
 Add first chapter and page. More...
 
 setForTranslation ($a_val)
 Set for translation. More...
 
 getForTranslation ()
 Get for translation. More...
 
getLMTree ()
 get content object tree More...
 
 createImportDirectory ()
 creates data directory for import files (data_dir/lm_data/lm_<id>/import, depending on data directory that is set in ILIAS setup/ini) More...
 
 getDataDirectory ()
 get data directory More...
 
 getImportDirectory ()
 get import directory of lm More...
 
 setImportDirectory ($a_import_dir)
 Set import directory for further use in ilContObjParser. More...
 
 createExportDirectory ($a_type="xml")
 creates data directory for export files (data_dir/lm_data/lm_<id>/export, depending on data directory that is set in ILIAS setup/ini) More...
 
 getExportDirectory ($a_type="xml")
 get export directory of lm More...
 
 delete ()
 delete learning module and all related data More...
 
 getLayout ()
 get default page layout of content object (see directory layouts/) More...
 
 setLayout ($a_layout)
 set default page layout More...
 
 getStyleSheetId ()
 get ID of assigned style sheet object More...
 
 setStyleSheetId ($a_style_id)
 set ID of assigned style sheet object More...
 
 writeStyleSheetId ($a_style_id)
 write ID of assigned style sheet object to db More...
 
 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...
 
 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...
 
 checkTree ()
 
 fixTree ()
 fix tree More...
 
 checkStructure ()
 Check tree (this has been copied from fixTree due to a bug fixing, should be reorganised) More...
 
 exportXML (&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
 export object to xml (see ilias_co.dtd) More...
 
 exportXMLMetaData (&$a_xml_writer)
 export content objects meta data to xml (see ilias_co.dtd) More...
 
 exportXMLStructureObjects (&$a_xml_writer, $a_inst, &$expLog)
 export structure objects to xml (see ilias_co.dtd) More...
 
 exportXMLPageObjects (&$a_xml_writer, $a_inst, &$expLog)
 export page objects to xml (see ilias_co.dtd) More...
 
 exportXMLMediaObjects (&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
 export media objects to xml (see ilias_co.dtd) More...
 
 exportFileItems ($a_target_dir, &$expLog)
 export files of file itmes More...
 
 exportXMLProperties ($a_xml_writer, &$expLog)
 export properties of content object More...
 
 getExportFiles ()
 get export files More...
 
 setPublicExportFile ($a_type, $a_file)
 specify public export file for type More...
 
 getPublicExportFile ($a_type)
 get public export file More...
 
 getOfflineFiles ($dir)
 get offline files More...
 
 exportSCORM ($a_target_dir, $log)
 export scorm package More...
 
 exportHTML ($a_target_dir, $log, $a_zip_file=true, $a_export_format="html", $a_lang="")
 export html package More...
 
 exportHTMLFile ($a_target_dir, $a_file_id)
 export file object More...
 
 exportHTMLMOB ($a_target_dir, &$a_lm_gui, $a_mob_id, $a_frame, &$a_linked_mobs)
 export media object to html More...
 
 exportHTMLGlossaryTerms (&$a_lm_gui, $a_target_dir)
 export glossary terms More...
 
 exportHTMLPages (&$a_lm_gui, $a_target_dir, $a_lang="", $a_all_languages=false)
 export all pages of learning module to html file More...
 
 exportPageHTML (&$a_lm_gui, $a_target_dir, $a_lm_page_id, $a_frame="", $a_exp_id_map=array(), $a_lang="-", $a_all_languages=false)
 export page html More...
 
 exportFO (&$a_xml_writer, $a_target_dir)
 export object to fo More...
 
 exportFOStructureObjects (&$a_xml_writer)
 export structure objects to fo More...
 
 getXMLZip ()
 
 executeDragDrop ($source_id, $target_id, $first_child, $as_subitem=false, $movecopy="move")
 Execute Drag Drop Action. More...
 
 validatePages ()
 Validate all pages. More...
 
 importFromZipFile ( $a_tmp_file, $a_filename, $a_validate=true, $a_import_into_help_module=0)
 Import lm from zip file. More...
 
 importFromDirectory ($a_directory, $a_validate=true, $a_mapping=null)
 Import lm from directory. More...
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone learning module. More...
 
 copyAllPagesAndChapters ($a_target_obj, $a_copy_id=0)
 Copy all pages and chapters. More...
 
 autoLinkGlossaryTerms ($a_glo_ref_id)
 Auto link glossary terms. More...
 
 setRating ($a_value)
 
 hasRating ()
 
 setRatingPages ($a_value)
 
 hasRatingPages ()
 
 MDUpdateListener ($a_element)
 
 getPublicExportFiles ()
 Get public export files. More...
 
- Public Member Functions inherited from ilObject
 __construct ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ()
 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...
 
 setOfflineStatus ($a_status)
 Set offline status. More...
 
 getOfflineStatus ()
 Get offline status. More...
 
 supportsOfflineHandling ()
 Check whether object supports offline handling. More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 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...
 
 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...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 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...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static writeHeaderPage ($a_lm_id, $a_page_id)
 Write header page. More...
 
static writeFooterPage ($a_lm_id, $a_page_id)
 Write footer page. More...
 
static _moveLMStyles ($a_from_style, $a_to_style)
 move learning modules from one style to another More...
 
static _lookupRestrictForwardNavigation ($a_obj_id)
 Lookup forward restriction navigation. More...
 
static _lookupStyleSheetId ($a_cont_obj_id)
 lookup style sheet ID More...
 
static _lookupContObjIdByStyleId ($a_style_id)
 lookup style sheet ID More...
 
static _lookupDisableDefaultFeedback ($a_id)
 Lookup disable default feedback. More...
 
static _lookupStoreTries ($a_id)
 Lookup disable default feedback. More...
 
static _getNrOfAssignedLMs ($a_style_id)
 gets the number of learning modules assigned to a content style More...
 
static _getNrLMsIndividualStyles ()
 get number of learning modules with individual styles More...
 
static _getNrLMsNoStyle ()
 get number of learning modules assigned no style More...
 
static _deleteStyleAssignments ($a_style_id)
 delete all style references to style More...
 
static getAvailableLayouts ()
 get all available lm layouts More...
 
static _checkPreconditionsOfPage ($cont_ref_id, $cont_obj_id, $page_id)
 checks wether the preconditions of a page are fulfilled or not More...
 
static _getMissingPreconditionsOfPage ($cont_ref_id, $cont_obj_id, $page_id)
 gets all missing preconditions of page More...
 
static _getMissingPreconditionsTopChapter ($cont_obj_ref_id, $cont_obj_id, $page_id)
 get top chapter of page for that any precondition is missing More...
 
static hasSuccessorPage ($a_cont_obj_id, $a_page_id)
 checks if page has a successor page More...
 
static getSupplyingExportFiles ($a_target_dir=".")
 Get supplying export files. More...
 
static lookupAutoGlossaries ($a_lm_id)
 Lookup auto glossaries. More...
 
static isOnlineHelpModule ($a_id, $a_as_obj_id=false)
 Is module an online module. More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupImportId ($a_obj_id)
 
static _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
static _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static lookupOfflineStatus ($a_obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner ($a_id)
 lookup object owner More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
static _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
static _lookupObjId ($a_id)
 
static _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
static setDeletedDates ($a_ref_ids)
 Set deleted date. More...
 
static _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
static _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
static _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
static _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type 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 collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Data Fields

 $lm_tree
 
 $meta_data
 
 $layout
 
 $style_id
 
 $pg_header
 
 $online
 
 $for_translation = 0
 
 $auto_glossaries = array()
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $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
 

Static Protected Member Functions

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

Protected Attributes

 $user
 
 $tpl
 
 $locator
 
 $rating
 
 $rating_pages
 
 $log
 
- Protected Attributes inherited from ilObject
 $objDefinition
 
 $db
 
 $log
 
 $error
 
 $tree
 
 $app_event_handler
 
 $rbacadmin
 
 $rbacreview
 

Private Attributes

 $import_dir = ''
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

References $DIC, ilLoggerFactory\getLogger(), and user().

61  {
62  global $DIC;
63 
64  $this->user = $DIC->user();
65  $this->db = $DIC->database();
66  $this->tree = $DIC->repositoryTree();
67  $this->lng = $DIC->language();
68  $this->error = $DIC["ilErr"];
69  if (isset($DIC["tpl"])) {
70  $this->tpl = $DIC["tpl"];
71  }
72  if (isset($DIC["ilLocator"])) {
73  $this->locator = $DIC["ilLocator"];
74  }
75 
76  // this also calls read() method! (if $a_id is set)
77  parent::__construct($a_id, $a_call_by_reference);
78 
79  $this->log = ilLoggerFactory::getLogger('lm');
80 
81  $this->mob_ids = array();
82  $this->file_ids = array();
83  $this->q_ids = array();
84  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

Member Function Documentation

◆ _checkPreconditionsOfPage()

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

checks wether the preconditions of a page are fulfilled or not

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

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

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

1306  {
1307  global $DIC;
1308 
1309  $ilUser = $DIC->user();
1310  $ilErr = $DIC["ilErr"];
1311 
1312  $lm_tree = new ilTree($cont_obj_id);
1313  $lm_tree->setTableNames('lm_tree', 'lm_data');
1314  $lm_tree->setTreeTablePK("lm_id");
1315 
1316  if ($lm_tree->isInTree($page_id)) {
1317  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1318  foreach ($path as $node) {
1319  if ($node["type"] == "st") {
1320  if (!ilConditionHandler::_checkAllConditionsOfTarget($cont_ref_id, $node["child"], "st")) {
1321  return false;
1322  }
1323  }
1324  }
1325  }
1326 
1327  return true;
1328  }
$path
Definition: aliased.php:25
global $DIC
Definition: saml.php:7
$ilErr
Definition: raiseError.php:18
$ilUser
Definition: imgupload.php:18
static _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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteStyleAssignments()

static ilObjContentObject::_deleteStyleAssignments (   $a_style_id)
static

delete all style references to style

Parameters
int$a_style_idstyle_id

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

References $DIC, and $ilDB.

Referenced by ilObjStyleSheet\delete().

950  {
951  global $DIC;
952 
953  $ilDB = $DIC->database();
954 
955  $q = "UPDATE content_object SET " .
956  " stylesheet = " . $ilDB->quote(0, "integer") .
957  " WHERE stylesheet = " . $ilDB->quote((int) $a_style_id, "integer");
958 
959  $ilDB->manipulate($q);
960  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ _getMissingPreconditionsOfPage()

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

gets all missing preconditions of page

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

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

Referenced by ilLMPresentationGUI\showPreconditionsOfPage().

1334  {
1335  $lm_tree = new ilTree($cont_obj_id);
1336  $lm_tree->setTableNames('lm_tree', 'lm_data');
1337  $lm_tree->setTreeTablePK("lm_id");
1338 
1339  $conds = array();
1340  if ($lm_tree->isInTree($page_id)) {
1341  // get full path of page
1342  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1343  foreach ($path as $node) {
1344  if ($node["type"] == "st") {
1345  // get all preconditions of upper chapters
1346  $tconds = ilConditionHandler::_getPersistedConditionsOfTarget($cont_ref_id, $node["child"], "st");
1347  foreach ($tconds as $tcond) {
1348  // store all missing preconditions
1349  if (!ilConditionHandler::_checkCondition($tcond)) {
1350  $conds[] = $tcond;
1351  }
1352  }
1353  }
1354  }
1355  }
1356 
1357  return $conds;
1358  }
$path
Definition: aliased.php:25
static _checkCondition($condition, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static _getPersistedConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_target_type="")
get all persisted conditions of target object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getMissingPreconditionsTopChapter()

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

get top chapter of page for that any precondition is missing

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

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

Referenced by ilLMPresentationGUI\showPreconditionsOfPage().

1364  {
1365  $lm_tree = new ilTree($cont_obj_id);
1366  $lm_tree->setTableNames('lm_tree', 'lm_data');
1367  $lm_tree->setTreeTablePK("lm_id");
1368 
1369  $conds = array();
1370  if ($lm_tree->isInTree($page_id)) {
1371  // get full path of page
1372  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1373  foreach ($path as $node) {
1374  if ($node["type"] == "st") {
1375  // get all preconditions of upper chapters
1376  $tconds = ilConditionHandler::_getPersistedConditionsOfTarget($cont_obj_ref_id, $node["child"], "st");
1377  foreach ($tconds as $tcond) {
1378  // look for missing precondition
1379  if (!ilConditionHandler::_checkCondition($tcond)) {
1380  return $node["child"];
1381  }
1382  }
1383  }
1384  }
1385  }
1386 
1387  return "";
1388  }
$path
Definition: aliased.php:25
static _checkCondition($condition, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static _getPersistedConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_target_type="")
get all persisted conditions of target object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getNrLMsIndividualStyles()

static ilObjContentObject::_getNrLMsIndividualStyles ( )
static

get number of learning modules with individual styles

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

References $DIC, and $ilDB.

Referenced by ilContentStyleSettingsGUI\edit().

912  {
913  global $DIC;
914 
915  $ilDB = $DIC->database();
916 
917  // joining with style table (not perfectly nice)
918  $q = "SELECT count(*) as cnt FROM content_object, style_data " .
919  " WHERE stylesheet = style_data.id " .
920  " AND standard = " . $ilDB->quote(0, "integer");
921  $cset = $ilDB->query($q);
922  $crow = $ilDB->fetchAssoc($cset);
923 
924  return (int) $crow["cnt"];
925  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ _getNrLMsNoStyle()

static ilObjContentObject::_getNrLMsNoStyle ( )
static

get number of learning modules assigned no style

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

References $DIC, and $ilDB.

Referenced by ilContentStyleSettingsGUI\edit().

931  {
932  global $DIC;
933 
934  $ilDB = $DIC->database();
935 
936  $q = "SELECT count(*) as cnt FROM content_object " .
937  " WHERE stylesheet = " . $ilDB->quote(0, "integer");
938  $cset = $ilDB->query($q);
939  $crow = $ilDB->fetchAssoc($cset);
940 
941  return (int) $crow["cnt"];
942  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ _getNrOfAssignedLMs()

static ilObjContentObject::_getNrOfAssignedLMs (   $a_style_id)
static

gets the number of learning modules assigned to a content style

Parameters
int$a_style_idstyle id

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

References $DIC, and $ilDB.

Referenced by ilContentStyleSettingsGUI\edit().

894  {
895  global $DIC;
896 
897  $ilDB = $DIC->database();
898 
899  $q = "SELECT count(*) as cnt FROM content_object " .
900  " WHERE stylesheet = " . $ilDB->quote($a_style_id, "integer");
901  $cset = $ilDB->query($q);
902  $crow = $ilDB->fetchAssoc($cset);
903 
904  return (int) $crow["cnt"];
905  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ _lookup()

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

Lookup property.

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

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

References $DIC, $ilDB, $ilLog, and $res.

791  {
792  global $DIC;
793 
794  $ilDB = $DIC->database();
795  $ilLog = $DIC["ilLog"];
796 
797  $q = "SELECT " . $a_field . " FROM content_object " .
798  " WHERE id = " . $ilDB->quote($a_obj_id, "integer");
799 
800  $res = $ilDB->query($q);
801  $rec = $ilDB->fetchAssoc($res);
802 
803  return $rec[$a_field];
804  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
global $ilDB

◆ _lookupContObjIdByStyleId()

static ilObjContentObject::_lookupContObjIdByStyleId (   $a_style_id)
static

lookup style sheet ID

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

References $DIC, $ilDB, and $res.

Referenced by ilObjStyleSheet\_getClonableContentStyles().

838  {
839  global $DIC;
840 
841  $ilDB = $DIC->database();
842 
843  $q = "SELECT id FROM content_object " .
844  " WHERE stylesheet = " . $ilDB->quote($a_style_id, "integer");
845  $res = $ilDB->query($q);
846  $obj_ids = array();
847  while ($cont = $ilDB->fetchAssoc($res)) {
848  $obj_ids[] = $cont["id"];
849  }
850  return $obj_ids;
851  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupDisableDefaultFeedback()

static ilObjContentObject::_lookupDisableDefaultFeedback (   $a_id)
static

Lookup disable default feedback.

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

References $DIC, $ilDB, and $res.

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

857  {
858  global $DIC;
859 
860  $ilDB = $DIC->database();
861 
862  $q = "SELECT disable_def_feedback FROM content_object " .
863  " WHERE id = " . $ilDB->quote($a_id, "integer");
864  $res = $ilDB->query($q);
865  $rec = $ilDB->fetchAssoc($res);
866 
867  return $rec["disable_def_feedback"];
868  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupRestrictForwardNavigation()

static ilObjContentObject::_lookupRestrictForwardNavigation (   $a_obj_id)
static

Lookup forward restriction navigation.

Parameters
int$a_obj_idobject id
Returns
string property value

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

Referenced by ilLMPageGUI\processAnswer().

813  {
814  return self::_lookup($a_obj_id, "restrict_forw_nav");
815  }
+ Here is the caller graph for this function:

◆ _lookupStoreTries()

static ilObjContentObject::_lookupStoreTries (   $a_id)
static

Lookup disable default feedback.

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

References $DIC, $ilDB, and $res.

Referenced by ilLMPageGUI\__construct().

874  {
875  global $DIC;
876 
877  $ilDB = $DIC->database();
878 
879  $q = "SELECT store_tries FROM content_object " .
880  " WHERE id = " . $ilDB->quote($a_id, "integer");
881  $res = $ilDB->query($q);
882  $rec = $ilDB->fetchAssoc($res);
883 
884  return $rec["store_tries"];
885  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupStyleSheetId()

static ilObjContentObject::_lookupStyleSheetId (   $a_cont_obj_id)
static

lookup style sheet ID

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

References $DIC, $ilDB, and $res.

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

821  {
822  global $DIC;
823 
824  $ilDB = $DIC->database();
825 
826  $q = "SELECT stylesheet FROM content_object " .
827  " WHERE id = " . $ilDB->quote($a_cont_obj_id, "integer");
828  $res = $ilDB->query($q);
829  $sheet = $ilDB->fetchAssoc($res);
830 
831  return $sheet["stylesheet"];
832  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
global $ilDB
+ Here is the caller graph for this function:

◆ _moveLMStyles()

static ilObjContentObject::_moveLMStyles (   $a_from_style,
  $a_to_style 
)
static

move learning modules from one style to another

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

References $DIC, $ilDB, and ilObjectFactory\getInstanceByObjId().

Referenced by ilContentStyleSettingsGUI\moveIndividualStyles(), and ilContentStyleSettingsGUI\moveLMStyles().

753  {
754  global $DIC;
755 
756  $ilDB = $DIC->database();
757 
758  if ($a_from_style < 0) { // change / delete all individual styles
759  $q = "SELECT stylesheet FROM content_object, style_data " .
760  " WHERE content_object.stylesheet = style_data.id " .
761  " AND style_data.standard = " . $ilDB->quote(0, "integer") .
762  " AND content_object.stylesheet > " . $ilDB->quote(0, "integer");
763  $style_set = $ilDB->query($q);
764  while ($style_rec = $ilDB->fetchAssoc($style_set)) {
765  // assign learning modules to new style
766  $q = "UPDATE content_object SET " .
767  " stylesheet = " . $ilDB->quote((int) $a_to_style, "integer") .
768  " WHERE stylesheet = " . $ilDB->quote($style_rec["stylesheet"], "integer");
769  $ilDB->manipulate($q);
770 
771  // delete style
772  $style_obj = ilObjectFactory::getInstanceByObjId($style_rec["stylesheet"]);
773  $style_obj->delete();
774  }
775  } else {
776  $q = "UPDATE content_object SET " .
777  " stylesheet = " . $ilDB->quote((int) $a_to_style, "integer") .
778  " WHERE stylesheet = " . $ilDB->quote($a_from_style, "integer");
779  $ilDB->manipulate($q);
780  }
781  }
global $DIC
Definition: saml.php:7
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addFirstChapterAndPage()

ilObjContentObject::addFirstChapterAndPage ( )

Add first chapter and page.

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

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

417  {
418  $lng = $this->lng;
419 
420  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
421  include_once("./Modules/LearningModule/classes/class.ilStructureObject.php");
422  include_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
423 
424  $root_id = $this->lm_tree->getRootId();
425 
426  // chapter
427  $chap = new ilStructureObject($this);
428  $chap->setType("st");
429  $chap->setTitle($lng->txt("cont_new_chap"));
430  $chap->setLMId($this->getId());
431  $chap->create();
432  ilLMObject::putInTree($chap, $root_id, IL_FIRST_NODE);
433 
434  // page
435  $page = new ilLMPageObject($this);
436  $page->setType("pg");
437  $page->setTitle($lng->txt("cont_new_page"));
438  $page->setLMId($this->getId());
439  $page->create();
440  ilLMObject::putInTree($page, $chap->getId(), IL_FIRST_NODE);
441  }
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_ref_id)

Auto link glossary terms.

Parameters

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

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

3480  {
3481  // get terms
3482  include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
3483  $terms = ilGlossaryTerm::getTermList($a_glo_ref_id);
3484 
3485  // each get page: get content
3486  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
3487  $pages = ilLMPage::getAllPages($this->getType(), $this->getId());
3488 
3489  // determine terms that occur in the page
3490  $found_pages = array();
3491  foreach ($pages as $p) {
3492  $pg = new ilLMPage($p["id"]);
3493  $c = $pg->getXMLContent();
3494  foreach ($terms as $t) {
3495  if (is_int(stripos($c, $t["term"]))) {
3496  $found_pages[$p["id"]]["terms"][] = $t;
3497  if (!is_object($found_pages[$p["id"]]["page"])) {
3498  $found_pages[$p["id"]]["page"] = $pg;
3499  }
3500  }
3501  }
3502  reset($terms);
3503  }
3504 
3505  // ilPCParagraph autoLinkGlossariesPage with page and terms
3506  include_once("./Services/COPage/classes/class.ilPCParagraph.php");
3507  foreach ($found_pages as $id => $fp) {
3508  ilPCParagraph::autoLinkGlossariesPage($fp["page"], $fp["terms"]);
3509  }
3510  }
static getAllPages($a_parent_type, $a_parent_id, $a_lang="-")
Get all pages for parent object.
static autoLinkGlossariesPage($a_page, $a_terms)
Auto link glossary of whole page.
getId()
get object id public
static getTermList( $a_glo_ref_id, $searchterm="", $a_first_letter="", $a_def="", $a_tax_node=0, $a_add_amet_fields=false, array $a_amet_filter=null, $a_include_references=false)
Get all terms for given set of glossary ids.
getType()
get object type public
Extension of ilPageObject for learning modules.
+ Here is the call graph for this function:

◆ checkStructure()

ilObjContentObject::checkStructure ( )

Check tree (this has been copied from fixTree due to a bug fixing, should be reorganised)

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

References ilObject\$db, $ilDB, $nodes, ilObject\$tree, ilPageObject\_exists(), ilObject\getId(), and getLMTree().

1552  {
1553  $issues = [];
1554  $ilDB = $this->db;
1555 
1556  $tree = $this->getLMTree();
1557 
1558  // check numbering, if errors, renumber
1559  // it is very important to keep this step before deleting subtrees
1560  // in the following steps
1561  $set = $ilDB->query(
1562  "SELECT l1.child, l1.lft l1lft, l1.rgt l1rgt, l2.parent, l2.lft l2lft, l2.rgt l2rgt" .
1563  " FROM lm_tree l1" .
1564  " JOIN lm_tree l2 ON ( l1.child = l2.parent" .
1565  " AND l1.lm_id = l2.lm_id )" .
1566  " JOIN lm_data ON ( l1.child = lm_data.obj_id )" .
1567  " WHERE (l2.lft < l1.lft" .
1568  " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)" .
1569  " AND l1.lm_id = " . $ilDB->quote($this->getId(), "integer") .
1570  " ORDER BY lm_data.create_date DESC"
1571  );
1572  while ($rec = $ilDB->fetchAssoc($set)) {
1573  $issues[] = "Tree numbering: " . print_r($rec, true);
1574  }
1575 
1576  // delete subtrees that have no lm_data records (changed due to #20637)
1577  $set = $ilDB->query("SELECT * FROM lm_tree WHERE lm_tree.lm_id = " . $ilDB->quote($this->getId(), "integer"));
1578  while ($node = $ilDB->fetchAssoc($set)) {
1579  $q = "SELECT * FROM lm_data WHERE obj_id = " .
1580  $ilDB->quote($node["child"], "integer");
1581  $obj_set = $ilDB->query($q);
1582  $obj_rec = $ilDB->fetchAssoc($obj_set);
1583  if (!$obj_rec) {
1584  $issues[] = "Tree entry without data entry: " . print_r($node, true);
1585  }
1586  }
1587 
1588  // delete subtrees that have pages as parent
1589  $nodes = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1590  foreach ($nodes as $node) {
1591  $q = "SELECT * FROM lm_data WHERE obj_id = " .
1592  $ilDB->quote($node["parent"], "integer");
1593  $obj_set = $ilDB->query($q);
1594  $obj_rec = $ilDB->fetchAssoc($obj_set);
1595  if ($obj_rec["type"] == "pg") {
1596  $node_data = $tree->getNodeData($node["child"]);
1597  if ($tree->isInTree($node["child"])) {
1598  $issues[] = "Subtree with page parent: " . print_r($node_data, true);
1599  }
1600  }
1601  }
1602 
1603  // check for multi-references pages or chapters
1604  // if errors -> create copies of them here
1605  $set = $ilDB->query("SELECT DISTINCT l1.lm_id" .
1606  " FROM lm_tree l1" .
1607  " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1608  " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1609  " WHERE l1.child <> 1" .
1610  " AND l1.lm_id <> lm_data.lm_id" .
1611  " AND l1.lm_id = " . $ilDB->quote($this->getId(), "integer"));
1612  if ($rec = $ilDB->fetchAssoc($set)) {
1613  $set = $ilDB->query("SELECT DISTINCT l1.child " .
1614  " FROM lm_tree l1" .
1615  " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1616  " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1617  " WHERE l1.child <> 1" .
1618  " AND l1.lm_id <> lm_data.lm_id" .
1619  " AND l1.lm_id = " . $ilDB->quote($this->getId(), "integer"));
1620  include_once("./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
1621  while ($rec = $ilDB->fetchAssoc($set)) {
1622  $set3 = $ilDB->queryF(
1623  "SELECT * FROM lm_tree " .
1624  " WHERE child = %s ",
1625  array("integer"),
1626  array($rec["child"])
1627  );
1628  while ($rec3 = $ilDB->fetchAssoc($set3)) {
1629  $issues[] = "Multi-reference item: " . print_r($rec3, true);
1630  }
1631  }
1632  }
1633 
1634  // missing copage entries
1635  $set = $ilDB->queryF(
1636  "SELECT * FROM lm_data " .
1637  " WHERE lm_id = %s AND type = %s",
1638  array("integer", "text"),
1639  array($this->getId(), "pg")
1640  );
1641  while ($rec = $ilDB->fetchAssoc($set)) {
1642  if (!ilPageObject::_exists("lm", $rec["obj_id"], "-")) {
1643  $issues[] = "Missing COPage: " . print_r($rec, true);
1644  }
1645  }
1646 
1647 
1648  return $issues;
1649  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
getId()
get object id public
& getLMTree()
get content object tree
global $ilDB
+ Here is the call graph for this function:

◆ checkTree()

ilObjContentObject::checkTree ( )

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

References ilObject\$tree, and ilObject\getId().

Referenced by executeDragDrop().

1409  {
1410  $tree = new ilTree($this->getId());
1411  $tree->setTableNames('lm_tree', 'lm_data');
1412  $tree->setTreeTablePK("lm_id");
1413  $tree->checkTree();
1414  $tree->checkTreeChilds();
1415  //echo "checked";
1416  }
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 1111 of file class.ilObjContentObject.php.

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

1112  {
1113  return $this->clean_frames;
1114  }
+ Here is the caller graph for this function:

◆ cloneObject()

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

Clone learning module.

public

Parameters
inttarget ref_id
intcopy id

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

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

3288  {
3289  $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
3290  $this->cloneMetaData($new_obj);
3291  //$new_obj->createProperties();
3292 
3293  //copy online status if object is not the root copy object
3294  $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
3295 
3296  if (!$cp_options->isRootNode($this->getRefId())) {
3297  $new_obj->setOfflineStatus($this->getOfflineStatus());
3298  }
3299 
3300  // $new_obj->setTitle($this->getTitle());
3301  $new_obj->setDescription($this->getDescription());
3302  $new_obj->setLayoutPerPage($this->getLayoutPerPage());
3303  $new_obj->setLayout($this->getLayout());
3304  $new_obj->setTOCMode($this->getTOCMode());
3305  $new_obj->setActiveLMMenu($this->isActiveLMMenu());
3306  $new_obj->setActiveTOC($this->isActiveTOC());
3307  $new_obj->setActiveNumbering($this->isActiveNumbering());
3308  $new_obj->setActivePrintView($this->isActivePrintView());
3309  $new_obj->setActivePreventGlossaryAppendix($this->isActivePreventGlossaryAppendix());
3310  $new_obj->setActiveDownloads($this->isActiveDownloads());
3311  $new_obj->setActiveDownloadsPublic($this->isActiveDownloadsPublic());
3312  $new_obj->setPublicNotes($this->publicNotes());
3313  $new_obj->setCleanFrames($this->cleanFrames());
3314  $new_obj->setHistoryUserComments($this->isActiveHistoryUserComments());
3315  $new_obj->setPublicAccessMode($this->getPublicAccessMode());
3316  $new_obj->setPageHeader($this->getPageHeader());
3317  $new_obj->setRating($this->hasRating());
3318  $new_obj->setRatingPages($this->hasRatingPages());
3319  $new_obj->setDisableDefaultFeedback($this->getDisableDefaultFeedback());
3320  $new_obj->setProgressIcons($this->getProgressIcons());
3321  $new_obj->setStoreTries($this->getStoreTries());
3322  $new_obj->setRestrictForwardNavigation($this->getRestrictForwardNavigation());
3323  $new_obj->setAutoGlossaries($this->getAutoGlossaries());
3324 
3325  $new_obj->update();
3326 
3327  $new_obj->createLMTree();
3328 
3329  // copy style
3330  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3331  $style_id = $this->getStyleSheetId();
3332  if ($style_id > 0 &&
3335  $new_id = $style_obj->ilClone();
3336  $new_obj->setStyleSheetId($new_id);
3337  } else { // or just set the same standard style
3338  $new_obj->setStyleSheetId($style_id);
3339  }
3340  $new_obj->update();
3341 
3342  // copy content
3343  $copied_nodes = $this->copyAllPagesAndChapters($new_obj, $a_copy_id);
3344 
3345  // page header and footer
3346  if ($this->getHeaderPage() > 0 && ($new_page_header = $copied_nodes[$this->getHeaderPage()]) > 0) {
3347  $new_obj->setHeaderPage($new_page_header);
3348  }
3349  if ($this->getFooterPage() > 0 && ($new_page_footer = $copied_nodes[$this->getFooterPage()]) > 0) {
3350  $new_obj->setFooterPage($new_page_footer);
3351  }
3352  $new_obj->update();
3353 
3354  // Copy learning progress settings
3355  include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
3356  $obj_settings = new ilLPObjSettings($this->getId());
3357  $obj_settings->cloneSettings($new_obj->getId());
3358  unset($obj_settings);
3359 
3360  // copy (page) multilang settings
3361  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
3362  $ot = ilObjectTranslation::getInstance($this->getId());
3363  $ot->copy($new_obj->getId());
3364 
3365  // copy lm menu
3366  include_once './Modules/LearningModule/classes/class.ilLMMenuEditor.php';
3367  $menu = new ilLMMenuEditor();
3368  $menu->setObjId($this->getId());
3369  $new_menu = new ilLMMenuEditor();
3370  $new_menu->setObjId($new_obj->getId());
3371  foreach ($menu->getMenuEntries() as $entry) {
3372  /*'id' => $row->id,
3373  'title' => $row->title,
3374  'link' => $row->target,
3375  'type' => $row->link_type,
3376  'ref_id' => $row->link_ref_id,
3377  'active'*/
3378 
3379  $new_menu->setTarget($entry["link"]);
3380  $new_menu->setTitle($entry["title"]);
3381  $new_menu->setLinkType($entry["type"]);
3382  $new_menu->setLinkRefId($entry["ref_id"]);
3383  $new_menu->create();
3384  ilLMMenuEditor::writeActive($new_menu->getEntryId(), $entry["active"] == "y" ? true : false);
3385  }
3386 
3387 
3388  return $new_obj;
3389  }
getStyleSheetId()
get ID of assigned style sheet object
getLayout()
get default page layout of content object (see directory layouts/)
getStoreTries()
Get store tries.
getOfflineStatus()
Get offline status.
getAutoGlossaries()
Get auto glossaries.
getPublicAccessMode()
get public access mode ("complete" | "selected")
static _lookupStandard($a_id)
Lookup standard flag.
getLayoutPerPage()
Get layout per page.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getProgressIcons()
Get progress icons.
getPageHeader()
get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER)
getId()
get object id public
getTOCMode()
get toc mode ("chapters" | "pages")
cloneMetaData($target_obj)
Copy meta data.
class for editing lm menu
getDisableDefaultFeedback()
Get disable default feedback for questions.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
copyAllPagesAndChapters($a_target_obj, $a_copy_id=0)
Copy all pages and chapters.
getRestrictForwardNavigation()
Get restrict forward navigation.
static getInstance($a_obj_id)
Get instance.
getDescription()
get description of content object
static writeActive($entry_id, $active)
Write status for entry id.
+ Here is the call graph for this function:

◆ copyAllPagesAndChapters()

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

Copy all pages and chapters.

Parameters
object$a_target_objtarget learning module

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

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

Referenced by cloneObject().

3397  {
3398  $parent_id = $a_target_obj->lm_tree->readRootId();
3399 
3400  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
3401  include_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
3402 
3403  // get all chapters of root lm
3404  $chapters = $this->lm_tree->getChildsByType($this->lm_tree->readRootId(), "st");
3405  $copied_nodes = array();
3406  //$time = time();
3407  foreach ($chapters as $chap) {
3408  $cid = ilLMObject::pasteTree(
3409  $a_target_obj,
3410  $chap["child"],
3411  $parent_id,
3412  IL_LAST_NODE,
3413  $time,
3414  $copied_nodes,
3415  true,
3416  $this
3417  );
3418  $target = $cid;
3419  }
3420 
3421  // copy free pages
3422  $pages = ilLMPageObject::getPageList($this->getId());
3423  foreach ($pages as $p) {
3424  if (!$this->lm_tree->isInTree($p["obj_id"])) {
3425  $item = new ilLMPageObject($this, $p["obj_id"]);
3426  $target_item = $item->copy($a_target_obj);
3427  $copied_nodes[$item->getId()] = $target_item->getId();
3428  }
3429  }
3430 
3431  // Add mapping for pages and chapters
3432  include_once './Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
3434  foreach ($copied_nodes as $old_id => $new_id) {
3435  $options->appendMapping(
3436  $this->getRefId() . '_' . $old_id,
3437  $a_target_obj->getRefId() . '_' . $new_id
3438  );
3439  }
3440 
3441  ilLMObject::updateInternalLinks($copied_nodes);
3442 
3443  $a_target_obj->checkTree();
3444 
3445  return $copied_nodes;
3446  }
static updateInternalLinks($a_copied_nodes, $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
$time
Definition: cron.php:21
static _getInstance($a_copy_id)
Get instance of copy wizard options.
Class ilLMPageObject.
getId()
get object id public
const IL_LAST_NODE
Definition: class.ilTree.php:4
getRefId()
get reference id public
static pasteTree( $a_target_lm, $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_source_lm=null)
Paste item (tree) from clipboard to current lm.
static getPageList($lm_id)
static
$target
Definition: test.php:19
+ 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 89 of file class.ilObjContentObject.php.

References ilObject\createMetaData(), createProperties(), ilObject\setOfflineStatus(), and updateAutoGlossaries().

90  {
91  $this->setOfflineStatus(true);
92  parent::create();
93 
94  // meta data will be created by
95  // import parser
96  if (!$a_no_meta_data) {
97  $this->createMetaData();
98  }
99 
100  $this->createProperties();
101  $this->updateAutoGlossaries();
102  }
createMetaData()
create meta data entry
updateAutoGlossaries()
Update auto glossaries.
setOfflineStatus($a_status)
Set offline status.
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 546 of file class.ilObjContentObject.php.

References $a_type, ilObject\$error, $ilErr, ilUtil\getDataDir(), ilObject\getId(), and ilUtil\makeDir().

547  {
549 
550  $lm_data_dir = ilUtil::getDataDir() . "/lm_data";
551  if (!is_writable($lm_data_dir)) {
552  $ilErr->raiseError("Content object Data Directory (" . $lm_data_dir
553  . ") not writeable.", $ilErr->FATAL);
554  }
555  // create learning module directory (data_dir/lm_data/lm_<id>)
556  $lm_dir = $lm_data_dir . "/lm_" . $this->getId();
557  ilUtil::makeDir($lm_dir);
558  if (!@is_dir($lm_dir)) {
559  $ilErr->raiseError("Creation of Learning Module Directory failed.", $ilErr->FATAL);
560  }
561  // create Export subdirectory (data_dir/lm_data/lm_<id>/Export)
562  switch ($a_type) {
563  // scorm
564  case "scorm":
565  $export_dir = $lm_dir . "/export_scorm";
566  break;
567 
568  default: // = xml
569  if (substr($a_type, 0, 4) == "html") {
570  $export_dir = $lm_dir . "/export_" . $a_type;
571  } else {
572  $export_dir = $lm_dir . "/export";
573  }
574  break;
575  }
576  ilUtil::makeDir($export_dir);
577 
578  if (!@is_dir($export_dir)) {
579  $ilErr->raiseError("Creation of Export Directory failed.", $ilErr->FATAL);
580  }
581  }
$ilErr
Definition: raiseError.php:18
$a_type
Definition: workflow.php:92
getId()
get object id public
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:

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

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

Referenced by importFromZipFile().

478  {
480 
481  $lm_data_dir = ilUtil::getDataDir() . "/lm_data";
482  if (!is_writable($lm_data_dir)) {
483  $ilErr->raiseError("Content object Data Directory (" . $lm_data_dir
484  . ") not writeable.", $ilErr->FATAL);
485  }
486 
487  // create learning module directory (data_dir/lm_data/lm_<id>)
488  $lm_dir = $lm_data_dir . "/lm_" . $this->getId();
489  ilUtil::makeDir($lm_dir);
490  if (!@is_dir($lm_dir)) {
491  $ilErr->raiseError("Creation of Learning Module Directory failed.", $ilErr->FATAL);
492  }
493 
494  // create import subdirectory (data_dir/lm_data/lm_<id>/import)
495  $import_dir = $lm_dir . "/import";
497  if (!@is_dir($import_dir)) {
498  $ilErr->raiseError("Creation of Import Directory failed.", $ilErr->FATAL);
499  }
500  }
$ilErr
Definition: raiseError.php:18
getId()
get object id public
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 358 of file class.ilObjContentObject.php.

References ilObject\getId().

359  {
360  $this->lm_tree = new ilTree($this->getId());
361  $this->lm_tree->setTreeTablePK("lm_id");
362  $this->lm_tree->setTableNames('lm_tree', 'lm_data');
363  $this->lm_tree->addTree($this->getId(), 1);
364  }
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 1248 of file class.ilObjContentObject.php.

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

Referenced by create().

1249  {
1250  $ilDB = $this->db;
1251 
1252  $q = "INSERT INTO content_object (id) VALUES (" . $ilDB->quote($this->getId(), "integer") . ")";
1253  $ilDB->manipulate($q);
1254 
1255  // #14661
1256  include_once("./Services/Notes/classes/class.ilNote.php");
1257  ilNote::activateComments($this->getId(), 0, $this->getType(), true);
1258 
1259  $this->readProperties(); // to get db default values
1260  }
getId()
get object id public
readProperties()
read content object properties
getType()
get object type public
static activateComments($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_activate=true)
Activate notes feature.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilObjContentObject::delete ( )

delete learning module and all related data

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

public

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

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

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

616  {
617  $ilDB = $this->db;
618 
619  // always call parent delete function first!!
620  if (!parent::delete()) {
621  return false;
622  }
623 
624  // delete lm object data
625  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
627 
628  // delete meta data of content object
629  $this->deleteMetaData();
630 
631 
632  // delete learning module tree
633  $this->lm_tree->removeTree($this->lm_tree->getTreeId());
634 
635  // delete data directory
637 
638  // delete content object record
639  $q = "DELETE FROM content_object WHERE id = " .
640  $ilDB->quote($this->getId(), "integer");
641  $ilDB->manipulate($q);
642 
643  // delete lm menu entries
644  $q = "DELETE FROM lm_menu WHERE lm_id = " .
645  $ilDB->quote($this->getId(), "integer");
646  $ilDB->manipulate($q);
647 
648  // remove auto glossary entries
649  $ilDB->manipulate(
650  "DELETE FROM lm_glossaries WHERE " .
651  " lm_id = " . $ilDB->quote($this->getId(), "integer")
652  );
653 
654 
655  return true;
656  }
getId()
get object id public
static _deleteAllObjectData(&$a_cobj)
delete all objects of content object (digi book / learning module)
getDataDirectory()
get data directory
global $ilDB
deleteMetaData()
delete meta data entry
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 2925 of file class.ilObjContentObject.php.

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

2926  {
2927  $lmtree = new ilTree($this->getId());
2928  $lmtree->setTableNames('lm_tree', 'lm_data');
2929  $lmtree->setTreeTablePK("lm_id");
2930  //echo "-".$source_id."-".$target_id."-".$first_child."-".$as_subitem."-";
2931  $source_obj = ilLMObjectFactory::getInstance($this, $source_id, true);
2932  $source_obj->setLMId($this->getId());
2933 
2934  if (!$first_child) {
2935  $target_obj = ilLMObjectFactory::getInstance($this, $target_id, true);
2936  $target_obj->setLMId($this->getId());
2937  $target_parent = $lmtree->getParentId($target_id);
2938  }
2939 
2940  // handle pages
2941  if ($source_obj->getType() == "pg") {
2942  //echo "1";
2943  if ($lmtree->isInTree($source_obj->getId())) {
2944  $node_data = $lmtree->getNodeData($source_obj->getId());
2945 
2946  // cut on move
2947  if ($movecopy == "move") {
2948  $parent_id = $lmtree->getParentId($source_obj->getId());
2949  $lmtree->deleteTree($node_data);
2950 
2951  // write history entry
2952  require_once("./Services/History/classes/class.ilHistory.php");
2954  $source_obj->getId(),
2955  "cut",
2956  array(ilLMObject::_lookupTitle($parent_id), $parent_id),
2957  $this->getType() . ":pg"
2958  );
2960  $parent_id,
2961  "cut_page",
2962  array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
2963  $this->getType() . ":st"
2964  );
2965  } else {
2966  // copy page
2967  $new_page = $source_obj->copy();
2968  $source_id = $new_page->getId();
2969  $source_obj = $new_page;
2970  }
2971 
2972  // paste page
2973  if (!$lmtree->isInTree($source_obj->getId())) {
2974  if ($first_child) { // as first child
2975  $target_pos = IL_FIRST_NODE;
2976  $parent = $target_id;
2977  } elseif ($as_subitem) { // as last child
2978  $parent = $target_id;
2979  $target_pos = IL_FIRST_NODE;
2980  $pg_childs = $lmtree->getChildsByType($parent, "pg");
2981  if (count($pg_childs) != 0) {
2982  $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
2983  }
2984  } else { // at position
2985  $target_pos = $target_id;
2986  $parent = $target_parent;
2987  }
2988 
2989  // insert page into tree
2990  $lmtree->insertNode(
2991  $source_obj->getId(),
2992  $parent,
2993  $target_pos
2994  );
2995 
2996  // write history entry
2997  if ($movecopy == "move") {
2998  // write history comments
2999  include_once("./Services/History/classes/class.ilHistory.php");
3001  $source_obj->getId(),
3002  "paste",
3003  array(ilLMObject::_lookupTitle($parent), $parent),
3004  $this->getType() . ":pg"
3005  );
3007  $parent,
3008  "paste_page",
3009  array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
3010  $this->getType() . ":st"
3011  );
3012  }
3013  }
3014  }
3015  }
3016 
3017  // handle chapters
3018  if ($source_obj->getType() == "st") {
3019  //echo "2";
3020  $source_node = $lmtree->getNodeData($source_id);
3021  $subnodes = $lmtree->getSubtree($source_node);
3022 
3023  // check, if target is within subtree
3024  foreach ($subnodes as $subnode) {
3025  if ($subnode["obj_id"] == $target_id) {
3026  return;
3027  }
3028  }
3029 
3030  $target_pos = $target_id;
3031 
3032  if ($first_child) { // as first subchapter
3033  $target_pos = IL_FIRST_NODE;
3034  $target_parent = $target_id;
3035 
3036  $pg_childs = $lmtree->getChildsByType($target_parent, "pg");
3037  if (count($pg_childs) != 0) {
3038  $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
3039  }
3040  } elseif ($as_subitem) { // as last subchapter
3041  $target_parent = $target_id;
3042  $target_pos = IL_FIRST_NODE;
3043  $childs = $lmtree->getChilds($target_parent);
3044  if (count($childs) != 0) {
3045  $target_pos = $childs[count($childs) - 1]["obj_id"];
3046  }
3047  }
3048 
3049  // insert into
3050  /*
3051  if ($position == "into")
3052  {
3053  $target_parent = $target_id;
3054  $target_pos = IL_FIRST_NODE;
3055 
3056  // if target_pos is still first node we must skip all pages
3057  if ($target_pos == IL_FIRST_NODE)
3058  {
3059  $pg_childs =& $lmtree->getChildsByType($target_parent, "pg");
3060  if (count($pg_childs) != 0)
3061  {
3062  $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
3063  }
3064  }
3065  }
3066  */
3067 
3068 
3069  // delete source tree
3070  if ($movecopy == "move") {
3071  $lmtree->deleteTree($source_node);
3072  } else {
3073  // copy chapter (incl. subcontents)
3074  $new_chapter = $source_obj->copy($lmtree, $target_parent, $target_pos);
3075  }
3076 
3077  if (!$lmtree->isInTree($source_id)) {
3078  $lmtree->insertNode($source_id, $target_parent, $target_pos);
3079 
3080  // insert moved tree
3081  if ($movecopy == "move") {
3082  foreach ($subnodes as $node) {
3083  if ($node["obj_id"] != $source_id) {
3084  $lmtree->insertNode($node["obj_id"], $node["parent"]);
3085  }
3086  }
3087  }
3088  }
3089 
3090  // check the tree
3091  $this->checkTree();
3092  }
3093 
3094  $this->checkTree();
3095  }
$target_id
Definition: goto.php:49
static _lookupTitle($a_obj_id)
Lookup title.
static _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
static getInstance(&$a_content_obj, $a_id=0, $a_halt=true)
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 1833 of file class.ilObjContentObject.php.

Referenced by exportXML().

1834  {
1835  include_once("./Modules/File/classes/class.ilObjFile.php");
1836 
1837  foreach ($this->file_ids as $file_id) {
1838  $expLog->write(date("[y-m-d H:i:s] ") . "File Item " . $file_id);
1839  $file_obj = new ilObjFile($file_id, false);
1840  $file_obj->export($a_target_dir);
1841  unset($file_obj);
1842  }
1843  }
+ 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 2819 of file class.ilObjContentObject.php.

References exportFOStructureObjects().

2820  {
2821  // fo:root (start)
2822  $attrs = array();
2823  $attrs["xmlns:fo"] = "http://www.w3.org/1999/XSL/Format";
2824  $a_xml_writer->xmlStartTag("fo:root", $attrs);
2825 
2826  // fo:layout-master-set (start)
2827  $attrs = array();
2828  $a_xml_writer->xmlStartTag("fo:layout-master-set", $attrs);
2829 
2830  // fo:simple-page-master (start)
2831  $attrs = array();
2832  $attrs["master-name"] = "DinA4";
2833  $attrs["page-height"] = "29.7cm";
2834  $attrs["page-width"] = "21cm";
2835  $attrs["margin-top"] = "4cm";
2836  $attrs["margin-bottom"] = "1cm";
2837  $attrs["margin-left"] = "2.8cm";
2838  $attrs["margin-right"] = "7.3cm";
2839  $a_xml_writer->xmlStartTag("fo:simple-page-master", $attrs);
2840 
2841  // fo:region-body (complete)
2842  $attrs = array();
2843  $attrs["margin-top"] = "0cm";
2844  $attrs["margin-bottom"] = "1.25cm";
2845  $a_xml_writer->xmlElement("fo:region-body", $attrs);
2846 
2847  // fo:region-before (complete)
2848  $attrs = array();
2849  $attrs["extent"] = "1cm";
2850  $a_xml_writer->xmlElement("fo:region-before", $attrs);
2851 
2852  // fo:region-after (complete)
2853  $attrs = array();
2854  $attrs["extent"] = "1cm";
2855  $a_xml_writer->xmlElement("fo:region-after", $attrs);
2856 
2857  // fo:simple-page-master (end)
2858  $a_xml_writer->xmlEndTag("fo:simple-page-master");
2859 
2860  // fo:layout-master-set (end)
2861  $a_xml_writer->xmlEndTag("fo:layout-master-set");
2862 
2863  // fo:page-sequence (start)
2864  $attrs = array();
2865  $attrs["master-reference"] = "DinA4";
2866  $a_xml_writer->xmlStartTag("fo:page-sequence", $attrs);
2867 
2868  // fo:flow (start)
2869  $attrs = array();
2870  $attrs["flow-name"] = "xsl-region-body";
2871  $a_xml_writer->xmlStartTag("fo:flow", $attrs);
2872 
2873 
2874  // StructureObjects
2875  $this->exportFOStructureObjects($a_xml_writer, $expLog);
2876 
2877  // fo:flow (end)
2878  $a_xml_writer->xmlEndTag("fo:flow");
2879 
2880  // fo:page-sequence (end)
2881  $a_xml_writer->xmlEndTag("fo:page-sequence");
2882 
2883  // fo:root (end)
2884  $a_xml_writer->xmlEndTag("fo:root");
2885  }
exportFOStructureObjects(&$a_xml_writer)
export structure objects to fo
+ 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 2893 of file class.ilObjContentObject.php.

Referenced by exportFO().

2894  {
2895  $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
2896  foreach ($childs as $child) {
2897  if ($child["type"] != "st") {
2898  continue;
2899  }
2900 
2901  $structure_obj = new ilStructureObject($this, $child["obj_id"]);
2902  $structure_obj->exportFO($a_xml_writer, $expLog);
2903  unset($structure_obj);
2904  }
2905  }
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 2104 of file class.ilObjContentObject.php.

References $_GET, $f, $files, $GLOBALS, $ilUser, $lang, $locator, $style, $tpl, $user, ilObject\_exists(), ilObject\_lookupType(), ilPlayerUtil\copyPlayerFilesToTargetDirectory(), ilExplorerBaseGUI\createHTMLExportDirs(), ilUtil\delDir(), exportHTMLFile(), exportHTMLGlossaryTerms(), exportHTMLMOB(), exportHTMLPages(), getExportDirectory(), ilPlayerUtil\getFlashVideoPlayerDirectory(), ilObject\getId(), ilUtil\getImagePath(), ilObjectTranslation\getInstance(), ilMathJax\getInstance(), getStyleSheetId(), ilUtil\getStyleSheetLocation(), ilObjStyleSheet\getSyntaxStylePath(), ilObject\getType(), ilUtil\getWebspaceDir(), isActiveTOC(), ilUtil\makeDir(), ilUtil\makeDirParents(), ilMathJax\PURPOSE_EXPORT, ilUtil\rCopy(), and ilUtil\zip().

Referenced by exportSCORM().

2105  {
2106  $tpl = $this->tpl;
2107  $ilLocator = $this->locator;
2108  $ilUser = $this->user;
2109 
2110  $user_lang = $ilUser->getLanguage();
2111 
2112  // initialize temporary target directory
2113  ilUtil::delDir($a_target_dir);
2114  ilUtil::makeDir($a_target_dir);
2115  $mob_dir = $a_target_dir . "/mobs";
2116  ilUtil::makeDir($mob_dir);
2117  $file_dir = $a_target_dir . "/files";
2118  ilUtil::makeDir($file_dir);
2119  $teximg_dir = $a_target_dir . "/teximg";
2120  ilUtil::makeDir($teximg_dir);
2121  $style_dir = $a_target_dir . "/style";
2122  ilUtil::makeDir($style_dir);
2123  $style_img_dir = $a_target_dir . "/style/images";
2124  ilUtil::makeDir($style_img_dir);
2125  $content_style_dir = $a_target_dir . "/content_style";
2126  ilUtil::makeDir($content_style_dir);
2127  $content_style_img_dir = $a_target_dir . "/content_style/images";
2128  ilUtil::makeDir($content_style_img_dir);
2129 
2130  // init the mathjax rendering for HTML export
2131  include_once './Services/MathJax/classes/class.ilMathJax.php';
2133 
2134  // export system style sheet
2135  $location_stylesheet = ilUtil::getStyleSheetLocation("filesystem");
2136  $style_name = $ilUser->prefs["style"] . ".css";
2137  copy($location_stylesheet, $style_dir . "/" . $style_name);
2138  $fh = fopen($location_stylesheet, "r");
2139  $css = fread($fh, filesize($location_stylesheet));
2140  preg_match_all("/url\(([^\)]*)\)/", $css, $files);
2141  foreach (array_unique($files[1]) as $fileref) {
2142  $css_fileref = str_replace(array("'", '"'), "", $fileref);
2143  $fileref = dirname($location_stylesheet) . "/" . $css_fileref;
2144  if (is_file($fileref)) {
2145  //echo "<br>make dir: ".dirname($style_dir."/".$css_fileref);
2146  ilUtil::makeDirParents(dirname($style_dir . "/" . $css_fileref));
2147  //echo "<br>copy: ".$fileref." TO ".$style_dir."/".$css_fileref;
2148  copy($fileref, $style_dir . "/" . $css_fileref);
2149  }
2150  }
2151  fclose($fh);
2152  $location_stylesheet = ilUtil::getStyleSheetLocation();
2153 
2154  // export content style sheet
2155  if ($this->getStyleSheetId() < 1) {
2156  $cont_stylesheet = "./Services/COPage/css/content.css";
2157 
2158  $css = fread(fopen($cont_stylesheet, 'r'), filesize($cont_stylesheet));
2159  preg_match_all("/url\(([^\)]*)\)/", $css, $files);
2160  foreach (array_unique($files[1]) as $fileref) {
2161  $target_fileref = str_replace("..", ".", $fileref);
2162  $target_fileref = str_replace('"', "", $target_fileref);
2163  if (is_file($target_fileref)) {
2164  copy($target_fileref, $content_style_img_dir . "/" . basename($target_fileref));
2165  }
2166  $css = str_replace($fileref, "images/" . basename($target_fileref), $css);
2167  }
2168  fwrite(fopen($content_style_dir . "/content.css", 'w'), $css);
2169  } else {
2170  $style = new ilObjStyleSheet($this->getStyleSheetId());
2171  $style->writeCSSFile($content_style_dir . "/content.css", "images");
2172  $style->copyImagesToDir($content_style_img_dir);
2173  }
2174 
2175  // export syntax highlighting style
2176  $syn_stylesheet = ilObjStyleSheet::getSyntaxStylePath();
2177  copy($syn_stylesheet, $a_target_dir . "/syntaxhighlight.css");
2178 
2179  // get learning module presentation gui class
2180  include_once("./Modules/LearningModule/classes/class.ilLMPresentationGUI.php");
2181  $_GET["cmd"] = "nop";
2182  $get_transl = $_GET["transl"];
2183  $_GET["transl"] = "";
2184  $lm_gui = new ilLMPresentationGUI();
2185  $lm_gui->setOfflineMode(true, ($a_lang == "all"));
2186  $lm_gui->setOfflineDirectory($a_target_dir);
2187  $lm_gui->setExportFormat($a_export_format);
2188 
2189  $ot = ilObjectTranslation::getInstance($this->getId());
2190  $langs = array();
2191  if ($a_lang != "all") {
2192  $langs = array($a_lang);
2193  } else {
2194  $ot_langs = $ot->getLanguages();
2195  foreach ($ot_langs as $otl) {
2196  $langs[] = $otl["lang_code"];
2197  }
2198  }
2199 
2200  // init collector arrays
2201  $this->offline_mobs = array();
2202  $this->offline_int_links = array();
2203  $this->offline_files = array();
2204 
2205  // iterate all languages
2206  foreach ($langs as $lang) {
2207  if ($lang != "") {
2208  $ilUser->setLanguage($lang);
2209  $ilUser->setCurrentLanguage($lang);
2210  } else {
2211  $ilUser->setLanguage($user_lang);
2212  $ilUser->setCurrentLanguage($user_lang);
2213  }
2214 
2215  if ($lang != "") {
2216  if ($lang == $ot->getMasterLanguage()) {
2217  $lm_gui->lang = "";
2218  } else {
2219  $lm_gui->lang = $lang;
2220  }
2221  }
2222 
2223  // export pages
2224  // now: forward ("all" info to export files and links)
2225  $this->exportHTMLPages($lm_gui, $a_target_dir, $lm_gui->lang, ($a_lang == "all"));
2226 
2227  // export table of contents
2228  $ilLocator->clearItems();
2229  if ($this->isActiveTOC()) {
2230  $tpl = new ilTemplate("tpl.main.html", true, true);
2231 
2232  $GLOBALS["tpl"] = $tpl;
2233 
2234  $lm_gui->tpl = $tpl;
2235  $content = $lm_gui->showTableOfContents();
2236  //var_dump($content); exit;
2237  if ($a_lang == "all") {
2238  $file = $a_target_dir . "/table_of_contents_" . $lang . ".html";
2239  } else {
2240  $file = $a_target_dir . "/table_of_contents.html";
2241  }
2242 
2243  // open file
2244  if (!($fp = @fopen($file, "w+"))) {
2245  die("<b>Error</b>: Could not open \"" . $file . "\" for writing" .
2246  " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />");
2247  }
2248  chmod($file, 0770);
2249  fwrite($fp, $content);
2250  fclose($fp);
2251  }
2252  }
2253 
2254  // export glossary terms
2255  $this->exportHTMLGlossaryTerms($lm_gui, $a_target_dir);
2256 
2257  // export all media objects
2258  $linked_mobs = array();
2259  foreach ($this->offline_mobs as $mob) {
2260  if (ilObject::_exists($mob) && ilObject::_lookupType($mob) == "mob") {
2261  $this->exportHTMLMOB($a_target_dir, $lm_gui, $mob, "_blank", $linked_mobs);
2262  }
2263  }
2264  $linked_mobs2 = array(); // mobs linked in link areas
2265  foreach ($linked_mobs as $mob) {
2266  if (ilObject::_exists($mob)) {
2267  $this->exportHTMLMOB($a_target_dir, $lm_gui, $mob, "_blank", $linked_mobs2);
2268  }
2269  }
2270  $_GET["obj_type"] = "MediaObject";
2271  $_GET["obj_id"] = $a_mob_id;
2272  $_GET["cmd"] = "";
2273 
2274  // export all file objects
2275  foreach ($this->offline_files as $file) {
2276  $this->exportHTMLFile($a_target_dir, $file);
2277  }
2278 
2279  // export questions (images)
2280  if (count($this->q_ids) > 0) {
2281  foreach ($this->q_ids as $q_id) {
2282  ilUtil::makeDirParents($a_target_dir . "/assessment/0/" . $q_id . "/images");
2283  ilUtil::rCopy(
2284  ilUtil::getWebspaceDir() . "/assessment/0/" . $q_id . "/images",
2285  $a_target_dir . "/assessment/0/" . $q_id . "/images"
2286  );
2287  }
2288  }
2289 
2290  // export images
2291  $image_dir = $a_target_dir . "/images";
2292  ilUtil::makeDir($image_dir);
2293  ilUtil::makeDir($image_dir . "/browser");
2294  copy(
2295  ilUtil::getImagePath("enlarge.svg", false, "filesystem"),
2296  $image_dir . "/enlarge.svg"
2297  );
2298  copy(
2299  ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
2300  $image_dir . "/browser/plus.png"
2301  );
2302  copy(
2303  ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
2304  $image_dir . "/browser/minus.png"
2305  );
2306  copy(
2307  ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
2308  $image_dir . "/browser/blank.png"
2309  );
2310  copy(
2311  ilUtil::getImagePath("spacer.png", false, "filesystem"),
2312  $image_dir . "/spacer.png"
2313  );
2314  copy(
2315  ilUtil::getImagePath("icon_st.svg", false, "filesystem"),
2316  $image_dir . "/icon_st.svg"
2317  );
2318  copy(
2319  ilUtil::getImagePath("icon_pg.svg", false, "filesystem"),
2320  $image_dir . "/icon_pg.svg"
2321  );
2322  copy(
2323  ilUtil::getImagePath("icon_lm.svg", false, "filesystem"),
2324  $image_dir . "/icon_lm.svg"
2325  );
2326  copy(
2327  ilUtil::getImagePath("nav_arr_L.png", false, "filesystem"),
2328  $image_dir . "/nav_arr_L.png"
2329  );
2330  copy(
2331  ilUtil::getImagePath("nav_arr_R.png", false, "filesystem"),
2332  $image_dir . "/nav_arr_R.png"
2333  );
2334 
2335  // export flv/mp3 player
2336  $services_dir = $a_target_dir . "/Services";
2337  ilUtil::makeDir($services_dir);
2338  $media_service_dir = $services_dir . "/MediaObjects";
2339  ilUtil::makeDir($media_service_dir);
2340  include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
2341  $flv_dir = $a_target_dir . "/" . ilPlayerUtil::getFlashVideoPlayerDirectory();
2342  ilUtil::makeDirParents($flv_dir);
2343  $mp3_dir = $media_service_dir . "/flash_mp3_player";
2344  ilUtil::makeDir($mp3_dir);
2345  // copy(ilPlayerUtil::getFlashVideoPlayerFilename(true),
2346  // $flv_dir."/".ilPlayerUtil::getFlashVideoPlayerFilename());
2348  include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
2351 
2352  // js files
2353  ilUtil::makeDir($a_target_dir . '/js');
2354  ilUtil::makeDir($a_target_dir . '/js/yahoo');
2355  ilUtil::makeDir($a_target_dir . '/css');
2356  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
2357  foreach (self::getSupplyingExportFiles($a_target_dir) as $f) {
2358  if ($f["source"] != "") {
2359  ilUtil::makeDirParents(dirname($f["target"]));
2360  copy($f["source"], $f["target"]);
2361  }
2362  }
2363  // template workaround: reset of template
2364  $tpl = new ilTemplate("tpl.main.html", true, true);
2365  $tpl->setVariable("LOCATION_STYLESHEET", $location_stylesheet);
2366  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2367 
2368  if ($a_lang != "") {
2369  $ilUser->setLanguage($user_lang);
2370  $ilUser->setCurrentLanguage($user_lang);
2371  }
2372 
2373  // zip everything
2374  if ($a_zip_file) {
2375  if ($a_lang == "") {
2376  $zip_target_dir = $this->getExportDirectory("html");
2377  } else {
2378  $zip_target_dir = $this->getExportDirectory("html_" . $a_lang);
2379  ilUtil::makeDir($zip_target_dir);
2380  }
2381 
2382  // zip it all
2383  $date = time();
2384  $zip_file = $zip_target_dir . "/" . $date . "__" . IL_INST_ID . "__" .
2385  $this->getType() . "_" . $this->getId() . ".zip";
2386  //echo "-".$a_target_dir."-".$zip_file."-"; exit;
2387  ilUtil::zip($a_target_dir, $zip_file);
2388  ilUtil::delDir($a_target_dir);
2389  }
2390  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
exportHTMLGlossaryTerms(&$a_lm_gui, $a_target_dir)
export glossary terms
$style
Definition: example_012.php:70
getStyleSheetId()
get ID of assigned style sheet object
getExportDirectory($a_type="xml")
get export directory of lm
$files
Definition: metarefresh.php:49
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
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
Class ilLMPresentationGUI.
static createHTMLExportDirs($a_target_dir)
Create html export directories.
getId()
get object id public
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.
$ilUser
Definition: imgupload.php:18
static getSyntaxStylePath()
get syntax style path
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
getType()
get object type public
const PURPOSE_EXPORT
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 ...
static getInstance()
Singleton: get instance.
exportHTMLPages(&$a_lm_gui, $a_target_dir, $a_lang="", $a_all_languages=false)
export all pages of learning module to html file
static copyPlayerFilesToTargetDirectory($a_target_dir)
Copy css files to target dir.
static getInstance($a_obj_id)
Get instance.
Class ilObjStyleSheet.
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349
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
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ 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 2507 of file class.ilObjContentObject.php.

References ilUtil\makeDir().

Referenced by exportHTML().

2508  {
2509  $file_dir = $a_target_dir . "/files/file_" . $a_file_id;
2510  ilUtil::makeDir($file_dir);
2511  include_once("./Modules/File/classes/class.ilObjFile.php");
2512  $file_obj = new ilObjFile($a_file_id, false);
2513  $source_file = $file_obj->getDirectory($file_obj->getVersion()) . "/" . $file_obj->getFileName();
2514  if (!is_file($source_file)) {
2515  $source_file = $file_obj->getDirectory() . "/" . $file_obj->getFileName();
2516  }
2517  if (is_file($source_file)) {
2518  copy($source_file, $file_dir . "/" . $file_obj->getFileName());
2519  }
2520  }
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 2588 of file class.ilObjContentObject.php.

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

Referenced by exportHTML().

2589  {
2590  $ilLocator = $this->locator;
2591 
2592  foreach ($this->offline_int_links as $int_link) {
2593  $ilLocator->clearItems();
2594  if ($int_link["type"] == "git") {
2595  $tpl = new ilTemplate("tpl.main.html", true, true);
2596  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2597 
2598  $_GET["obj_id"] = $int_link["id"];
2599  $_GET["frame"] = "_blank";
2600  $content = $a_lm_gui->glossary();
2601  $file = $a_target_dir . "/term_" . $int_link["id"] . ".html";
2602 
2603  // open file
2604  if (!($fp = @fopen($file, "w+"))) {
2605  die("<b>Error</b>: Could not open \"" . $file . "\" for writing" .
2606  " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />");
2607  }
2608  chmod($file, 0770);
2609  fwrite($fp, $content);
2610  fclose($fp);
2611 
2612  // store linked/embedded media objects of glosssary term
2613  include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
2614  $defs = ilGlossaryDefinition::getDefinitionList($int_link["id"]);
2615  foreach ($defs as $def) {
2616  $def_mobs = ilObjMediaObject::_getMobsOfObject("gdf:pg", $def["id"]);
2617  foreach ($def_mobs as $def_mob) {
2618  $this->offline_mobs[$def_mob] = $def_mob;
2619  include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
2620  $this->log->debug("HTML Export: Add media object $def_mob (" . ilObject::_lookupTitle($def_mob) . ") " .
2621  " due to glossary entry " . $int_link["id"] . " (" . ilGlossaryTerm::_lookGlossaryTerm($int_link["id"]) . ").");
2622  }
2623 
2624  // get all files of page
2625  $def_files = ilObjFile::_getFilesOfObject("gdf:pg", $page["obj_id"]);
2626  $this->offline_files = array_merge($this->offline_files, $def_files);
2627  }
2628  }
2629  }
2630  }
static _getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
static getDefinitionList($a_term_id)
static
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
special template class to simplify handling of ITX/PEAR
static _getFilesOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_usage_lang="-")
get all files of an object
$def
Definition: croninfo.php:21
static _lookGlossaryTerm($term_id)
get glossary term
+ 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 2525 of file class.ilObjContentObject.php.

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

Referenced by exportHTML().

2526  {
2527  $tpl = $this->tpl;
2528 
2529  $mob_dir = $a_target_dir . "/mobs";
2530 
2531  $source_dir = ilUtil::getWebspaceDir() . "/mobs/mm_" . $a_mob_id;
2532  if (@is_dir($source_dir)) {
2533  ilUtil::makeDir($mob_dir . "/mm_" . $a_mob_id);
2534  ilUtil::rCopy($source_dir, $mob_dir . "/mm_" . $a_mob_id);
2535  }
2536 
2537  $tpl = new ilTemplate("tpl.main.html", true, true);
2538  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2539  $_GET["obj_type"] = "MediaObject";
2540  $_GET["mob_id"] = $a_mob_id;
2541  $_GET["frame"] = $a_frame;
2542  $_GET["cmd"] = "";
2543  $content = $a_lm_gui->media();
2544  $file = $a_target_dir . "/media_" . $a_mob_id . ".html";
2545 
2546  // open file
2547  if (!($fp = @fopen($file, "w+"))) {
2548  die("<b>Error</b>: Could not open \"" . $file . "\" for writing" .
2549  " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />");
2550  }
2551  chmod($file, 0770);
2552  fwrite($fp, $content);
2553  fclose($fp);
2554 
2555  // fullscreen
2556  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2557  $mob_obj = new ilObjMediaObject($a_mob_id);
2558  if ($mob_obj->hasFullscreenItem()) {
2559  $tpl = new ilTemplate("tpl.main.html", true, true);
2560  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2561  $_GET["obj_type"] = "";
2562  $_GET["frame"] = "";
2563  $_GET["mob_id"] = $a_mob_id;
2564  $_GET["cmd"] = "fullscreen";
2565  $content = $a_lm_gui->fullscreen();
2566  $file = $a_target_dir . "/fullscreen_" . $a_mob_id . ".html";
2567 
2568  // open file
2569  if (!($fp = @fopen($file, "w+"))) {
2570  die("<b>Error</b>: Could not open \"" . $file . "\" for writing" .
2571  " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />");
2572  }
2573  chmod($file, 0770);
2574  fwrite($fp, $content);
2575  fclose($fp);
2576  }
2577  $linked_mobs = $mob_obj->getLinkedMediaObjects();
2578  foreach ($linked_mobs as $id) {
2579  $this->log->debug("HTML Export: Add media object $id (" . ilObject::_lookupTitle($id) . ") " .
2580  " due to media object " . $a_mob_id . " (" . ilObject::_lookupTitle($a_mob_id) . ").");
2581  }
2582  $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
2583  }
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
special template class to simplify handling of ITX/PEAR
Class ilObjMediaObject.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static getWebspaceDir($mode="filesystem")
get webspace directory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportHTMLPages()

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

export all pages of learning module to html file

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

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

Referenced by exportHTML().

2636  {
2637  $ilLocator = $this->locator;
2638 
2639  $pages = ilLMPageObject::getPageList($this->getId());
2640 
2641  $lm_tree = $this->getLMTree();
2642  $first_page = $lm_tree->fetchSuccessorNode($lm_tree->getRootId(), "pg");
2643  $this->first_page_id = $first_page["child"];
2644 
2645  // iterate all learning module pages
2646  $mobs = array();
2647  $int_links = array();
2648  $this->offline_files = array();
2649 
2650  include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
2651  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2652 
2653  // get html export id mapping
2654  $lm_set = new ilSetting("lm");
2655  $exp_id_map = array();
2656 
2657  if ($lm_set->get("html_export_ids")) {
2658  foreach ($pages as $page) {
2659  $exp_id = ilLMPageObject::getExportId($this->getId(), $page["obj_id"]);
2660  if (trim($exp_id) != "") {
2661  $exp_id_map[$page["obj_id"]] = trim($exp_id);
2662  }
2663  }
2664  }
2665  //exit;
2666  if ($a_lang == "") {
2667  $a_lang = "-";
2668  }
2669 
2670  reset($pages);
2671  foreach ($pages as $page) {
2672  if (ilLMPage::_exists($this->getType(), $page["obj_id"])) {
2673  $ilLocator->clearItems();
2674  $this->exportPageHTML(
2675  $a_lm_gui,
2676  $a_target_dir,
2677  $page["obj_id"],
2678  "",
2679  $exp_id_map,
2680  $a_lang,
2681  $a_all_languages
2682  );
2683 
2684  // get all snippets of page
2685  $pcs = ilPageContentUsage::getUsagesOfPage($page["obj_id"], $this->getType() . ":pg", 0, false, $a_lang);
2686  foreach ($pcs as $pc) {
2687  if ($pc["type"] == "incl") {
2688  $incl_mobs = ilObjMediaObject::_getMobsOfObject("mep:pg", $pc["id"]);
2689  foreach ($incl_mobs as $incl_mob) {
2690  $mobs[$incl_mob] = $incl_mob;
2691  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
2692  $this->log->debug("HTML Export: Add media object $incl_mob (" . ilObject::_lookupTitle($incl_mob) . ") " .
2693  " due to snippet " . $pc["id"] . " in page " . $page["obj_id"] . " (" . ilLMObject::_lookupTitle($page["obj_id"]) . ").");
2694  }
2695  }
2696  }
2697 
2698  // get all media objects of page
2699  $pg_mobs = ilObjMediaObject::_getMobsOfObject($this->getType() . ":pg", $page["obj_id"], 0, $a_lang);
2700  foreach ($pg_mobs as $pg_mob) {
2701  $mobs[$pg_mob] = $pg_mob;
2702  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
2703  $this->log->debug("HTML Export: Add media object $pg_mob (" . ilObject::_lookupTitle($pg_mob) . ") " .
2704  " due to page " . $page["obj_id"] . " (" . ilLMObject::_lookupTitle($page["obj_id"]) . ").");
2705  }
2706 
2707  // get all internal links of page
2708  $pg_links = ilInternalLink::_getTargetsOfSource($this->getType() . ":pg", $page["obj_id"], $a_lang);
2709  $int_links = array_merge($int_links, $pg_links);
2710 
2711  // get all files of page
2712  include_once("./Modules/File/classes/class.ilObjFile.php");
2713  $pg_files = ilObjFile::_getFilesOfObject($this->getType() . ":pg", $page["obj_id"], 0, $a_lang);
2714  $this->offline_files = array_merge($this->offline_files, $pg_files);
2715 
2716  // collect all questions
2717  include_once("./Services/COPage/classes/class.ilPCQuestion.php");
2718  $q_ids = ilPCQuestion::_getQuestionIdsForPage($this->getType(), $page["obj_id"], $a_lang);
2719  foreach ($q_ids as $q_id) {
2720  $this->q_ids[$q_id] = $q_id;
2721  }
2722  }
2723  }
2724  foreach ($mobs as $m) {
2725  $this->offline_mobs[$m] = $m;
2726  }
2727  foreach ($int_links as $k => $v) {
2728  $this->offline_int_links[$k] = $v;
2729  }
2730  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
static _getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
static _getQuestionIdsForPage($a_parent_type, $a_page_id, $a_lang="-")
Get all questions of a page.
static _lookupTitle($a_id)
lookup object title
static _lookupTitle($a_obj_id)
Lookup title.
exportPageHTML(&$a_lm_gui, $a_target_dir, $a_lm_page_id, $a_frame="", $a_exp_id_map=array(), $a_lang="-", $a_all_languages=false)
export page html
static getUsagesOfPage($a_usage_id, $a_usage_type, $a_hist_nr=0, $a_all_hist_nrs=false, $a_lang="-")
Get page content usages for page.
$mobs
getId()
get object id public
& getLMTree()
get content object tree
static getExportId($a_lm_id, $a_lmobj_id, $a_type="pg")
Get export ID.
getType()
get object type public
static _getFilesOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_usage_lang="-")
get all files of an object
$lm_set
static getPageList($lm_id)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportPageHTML()

ilObjContentObject::exportPageHTML ( $a_lm_gui,
  $a_target_dir,
  $a_lm_page_id,
  $a_frame = "",
  $a_exp_id_map = array(),
  $a_lang = "-",
  $a_all_languages = false 
)

export page html

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

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

Referenced by exportHTMLPages().

2745  {
2746  $tpl = $this->tpl;
2747 
2748  $lang_suffix = "";
2749  if ($a_lang != "-" && $a_lang != "" && $a_all_languages) {
2750  $lang_suffix = "_" . $a_lang;
2751  }
2752 
2753  //echo "<br>B: export Page HTML ($a_lm_page_id)"; flush();
2754  // template workaround: reset of template
2755  $tpl = new ilTemplate("tpl.main.html", true, true);
2756  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2757 
2758  include_once("./Services/COPage/classes/class.ilPCQuestion.php");
2760 
2761  $_GET["obj_id"] = $a_lm_page_id;
2762  $_GET["frame"] = $a_frame;
2763 
2764  if ($a_frame == "") {
2765  //if ($nid = ilLMObject::_lookupNID($a_lm_gui->lm->getId(), $a_lm_page_id, "pg"))
2766  if (is_array($a_exp_id_map) && isset($a_exp_id_map[$a_lm_page_id])) {
2767  $file = $a_target_dir . "/lm_pg_" . $a_exp_id_map[$a_lm_page_id] . $lang_suffix . ".html";
2768  } else {
2769  $file = $a_target_dir . "/lm_pg_" . $a_lm_page_id . $lang_suffix . ".html";
2770  }
2771  } else {
2772  if ($a_frame != "toc") {
2773  $file = $a_target_dir . "/frame_" . $a_lm_page_id . "_" . $a_frame . $lang_suffix . ".html";
2774  } else {
2775  $file = $a_target_dir . "/frame_" . $a_frame . $lang_suffix . ".html";
2776  }
2777  }
2778 
2779  // return if file is already existing
2780  if (@is_file($file)) {
2781  return;
2782  }
2783 
2784  $content = $a_lm_gui->layout("main.xml", false);
2785 
2786  // open file
2787  if (!($fp = @fopen($file, "w+"))) {
2788  die("<b>Error</b>: Could not open \"" . $file . "\" for writing" .
2789  " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />");
2790  }
2791 
2792  // set file permissions
2793  chmod($file, 0770);
2794 
2795  // write xml data into the file
2796  fwrite($fp, $content);
2797 
2798  // close file
2799  fclose($fp);
2800 
2801  if ($this->first_page_id == $a_lm_page_id && $a_frame == "") {
2802  copy($file, $a_target_dir . "/index" . $lang_suffix . ".html");
2803  }
2804 
2805  // write frames of frameset
2806  $frameset = $a_lm_gui->getCurrentFrameSet();
2807 
2808  foreach ($frameset as $frame) {
2809  $this->exportPageHTML($a_lm_gui, $a_target_dir, $a_lm_page_id, $frame);
2810  }
2811  }
$_GET["client_id"]
exportPageHTML(&$a_lm_gui, $a_target_dir, $a_lm_page_id, $a_frame="", $a_exp_id_map=array(), $a_lang="-", $a_all_languages=false)
export page html
special template class to simplify handling of ITX/PEAR
static resetInitialState()
Reset initial state (for exports)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportSCORM()

ilObjContentObject::exportSCORM (   $a_target_dir,
  $log 
)

export scorm package

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

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

2061  {
2062  ilUtil::delDir($a_target_dir);
2063  ilUtil::makeDir($a_target_dir);
2064  //ilUtil::makeDir($a_target_dir."/res");
2065 
2066  // export everything to html
2067  $this->exportHTML($a_target_dir . "/res", $log, false, "scorm");
2068 
2069  // build manifest file
2070  include("./Modules/LearningModule/classes/class.ilLMContObjectManifestBuilder.php");
2071  $man_builder = new ilLMContObjectManifestBuilder($this);
2072  $man_builder->buildManifest();
2073  $man_builder->dump($a_target_dir);
2074 
2075  // copy scorm 1.2 schema definitions
2076  copy("Modules/LearningModule/scorm_xsd/adlcp_rootv1p2.xsd", $a_target_dir . "/adlcp_rootv1p2.xsd");
2077  copy("Modules/LearningModule/scorm_xsd/imscp_rootv1p1p2.xsd", $a_target_dir . "/imscp_rootv1p1p2.xsd");
2078  copy("Modules/LearningModule/scorm_xsd/imsmd_rootv1p2p1.xsd", $a_target_dir . "/imsmd_rootv1p2p1.xsd");
2079  copy("Modules/LearningModule/scorm_xsd/ims_xml.xsd", $a_target_dir . "/ims_xml.xsd");
2080 
2081  // zip it all
2082  $date = time();
2083  $zip_file = $a_target_dir . "/" . $date . "__" . IL_INST_ID . "__" .
2084  $this->getType() . "_" . $this->getId() . ".zip";
2085  //echo "zip-".$a_target_dir."-to-".$zip_file;
2086  ilUtil::zip(array($a_target_dir . "/res",
2087  $a_target_dir . "/imsmanifest.xml",
2088  $a_target_dir . "/adlcp_rootv1p2.xsd",
2089  $a_target_dir . "/imscp_rootv1p1p2.xsd",
2090  $a_target_dir . "/ims_xml.xsd",
2091  $a_target_dir . "/imsmd_rootv1p2p1.xsd"), $zip_file);
2092 
2093  $dest_file = $this->getExportDirectory("scorm") . "/" . $date . "__" . IL_INST_ID . "__" .
2094  $this->getType() . "_" . $this->getId() . ".zip";
2095 
2096  rename($zip_file, $dest_file);
2097  ilUtil::delDir($a_target_dir);
2098  }
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
Content Object (ILIAS native learning module / digilib book) Manifest export class.
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
+ 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 1657 of file class.ilObjContentObject.php.

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

1658  {
1659  $attrs = array();
1660  switch ($this->getType()) {
1661  case "lm":
1662  $attrs["Type"] = "LearningModule";
1663  break;
1664  }
1665  $a_xml_writer->xmlStartTag("ContentObject", $attrs);
1666 
1667  // MetaData
1668  $this->exportXMLMetaData($a_xml_writer);
1669 
1670  // StructureObjects
1671  //echo "ContObj:".$a_inst.":<br>";
1672  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Structure Objects");
1673  $this->exportXMLStructureObjects($a_xml_writer, $a_inst, $expLog);
1674  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Structure Objects");
1675 
1676  // PageObjects
1677  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Page Objects");
1678  $this->exportXMLPageObjects($a_xml_writer, $a_inst, $expLog);
1679  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Page Objects");
1680 
1681  // MediaObjects
1682  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Media Objects");
1683  $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
1684  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Media Objects");
1685 
1686  // FileItems
1687  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export File Items");
1688  $this->exportFileItems($a_target_dir, $expLog);
1689  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export File Items");
1690 
1691  // Questions
1692  if (count($this->q_ids) > 0) {
1693  $qti_file = fopen($a_target_dir . "/qti.xml", "w");
1694  include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
1695  $pool = new ilObjQuestionPool();
1696  fwrite($qti_file, $pool->questionsToXML($this->q_ids));
1697  fclose($qti_file);
1698  }
1699 
1700  // To do: implement version selection/detection
1701  // Properties
1702  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Properties");
1703  $this->exportXMLProperties($a_xml_writer, $expLog);
1704  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Properties");
1705 
1706  $a_xml_writer->xmlEndTag("ContentObject");
1707  }
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
+ 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 1796 of file class.ilObjContentObject.php.

References ilObject\_lookupType().

Referenced by exportXML().

1797  {
1798  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1799 
1800  $linked_mobs = array();
1801 
1802  // mobs directly embedded into pages
1803  foreach ($this->mob_ids as $mob_id) {
1804  if ($mob_id > 0 && ilObject::_lookupType($mob_id) == "mob") {
1805  $expLog->write(date("[y-m-d H:i:s] ") . "Media Object " . $mob_id);
1806  $media_obj = new ilObjMediaObject($mob_id);
1807  $media_obj->exportXML($a_xml_writer, $a_inst);
1808  $media_obj->exportFiles($a_target_dir);
1809 
1810  $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
1811  $linked_mobs = array_merge($linked_mobs, $lmobs);
1812 
1813  unset($media_obj);
1814  }
1815  }
1816 
1817  // linked mobs (in map areas)
1818  foreach ($linked_mobs as $mob_id) {
1819  if ($mob_id > 0) {
1820  $expLog->write(date("[y-m-d H:i:s] ") . "Media Object " . $mob_id);
1821  $media_obj = new ilObjMediaObject($mob_id);
1822  $media_obj->exportXML($a_xml_writer, $a_inst);
1823  $media_obj->exportFiles($a_target_dir);
1824  unset($media_obj);
1825  }
1826  }
1827  }
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 1715 of file class.ilObjContentObject.php.

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

Referenced by exportXML().

1716  {
1717  include_once("Services/MetaData/classes/class.ilMD2XML.php");
1718  $md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
1719  $md2xml->setExportMode(true);
1720  $md2xml->startExport();
1721  $a_xml_writer->appendXML($md2xml->getXML());
1722  }
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 1753 of file class.ilObjContentObject.php.

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

Referenced by exportXML().

1754  {
1755  include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
1756  include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
1757 
1758  $pages = ilLMPageObject::getPageList($this->getId());
1759  foreach ($pages as $page) {
1760  if (ilLMPage::_exists($this->getType(), $page["obj_id"])) {
1761  $expLog->write(date("[y-m-d H:i:s] ") . "Page Object " . $page["obj_id"]);
1762 
1763  // export xml to writer object
1764  $page_obj = new ilLMPageObject($this, $page["obj_id"]);
1765  $page_obj->exportXML($a_xml_writer, "normal", $a_inst);
1766 
1767  // collect media objects
1768  $mob_ids = $page_obj->getMediaObjectIDs();
1769  foreach ($mob_ids as $mob_id) {
1770  $this->mob_ids[$mob_id] = $mob_id;
1771  }
1772 
1773  // collect all file items
1774  $file_ids = $page_obj->getFileItemIds();
1775  foreach ($file_ids as $file_id) {
1776  $this->file_ids[$file_id] = $file_id;
1777  }
1778 
1779  // collect all questions
1780  $q_ids = $page_obj->getQuestionIds();
1781  foreach ($q_ids as $q_id) {
1782  $this->q_ids[$q_id] = $q_id;
1783  }
1784 
1785  unset($page_obj);
1786  }
1787  }
1788  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
Class ilLMPageObject.
getId()
get object id public
getType()
get object type public
static getPageList($lm_id)
static
+ 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 1849 of file class.ilObjContentObject.php.

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

Referenced by exportXML().

1850  {
1851  $attrs = array();
1852  $a_xml_writer->xmlStartTag("Properties", $attrs);
1853 
1854  // Layout
1855  $attrs = array("Name" => "Layout", "Value" => $this->getLayout());
1856  $a_xml_writer->xmlElement("Property", $attrs);
1857 
1858  // Page Header
1859  $attrs = array("Name" => "PageHeader", "Value" => $this->getPageHeader());
1860  $a_xml_writer->xmlElement("Property", $attrs);
1861 
1862  // TOC Mode
1863  $attrs = array("Name" => "TOCMode", "Value" => $this->getTOCMode());
1864  $a_xml_writer->xmlElement("Property", $attrs);
1865 
1866  // LM Menu Activation
1867  $attrs = array("Name" => "ActiveLMMenu", "Value" =>
1868  ilUtil::tf2yn($this->isActiveLMMenu()));
1869  $a_xml_writer->xmlElement("Property", $attrs);
1870 
1871  // Numbering Activation
1872  $attrs = array("Name" => "ActiveNumbering", "Value" =>
1873  ilUtil::tf2yn($this->isActiveNumbering()));
1874  $a_xml_writer->xmlElement("Property", $attrs);
1875 
1876  // Table of contents button activation
1877  $attrs = array("Name" => "ActiveTOC", "Value" =>
1878  ilUtil::tf2yn($this->isActiveTOC()));
1879  $a_xml_writer->xmlElement("Property", $attrs);
1880 
1881  // Print view button activation
1882  $attrs = array("Name" => "ActivePrintView", "Value" =>
1883  ilUtil::tf2yn($this->isActivePrintView()));
1884  $a_xml_writer->xmlElement("Property", $attrs);
1885 
1886  // Note that download button is not saved, because
1887  // download files do not exist after import
1888 
1889  // Clean frames
1890  $attrs = array("Name" => "CleanFrames", "Value" =>
1891  ilUtil::tf2yn($this->cleanFrames()));
1892  $a_xml_writer->xmlElement("Property", $attrs);
1893 
1894  // Public notes activation
1895  $attrs = array("Name" => "PublicNotes", "Value" =>
1896  ilUtil::tf2yn($this->publicNotes()));
1897  $a_xml_writer->xmlElement("Property", $attrs);
1898 
1899  // History comments for authors activation
1900  $attrs = array("Name" => "HistoryUserComments", "Value" =>
1902  $a_xml_writer->xmlElement("Property", $attrs);
1903 
1904  // Rating
1905  $attrs = array("Name" => "Rating", "Value" =>
1906  ilUtil::tf2yn($this->hasRating()));
1907  $a_xml_writer->xmlElement("Property", $attrs);
1908  $attrs = array("Name" => "RatingPages", "Value" =>
1909  ilUtil::tf2yn($this->hasRatingPages()));
1910  $a_xml_writer->xmlElement("Property", $attrs);
1911 
1912  // Header Page
1913  if ($this->getHeaderPage() > 0) {
1914  $attrs = array("Name" => "HeaderPage", "Value" =>
1915  "il_" . IL_INST_ID . "_pg_" . $this->getHeaderPage());
1916  $a_xml_writer->xmlElement("Property", $attrs);
1917  }
1918 
1919  // Footer Page
1920  if ($this->getFooterPage() > 0) {
1921  $attrs = array("Name" => "FooterPage", "Value" =>
1922  "il_" . IL_INST_ID . "_pg_" . $this->getFooterPage());
1923  $a_xml_writer->xmlElement("Property", $attrs);
1924  }
1925 
1926  // layout per page
1927  $attrs = array("Name" => "LayoutPerPage", "Value" =>
1928  $this->getLayoutPerPage());
1929  $a_xml_writer->xmlElement("Property", $attrs);
1930 
1931  // progress icons
1932  $attrs = array("Name" => "ProgressIcons", "Value" =>
1933  $this->getProgressIcons());
1934  $a_xml_writer->xmlElement("Property", $attrs);
1935 
1936  // store tries
1937  $attrs = array("Name" => "StoreTries", "Value" =>
1938  $this->getStoreTries());
1939  $a_xml_writer->xmlElement("Property", $attrs);
1940 
1941  // restrict forward navigation
1942  $attrs = array("Name" => "RestrictForwardNavigation", "Value" =>
1943  $this->getRestrictForwardNavigation());
1944  $a_xml_writer->xmlElement("Property", $attrs);
1945 
1946  // disable default feedback
1947  $attrs = array("Name" => "DisableDefaultFeedback", "Value" =>
1948  $this->getDisableDefaultFeedback());
1949  $a_xml_writer->xmlElement("Property", $attrs);
1950 
1951  $a_xml_writer->xmlEndTag("Properties");
1952  }
static tf2yn($a_tf)
convert true/false to "y"/"n"
getLayout()
get default page layout of content object (see directory layouts/)
getStoreTries()
Get store tries.
getLayoutPerPage()
Get layout per page.
getProgressIcons()
Get progress icons.
getPageHeader()
get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER)
getTOCMode()
get toc mode ("chapters" | "pages")
getDisableDefaultFeedback()
Get disable default feedback for questions.
getRestrictForwardNavigation()
Get restrict forward navigation.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLStructureObjects()

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

export structure objects to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

Referenced by exportXML().

1731  {
1732  include_once './Modules/LearningModule/classes/class.ilStructureObject.php';
1733 
1734  $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
1735  foreach ($childs as $child) {
1736  if ($child["type"] != "st") {
1737  continue;
1738  }
1739 
1740  $structure_obj = new ilStructureObject($this, $child["obj_id"]);
1741  $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
1742  unset($structure_obj);
1743  }
1744  }
Class ilStructreObject.
+ Here is the caller graph for this function:

◆ fixTree()

ilObjContentObject::fixTree ( )

fix tree

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

References ilObject\$db, $ilDB, $nodes, ilObject\$tree, ilPageObject\_exists(), ilObject\getId(), ilLMObjectFactory\getInstance(), and getLMTree().

1422  {
1423  $ilDB = $this->db;
1424 
1425  $tree = $this->getLMTree();
1426 
1427  // check numbering, if errors, renumber
1428  // it is very important to keep this step before deleting subtrees
1429  // in the following steps
1430  $set = $ilDB->query(
1431  "SELECT DISTINCT l1.lm_id" .
1432  " FROM lm_tree l1" .
1433  " JOIN lm_tree l2 ON ( l1.child = l2.parent" .
1434  " AND l1.lm_id = l2.lm_id )" .
1435  " JOIN lm_data ON ( l1.child = lm_data.obj_id )" .
1436  " WHERE (l2.lft < l1.lft" .
1437  " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)" .
1438  " AND l1.lm_id = " . $ilDB->quote($this->getId(), "integer") .
1439  " ORDER BY lm_data.create_date DESC"
1440  );
1441  if ($rec = $ilDB->fetchAssoc($set)) {
1442  $tree->renumber();
1443  }
1444 
1445  // delete subtrees that have no lm_data records (changed due to #20637)
1446  $set = $ilDB->query("SELECT * FROM lm_tree WHERE lm_tree.lm_id = " . $ilDB->quote($this->getId(), "integer"));
1447  while ($node = $ilDB->fetchAssoc($set)) {
1448  $q = "SELECT * FROM lm_data WHERE obj_id = " .
1449  $ilDB->quote($node["child"], "integer");
1450  $obj_set = $ilDB->query($q);
1451  $obj_rec = $ilDB->fetchAssoc($obj_set);
1452  if (!$obj_rec) {
1453  $node_data = $tree->getNodeData($node["child"]);
1454  $node_data["child"] = $node["child"];
1455  $tree->deleteTree($node_data);
1456  }
1457  }
1458 
1459  // delete subtrees that have pages as parent
1460  $nodes = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1461  foreach ($nodes as $node) {
1462  $q = "SELECT * FROM lm_data WHERE obj_id = " .
1463  $ilDB->quote($node["parent"], "integer");
1464  $obj_set = $ilDB->query($q);
1465  $obj_rec = $ilDB->fetchAssoc($obj_set);
1466  if ($obj_rec["type"] == "pg") {
1467  $node_data = $tree->getNodeData($node["child"]);
1468  if ($tree->isInTree($node["child"])) {
1469  $tree->deleteTree($node_data);
1470  }
1471  }
1472  }
1473 
1474  // check for multi-references pages or chapters
1475  // if errors -> create copies of them here
1476  $set = $ilDB->query("SELECT DISTINCT l1.lm_id" .
1477  " FROM lm_tree l1" .
1478  " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1479  " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1480  " WHERE l1.child <> 1" .
1481  " AND l1.lm_id <> lm_data.lm_id" .
1482  " AND l1.lm_id = " . $ilDB->quote($this->getId(), "integer"));
1483  if ($rec = $ilDB->fetchAssoc($set)) {
1484  $set = $ilDB->query("SELECT DISTINCT l1.child " .
1485  " FROM lm_tree l1" .
1486  " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1487  " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1488  " WHERE l1.child <> 1" .
1489  " AND l1.lm_id <> lm_data.lm_id" .
1490  " AND l1.lm_id = " . $ilDB->quote($this->getId(), "integer"));
1491  include_once("./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
1492  while ($rec = $ilDB->fetchAssoc($set)) {
1493  $cobj = ilLMObjectFactory::getInstance($this, $rec["child"]);
1494 
1495  if (is_object($cobj)) {
1496  if ($cobj->getType() == "pg") {
1497  // make a copy of it
1498  $pg_copy = $cobj->copy($this);
1499 
1500  // replace the child in the tree with the copy (id)
1501  $ilDB->manipulate(
1502  "UPDATE lm_tree SET " .
1503  " child = " . $ilDB->quote($pg_copy->getId(), "integer") .
1504  " WHERE child = " . $ilDB->quote($cobj->getId(), "integer") .
1505  " AND lm_id = " . $ilDB->quote($this->getId(), "integer")
1506  );
1507  } elseif ($cobj->getType() == "st") {
1508  // make a copy of it
1509  $st_copy = $cobj->copy($this);
1510 
1511  // replace the child in the tree with the copy (id)
1512  $ilDB->manipulate(
1513  "UPDATE lm_tree SET " .
1514  " child = " . $ilDB->quote($st_copy->getId(), "integer") .
1515  " WHERE child = " . $ilDB->quote($cobj->getId(), "integer") .
1516  " AND lm_id = " . $ilDB->quote($this->getId(), "integer")
1517  );
1518 
1519  // make all childs refer to the copy now
1520  $ilDB->manipulate(
1521  "UPDATE lm_tree SET " .
1522  " parent = " . $ilDB->quote($st_copy->getId(), "integer") .
1523  " WHERE parent = " . $ilDB->quote($cobj->getId(), "integer") .
1524  " AND lm_id = " . $ilDB->quote($this->getId(), "integer")
1525  );
1526  }
1527  }
1528  }
1529  }
1530 
1531  // missing copage entries
1532  $set = $ilDB->queryF(
1533  "SELECT * FROM lm_data " .
1534  " WHERE lm_id = %s AND type = %s",
1535  array("integer", "text"),
1536  array($this->getId(), "pg")
1537  );
1538  while ($rec = $ilDB->fetchAssoc($set)) {
1539  if (!ilPageObject::_exists("lm", $rec["obj_id"], "-")) {
1540  $lm_page = new ilLMPage();
1541  $lm_page->setId($rec["obj_id"]);
1542  $lm_page->setParentId($this->getId());
1543  $lm_page->create();
1544  }
1545  }
1546  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
getId()
get object id public
& getLMTree()
get content object tree
static getInstance(&$a_content_obj, $a_id=0, $a_halt=true)
global $ilDB
Extension of ilPageObject for learning modules.
+ Here is the call graph for this function:

◆ getAutoGlossaries()

ilObjContentObject::getAutoGlossaries ( )

Get auto glossaries.

Returns
array int

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

References $auto_glossaries.

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

391  {
392  return $this->auto_glossaries;
393  }
+ Here is the caller graph for this function:

◆ getAvailableLayouts()

static ilObjContentObject::getAvailableLayouts ( )
static

get all available lm layouts

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

References $l, and $ret.

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

1267  {
1268  $dir = opendir("./Modules/LearningModule/layouts/lm");
1269 
1270  $layouts = array();
1271 
1272  while ($file = readdir($dir)) {
1273  if ($file != "." && $file != ".." && $file != "CVS" && $file != ".svn") {
1274  // directories
1275  if (@is_dir("./Modules/LearningModule/layouts/lm/" . $file)) {
1276  $layouts[$file] = $file;
1277  }
1278  }
1279  }
1280  asort($layouts);
1281 
1282  // workaround: fix ordering
1283  $ret = array(
1284  'toc2win' => 'toc2win',
1285  'toc2windyn' => 'toc2windyn',
1286  '1window' => '1window',
1287  '2window' => '2window',
1288  '3window' => '3window',
1289  'presentation' => 'presentation',
1290  'fullscreen' => 'fullscreen'
1291  );
1292 
1293  foreach ($layouts as $l) {
1294  if (!in_array($l, $ret)) {
1295  $ret[$l] = $l;
1296  }
1297  }
1298 
1299  return $ret;
1300  }
global $l
Definition: afr.php:30
$ret
Definition: parser.php:6
+ Here is the caller graph for this function:

◆ getDataDirectory()

ilObjContentObject::getDataDirectory ( )

get data directory

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

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

Referenced by delete().

506  {
507  return ilUtil::getDataDir() . "/lm_data" .
508  "/lm_" . $this->getId();
509  }
getId()
get object id public
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 160 of file class.ilObjContentObject.php.

Referenced by cloneObject().

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

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

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

◆ getExportDirectory()

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

get export directory of lm

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

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

Referenced by exportHTML(), exportSCORM(), getExportFiles(), and getPublicExportFiles().

587  {
588  switch ($a_type) {
589  case "scorm":
590  $export_dir = ilUtil::getDataDir() . "/lm_data" . "/lm_" . $this->getId() . "/export_scorm";
591  break;
592 
593  default: // = xml
594  if (substr($a_type, 0, 4) == "html") {
595  $export_dir = ilUtil::getDataDir() . "/lm_data" . "/lm_" . $this->getId() . "/export_" . $a_type;
596  } else {
597  $export_dir = ilUtil::getDataDir() . "/lm_data" . "/lm_" . $this->getId() . "/export";
598  }
599  break;
600  }
601  return $export_dir;
602  }
$a_type
Definition: workflow.php:92
getId()
get object id public
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 1957 of file class.ilObjContentObject.php.

References ilObject\$type, and getExportDirectory().

1958  {
1959  $file = array();
1960 
1961  $types = array("xml", "html", "scorm");
1962 
1963  foreach ($types as $type) {
1964  $dir = $this->getExportDirectory($type);
1965  // quit if import dir not available
1966  if (!@is_dir($dir) or
1967  !is_writeable($dir)) {
1968  continue;
1969  }
1970 
1971  // open directory
1972  $cdir = dir($dir);
1973 
1974  // initialize array
1975 
1976  // get files and save the in the array
1977  while ($entry = $cdir->read()) {
1978  if ($entry != "." and
1979  $entry != ".." and
1980  substr($entry, -4) == ".zip" and
1981  preg_match("~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.zip\$~", $entry)) {
1982  $file[$entry . $type] = array("type" => $type, "file" => $entry,
1983  "size" => filesize($dir . "/" . $entry));
1984  }
1985  }
1986 
1987  // close import directory
1988  $cdir->close();
1989  }
1990 
1991  // sort files
1992  ksort($file);
1993  reset($file);
1994  return $file;
1995  }
getExportDirectory($a_type="xml")
get export directory of lm
+ Here is the call graph for this function:

◆ getFooterPage()

ilObjContentObject::getFooterPage ( )

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

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

1147  {
1148  return $this->footer_page;
1149  }
+ Here is the caller graph for this function:

◆ getForTranslation()

ilObjContentObject::getForTranslation ( )

Get for translation.

Returns
bool lm has been imported for translation purposes

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

References $for_translation.

Referenced by updateProperties().

459  {
460  return $this->for_translation;
461  }
+ Here is the caller graph for this function:

◆ getHeaderPage()

ilObjContentObject::getHeaderPage ( )

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

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

1137  {
1138  return $this->header_page;
1139  }
+ 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 1071 of file class.ilObjContentObject.php.

Referenced by updateProperties().

1072  {
1073  return $this->hide_header_footer_print;
1074  }
+ Here is the caller graph for this function:

◆ getImportDirectory()

ilObjContentObject::getImportDirectory ( )

get import directory of lm

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

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

Referenced by importFromZipFile().

515  {
516  if (strlen($this->import_dir)) {
517  return $this->import_dir;
518  }
519 
520  $import_dir = ilUtil::getDataDir() . "/lm_data" .
521  "/lm_" . $this->getId() . "/import";
522  if (@is_dir($import_dir)) {
523  return $import_dir;
524  } else {
525  return false;
526  }
527  }
getId()
get object id public
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 175 of file class.ilObjContentObject.php.

References ilObject\$import_id.

Referenced by importFromDirectory().

176  {
177  return $this->import_id;
178  }
+ Here is the caller graph for this function:

◆ getLayout()

ilObjContentObject::getLayout ( )

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

Returns
string default layout

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

References $layout.

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

665  {
666  return $this->layout;
667  }
+ Here is the caller graph for this function:

◆ getLayoutPerPage()

ilObjContentObject::getLayoutPerPage ( )

Get layout per page.

Returns
boolean layout per page

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

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

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

◆ getLMTree()

& ilObjContentObject::getLMTree ( )

get content object tree

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

References $lm_tree.

Referenced by checkStructure(), exportHTMLPages(), and fixTree().

467  {
468  return $this->lm_tree;
469  }
+ Here is the caller graph for this function:

◆ getOfflineFiles()

ilObjContentObject::getOfflineFiles (   $dir)

get offline files

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

2024  {
2025  // quit if offline dir not available
2026  if (!@is_dir($dir) or
2027  !is_writeable($dir)) {
2028  return array();
2029  }
2030 
2031  // open directory
2032  $dir = dir($dir);
2033 
2034  // initialize array
2035  $file = array();
2036 
2037  // get files and save the in the array
2038  while ($entry = $dir->read()) {
2039  if ($entry != "." and
2040  $entry != ".." and
2041  substr($entry, -4) == ".pdf" and
2042  preg_match("~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.pdf\$~", $entry)) {
2043  $file[] = $entry;
2044  }
2045  }
2046 
2047  // close import directory
2048  $dir->close();
2049 
2050  // sort files
2051  sort($file);
2052  reset($file);
2053 
2054  return $file;
2055  }

◆ getPageHeader()

ilObjContentObject::getPageHeader ( )

get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER)

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

References $pg_header.

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

966  {
967  return $this->pg_header;
968  }
+ Here is the caller graph for this function:

◆ getProgressIcons()

ilObjContentObject::getProgressIcons ( )

Get progress icons.

Returns
bool show progress icons

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

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

241  {
242  return $this->progr_icons;
243  }
+ Here is the caller graph for this function:

◆ getPublicAccessMode()

ilObjContentObject::getPublicAccessMode ( )

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

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

Referenced by cloneObject(), and updateProperties().

992  {
993  return $this->public_access_mode;
994  }
+ 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 2015 of file class.ilObjContentObject.php.

References $a_type.

Referenced by getPublicExportFiles(), and updateProperties().

2016  {
2017  return $this->public_export_file[$a_type];
2018  }
$a_type
Definition: workflow.php:92
+ Here is the caller graph for this function:

◆ getPublicExportFiles()

ilObjContentObject::getPublicExportFiles ( )

Get public export files.

Returns
array array of arrays with keys "type" (html, scorm or xml), "file" (filename) and "size" in bytes, "dir_type" detailed directoy type, e.g. html_de

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

References $l, $size, ilObject\$type, getExportDirectory(), ilObject\getId(), ilObjectTranslation\getInstance(), and getPublicExportFile().

3605  {
3606  $dirs = array("xml", "scorm");
3607  $export_files = array();
3608 
3609  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
3610  $ot = ilObjectTranslation::getInstance($this->getId());
3611  if ($ot->getContentActivated()) {
3612  $langs = $ot->getLanguages();
3613  foreach ($langs as $l => $ldata) {
3614  $dirs[] = "html_" . $l;
3615  }
3616  $dirs[] = "html_all";
3617  } else {
3618  $dirs[] = "html";
3619  }
3620 
3621  foreach ($dirs as $dir) {
3622  $type = explode("_", $dir);
3623  $type = $type[0];
3624  if ($this->getPublicExportFile($type) != "") {
3625  if (is_file($this->getExportDirectory($dir) . "/" .
3626  $this->getPublicExportFile($type))) {
3627  $size = filesize($this->getExportDirectory($dir) . "/" .
3628  $this->getPublicExportFile($type));
3629  $export_files[] = array("type" => $type,
3630  "dir_type" => $dir,
3631  "file" => $this->getPublicExportFile($type),
3632  "size" => $size);
3633  }
3634  }
3635  }
3636 
3637  return $export_files;
3638  }
$size
Definition: RandomTest.php:84
getExportDirectory($a_type="xml")
get export directory of lm
getPublicExportFile($a_type)
get public export file
getId()
get object id public
global $l
Definition: afr.php:30
static getInstance($a_obj_id)
Get instance.
+ Here is the call graph for this function:

◆ getRestrictForwardNavigation()

ilObjContentObject::getRestrictForwardNavigation ( )

Get restrict forward navigation.

Returns
bool restrict forward navigation

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

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

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

◆ getStoreTries()

ilObjContentObject::getStoreTries ( )

Get store tries.

Returns
bool store tries

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

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

261  {
262  return $this->store_tries;
263  }
+ Here is the caller graph for this function:

◆ getStyleSheetId()

ilObjContentObject::getStyleSheetId ( )

get ID of assigned style sheet object

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

References $style_id.

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

683  {
684  return $this->style_id;
685  }
+ Here is the caller graph for this function:

◆ getSupplyingExportFiles()

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

Get supplying export files.

Parameters

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

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

Referenced by ilLMPresentationGUI\layout(), and ilLMPresentationGUI\showTableOfContents().

2399  {
2400  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
2401  include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
2402  include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
2403  include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
2404  $scripts = array(
2405  array("source" => ilYuiUtil::getLocalPath('yahoo/yahoo-min.js'),
2406  "target" => $a_target_dir . '/js/yahoo/yahoo-min.js',
2407  "type" => "js"),
2408  array("source" => ilYuiUtil::getLocalPath('yahoo-dom-event/yahoo-dom-event.js'),
2409  "target" => $a_target_dir . '/js/yahoo/yahoo-dom-event.js',
2410  "type" => "js"),
2411  array("source" => ilYuiUtil::getLocalPath('animation/animation-min.js'),
2412  "target" => $a_target_dir . '/js/yahoo/animation-min.js',
2413  "type" => "js"),
2414  array("source" => './Services/JavaScript/js/Basic.js',
2415  "target" => $a_target_dir . '/js/Basic.js',
2416  "type" => "js"),
2417  array("source" => './Services/Accordion/js/accordion.js',
2418  "target" => $a_target_dir . '/js/accordion.js',
2419  "type" => "js"),
2420  array("source" => './Services/Accordion/css/accordion.css',
2421  "target" => $a_target_dir . '/css/accordion.css',
2422  "type" => "css"),
2423  array("source" => iljQueryUtil::getLocaljQueryPath(),
2424  "target" => $a_target_dir . '/js/jquery.js',
2425  "type" => "js"),
2426  array("source" => iljQueryUtil::getLocalMaphilightPath(),
2427  "target" => $a_target_dir . '/js/maphilight.js',
2428  "type" => "js"),
2429  array("source" => iljQueryUtil::getLocaljQueryUIPath(),
2430  "target" => $a_target_dir . '/js/jquery-ui-min.js',
2431  "type" => "js"),
2432  array("source" => './Services/COPage/js/ilCOPagePres.js',
2433  "target" => $a_target_dir . '/js/ilCOPagePres.js',
2434  "type" => "js"),
2435  array("source" => './Modules/Scorm2004/scripts/questions/pure.js',
2436  "target" => $a_target_dir . '/js/pure.js',
2437  "type" => "js"),
2438  array("source" => './Modules/Scorm2004/scripts/questions/question_handling.js',
2439  "target" => $a_target_dir . '/js/question_handling.js',
2440  "type" => "js"),
2441  array("source" => './Modules/TestQuestionPool/js/ilMatchingQuestion.js',
2442  "target" => $a_target_dir . '/js/ilMatchingQuestion.js',
2443  "type" => "js"),
2444  array("source" => './Modules/Scorm2004/templates/default/question_handling.css',
2445  "target" => $a_target_dir . '/css/question_handling.css',
2446  "type" => "css"),
2447  array("source" => './Modules/TestQuestionPool/templates/default/test_javascript.css',
2448  "target" => $a_target_dir . '/css/test_javascript.css',
2449  "type" => "css"),
2450  array("source" => './Modules/TestQuestionPool/js/ilAssMultipleChoice.js',
2451  "target" => $a_target_dir . '/js/ilAssMultipleChoice.js',
2452  "type" => "js"),
2453  array("source" => ilPlayerUtil::getLocalMediaElementJsPath(),
2454  "target" => $a_target_dir . "/" . ilPlayerUtil::getLocalMediaElementJsPath(),
2455  "type" => "js"),
2456  array("source" => ilPlayerUtil::getLocalMediaElementCssPath(),
2457  "target" => $a_target_dir . "/" . ilPlayerUtil::getLocalMediaElementCssPath(),
2458  "type" => "css"),
2459  array("source" => ilExplorerBaseGUI::getLocalExplorerJsPath(),
2460  "target" => $a_target_dir . "/" . ilExplorerBaseGUI::getLocalExplorerJsPath(),
2461  "type" => "js"),
2462  array("source" => ilExplorerBaseGUI::getLocalJsTreeJsPath(),
2463  "target" => $a_target_dir . "/" . ilExplorerBaseGUI::getLocalJsTreeJsPath(),
2464  "type" => "js"),
2465  array("source" => ilExplorerBaseGUI::getLocalJsTreeCssPath(),
2466  "target" => $a_target_dir . "/" . ilExplorerBaseGUI::getLocalJsTreeCssPath(),
2467  "type" => "css"),
2468  array("source" => './Modules/LearningModule/js/LearningModule.js',
2469  "target" => $a_target_dir . '/js/LearningModule.js',
2470  "type" => "js")
2471  );
2472 
2473  $mathJaxSetting = new ilSetting("MathJax");
2474  $use_mathjax = $mathJaxSetting->get("enable");
2475  if ($use_mathjax) {
2476  $scripts[] = array("source" => "",
2477  "target" => $mathJaxSetting->get("path_to_mathjax"),
2478  "type" => "js");
2479  }
2480 
2481  // auto linking js
2482  include_once("./Services/Link/classes/class.ilLinkifyUtil.php");
2483  foreach (ilLinkifyUtil::getLocalJsPaths() as $p) {
2484  if (is_int(strpos($p, "ExtLink"))) {
2485  $scripts[] = array("source" => $p,
2486  "target" => $a_target_dir . '/js/ilExtLink.js',
2487  "type" => "js");
2488  }
2489  if (is_int(strpos($p, "linkify.min.js"))) {
2490  $scripts[] = array("source" => $p,
2491  "target" => $a_target_dir . '/js/linkify.min.js',
2492  "type" => "js");
2493  }
2494  if (is_int(strpos($p, "linkify-jquery.min.js"))) {
2495  $scripts[] = array("source" => $p,
2496  "target" => $a_target_dir . '/js/linkify-jquery.min.js',
2497  "type" => "js");
2498  }
2499  }
2500 
2501  return $scripts;
2502  }
static getLocaljQueryUIPath()
static getLocalJsPaths()
Get paths of necessary js files.
static getLocalJsTreeJsPath()
Get local path of jsTree js.
static getLocalMediaElementCssPath()
Get local path of jQuery file.
static getLocalMediaElementJsPath()
Get local path of jQuery file.
static getLocalExplorerJsPath()
Get local path of explorer js.
static getLocalPath($a_name="")
Get local path of a YUI js file.
static getLocalMaphilightPath()
Get local path of maphilight file.
if(strpos($jquery_path, './')===0) elseif(strpos($jquery_path, '.')===0) $mathJaxSetting
Definition: latex.php:32
static getLocalJsTreeCssPath()
Get local path of jsTree js.
static getLocaljQueryPath()
+ 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 141 of file class.ilObjContentObject.php.

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

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

◆ getTOCMode()

ilObjContentObject::getTOCMode ( )

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

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

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

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

◆ getTree()

& ilObjContentObject::getTree ( )

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

References $lm_tree.

287  {
288  return $this->lm_tree;
289  }

◆ getXMLZip()

ilObjContentObject::getXMLZip ( )

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

2908  {
2909  include_once("./Modules/LearningModule/classes/class.ilContObjectExport.php");
2910 
2911  $cont_exp = new ilContObjectExport($this, 'xml');
2912 
2913  $export_file = $cont_exp->buildExportFile();
2914  return $export_file;
2915  }
Export class for content objects.

◆ hasRating()

ilObjContentObject::hasRating ( )

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

References $rating.

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

3539  {
3540  return $this->rating;
3541  }
+ Here is the caller graph for this function:

◆ hasRatingPages()

ilObjContentObject::hasRatingPages ( )

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

References $rating_pages.

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

3549  {
3550  return $this->rating_pages;
3551  }
+ Here is the caller graph for this function:

◆ hasSuccessorPage()

static ilObjContentObject::hasSuccessorPage (   $a_cont_obj_id,
  $a_page_id 
)
static

checks if page has a successor page

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

References ilObject\$tree.

Referenced by ilPageObjectGUI\showPage().

1394  {
1395  $tree = new ilTree($a_cont_obj_id);
1396  $tree->setTableNames('lm_tree', 'lm_data');
1397  $tree->setTreeTablePK("lm_id");
1398  if ($tree->isInTree($a_page_id)) {
1399  $succ = $tree->fetchSuccessorNode($a_page_id, "pg");
1400  if ($succ > 0) {
1401  return true;
1402  }
1403  }
1404  return false;
1405  }
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:

◆ import()

ilObjContentObject::import ( )

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

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

331  {
332  // nothing to do. just display the dialogue in Out
333  return;
334  }

◆ importFromDirectory()

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

Import lm from directory.

Parameters

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

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

Referenced by importFromZipFile().

3190  {
3191  $lng = $this->lng;
3192 
3193  $this->log->debug("import from directory " . $a_directory);
3194 
3195  // determine filename of xml file
3196  $subdir = basename($a_directory);
3197  $xml_file = $a_directory . "/" . $subdir . ".xml";
3198 
3199  // check directory exists within zip file
3200  if (!is_dir($a_directory)) {
3201  $this->log->error(sprintf($lng->txt("cont_no_subdir_in_zip"), $subdir));
3202  return sprintf($lng->txt("cont_no_subdir_in_zip"), $subdir);
3203  }
3204 
3205  // check whether xml file exists within zip file
3206  if (!is_file($xml_file)) {
3207  $this->log->error(sprintf($lng->txt("cont_zip_file_invalid"), $subdir . "/" . $subdir . ".xml"));
3208  return sprintf($lng->txt("cont_zip_file_invalid"), $subdir . "/" . $subdir . ".xml");
3209  }
3210 
3211  // import questions
3212  $this->log->debug("import qti");
3213  $qti_file = $a_directory . "/qti.xml";
3214  $qtis = array();
3215  if (is_file($qti_file)) {
3216  include_once "./Services/QTI/classes/class.ilQTIParser.php";
3217  include_once("./Modules/Test/classes/class.ilObjTest.php");
3218  $qtiParser = new ilQTIParser(
3219  $qti_file,
3221  0,
3222  ""
3223  );
3224  $result = $qtiParser->startParsing();
3225  $founditems = &$qtiParser->getFoundItems();
3226  $testObj = new ilObjTest(0, true);
3227  if (count($founditems) > 0) {
3228  $qtiParser = new ilQTIParser($qti_file, IL_MO_PARSE_QTI, 0, "");
3229  $qtiParser->setTestObject($testObj);
3230  $result = $qtiParser->startParsing();
3231  $qtis = array_merge($qtis, $qtiParser->getImportMapping());
3232  }
3233  }
3234 
3235  $this->log->debug("get ilContObjParser");
3236  include_once("./Modules/LearningModule/classes/class.ilContObjParser.php");
3237  $subdir = ".";
3238  $contParser = new ilContObjParser($this, $xml_file, $subdir, $a_directory);
3239  // smeyer: added \ilImportMapping lok im/export
3240  $contParser->setImportMapping($a_mapping);
3241  $contParser->setQuestionMapping($qtis);
3242  $contParser->startParsing();
3243  ilObject::_writeImportId($this->getId(), $this->getImportId());
3244  $this->MDUpdateListener('General');
3245 
3246  // import style
3247  $style_file = $a_directory . "/style.xml";
3248  $style_zip_file = $a_directory . "/style.zip";
3249  if (is_file($style_zip_file)) { // try to import style.zip first
3250  require_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3251  $style = new ilObjStyleSheet();
3252  $style->import($style_zip_file);
3253  $this->writeStyleSheetId($style->getId());
3254  } elseif (is_file($style_file)) { // try to import style.xml
3255  require_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3256  $style = new ilObjStyleSheet();
3257  $style->import($style_file);
3258  $this->writeStyleSheetId($style->getId());
3259  }
3260 
3261  // // validate
3262  if ($a_validate) {
3263  $mess = $this->validatePages();
3264  }
3265 
3266  if ($mess == "") {
3267  // handle internal links to this learning module
3268  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
3270  $this->getImportId(),
3271  $this->getType(),
3272  $this->getRefId()
3273  );
3274  }
3275 
3276  return $mess;
3277  }
Content Object Parser.
$style
Definition: example_012.php:70
$result
validatePages()
Validate all pages.
writeStyleSheetId($a_style_id)
write ID of assigned style sheet object to db
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
static _writeImportId($a_obj_id, $a_import_id)
write import id to db (static)
Class ilObjStyleSheet.
getRefId()
get reference id public
const IL_MO_VERIFY_QTI
+ 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 3142 of file class.ilObjContentObject.php.

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

3147  {
3148  $lng = $this->lng;
3149 
3150  // create import directory
3151  $this->createImportDirectory();
3152 
3153  // copy uploaded file to import directory
3154  $file = pathinfo($a_filename);
3155  $full_path = $this->getImportDirectory() . "/" . $a_filename;
3156 
3157  ilUtil::moveUploadedFile(
3158  $a_tmp_file,
3159  $a_filename,
3160  $full_path
3161  );
3162 
3163  // unzip file
3164  ilUtil::unzip($full_path);
3165 
3166  $subdir = basename($file["basename"], "." . $file["extension"]);
3167 
3168  $mess = $this->importFromDirectory(
3169  $this->getImportDirectory() . "/" . $subdir,
3170  $a_validate
3171  );
3172 
3173 
3174  // delete import directory
3176 
3177  return $mess;
3178  }
getImportDirectory()
get import directory of lm
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
createImportDirectory()
creates data directory for import files (data_dir/lm_data/lm_<id>/import, depending on data directory...
importFromDirectory($a_directory, $a_validate=true, $a_mapping=null)
Import lm from directory.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ isActiveDownloads()

ilObjContentObject::isActiveDownloads ( )

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

Referenced by cloneObject(), and updateProperties().

1082  {
1083  return $this->downloads_active;
1084  }
+ Here is the caller graph for this function:

◆ isActiveDownloadsPublic()

ilObjContentObject::isActiveDownloadsPublic ( )

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

Referenced by cloneObject(), and updateProperties().

1092  {
1093  return $this->downloads_public_active;
1094  }
+ Here is the caller graph for this function:

◆ isActiveHistoryUserComments()

ilObjContentObject::isActiveHistoryUserComments ( )

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

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

1127  {
1128  return $this->user_comments;
1129  }
+ Here is the caller graph for this function:

◆ isActiveLMMenu()

ilObjContentObject::isActiveLMMenu ( )

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

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

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

◆ isActiveNumbering()

ilObjContentObject::isActiveNumbering ( )

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

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

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

◆ isActivePreventGlossaryAppendix()

ilObjContentObject::isActivePreventGlossaryAppendix ( )

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

Referenced by cloneObject(), and updateProperties().

1052  {
1053  return $this->prevent_glossary_appendix_active;
1054  }
+ Here is the caller graph for this function:

◆ isActivePrintView()

ilObjContentObject::isActivePrintView ( )

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

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

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

◆ isActiveTOC()

ilObjContentObject::isActiveTOC ( )

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

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

1022  {
1023  return $this->toc_active;
1024  }
+ 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 3522 of file class.ilObjContentObject.php.

References ilObject\_lookupObjId().

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

3523  {
3524  if (!$a_as_obj_id && $a_id > 0 && $a_id == OH_REF_ID) {
3525  return true;
3526  }
3527  if ($a_as_obj_id && $a_id > 0 && $a_id == ilObject::_lookupObjId(OH_REF_ID)) {
3528  return true;
3529  }
3530  return false;
3531  }
static _lookupObjId($a_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupAutoGlossaries()

static ilObjContentObject::lookupAutoGlossaries (   $a_lm_id)
static

Lookup auto glossaries.

Parameters

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

References $DIC, and $ilDB.

Referenced by ilLMPage\beforePageContentUpdate().

3456  {
3457  global $DIC;
3458 
3459  $ilDB = $DIC->database();
3460 
3461  // read auto glossaries
3462  $set = $ilDB->query(
3463  "SELECT * FROM lm_glossaries " .
3464  " WHERE lm_id = " . $ilDB->quote($a_lm_id, "integer")
3465  );
3466  $glos = array();
3467  while ($rec = $ilDB->fetchAssoc($set)) {
3468  $glos[] = $rec["glo_id"];
3469  }
3470  return $glos;
3471  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ MDUpdateListener()

ilObjContentObject::MDUpdateListener (   $a_element)

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

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

Referenced by importFromDirectory().

3555  {
3556  parent::MDUpdateListener($a_element);
3557 
3558  include_once 'Services/MetaData/classes/class.ilMD.php';
3559 
3560  switch ($a_element) {
3561  case 'Educational':
3562  include_once("./Services/Object/classes/class.ilObjectLP.php");
3563  $obj_lp = ilObjectLP::getInstance($this->getId());
3564  if (in_array(
3565  $obj_lp->getCurrentMode(),
3567  )) {
3568  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
3570  }
3571  break;
3572 
3573  case 'General':
3574 
3575  // Update Title and description
3576  $md = new ilMD($this->getId(), 0, $this->getType());
3577  if (!is_object($md_gen = $md->getGeneral())) {
3578  return false;
3579  }
3580 
3581  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
3582  $ot = ilObjectTranslation::getInstance($this->getId());
3583  if ($ot->getContentActivated()) {
3584  $ot->setDefaultTitle($md_gen->getTitle());
3585 
3586  foreach ($md_gen->getDescriptionIds() as $id) {
3587  $md_des = $md_gen->getDescription($id);
3588  $ot->setDefaultDescription($md_des->getDescription());
3589  break;
3590  }
3591  $ot->save();
3592  }
3593  break;
3594 
3595  }
3596  return true;
3597  }
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
getId()
get object id public
getType()
get object type public
static getInstance($a_obj_id)
Get instance.
static getInstance($a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ publicNotes()

ilObjContentObject::publicNotes ( )

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

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

1102  {
1103  return $this->pub_notes;
1104  }
+ Here is the caller graph for this function:

◆ putInTree()

ilObjContentObject::putInTree (   $a_parent)

put content object in main tree

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

References ilObject\$tree.

342  {
343  $tree = $this->tree;
344 
345  // put this object in tree under $a_parent
346  parent::putInTree($a_parent);
347 
348  // make new tree for this object
349  //$tree->addTree($this->getId());
350  }

◆ read()

ilObjContentObject::read ( )

read data of content object

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

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

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

◆ readProperties()

ilObjContentObject::readProperties ( )

read content object properties

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

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

Referenced by createProperties(), and read().

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

◆ removeAutoGlossary()

ilObjContentObject::removeAutoGlossary (   $a_glo_id)

Remove auto glossary.

Parameters

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

References getAutoGlossaries(), and setAutoGlossaries().

402  {
403  $glo_ids = array();
404  foreach ($this->getAutoGlossaries() as $g) {
405  if ($g != $a_glo_id) {
406  $glo_ids[] = $g;
407  }
408  }
409  $this->setAutoGlossaries($glo_ids);
410  }
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 1076 of file class.ilObjContentObject.php.

Referenced by readProperties().

1077  {
1078  $this->downloads_active = $a_down;
1079  }
+ Here is the caller graph for this function:

◆ setActiveDownloadsPublic()

ilObjContentObject::setActiveDownloadsPublic (   $a_down)

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

Referenced by readProperties().

1087  {
1088  $this->downloads_public_active = $a_down;
1089  }
+ Here is the caller graph for this function:

◆ setActiveLMMenu()

ilObjContentObject::setActiveLMMenu (   $a_act_lm_menu)

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

Referenced by readProperties().

1007  {
1008  $this->lm_menu_active = $a_act_lm_menu;
1009  }
+ Here is the caller graph for this function:

◆ setActiveNumbering()

ilObjContentObject::setActiveNumbering (   $a_num)

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

Referenced by readProperties().

1027  {
1028  $this->numbering = $a_num;
1029  }
+ Here is the caller graph for this function:

◆ setActivePreventGlossaryAppendix()

ilObjContentObject::setActivePreventGlossaryAppendix (   $a_print)

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

Referenced by readProperties().

1047  {
1048  $this->prevent_glossary_appendix_active = $a_print;
1049  }
+ Here is the caller graph for this function:

◆ setActivePrintView()

ilObjContentObject::setActivePrintView (   $a_print)

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

Referenced by readProperties().

1037  {
1038  $this->print_view_active = $a_print;
1039  }
+ Here is the caller graph for this function:

◆ setActiveTOC()

ilObjContentObject::setActiveTOC (   $a_toc)

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

Referenced by readProperties().

1017  {
1018  $this->toc_active = $a_toc;
1019  }
+ Here is the caller graph for this function:

◆ setAutoGlossaries()

ilObjContentObject::setAutoGlossaries (   $a_val)

Set auto glossaries.

Parameters
array$a_valint

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

References ilObject\_lookupType().

Referenced by read(), and removeAutoGlossary().

372  {
373  $this->auto_glossaries = array();
374  if (is_array($a_val)) {
375  foreach ($a_val as $v) {
376  $v = (int) $v;
377  if ($v > 0 && ilObject::_lookupType($v) == "glo" &&
378  !in_array($v, $this->auto_glossaries)) {
379  $this->auto_glossaries[] = $v;
380  }
381  }
382  }
383  }
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 1106 of file class.ilObjContentObject.php.

Referenced by readProperties(), and updateProperties().

1107  {
1108  $this->clean_frames = $a_clean;
1109  }
+ Here is the caller graph for this function:

◆ setDescription()

ilObjContentObject::setDescription (   $a_description)

set description of content object

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

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

◆ setDisableDefaultFeedback()

ilObjContentObject::setDisableDefaultFeedback (   $a_val)

Set disable default feedback for questions.

Parameters
bool$a_valdisable default feedback

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

Referenced by readProperties().

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

◆ setFooterPage()

ilObjContentObject::setFooterPage (   $a_pg)

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

Referenced by readProperties().

1142  {
1143  $this->footer_page = $a_pg;
1144  }
+ Here is the caller graph for this function:

◆ setForTranslation()

ilObjContentObject::setForTranslation (   $a_val)

Set for translation.

Parameters
bool$a_vallm has been imported for translation purposes

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

Referenced by readProperties().

449  {
450  $this->for_translation = $a_val;
451  }
+ Here is the caller graph for this function:

◆ setHeaderPage()

ilObjContentObject::setHeaderPage (   $a_pg)

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

Referenced by readProperties().

1132  {
1133  $this->header_page = $a_pg;
1134  }
+ 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 1061 of file class.ilObjContentObject.php.

Referenced by readProperties().

1062  {
1063  $this->hide_header_footer_print = $a_val;
1064  }
+ Here is the caller graph for this function:

◆ setHistoryUserComments()

ilObjContentObject::setHistoryUserComments (   $a_comm)

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

Referenced by readProperties().

1117  {
1118  $this->user_comments = $a_comm;
1119  }
+ 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 535 of file class.ilObjContentObject.php.

536  {
537  $this->import_dir = $a_import_dir;
538  }

◆ setImportId()

ilObjContentObject::setImportId (   $a_id)

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

181  {
182  $this->import_id = $a_id;
183  }

◆ setLayout()

ilObjContentObject::setLayout (   $a_layout)

set default page layout

Parameters
string$a_layoutdefault page layout

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

Referenced by readProperties().

675  {
676  $this->layout = $a_layout;
677  }
+ Here is the caller graph for this function:

◆ setLayoutPerPage()

ilObjContentObject::setLayoutPerPage (   $a_val)

Set layout per page.

Parameters
booleanlayout per page

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

Referenced by readProperties().

191  {
192  $this->layout_per_page = $a_val;
193  }
+ 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 975 of file class.ilObjContentObject.php.

Referenced by readProperties().

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

◆ setProgressIcons()

ilObjContentObject::setProgressIcons (   $a_val)

Set progress icons.

Parameters
bool$a_valshow progress icons

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

Referenced by readProperties().

231  {
232  $this->progr_icons = $a_val;
233  }
+ Here is the caller graph for this function:

◆ setPublicAccessMode()

ilObjContentObject::setPublicAccessMode (   $a_mode)

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

Referenced by readProperties().

1122  {
1123  $this->public_access_mode = $a_mode;
1124  }
+ 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 2003 of file class.ilObjContentObject.php.

References $a_type.

Referenced by readProperties().

2004  {
2005  $this->public_export_file[$a_type] = $a_file;
2006  }
$a_type
Definition: workflow.php:92
+ Here is the caller graph for this function:

◆ setPublicNotes()

ilObjContentObject::setPublicNotes (   $a_pub_notes)

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

Referenced by readProperties().

1097  {
1098  $this->pub_notes = $a_pub_notes;
1099  }
+ Here is the caller graph for this function:

◆ setRating()

ilObjContentObject::setRating (   $a_value)

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

Referenced by readProperties().

3534  {
3535  $this->rating = (bool) $a_value;
3536  }
+ Here is the caller graph for this function:

◆ setRatingPages()

ilObjContentObject::setRatingPages (   $a_value)

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

Referenced by readProperties().

3544  {
3545  $this->rating_pages = (bool) $a_value;
3546  }
+ Here is the caller graph for this function:

◆ setRestrictForwardNavigation()

ilObjContentObject::setRestrictForwardNavigation (   $a_val)

Set restrict forward navigation.

Parameters
bool$a_valrestrict forward navigation

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

Referenced by readProperties().

271  {
272  $this->restrict_forw_nav = $a_val;
273  }
+ Here is the caller graph for this function:

◆ setStoreTries()

ilObjContentObject::setStoreTries (   $a_val)

Set store tries.

Parameters
bool$a_valstore tries

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

Referenced by readProperties().

251  {
252  $this->store_tries = $a_val;
253  }
+ Here is the caller graph for this function:

◆ setStyleSheetId()

ilObjContentObject::setStyleSheetId (   $a_style_id)

set ID of assigned style sheet object

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

Referenced by readProperties().

691  {
692  $this->style_id = $a_style_id;
693  }
+ Here is the caller graph for this function:

◆ setTitle()

ilObjContentObject::setTitle (   $a_title)

set title of content object

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

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

◆ setTOCMode()

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

set toc mode

Parameters
string$a_toc_mode"chapters" | "pages"

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

Referenced by readProperties().

1002  {
1003  $this->toc_mode = $a_toc_mode;
1004  }
+ Here is the caller graph for this function:

◆ update()

ilObjContentObject::update ( )

update complete object (meta data and properties)

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

References League\Flysystem\Adapter\Polyfill\update(), updateAutoGlossaries(), ilObject\updateMetaData(), and updateProperties().

295  {
296  $this->updateMetaData();
297  parent::update();
298  $this->updateProperties();
299  $this->updateAutoGlossaries();
300  }
updateMetaData()
update meta data entry
updateAutoGlossaries()
Update auto glossaries.
updateProperties()
Update content object properties.
update($pash, $contents, Config $config)
+ Here is the call graph for this function:

◆ updateAutoGlossaries()

ilObjContentObject::updateAutoGlossaries ( )

Update auto glossaries.

Parameters

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

References ilObject\$db, $ilDB, and getAutoGlossaries().

Referenced by create(), and update().

309  {
310  $ilDB = $this->db;
311 
312  // update auto glossaries
313  $ilDB->manipulate(
314  "DELETE FROM lm_glossaries WHERE " .
315  " lm_id = " . $ilDB->quote($this->getId(), "integer")
316  );
317  foreach ($this->getAutoGlossaries() as $glo_id) {
318  $ilDB->manipulate("INSERT INTO lm_glossaries " .
319  "(lm_id, glo_id) VALUES (" .
320  $ilDB->quote($this->getId(), "integer") . "," .
321  $ilDB->quote($glo_id, "integer") .
322  ")");
323  }
324  }
getAutoGlossaries()
Get auto glossaries.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateProperties()

ilObjContentObject::updateProperties ( )

Update content object properties.

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

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

Referenced by update().

1201  {
1202  $ilDB = $this->db;
1203 
1204  // force clean_frames to be set, if layout per page is activated
1205  if ($this->getLayoutPerPage()) {
1206  $this->setCleanFrames(true);
1207  }
1208 
1209  $q = "UPDATE content_object SET " .
1210  " default_layout = " . $ilDB->quote($this->getLayout(), "text") . ", " .
1211  " stylesheet = " . $ilDB->quote($this->getStyleSheetId(), "integer") . "," .
1212  " page_header = " . $ilDB->quote($this->getPageHeader(), "text") . "," .
1213  " toc_mode = " . $ilDB->quote($this->getTOCMode(), "text") . "," .
1214  " toc_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveTOC()), "text") . "," .
1215  " numbering = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveNumbering()), "text") . "," .
1216  " print_view_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActivePrintView()), "text") . "," .
1217  " no_glo_appendix = " . $ilDB->quote(ilUtil::tf2yn($this->isActivePreventGlossaryAppendix()), "text") . "," .
1218  " hide_head_foot_print = " . $ilDB->quote($this->getHideHeaderFooterPrint(), "integer") . "," .
1219  " downloads_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveDownloads()), "text") . "," .
1220  " downloads_public_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveDownloadsPublic()), "text") . "," .
1221  " clean_frames = " . $ilDB->quote(ilUtil::tf2yn($this->cleanFrames()), "text") . "," .
1222  " hist_user_comments = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveHistoryUserComments()), "text") . "," .
1223  " public_access_mode = " . $ilDB->quote($this->getPublicAccessMode(), "text") . "," .
1224  " public_xml_file = " . $ilDB->quote($this->getPublicExportFile("xml"), "text") . "," .
1225  " public_html_file = " . $ilDB->quote($this->getPublicExportFile("html"), "text") . "," .
1226  " public_scorm_file = " . $ilDB->quote($this->getPublicExportFile("scorm"), "text") . "," .
1227  " header_page = " . $ilDB->quote($this->getHeaderPage(), "integer") . "," .
1228  " footer_page = " . $ilDB->quote($this->getFooterPage(), "integer") . "," .
1229  " lm_menu_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveLMMenu()), "text") . ", " .
1230  " layout_per_page = " . $ilDB->quote($this->getLayoutPerPage(), "integer") . ", " .
1231  " rating = " . $ilDB->quote($this->hasRating(), "integer") . ", " .
1232  " rating_pages = " . $ilDB->quote($this->hasRatingPages(), "integer") . ", " .
1233  " disable_def_feedback = " . $ilDB->quote($this->getDisableDefaultFeedback(), "integer") . ", " .
1234  " progr_icons = " . $ilDB->quote($this->getProgressIcons(), "integer") . ", " .
1235  " store_tries = " . $ilDB->quote($this->getStoreTries(), "integer") . ", " .
1236  " restrict_forw_nav = " . $ilDB->quote($this->getRestrictForwardNavigation(), "integer") . ", " .
1237  " for_translation = " . $ilDB->quote((int) $this->getForTranslation(), "integer") . " " .
1238  " WHERE id = " . $ilDB->quote($this->getId(), "integer");
1239  $ilDB->manipulate($q);
1240  // #14661
1241  include_once("./Services/Notes/classes/class.ilNote.php");
1242  ilNote::activateComments($this->getId(), 0, $this->getType(), $this->publicNotes());
1243  }
getHideHeaderFooterPrint()
Get hide header footer in print mode.
static tf2yn($a_tf)
convert true/false to "y"/"n"
getStyleSheetId()
get ID of assigned style sheet object
getLayout()
get default page layout of content object (see directory layouts/)
getStoreTries()
Get store tries.
getPublicExportFile($a_type)
get public export file
getPublicAccessMode()
get public access mode ("complete" | "selected")
getLayoutPerPage()
Get layout per page.
getForTranslation()
Get for translation.
getProgressIcons()
Get progress icons.
getPageHeader()
get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER)
getId()
get object id public
getTOCMode()
get toc mode ("chapters" | "pages")
getDisableDefaultFeedback()
Get disable default feedback for questions.
getType()
get object type public
getRestrictForwardNavigation()
Get restrict forward navigation.
static activateComments($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_activate=true)
Activate notes feature.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validatePages()

ilObjContentObject::validatePages ( )

Validate all pages.

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

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

Referenced by importFromDirectory().

3101  {
3102  include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
3103  include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
3104 
3105  $mess = "";
3106 
3107  $pages = ilLMPageObject::getPageList($this->getId());
3108  foreach ($pages as $page) {
3109  if (ilLMPage::_exists($this->getType(), $page["obj_id"])) {
3110  $cpage = new ilLMPage($page["obj_id"]);
3111  $cpage->buildDom();
3112  $error = @$cpage->validateDom();
3113 
3114  if ($error != "") {
3115  $this->lng->loadLanguageModule("content");
3116  ilUtil::sendInfo($this->lng->txt("cont_import_validation_errors"));
3117  $title = ilLMObject::_lookupTitle($page["obj_id"]);
3118  $page_obj = new ilLMPageObject($this, $page["obj_id"]);
3119  $mess .= $this->lng->txt("obj_pg") . ": " . $title;
3120  $mess .= '<div class="small">';
3121  foreach ($error as $e) {
3122  $err_mess = implode($e, " - ");
3123  if (!is_int(strpos($err_mess, ":0:"))) {
3124  $mess .= htmlentities($err_mess) . "<br />";
3125  }
3126  }
3127  $mess .= '</div>';
3128  $mess .= "<br />";
3129  }
3130  }
3131  }
3132 
3133  return $mess;
3134  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
static _lookupTitle($a_obj_id)
Lookup title.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class ilLMPageObject.
getId()
get object id public
getType()
get object type public
static getPageList($lm_id)
static
Extension of ilPageObject for learning modules.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeFooterPage()

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

Write footer page.

Parameters
int$a_lm_idlearning module id
int$a_page_idpage

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

References $DIC, and $ilDB.

Referenced by ilLearningModuleImporter\finalProcessing().

736  {
737  global $DIC;
738 
739  $ilDB = $DIC->database();
740 
741  $ilDB->manipulate(
742  "UPDATE content_object SET " .
743  " footer_page = " . $ilDB->quote($a_page_id, "integer") .
744  " WHERE id = " . $ilDB->quote($a_lm_id, "integer")
745  );
746  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ writeHeaderPage()

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

Write header page.

Parameters
int$a_lm_idlearning module id
int$a_page_idpage

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

References $DIC, and $ilDB.

Referenced by ilLearningModuleImporter\finalProcessing().

717  {
718  global $DIC;
719 
720  $ilDB = $DIC->database();
721 
722  $ilDB->manipulate(
723  "UPDATE content_object SET " .
724  " header_page = " . $ilDB->quote($a_page_id, "integer") .
725  " WHERE id = " . $ilDB->quote($a_lm_id, "integer")
726  );
727  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ writeStyleSheetId()

ilObjContentObject::writeStyleSheetId (   $a_style_id)

write ID of assigned style sheet object to db

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

References ilObject\$db, $ilDB, and ilObject\getId().

Referenced by importFromDirectory().

699  {
700  $ilDB = $this->db;
701 
702  $q = "UPDATE content_object SET " .
703  " stylesheet = " . $ilDB->quote((int) $a_style_id, "integer") .
704  " WHERE id = " . $ilDB->quote($this->getId(), "integer");
705  $ilDB->manipulate($q);
706 
707  $this->style_id = $a_style_id;
708  }
getId()
get object id public
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $auto_glossaries

ilObjContentObject::$auto_glossaries = array()

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

Referenced by getAutoGlossaries().

◆ $for_translation

ilObjContentObject::$for_translation = 0

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

Referenced by getForTranslation().

◆ $import_dir

ilObjContentObject::$import_dir = ''
private

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

Referenced by createImportDirectory(), and getImportDirectory().

◆ $layout

ilObjContentObject::$layout

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

Referenced by getLayout().

◆ $lm_tree

◆ $locator

ilObjContentObject::$locator
protected

◆ $log

ilObjContentObject::$log
protected

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

Referenced by exportSCORM().

◆ $meta_data

ilObjContentObject::$meta_data

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

◆ $online

ilObjContentObject::$online

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

◆ $pg_header

ilObjContentObject::$pg_header

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

Referenced by getPageHeader().

◆ $rating

ilObjContentObject::$rating
protected

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

Referenced by hasRating().

◆ $rating_pages

ilObjContentObject::$rating_pages
protected

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

Referenced by hasRatingPages().

◆ $style_id

ilObjContentObject::$style_id

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

Referenced by cloneObject(), and getStyleSheetId().

◆ $tpl

ilObjContentObject::$tpl
protected

◆ $user

ilObjContentObject::$user
protected

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

Referenced by exportHTML().


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