ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 setOnline ($a_online)
 
 getOnline ()
 
 setActiveLMMenu ($a_act_lm_menu)
 
 isActiveLMMenu ()
 
 setActiveTOC ($a_toc)
 
 isActiveTOC ()
 
 setActiveNumbering ($a_num)
 
 isActiveNumbering ()
 
 setActivePrintView ($a_print)
 
 isActivePrintView ()
 
 setActivePreventGlossaryAppendix ($a_print)
 
 isActivePreventGlossaryAppendix ()
 
 setHideHeaderFooterPrint ($a_val)
 Set hide header footer in print mode. More...
 
 getHideHeaderFooterPrint ()
 Get hide header footer in print mode. More...
 
 setActiveDownloads ($a_down)
 
 isActiveDownloads ()
 
 setActiveDownloadsPublic ($a_down)
 
 isActiveDownloadsPublic ()
 
 setPublicNotes ($a_pub_notes)
 
 publicNotes ()
 
 setCleanFrames ($a_clean)
 
 cleanFrames ()
 
 setHistoryUserComments ($a_comm)
 
 setPublicAccessMode ($a_mode)
 
 isActiveHistoryUserComments ()
 
 setHeaderPage ($a_pg)
 
 getHeaderPage ()
 
 setFooterPage ($a_pg)
 
 getFooterPage ()
 
 readProperties ()
 read content object properties More...
 
 updateProperties ()
 Update content object properties. More...
 
 createProperties ()
 create new properties record More...
 
 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...
 
 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 _lookupOnline ($a_id)
 check wether content object is online 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 _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 type $ilDB. 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 _getIcon ( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static _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, array, 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
Create styles array
The data for the language used.
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 1333 of file class.ilObjContentObject.php.

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

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

1334  {
1335  global $DIC;
1336 
1337  $ilUser = $DIC->user();
1338  $ilErr = $DIC["ilErr"];
1339 
1340  $lm_tree = new ilTree($cont_obj_id);
1341  $lm_tree->setTableNames('lm_tree', 'lm_data');
1342  $lm_tree->setTreeTablePK("lm_id");
1343 
1344  if ($lm_tree->isInTree($page_id)) {
1345  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1346  foreach ($path as $node) {
1347  if ($node["type"] == "st") {
1348  if (!ilConditionHandler::_checkAllConditionsOfTarget($cont_ref_id, $node["child"], "st")) {
1349  return false;
1350  }
1351  }
1352  }
1353  }
1354 
1355  return true;
1356  }
global $ilErr
Definition: raiseError.php:16
global $DIC
Definition: saml.php:7
$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 948 of file class.ilObjContentObject.php.

References $DIC, and $ilDB.

Referenced by ilObjStyleSheet\delete().

949  {
950  global $DIC;
951 
952  $ilDB = $DIC->database();
953 
954  $q = "UPDATE content_object SET " .
955  " stylesheet = " . $ilDB->quote(0, "integer") .
956  " WHERE stylesheet = " . $ilDB->quote((int) $a_style_id, "integer");
957 
958  $ilDB->manipulate($q);
959  }
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 1361 of file class.ilObjContentObject.php.

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

Referenced by ilLMPresentationGUI\showPreconditionsOfPage().

1362  {
1363  $lm_tree = new ilTree($cont_obj_id);
1364  $lm_tree->setTableNames('lm_tree', 'lm_data');
1365  $lm_tree->setTreeTablePK("lm_id");
1366 
1367  $conds = array();
1368  if ($lm_tree->isInTree($page_id)) {
1369  // get full path of page
1370  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1371  foreach ($path as $node) {
1372  if ($node["type"] == "st") {
1373  // get all preconditions of upper chapters
1374  $tconds = ilConditionHandler::_getConditionsOfTarget($cont_ref_id, $node["child"], "st");
1375  foreach ($tconds as $tcond) {
1376  // store all missing preconditions
1377  if (!ilConditionHandler::_checkCondition($tcond["id"])) {
1378  $conds[] = $tcond;
1379  }
1380  }
1381  }
1382  }
1383  }
1384 
1385  return $conds;
1386  }
static _checkCondition($a_id, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
static _getConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_target_type="")
get all conditions of target object
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Create styles array
The data for the language used.
+ 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 1391 of file class.ilObjContentObject.php.

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

Referenced by ilLMPresentationGUI\showPreconditionsOfPage().

1392  {
1393  $lm_tree = new ilTree($cont_obj_id);
1394  $lm_tree->setTableNames('lm_tree', 'lm_data');
1395  $lm_tree->setTreeTablePK("lm_id");
1396 
1397  $conds = array();
1398  if ($lm_tree->isInTree($page_id)) {
1399  // get full path of page
1400  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1401  foreach ($path as $node) {
1402  if ($node["type"] == "st") {
1403  // get all preconditions of upper chapters
1404  $tconds = ilConditionHandler::_getConditionsOfTarget($cont_obj_ref_id, $node["child"], "st");
1405  foreach ($tconds as $tcond) {
1406  // look for missing precondition
1407  if (!ilConditionHandler::_checkCondition($tcond["id"])) {
1408  return $node["child"];
1409  }
1410  }
1411  }
1412  }
1413  }
1414 
1415  return "";
1416  }
static _checkCondition($a_id, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
static _getConditionsOfTarget($a_target_ref_id, $a_target_obj_id, $a_target_type="")
get all conditions of target object
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Create styles array
The data for the language used.
+ 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 910 of file class.ilObjContentObject.php.

References $DIC, and $ilDB.

Referenced by ilContentStyleSettingsGUI\edit().

911  {
912  global $DIC;
913 
914  $ilDB = $DIC->database();
915 
916  // joining with style table (not perfectly nice)
917  $q = "SELECT count(*) as cnt FROM content_object, style_data " .
918  " WHERE stylesheet = style_data.id " .
919  " AND standard = " . $ilDB->quote(0, "integer");
920  $cset = $ilDB->query($q);
921  $crow = $ilDB->fetchAssoc($cset);
922 
923  return (int) $crow["cnt"];
924  }
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 929 of file class.ilObjContentObject.php.

References $DIC, and $ilDB.

Referenced by ilContentStyleSettingsGUI\edit().

930  {
931  global $DIC;
932 
933  $ilDB = $DIC->database();
934 
935  $q = "SELECT count(*) as cnt FROM content_object " .
936  " WHERE stylesheet = " . $ilDB->quote(0, "integer");
937  $cset = $ilDB->query($q);
938  $crow = $ilDB->fetchAssoc($cset);
939 
940  return (int) $crow["cnt"];
941  }
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 892 of file class.ilObjContentObject.php.

References $DIC, and $ilDB.

Referenced by ilContentStyleSettingsGUI\edit().

893  {
894  global $DIC;
895 
896  $ilDB = $DIC->database();
897 
898  $q = "SELECT count(*) as cnt FROM content_object " .
899  " WHERE stylesheet = " . $ilDB->quote($a_style_id, "integer");
900  $cset = $ilDB->query($q);
901  $crow = $ilDB->fetchAssoc($cset);
902 
903  return (int) $crow["cnt"];
904  }
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 789 of file class.ilObjContentObject.php.

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

790  {
791  global $DIC;
792 
793  $ilDB = $DIC->database();
794  $ilLog = $DIC["ilLog"];
795 
796  $q = "SELECT " . $a_field . " FROM content_object " .
797  " WHERE id = " . $ilDB->quote($a_obj_id, "integer");
798 
799  $res = $ilDB->query($q);
800  $rec = $ilDB->fetchAssoc($res);
801 
802  return $rec[$a_field];
803  }
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 836 of file class.ilObjContentObject.php.

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

Referenced by ilObjStyleSheet\_getClonableContentStyles().

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

◆ _lookupDisableDefaultFeedback()

static ilObjContentObject::_lookupDisableDefaultFeedback (   $a_id)
static

Lookup disable default feedback.

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

References $DIC, $ilDB, and $res.

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

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

◆ _lookupOnline()

static ilObjContentObject::_lookupOnline (   $a_id)
static

check wether content object is online

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

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

1277  {
1278  global $DIC;
1279 
1280  $ilDB = $DIC->database();
1281 
1282  //echo "class ilObjContentObject::_lookupOnline($a_id) called. Use Access class instead.";
1283 
1284  $q = "SELECT is_online FROM content_object WHERE id = " . $ilDB->quote($a_id, "integer");
1285  $lm_set = $ilDB->query($q);
1286  $lm_rec = $ilDB->fetchAssoc($lm_set);
1287 
1288  return ilUtil::yn2tf($lm_rec["is_online"]);
1289  }
global $DIC
Definition: saml.php:7
$lm_set
global $ilDB
static yn2tf($a_yn)
convert "y"/"n" to true/false
+ Here is the call graph for this function:

◆ _lookupRestrictForwardNavigation()

static ilObjContentObject::_lookupRestrictForwardNavigation (   $a_obj_id)
static

Lookup forward restriction navigation.

Parameters
int$a_obj_idobject id
Returns
string property value

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

Referenced by ilLMPageGUI\processAnswer().

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

◆ _lookupStoreTries()

static ilObjContentObject::_lookupStoreTries (   $a_id)
static

Lookup disable default feedback.

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

References $DIC, $ilDB, and $res.

Referenced by ilLMPageGUI\__construct().

873  {
874  global $DIC;
875 
876  $ilDB = $DIC->database();
877 
878  $q = "SELECT store_tries FROM content_object " .
879  " WHERE id = " . $ilDB->quote($a_id, "integer");
880  $res = $ilDB->query($q);
881  $rec = $ilDB->fetchAssoc($res);
882 
883  return $rec["store_tries"];
884  }
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 819 of file class.ilObjContentObject.php.

References $DIC, $ilDB, and $res.

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

820  {
821  global $DIC;
822 
823  $ilDB = $DIC->database();
824 
825  $q = "SELECT stylesheet FROM content_object " .
826  " WHERE id = " . $ilDB->quote($a_cont_obj_id, "integer");
827  $res = $ilDB->query($q);
828  $sheet = $ilDB->fetchAssoc($res);
829 
830  return $sheet["stylesheet"];
831  }
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 751 of file class.ilObjContentObject.php.

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

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

752  {
753  global $DIC;
754 
755  $ilDB = $DIC->database();
756 
757  if ($a_from_style < 0) { // change / delete all individual styles
758  $q = "SELECT stylesheet FROM content_object, style_data " .
759  " WHERE content_object.stylesheet = style_data.id " .
760  " AND style_data.standard = " . $ilDB->quote(0, "integer") .
761  " AND content_object.stylesheet > " . $ilDB->quote(0, "integer");
762  $style_set = $ilDB->query($q);
763  while ($style_rec = $ilDB->fetchAssoc($style_set)) {
764  // assign learning modules to new style
765  $q = "UPDATE content_object SET " .
766  " stylesheet = " . $ilDB->quote((int) $a_to_style, "integer") .
767  " WHERE stylesheet = " . $ilDB->quote($style_rec["stylesheet"], "integer");
768  $ilDB->manipulate($q);
769 
770  // delete style
771  $style_obj = ilObjectFactory::getInstanceByObjId($style_rec["stylesheet"]);
772  $style_obj->delete();
773  }
774  } else {
775  $q = "UPDATE content_object SET " .
776  " stylesheet = " . $ilDB->quote((int) $a_to_style, "integer") .
777  " WHERE stylesheet = " . $ilDB->quote($a_from_style, "integer");
778  $ilDB->manipulate($q);
779  }
780  }
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 415 of file class.ilObjContentObject.php.

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

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

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

3498  {
3499  // get terms
3500  include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
3501  $terms = ilGlossaryTerm::getTermList($a_glo_ref_id);
3502 
3503  // each get page: get content
3504  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
3505  $pages = ilLMPage::getAllPages($this->getType(), $this->getId());
3506 
3507  // determine terms that occur in the page
3508  $found_pages = array();
3509  foreach ($pages as $p) {
3510  $pg = new ilLMPage($p["id"]);
3511  $c = $pg->getXMLContent();
3512  foreach ($terms as $t) {
3513  if (is_int(stripos($c, $t["term"]))) {
3514  $found_pages[$p["id"]]["terms"][] = $t;
3515  if (!is_object($found_pages[$p["id"]]["page"])) {
3516  $found_pages[$p["id"]]["page"] = $pg;
3517  }
3518  }
3519  }
3520  reset($terms);
3521  }
3522 
3523  // ilPCParagraph autoLinkGlossariesPage with page and terms
3524  include_once("./Services/COPage/classes/class.ilPCParagraph.php");
3525  foreach ($found_pages as $id => $fp) {
3526  ilPCParagraph::autoLinkGlossariesPage($fp["page"], $fp["terms"]);
3527  }
3528  }
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
Create styles array
The data for the language used.
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 1579 of file class.ilObjContentObject.php.

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

1580  {
1581  $issues = [];
1582  $ilDB = $this->db;
1583 
1584  $tree = $this->getLMTree();
1585 
1586  // check numbering, if errors, renumber
1587  // it is very important to keep this step before deleting subtrees
1588  // in the following steps
1589  $set = $ilDB->query(
1590  "SELECT l1.child, l1.lft l1lft, l1.rgt l1rgt, l2.parent, l2.lft l2lft, l2.rgt l2rgt" .
1591  " FROM lm_tree l1" .
1592  " JOIN lm_tree l2 ON ( l1.child = l2.parent" .
1593  " AND l1.lm_id = l2.lm_id )" .
1594  " JOIN lm_data ON ( l1.child = lm_data.obj_id )" .
1595  " WHERE (l2.lft < l1.lft" .
1596  " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)" .
1597  " AND l1.lm_id = " . $ilDB->quote($this->getId(), "integer") .
1598  " ORDER BY lm_data.create_date DESC"
1599  );
1600  while ($rec = $ilDB->fetchAssoc($set)) {
1601  $issues[] = "Tree numbering: " . print_r($rec, true);
1602  }
1603 
1604  // delete subtrees that have no lm_data records (changed due to #20637)
1605  $set = $ilDB->query("SELECT * FROM lm_tree WHERE lm_tree.lm_id = " . $ilDB->quote($this->getId(), "integer"));
1606  while ($node = $ilDB->fetchAssoc($set)) {
1607  $q = "SELECT * FROM lm_data WHERE obj_id = " .
1608  $ilDB->quote($node["child"], "integer");
1609  $obj_set = $ilDB->query($q);
1610  $obj_rec = $ilDB->fetchAssoc($obj_set);
1611  if (!$obj_rec) {
1612  $issues[] = "Tree entry without data entry: " . print_r($node, true);
1613  }
1614  }
1615 
1616  // delete subtrees that have pages as parent
1617  $nodes = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1618  foreach ($nodes as $node) {
1619  $q = "SELECT * FROM lm_data WHERE obj_id = " .
1620  $ilDB->quote($node["parent"], "integer");
1621  $obj_set = $ilDB->query($q);
1622  $obj_rec = $ilDB->fetchAssoc($obj_set);
1623  if ($obj_rec["type"] == "pg") {
1624  $node_data = $tree->getNodeData($node["child"]);
1625  if ($tree->isInTree($node["child"])) {
1626  $issues[] = "Subtree with page parent: " . print_r($node_data, true);
1627  }
1628  }
1629  }
1630 
1631  // check for multi-references pages or chapters
1632  // if errors -> create copies of them here
1633  $set = $ilDB->query("SELECT DISTINCT l1.lm_id" .
1634  " FROM lm_tree l1" .
1635  " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1636  " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1637  " WHERE l1.child <> 1" .
1638  " AND l1.lm_id <> lm_data.lm_id" .
1639  " AND l1.lm_id = " . $ilDB->quote($this->getId(), "integer"));
1640  if ($rec = $ilDB->fetchAssoc($set)) {
1641  $set = $ilDB->query("SELECT DISTINCT l1.child " .
1642  " FROM lm_tree l1" .
1643  " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1644  " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1645  " WHERE l1.child <> 1" .
1646  " AND l1.lm_id <> lm_data.lm_id" .
1647  " AND l1.lm_id = " . $ilDB->quote($this->getId(), "integer"));
1648  include_once("./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
1649  while ($rec = $ilDB->fetchAssoc($set)) {
1650  $set3 = $ilDB->queryF(
1651  "SELECT * FROM lm_tree " .
1652  " WHERE child = %s ",
1653  array("integer"),
1654  array($rec["child"])
1655  );
1656  while ($rec3 = $ilDB->fetchAssoc($set3)) {
1657  $issues[] = "Multi-reference item: " . print_r($rec3, true);
1658  }
1659  }
1660  }
1661 
1662  // missing copage entries
1663  $set = $ilDB->queryF(
1664  "SELECT * FROM lm_data " .
1665  " WHERE lm_id = %s AND type = %s",
1666  array("integer", "text"),
1667  array($this->getId(), "pg")
1668  );
1669  while ($rec = $ilDB->fetchAssoc($set)) {
1670  if (!ilPageObject::_exists("lm", $rec["obj_id"], "-")) {
1671  $issues[] = "Missing COPage: " . print_r($rec, true);
1672  }
1673  }
1674 
1675 
1676  return $issues;
1677  }
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
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ checkTree()

ilObjContentObject::checkTree ( )

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

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

Referenced by executeDragDrop().

1437  {
1438  $tree = new ilTree($this->getId());
1439  $tree->setTableNames('lm_tree', 'lm_data');
1440  $tree->setTreeTablePK("lm_id");
1441  $tree->checkTree();
1442  $tree->checkTreeChilds();
1443  //echo "checked";
1444  }
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 1120 of file class.ilObjContentObject.php.

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

1121  {
1122  return $this->clean_frames;
1123  }
+ 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 3305 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(), getOnline(), getPageHeader(), getProgressIcons(), getPublicAccessMode(), getRestrictForwardNavigation(), getStoreTries(), getStyleSheetId(), getTOCMode(), hasRating(), hasRatingPages(), isActiveDownloads(), isActiveDownloadsPublic(), isActiveHistoryUserComments(), isActiveLMMenu(), isActiveNumbering(), isActivePreventGlossaryAppendix(), isActivePrintView(), isActiveTOC(), publicNotes(), and ilLMMenuEditor\writeActive().

3306  {
3307  $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
3308  $this->cloneMetaData($new_obj);
3309  //$new_obj->createProperties();
3310 
3311  //copy online status if object is not the root copy object
3312  $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
3313 
3314  if (!$cp_options->isRootNode($this->getRefId())) {
3315  $new_obj->setOnline($this->getOnline());
3316  }
3317 
3318  // $new_obj->setTitle($this->getTitle());
3319  $new_obj->setDescription($this->getDescription());
3320  $new_obj->setLayoutPerPage($this->getLayoutPerPage());
3321  $new_obj->setLayout($this->getLayout());
3322  $new_obj->setTOCMode($this->getTOCMode());
3323  $new_obj->setActiveLMMenu($this->isActiveLMMenu());
3324  $new_obj->setActiveTOC($this->isActiveTOC());
3325  $new_obj->setActiveNumbering($this->isActiveNumbering());
3326  $new_obj->setActivePrintView($this->isActivePrintView());
3327  $new_obj->setActivePreventGlossaryAppendix($this->isActivePreventGlossaryAppendix());
3328  $new_obj->setActiveDownloads($this->isActiveDownloads());
3329  $new_obj->setActiveDownloadsPublic($this->isActiveDownloadsPublic());
3330  $new_obj->setPublicNotes($this->publicNotes());
3331  $new_obj->setCleanFrames($this->cleanFrames());
3332  $new_obj->setHistoryUserComments($this->isActiveHistoryUserComments());
3333  $new_obj->setPublicAccessMode($this->getPublicAccessMode());
3334  $new_obj->setPageHeader($this->getPageHeader());
3335  $new_obj->setRating($this->hasRating());
3336  $new_obj->setRatingPages($this->hasRatingPages());
3337  $new_obj->setDisableDefaultFeedback($this->getDisableDefaultFeedback());
3338  $new_obj->setProgressIcons($this->getProgressIcons());
3339  $new_obj->setStoreTries($this->getStoreTries());
3340  $new_obj->setRestrictForwardNavigation($this->getRestrictForwardNavigation());
3341  $new_obj->setAutoGlossaries($this->getAutoGlossaries());
3342 
3343  $new_obj->update();
3344 
3345  $new_obj->createLMTree();
3346 
3347  // copy style
3348  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3349  $style_id = $this->getStyleSheetId();
3350  if ($style_id > 0 &&
3353  $new_id = $style_obj->ilClone();
3354  $new_obj->setStyleSheetId($new_id);
3355  } else { // or just set the same standard style
3356  $new_obj->setStyleSheetId($style_id);
3357  }
3358  $new_obj->update();
3359 
3360  // copy content
3361  $copied_nodes = $this->copyAllPagesAndChapters($new_obj, $a_copy_id);
3362 
3363  // page header and footer
3364  if ($this->getHeaderPage() > 0 && ($new_page_header = $copied_nodes[$this->getHeaderPage()]) > 0) {
3365  $new_obj->setHeaderPage($new_page_header);
3366  }
3367  if ($this->getFooterPage() > 0 && ($new_page_footer = $copied_nodes[$this->getFooterPage()]) > 0) {
3368  $new_obj->setFooterPage($new_page_footer);
3369  }
3370  $new_obj->update();
3371 
3372  // Copy learning progress settings
3373  include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
3374  $obj_settings = new ilLPObjSettings($this->getId());
3375  $obj_settings->cloneSettings($new_obj->getId());
3376  unset($obj_settings);
3377 
3378  // copy (page) multilang settings
3379  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
3380  $ot = ilObjectTranslation::getInstance($this->getId());
3381  $ot->copy($new_obj->getId());
3382 
3383  // copy lm menu
3384  include_once './Modules/LearningModule/classes/class.ilLMMenuEditor.php';
3385  $menu = new ilLMMenuEditor();
3386  $menu->setObjId($this->getId());
3387  $new_menu = new ilLMMenuEditor();
3388  $new_menu->setObjId($new_obj->getId());
3389  foreach ($menu->getMenuEntries() as $entry) {
3390  /*'id' => $row->id,
3391  'title' => $row->title,
3392  'link' => $row->target,
3393  'type' => $row->link_type,
3394  'ref_id' => $row->link_ref_id,
3395  'active'*/
3396 
3397  $new_menu->setTarget($entry["link"]);
3398  $new_menu->setTitle($entry["title"]);
3399  $new_menu->setLinkType($entry["type"]);
3400  $new_menu->setLinkRefId($entry["ref_id"]);
3401  $new_menu->create();
3402  ilLMMenuEditor::writeActive($new_menu->getEntryId(), $entry["active"] == "y" ? true : false);
3403  }
3404 
3405 
3406  return $new_obj;
3407  }
getStyleSheetId()
get ID of assigned style sheet object
getLayout()
get default page layout of content object (see directory layouts/)
getStoreTries()
Get store tries.
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 3414 of file class.ilObjContentObject.php.

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

Referenced by cloneObject().

3415  {
3416  $parent_id = $a_target_obj->lm_tree->readRootId();
3417 
3418  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
3419  include_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
3420 
3421  // get all chapters of root lm
3422  $chapters = $this->lm_tree->getChildsByType($this->lm_tree->readRootId(), "st");
3423  $copied_nodes = array();
3424  //$time = time();
3425  foreach ($chapters as $chap) {
3426  $cid = ilLMObject::pasteTree(
3427  $a_target_obj,
3428  $chap["child"],
3429  $parent_id,
3430  IL_LAST_NODE,
3431  $time,
3432  $copied_nodes,
3433  true,
3434  $this
3435  );
3436  $target = $cid;
3437  }
3438 
3439  // copy free pages
3440  $pages = ilLMPageObject::getPageList($this->getId());
3441  foreach ($pages as $p) {
3442  if (!$this->lm_tree->isInTree($p["obj_id"])) {
3443  $item = new ilLMPageObject($this, $p["obj_id"]);
3444  $target_item = $item->copy($a_target_obj);
3445  $copied_nodes[$item->getId()] = $target_item->getId();
3446  }
3447  }
3448 
3449  // Add mapping for pages and chapters
3450  include_once './Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
3452  foreach ($copied_nodes as $old_id => $new_id) {
3453  $options->appendMapping(
3454  $this->getRefId() . '_' . $old_id,
3455  $a_target_obj->getRefId() . '_' . $new_id
3456  );
3457  }
3458 
3459  ilLMObject::updateInternalLinks($copied_nodes);
3460 
3461  $a_target_obj->checkTree();
3462 
3463  return $copied_nodes;
3464  }
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
Create styles array
The data for the language used.
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
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ 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(), and updateAutoGlossaries().

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

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

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

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

Referenced by importFromZipFile().

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

References ilObject\getId().

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

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

Referenced by create().

1260  {
1261  $ilDB = $this->db;
1262 
1263  $q = "INSERT INTO content_object (id) VALUES (" . $ilDB->quote($this->getId(), "integer") . ")";
1264  $ilDB->manipulate($q);
1265 
1266  // #14661
1267  include_once("./Services/Notes/classes/class.ilNote.php");
1268  ilNote::activateComments($this->getId(), 0, $this->getType(), true);
1269 
1270  $this->readProperties(); // to get db default values
1271  }
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 614 of file class.ilObjContentObject.php.

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

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

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

2944  {
2945  $lmtree = new ilTree($this->getId());
2946  $lmtree->setTableNames('lm_tree', 'lm_data');
2947  $lmtree->setTreeTablePK("lm_id");
2948  //echo "-".$source_id."-".$target_id."-".$first_child."-".$as_subitem."-";
2949  $source_obj = ilLMObjectFactory::getInstance($this, $source_id, true);
2950  $source_obj->setLMId($this->getId());
2951 
2952  if (!$first_child) {
2953  $target_obj = ilLMObjectFactory::getInstance($this, $target_id, true);
2954  $target_obj->setLMId($this->getId());
2955  $target_parent = $lmtree->getParentId($target_id);
2956  }
2957 
2958  // handle pages
2959  if ($source_obj->getType() == "pg") {
2960  //echo "1";
2961  if ($lmtree->isInTree($source_obj->getId())) {
2962  $node_data = $lmtree->getNodeData($source_obj->getId());
2963 
2964  // cut on move
2965  if ($movecopy == "move") {
2966  $parent_id = $lmtree->getParentId($source_obj->getId());
2967  $lmtree->deleteTree($node_data);
2968 
2969  // write history entry
2970  require_once("./Services/History/classes/class.ilHistory.php");
2972  $source_obj->getId(),
2973  "cut",
2974  array(ilLMObject::_lookupTitle($parent_id), $parent_id),
2975  $this->getType() . ":pg"
2976  );
2978  $parent_id,
2979  "cut_page",
2980  array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
2981  $this->getType() . ":st"
2982  );
2983  } else {
2984  // copy page
2985  $new_page = $source_obj->copy();
2986  $source_id = $new_page->getId();
2987  $source_obj = $new_page;
2988  }
2989 
2990  // paste page
2991  if (!$lmtree->isInTree($source_obj->getId())) {
2992  if ($first_child) { // as first child
2993  $target_pos = IL_FIRST_NODE;
2994  $parent = $target_id;
2995  } elseif ($as_subitem) { // as last child
2996  $parent = $target_id;
2997  $target_pos = IL_FIRST_NODE;
2998  $pg_childs = $lmtree->getChildsByType($parent, "pg");
2999  if (count($pg_childs) != 0) {
3000  $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
3001  }
3002  } else { // at position
3003  $target_pos = $target_id;
3004  $parent = $target_parent;
3005  }
3006 
3007  // insert page into tree
3008  $lmtree->insertNode(
3009  $source_obj->getId(),
3010  $parent,
3011  $target_pos
3012  );
3013 
3014  // write history entry
3015  if ($movecopy == "move") {
3016  // write history comments
3017  include_once("./Services/History/classes/class.ilHistory.php");
3019  $source_obj->getId(),
3020  "paste",
3021  array(ilLMObject::_lookupTitle($parent), $parent),
3022  $this->getType() . ":pg"
3023  );
3025  $parent,
3026  "paste_page",
3027  array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
3028  $this->getType() . ":st"
3029  );
3030  }
3031  }
3032  }
3033  }
3034 
3035  // handle chapters
3036  if ($source_obj->getType() == "st") {
3037  //echo "2";
3038  $source_node = $lmtree->getNodeData($source_id);
3039  $subnodes = $lmtree->getSubtree($source_node);
3040 
3041  // check, if target is within subtree
3042  foreach ($subnodes as $subnode) {
3043  if ($subnode["obj_id"] == $target_id) {
3044  return;
3045  }
3046  }
3047 
3048  $target_pos = $target_id;
3049 
3050  if ($first_child) { // as first subchapter
3051  $target_pos = IL_FIRST_NODE;
3052  $target_parent = $target_id;
3053 
3054  $pg_childs = $lmtree->getChildsByType($target_parent, "pg");
3055  if (count($pg_childs) != 0) {
3056  $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
3057  }
3058  } elseif ($as_subitem) { // as last subchapter
3059  $target_parent = $target_id;
3060  $target_pos = IL_FIRST_NODE;
3061  $childs = $lmtree->getChilds($target_parent);
3062  if (count($childs) != 0) {
3063  $target_pos = $childs[count($childs) - 1]["obj_id"];
3064  }
3065  }
3066 
3067  // insert into
3068  /*
3069  if ($position == "into")
3070  {
3071  $target_parent = $target_id;
3072  $target_pos = IL_FIRST_NODE;
3073 
3074  // if target_pos is still first node we must skip all pages
3075  if ($target_pos == IL_FIRST_NODE)
3076  {
3077  $pg_childs =& $lmtree->getChildsByType($target_parent, "pg");
3078  if (count($pg_childs) != 0)
3079  {
3080  $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
3081  }
3082  }
3083  }
3084  */
3085 
3086 
3087  // delete source tree
3088  if ($movecopy == "move") {
3089  $lmtree->deleteTree($source_node);
3090  } else {
3091  // copy chapter (incl. subcontents)
3092  $new_chapter = $source_obj->copy($lmtree, $target_parent, $target_pos);
3093  }
3094 
3095  if (!$lmtree->isInTree($source_id)) {
3096  $lmtree->insertNode($source_id, $target_parent, $target_pos);
3097 
3098  // insert moved tree
3099  if ($movecopy == "move") {
3100  foreach ($subnodes as $node) {
3101  if ($node["obj_id"] != $source_id) {
3102  $lmtree->insertNode($node["obj_id"], $node["parent"]);
3103  }
3104  }
3105  }
3106  }
3107 
3108  // check the tree
3109  $this->checkTree();
3110  }
3111 
3112  $this->checkTree();
3113  }
$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...
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ exportFileItems()

ilObjContentObject::exportFileItems (   $a_target_dir,
$expLog 
)

export files of file itmes

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

References date.

Referenced by exportXML().

1862  {
1863  include_once("./Modules/File/classes/class.ilObjFile.php");
1864 
1865  foreach ($this->file_ids as $file_id) {
1866  $expLog->write(date("[y-m-d H:i:s] ") . "File Item " . $file_id);
1867  $file_obj = new ilObjFile($file_id, false);
1868  $file_obj->export($a_target_dir);
1869  unset($file_obj);
1870  }
1871  }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
+ 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 2837 of file class.ilObjContentObject.php.

References array, and exportFOStructureObjects().

2838  {
2839  // fo:root (start)
2840  $attrs = array();
2841  $attrs["xmlns:fo"] = "http://www.w3.org/1999/XSL/Format";
2842  $a_xml_writer->xmlStartTag("fo:root", $attrs);
2843 
2844  // fo:layout-master-set (start)
2845  $attrs = array();
2846  $a_xml_writer->xmlStartTag("fo:layout-master-set", $attrs);
2847 
2848  // fo:simple-page-master (start)
2849  $attrs = array();
2850  $attrs["master-name"] = "DinA4";
2851  $attrs["page-height"] = "29.7cm";
2852  $attrs["page-width"] = "21cm";
2853  $attrs["margin-top"] = "4cm";
2854  $attrs["margin-bottom"] = "1cm";
2855  $attrs["margin-left"] = "2.8cm";
2856  $attrs["margin-right"] = "7.3cm";
2857  $a_xml_writer->xmlStartTag("fo:simple-page-master", $attrs);
2858 
2859  // fo:region-body (complete)
2860  $attrs = array();
2861  $attrs["margin-top"] = "0cm";
2862  $attrs["margin-bottom"] = "1.25cm";
2863  $a_xml_writer->xmlElement("fo:region-body", $attrs);
2864 
2865  // fo:region-before (complete)
2866  $attrs = array();
2867  $attrs["extent"] = "1cm";
2868  $a_xml_writer->xmlElement("fo:region-before", $attrs);
2869 
2870  // fo:region-after (complete)
2871  $attrs = array();
2872  $attrs["extent"] = "1cm";
2873  $a_xml_writer->xmlElement("fo:region-after", $attrs);
2874 
2875  // fo:simple-page-master (end)
2876  $a_xml_writer->xmlEndTag("fo:simple-page-master");
2877 
2878  // fo:layout-master-set (end)
2879  $a_xml_writer->xmlEndTag("fo:layout-master-set");
2880 
2881  // fo:page-sequence (start)
2882  $attrs = array();
2883  $attrs["master-reference"] = "DinA4";
2884  $a_xml_writer->xmlStartTag("fo:page-sequence", $attrs);
2885 
2886  // fo:flow (start)
2887  $attrs = array();
2888  $attrs["flow-name"] = "xsl-region-body";
2889  $a_xml_writer->xmlStartTag("fo:flow", $attrs);
2890 
2891 
2892  // StructureObjects
2893  $this->exportFOStructureObjects($a_xml_writer, $expLog);
2894 
2895  // fo:flow (end)
2896  $a_xml_writer->xmlEndTag("fo:flow");
2897 
2898  // fo:page-sequence (end)
2899  $a_xml_writer->xmlEndTag("fo:page-sequence");
2900 
2901  // fo:root (end)
2902  $a_xml_writer->xmlEndTag("fo:root");
2903  }
exportFOStructureObjects(&$a_xml_writer)
export structure objects to fo
Create styles array
The data for the language used.
+ 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 2911 of file class.ilObjContentObject.php.

Referenced by exportFO().

2912  {
2913  $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
2914  foreach ($childs as $child) {
2915  if ($child["type"] != "st") {
2916  continue;
2917  }
2918 
2919  $structure_obj = new ilStructureObject($this, $child["obj_id"]);
2920  $structure_obj->exportFO($a_xml_writer, $expLog);
2921  unset($structure_obj);
2922  }
2923  }
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 2132 of file class.ilObjContentObject.php.

References $_GET, $fh, $file, $files, $GLOBALS, $ilUser, $lang, $locator, $style, $tpl, $user, ilObject\_exists(), ilObject\_lookupType(), array, 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(), time, and ilUtil\zip().

Referenced by exportSCORM().

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

References ilUtil\makeDir().

Referenced by exportHTML().

2526  {
2527  $file_dir = $a_target_dir . "/files/file_" . $a_file_id;
2528  ilUtil::makeDir($file_dir);
2529  include_once("./Modules/File/classes/class.ilObjFile.php");
2530  $file_obj = new ilObjFile($a_file_id, false);
2531  $source_file = $file_obj->getDirectory($file_obj->getVersion()) . "/" . $file_obj->getFileName();
2532  if (!is_file($source_file)) {
2533  $source_file = $file_obj->getDirectory() . "/" . $file_obj->getFileName();
2534  }
2535  if (is_file($source_file)) {
2536  copy($source_file, $file_dir . "/" . $file_obj->getFileName());
2537  }
2538  }
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 2606 of file class.ilObjContentObject.php.

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

Referenced by exportHTML().

2607  {
2608  $ilLocator = $this->locator;
2609 
2610  foreach ($this->offline_int_links as $int_link) {
2611  $ilLocator->clearItems();
2612  if ($int_link["type"] == "git") {
2613  $tpl = new ilTemplate("tpl.main.html", true, true);
2614  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2615 
2616  $_GET["obj_id"] = $int_link["id"];
2617  $_GET["frame"] = "_blank";
2618  $content = $a_lm_gui->glossary();
2619  $file = $a_target_dir . "/term_" . $int_link["id"] . ".html";
2620 
2621  // open file
2622  if (!($fp = @fopen($file, "w+"))) {
2623  die("<b>Error</b>: Could not open \"" . $file . "\" for writing" .
2624  " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />");
2625  }
2626  chmod($file, 0770);
2627  fwrite($fp, $content);
2628  fclose($fp);
2629 
2630  // store linked/embedded media objects of glosssary term
2631  include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
2632  $defs = ilGlossaryDefinition::getDefinitionList($int_link["id"]);
2633  foreach ($defs as $def) {
2634  $def_mobs = ilObjMediaObject::_getMobsOfObject("gdf:pg", $def["id"]);
2635  foreach ($def_mobs as $def_mob) {
2636  $this->offline_mobs[$def_mob] = $def_mob;
2637  include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
2638  $this->log->debug("HTML Export: Add media object $def_mob (" . ilObject::_lookupTitle($def_mob) . ") " .
2639  " due to glossary entry " . $int_link["id"] . " (" . ilGlossaryTerm::_lookGlossaryTerm($int_link["id"]) . ").");
2640  }
2641 
2642  // get all files of page
2643  $def_files = ilObjFile::_getFilesOfObject("gdf:pg", $page["obj_id"]);
2644  $this->offline_files = array_merge($this->offline_files, $def_files);
2645  }
2646  }
2647  }
2648  }
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
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
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 2543 of file class.ilObjContentObject.php.

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

Referenced by exportHTML().

2544  {
2545  $tpl = $this->tpl;
2546 
2547  $mob_dir = $a_target_dir . "/mobs";
2548 
2549  $source_dir = ilUtil::getWebspaceDir() . "/mobs/mm_" . $a_mob_id;
2550  if (@is_dir($source_dir)) {
2551  ilUtil::makeDir($mob_dir . "/mm_" . $a_mob_id);
2552  ilUtil::rCopy($source_dir, $mob_dir . "/mm_" . $a_mob_id);
2553  }
2554 
2555  $tpl = new ilTemplate("tpl.main.html", true, true);
2556  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2557  $_GET["obj_type"] = "MediaObject";
2558  $_GET["mob_id"] = $a_mob_id;
2559  $_GET["frame"] = $a_frame;
2560  $_GET["cmd"] = "";
2561  $content = $a_lm_gui->media();
2562  $file = $a_target_dir . "/media_" . $a_mob_id . ".html";
2563 
2564  // open file
2565  if (!($fp = @fopen($file, "w+"))) {
2566  die("<b>Error</b>: Could not open \"" . $file . "\" for writing" .
2567  " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />");
2568  }
2569  chmod($file, 0770);
2570  fwrite($fp, $content);
2571  fclose($fp);
2572 
2573  // fullscreen
2574  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2575  $mob_obj = new ilObjMediaObject($a_mob_id);
2576  if ($mob_obj->hasFullscreenItem()) {
2577  $tpl = new ilTemplate("tpl.main.html", true, true);
2578  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2579  $_GET["obj_type"] = "";
2580  $_GET["frame"] = "";
2581  $_GET["mob_id"] = $a_mob_id;
2582  $_GET["cmd"] = "fullscreen";
2583  $content = $a_lm_gui->fullscreen();
2584  $file = $a_target_dir . "/fullscreen_" . $a_mob_id . ".html";
2585 
2586  // open file
2587  if (!($fp = @fopen($file, "w+"))) {
2588  die("<b>Error</b>: Could not open \"" . $file . "\" for writing" .
2589  " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />");
2590  }
2591  chmod($file, 0770);
2592  fwrite($fp, $content);
2593  fclose($fp);
2594  }
2595  $linked_mobs = $mob_obj->getLinkedMediaObjects();
2596  foreach ($linked_mobs as $id) {
2597  $this->log->debug("HTML Export: Add media object $id (" . ilObject::_lookupTitle($id) . ") " .
2598  " due to media object " . $a_mob_id . " (" . ilObject::_lookupTitle($a_mob_id) . ").");
2599  }
2600  $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
2601  }
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 ...
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
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 2653 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(), array, exportPageHTML(), ilLMObject\getExportId(), ilObject\getId(), getLMTree(), ilLMPageObject\getPageList(), ilObject\getType(), and ilPageContentUsage\getUsagesOfPage().

Referenced by exportHTML().

2654  {
2655  $ilLocator = $this->locator;
2656 
2657  $pages = ilLMPageObject::getPageList($this->getId());
2658 
2659  $lm_tree = $this->getLMTree();
2660  $first_page = $lm_tree->fetchSuccessorNode($lm_tree->getRootId(), "pg");
2661  $this->first_page_id = $first_page["child"];
2662 
2663  // iterate all learning module pages
2664  $mobs = array();
2665  $int_links = array();
2666  $this->offline_files = array();
2667 
2668  include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
2669  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2670 
2671  // get html export id mapping
2672  $lm_set = new ilSetting("lm");
2673  $exp_id_map = array();
2674 
2675  if ($lm_set->get("html_export_ids")) {
2676  foreach ($pages as $page) {
2677  $exp_id = ilLMPageObject::getExportId($this->getId(), $page["obj_id"]);
2678  if (trim($exp_id) != "") {
2679  $exp_id_map[$page["obj_id"]] = trim($exp_id);
2680  }
2681  }
2682  }
2683  //exit;
2684  if ($a_lang == "") {
2685  $a_lang = "-";
2686  }
2687 
2688  reset($pages);
2689  foreach ($pages as $page) {
2690  if (ilLMPage::_exists($this->getType(), $page["obj_id"])) {
2691  $ilLocator->clearItems();
2692  $this->exportPageHTML(
2693  $a_lm_gui,
2694  $a_target_dir,
2695  $page["obj_id"],
2696  "",
2697  $exp_id_map,
2698  $a_lang,
2699  $a_all_languages
2700  );
2701 
2702  // get all snippets of page
2703  $pcs = ilPageContentUsage::getUsagesOfPage($page["obj_id"], $this->getType() . ":pg", 0, false, $a_lang);
2704  foreach ($pcs as $pc) {
2705  if ($pc["type"] == "incl") {
2706  $incl_mobs = ilObjMediaObject::_getMobsOfObject("mep:pg", $pc["id"]);
2707  foreach ($incl_mobs as $incl_mob) {
2708  $mobs[$incl_mob] = $incl_mob;
2709  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
2710  $this->log->debug("HTML Export: Add media object $incl_mob (" . ilObject::_lookupTitle($incl_mob) . ") " .
2711  " due to snippet " . $pc["id"] . " in page " . $page["obj_id"] . " (" . ilLMObject::_lookupTitle($page["obj_id"]) . ").");
2712  }
2713  }
2714  }
2715 
2716  // get all media objects of page
2717  $pg_mobs = ilObjMediaObject::_getMobsOfObject($this->getType() . ":pg", $page["obj_id"], 0, $a_lang);
2718  foreach ($pg_mobs as $pg_mob) {
2719  $mobs[$pg_mob] = $pg_mob;
2720  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
2721  $this->log->debug("HTML Export: Add media object $pg_mob (" . ilObject::_lookupTitle($pg_mob) . ") " .
2722  " due to page " . $page["obj_id"] . " (" . ilLMObject::_lookupTitle($page["obj_id"]) . ").");
2723  }
2724 
2725  // get all internal links of page
2726  $pg_links = ilInternalLink::_getTargetsOfSource($this->getType() . ":pg", $page["obj_id"], $a_lang);
2727  $int_links = array_merge($int_links, $pg_links);
2728 
2729  // get all files of page
2730  include_once("./Modules/File/classes/class.ilObjFile.php");
2731  $pg_files = ilObjFile::_getFilesOfObject($this->getType() . ":pg", $page["obj_id"], 0, $a_lang);
2732  $this->offline_files = array_merge($this->offline_files, $pg_files);
2733 
2734  // collect all questions
2735  include_once("./Services/COPage/classes/class.ilPCQuestion.php");
2736  $q_ids = ilPCQuestion::_getQuestionIdsForPage($this->getType(), $page["obj_id"], $a_lang);
2737  foreach ($q_ids as $q_id) {
2738  $this->q_ids[$q_id] = $q_id;
2739  }
2740  }
2741  }
2742  foreach ($mobs as $m) {
2743  $this->offline_mobs[$m] = $m;
2744  }
2745  foreach ($int_links as $k => $v) {
2746  $this->offline_int_links[$k] = $v;
2747  }
2748  }
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
Create styles array
The data for the language used.
$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 2755 of file class.ilObjContentObject.php.

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

Referenced by exportHTMLPages().

2763  {
2764  $tpl = $this->tpl;
2765 
2766  $lang_suffix = "";
2767  if ($a_lang != "-" && $a_lang != "" && $a_all_languages) {
2768  $lang_suffix = "_" . $a_lang;
2769  }
2770 
2771  //echo "<br>B: export Page HTML ($a_lm_page_id)"; flush();
2772  // template workaround: reset of template
2773  $tpl = new ilTemplate("tpl.main.html", true, true);
2774  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2775 
2776  include_once("./Services/COPage/classes/class.ilPCQuestion.php");
2778 
2779  $_GET["obj_id"] = $a_lm_page_id;
2780  $_GET["frame"] = $a_frame;
2781 
2782  if ($a_frame == "") {
2783  //if ($nid = ilLMObject::_lookupNID($a_lm_gui->lm->getId(), $a_lm_page_id, "pg"))
2784  if (is_array($a_exp_id_map) && isset($a_exp_id_map[$a_lm_page_id])) {
2785  $file = $a_target_dir . "/lm_pg_" . $a_exp_id_map[$a_lm_page_id] . $lang_suffix . ".html";
2786  } else {
2787  $file = $a_target_dir . "/lm_pg_" . $a_lm_page_id . $lang_suffix . ".html";
2788  }
2789  } else {
2790  if ($a_frame != "toc") {
2791  $file = $a_target_dir . "/frame_" . $a_lm_page_id . "_" . $a_frame . $lang_suffix . ".html";
2792  } else {
2793  $file = $a_target_dir . "/frame_" . $a_frame . $lang_suffix . ".html";
2794  }
2795  }
2796 
2797  // return if file is already existing
2798  if (@is_file($file)) {
2799  return;
2800  }
2801 
2802  $content = $a_lm_gui->layout("main.xml", false);
2803 
2804  // open file
2805  if (!($fp = @fopen($file, "w+"))) {
2806  die("<b>Error</b>: Could not open \"" . $file . "\" for writing" .
2807  " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />");
2808  }
2809 
2810  // set file permissions
2811  chmod($file, 0770);
2812 
2813  // write xml data into the file
2814  fwrite($fp, $content);
2815 
2816  // close file
2817  fclose($fp);
2818 
2819  if ($this->first_page_id == $a_lm_page_id && $a_frame == "") {
2820  copy($file, $a_target_dir . "/index" . $lang_suffix . ".html");
2821  }
2822 
2823  // write frames of frameset
2824  $frameset = $a_lm_gui->getCurrentFrameSet();
2825 
2826  foreach ($frameset as $frame) {
2827  $this->exportPageHTML($a_lm_gui, $a_target_dir, $a_lm_page_id, $frame);
2828  }
2829  }
$_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)
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ 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 2088 of file class.ilObjContentObject.php.

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

2089  {
2090  ilUtil::delDir($a_target_dir);
2091  ilUtil::makeDir($a_target_dir);
2092  //ilUtil::makeDir($a_target_dir."/res");
2093 
2094  // export everything to html
2095  $this->exportHTML($a_target_dir . "/res", $log, false, "scorm");
2096 
2097  // build manifest file
2098  include("./Modules/LearningModule/classes/class.ilLMContObjectManifestBuilder.php");
2099  $man_builder = new ilLMContObjectManifestBuilder($this);
2100  $man_builder->buildManifest();
2101  $man_builder->dump($a_target_dir);
2102 
2103  // copy scorm 1.2 schema definitions
2104  copy("Modules/LearningModule/scorm_xsd/adlcp_rootv1p2.xsd", $a_target_dir . "/adlcp_rootv1p2.xsd");
2105  copy("Modules/LearningModule/scorm_xsd/imscp_rootv1p1p2.xsd", $a_target_dir . "/imscp_rootv1p1p2.xsd");
2106  copy("Modules/LearningModule/scorm_xsd/imsmd_rootv1p2p1.xsd", $a_target_dir . "/imsmd_rootv1p2p1.xsd");
2107  copy("Modules/LearningModule/scorm_xsd/ims_xml.xsd", $a_target_dir . "/ims_xml.xsd");
2108 
2109  // zip it all
2110  $date = time();
2111  $zip_file = $a_target_dir . "/" . $date . "__" . IL_INST_ID . "__" .
2112  $this->getType() . "_" . $this->getId() . ".zip";
2113  //echo "zip-".$a_target_dir."-to-".$zip_file;
2114  ilUtil::zip(array($a_target_dir . "/res",
2115  $a_target_dir . "/imsmanifest.xml",
2116  $a_target_dir . "/adlcp_rootv1p2.xsd",
2117  $a_target_dir . "/imscp_rootv1p1p2.xsd",
2118  $a_target_dir . "/ims_xml.xsd",
2119  $a_target_dir . "/imsmd_rootv1p2p1.xsd"), $zip_file);
2120 
2121  $dest_file = $this->getExportDirectory("scorm") . "/" . $date . "__" . IL_INST_ID . "__" .
2122  $this->getType() . "_" . $this->getId() . ".zip";
2123 
2124  rename($zip_file, $dest_file);
2125  ilUtil::delDir($a_target_dir);
2126  }
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
Create styles array
The data for the language used.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
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 1685 of file class.ilObjContentObject.php.

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

1686  {
1687  $attrs = array();
1688  switch ($this->getType()) {
1689  case "lm":
1690  $attrs["Type"] = "LearningModule";
1691  break;
1692  }
1693  $a_xml_writer->xmlStartTag("ContentObject", $attrs);
1694 
1695  // MetaData
1696  $this->exportXMLMetaData($a_xml_writer);
1697 
1698  // StructureObjects
1699  //echo "ContObj:".$a_inst.":<br>";
1700  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Structure Objects");
1701  $this->exportXMLStructureObjects($a_xml_writer, $a_inst, $expLog);
1702  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Structure Objects");
1703 
1704  // PageObjects
1705  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Page Objects");
1706  $this->exportXMLPageObjects($a_xml_writer, $a_inst, $expLog);
1707  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Page Objects");
1708 
1709  // MediaObjects
1710  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Media Objects");
1711  $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
1712  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Media Objects");
1713 
1714  // FileItems
1715  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export File Items");
1716  $this->exportFileItems($a_target_dir, $expLog);
1717  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export File Items");
1718 
1719  // Questions
1720  if (count($this->q_ids) > 0) {
1721  $qti_file = fopen($a_target_dir . "/qti.xml", "w");
1722  include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
1723  $pool = new ilObjQuestionPool();
1724  fwrite($qti_file, $pool->questionsToXML($this->q_ids));
1725  fclose($qti_file);
1726  }
1727 
1728  // To do: implement version selection/detection
1729  // Properties
1730  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Properties");
1731  $this->exportXMLProperties($a_xml_writer, $expLog);
1732  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Properties");
1733 
1734  $a_xml_writer->xmlEndTag("ContentObject");
1735  }
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
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
getType()
get object type public
Create styles array
The data for the language used.
+ 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 1824 of file class.ilObjContentObject.php.

References ilObject\_lookupType(), array, and date.

Referenced by exportXML().

1825  {
1826  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1827 
1828  $linked_mobs = array();
1829 
1830  // mobs directly embedded into pages
1831  foreach ($this->mob_ids as $mob_id) {
1832  if ($mob_id > 0 && ilObject::_lookupType($mob_id) == "mob") {
1833  $expLog->write(date("[y-m-d H:i:s] ") . "Media Object " . $mob_id);
1834  $media_obj = new ilObjMediaObject($mob_id);
1835  $media_obj->exportXML($a_xml_writer, $a_inst);
1836  $media_obj->exportFiles($a_target_dir);
1837 
1838  $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
1839  $linked_mobs = array_merge($linked_mobs, $lmobs);
1840 
1841  unset($media_obj);
1842  }
1843  }
1844 
1845  // linked mobs (in map areas)
1846  foreach ($linked_mobs as $mob_id) {
1847  if ($mob_id > 0) {
1848  $expLog->write(date("[y-m-d H:i:s] ") . "Media Object " . $mob_id);
1849  $media_obj = new ilObjMediaObject($mob_id);
1850  $media_obj->exportXML($a_xml_writer, $a_inst);
1851  $media_obj->exportFiles($a_target_dir);
1852  unset($media_obj);
1853  }
1854  }
1855  }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Class ilObjMediaObject.
Create styles array
The data for the language used.
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 1743 of file class.ilObjContentObject.php.

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

Referenced by exportXML().

1744  {
1745  include_once("Services/MetaData/classes/class.ilMD2XML.php");
1746  $md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
1747  $md2xml->setExportMode(true);
1748  $md2xml->startExport();
1749  $a_xml_writer->appendXML($md2xml->getXML());
1750  }
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 1781 of file class.ilObjContentObject.php.

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

Referenced by exportXML().

1782  {
1783  include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
1784  include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
1785 
1786  $pages = ilLMPageObject::getPageList($this->getId());
1787  foreach ($pages as $page) {
1788  if (ilLMPage::_exists($this->getType(), $page["obj_id"])) {
1789  $expLog->write(date("[y-m-d H:i:s] ") . "Page Object " . $page["obj_id"]);
1790 
1791  // export xml to writer object
1792  $page_obj = new ilLMPageObject($this, $page["obj_id"]);
1793  $page_obj->exportXML($a_xml_writer, "normal", $a_inst);
1794 
1795  // collect media objects
1796  $mob_ids = $page_obj->getMediaObjectIDs();
1797  foreach ($mob_ids as $mob_id) {
1798  $this->mob_ids[$mob_id] = $mob_id;
1799  }
1800 
1801  // collect all file items
1802  $file_ids = $page_obj->getFileItemIds();
1803  foreach ($file_ids as $file_id) {
1804  $this->file_ids[$file_id] = $file_id;
1805  }
1806 
1807  // collect all questions
1808  $q_ids = $page_obj->getQuestionIds();
1809  foreach ($q_ids as $q_id) {
1810  $this->q_ids[$q_id] = $q_id;
1811  }
1812 
1813  unset($page_obj);
1814  }
1815  }
1816  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
Class ilLMPageObject.
getId()
get object id public
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
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 1877 of file class.ilObjContentObject.php.

References array, 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().

1878  {
1879  $attrs = array();
1880  $a_xml_writer->xmlStartTag("Properties", $attrs);
1881 
1882  // Layout
1883  $attrs = array("Name" => "Layout", "Value" => $this->getLayout());
1884  $a_xml_writer->xmlElement("Property", $attrs);
1885 
1886  // Page Header
1887  $attrs = array("Name" => "PageHeader", "Value" => $this->getPageHeader());
1888  $a_xml_writer->xmlElement("Property", $attrs);
1889 
1890  // TOC Mode
1891  $attrs = array("Name" => "TOCMode", "Value" => $this->getTOCMode());
1892  $a_xml_writer->xmlElement("Property", $attrs);
1893 
1894  // LM Menu Activation
1895  $attrs = array("Name" => "ActiveLMMenu", "Value" =>
1896  ilUtil::tf2yn($this->isActiveLMMenu()));
1897  $a_xml_writer->xmlElement("Property", $attrs);
1898 
1899  // Numbering Activation
1900  $attrs = array("Name" => "ActiveNumbering", "Value" =>
1901  ilUtil::tf2yn($this->isActiveNumbering()));
1902  $a_xml_writer->xmlElement("Property", $attrs);
1903 
1904  // Table of contents button activation
1905  $attrs = array("Name" => "ActiveTOC", "Value" =>
1906  ilUtil::tf2yn($this->isActiveTOC()));
1907  $a_xml_writer->xmlElement("Property", $attrs);
1908 
1909  // Print view button activation
1910  $attrs = array("Name" => "ActivePrintView", "Value" =>
1911  ilUtil::tf2yn($this->isActivePrintView()));
1912  $a_xml_writer->xmlElement("Property", $attrs);
1913 
1914  // Note that download button is not saved, because
1915  // download files do not exist after import
1916 
1917  // Clean frames
1918  $attrs = array("Name" => "CleanFrames", "Value" =>
1919  ilUtil::tf2yn($this->cleanFrames()));
1920  $a_xml_writer->xmlElement("Property", $attrs);
1921 
1922  // Public notes activation
1923  $attrs = array("Name" => "PublicNotes", "Value" =>
1924  ilUtil::tf2yn($this->publicNotes()));
1925  $a_xml_writer->xmlElement("Property", $attrs);
1926 
1927  // History comments for authors activation
1928  $attrs = array("Name" => "HistoryUserComments", "Value" =>
1930  $a_xml_writer->xmlElement("Property", $attrs);
1931 
1932  // Rating
1933  $attrs = array("Name" => "Rating", "Value" =>
1934  ilUtil::tf2yn($this->hasRating()));
1935  $a_xml_writer->xmlElement("Property", $attrs);
1936  $attrs = array("Name" => "RatingPages", "Value" =>
1937  ilUtil::tf2yn($this->hasRatingPages()));
1938  $a_xml_writer->xmlElement("Property", $attrs);
1939 
1940  // Header Page
1941  if ($this->getHeaderPage() > 0) {
1942  $attrs = array("Name" => "HeaderPage", "Value" =>
1943  "il_" . IL_INST_ID . "_pg_" . $this->getHeaderPage());
1944  $a_xml_writer->xmlElement("Property", $attrs);
1945  }
1946 
1947  // Footer Page
1948  if ($this->getFooterPage() > 0) {
1949  $attrs = array("Name" => "FooterPage", "Value" =>
1950  "il_" . IL_INST_ID . "_pg_" . $this->getFooterPage());
1951  $a_xml_writer->xmlElement("Property", $attrs);
1952  }
1953 
1954  // layout per page
1955  $attrs = array("Name" => "LayoutPerPage", "Value" =>
1956  $this->getLayoutPerPage());
1957  $a_xml_writer->xmlElement("Property", $attrs);
1958 
1959  // progress icons
1960  $attrs = array("Name" => "ProgressIcons", "Value" =>
1961  $this->getProgressIcons());
1962  $a_xml_writer->xmlElement("Property", $attrs);
1963 
1964  // store tries
1965  $attrs = array("Name" => "StoreTries", "Value" =>
1966  $this->getStoreTries());
1967  $a_xml_writer->xmlElement("Property", $attrs);
1968 
1969  // restrict forward navigation
1970  $attrs = array("Name" => "RestrictForwardNavigation", "Value" =>
1971  $this->getRestrictForwardNavigation());
1972  $a_xml_writer->xmlElement("Property", $attrs);
1973 
1974  // disable default feedback
1975  $attrs = array("Name" => "DisableDefaultFeedback", "Value" =>
1976  $this->getDisableDefaultFeedback());
1977  $a_xml_writer->xmlElement("Property", $attrs);
1978 
1979  $a_xml_writer->xmlEndTag("Properties");
1980  }
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.
Create styles array
The data for the language used.
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 1758 of file class.ilObjContentObject.php.

Referenced by exportXML().

1759  {
1760  include_once './Modules/LearningModule/classes/class.ilStructureObject.php';
1761 
1762  $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
1763  foreach ($childs as $child) {
1764  if ($child["type"] != "st") {
1765  continue;
1766  }
1767 
1768  $structure_obj = new ilStructureObject($this, $child["obj_id"]);
1769  $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
1770  unset($structure_obj);
1771  }
1772  }
Class ilStructreObject.
+ Here is the caller graph for this function:

◆ fixTree()

ilObjContentObject::fixTree ( )

fix tree

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

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

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

References $auto_glossaries.

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

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

◆ getAvailableLayouts()

static ilObjContentObject::getAvailableLayouts ( )
static

get all available lm layouts

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

References $file, $l, $ret, and array.

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

1295  {
1296  $dir = opendir("./Modules/LearningModule/layouts/lm");
1297 
1298  $layouts = array();
1299 
1300  while ($file = readdir($dir)) {
1301  if ($file != "." && $file != ".." && $file != "CVS" && $file != ".svn") {
1302  // directories
1303  if (@is_dir("./Modules/LearningModule/layouts/lm/" . $file)) {
1304  $layouts[$file] = $file;
1305  }
1306  }
1307  }
1308  asort($layouts);
1309 
1310  // workaround: fix ordering
1311  $ret = array(
1312  'toc2win' => 'toc2win',
1313  'toc2windyn' => 'toc2windyn',
1314  '1window' => '1window',
1315  '2window' => '2window',
1316  '3window' => '3window',
1317  'presentation' => 'presentation',
1318  'fullscreen' => 'fullscreen'
1319  );
1320 
1321  foreach ($layouts as $l) {
1322  if (!in_array($l, $ret)) {
1323  $ret[$l] = $l;
1324  }
1325  }
1326 
1327  return $ret;
1328  }
Create styles array
The data for the language used.
global $l
Definition: afr.php:30
$ret
Definition: parser.php:6
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the caller graph for this function:

◆ getDataDirectory()

ilObjContentObject::getDataDirectory ( )

get data directory

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

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

Referenced by delete().

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

Referenced by cloneObject().

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

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

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

◆ getExportDirectory()

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

get export directory of lm

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

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

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

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

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

1986  {
1987  $file = array();
1988 
1989  $types = array("xml", "html", "scorm");
1990 
1991  foreach ($types as $type) {
1992  $dir = $this->getExportDirectory($type);
1993  // quit if import dir not available
1994  if (!@is_dir($dir) or
1995  !is_writeable($dir)) {
1996  continue;
1997  }
1998 
1999  // open directory
2000  $cdir = dir($dir);
2001 
2002  // initialize array
2003 
2004  // get files and save the in the array
2005  while ($entry = $cdir->read()) {
2006  if ($entry != "." and
2007  $entry != ".." and
2008  substr($entry, -4) == ".zip" and
2009  preg_match("~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.zip\$~", $entry)) {
2010  $file[$entry . $type] = array("type" => $type, "file" => $entry,
2011  "size" => filesize($dir . "/" . $entry));
2012  }
2013  }
2014 
2015  // close import directory
2016  $cdir->close();
2017  }
2018 
2019  // sort files
2020  ksort($file);
2021  reset($file);
2022  return $file;
2023  }
getExportDirectory($a_type="xml")
get export directory of lm
Create styles array
The data for the language used.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the call graph for this function:

◆ getFooterPage()

ilObjContentObject::getFooterPage ( )

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

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

1156  {
1157  return $this->footer_page;
1158  }
+ 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 457 of file class.ilObjContentObject.php.

References $for_translation.

Referenced by updateProperties().

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

◆ getHeaderPage()

ilObjContentObject::getHeaderPage ( )

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

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

1146  {
1147  return $this->header_page;
1148  }
+ 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 1080 of file class.ilObjContentObject.php.

Referenced by updateProperties().

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

◆ getImportDirectory()

ilObjContentObject::getImportDirectory ( )

get import directory of lm

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

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

Referenced by importFromZipFile().

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

References ilObject\$import_id.

Referenced by importFromDirectory().

175  {
176  return $this->import_id;
177  }
+ 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 663 of file class.ilObjContentObject.php.

References $layout.

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

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

◆ getLayoutPerPage()

ilObjContentObject::getLayoutPerPage ( )

Get layout per page.

Returns
boolean layout per page

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

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

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

◆ getLMTree()

& ilObjContentObject::getLMTree ( )

get content object tree

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

References $lm_tree.

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

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

◆ getOfflineFiles()

ilObjContentObject::getOfflineFiles (   $dir)

get offline files

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

References $file, and array.

2052  {
2053  // quit if offline dir not available
2054  if (!@is_dir($dir) or
2055  !is_writeable($dir)) {
2056  return array();
2057  }
2058 
2059  // open directory
2060  $dir = dir($dir);
2061 
2062  // initialize array
2063  $file = array();
2064 
2065  // get files and save the in the array
2066  while ($entry = $dir->read()) {
2067  if ($entry != "." and
2068  $entry != ".." and
2069  substr($entry, -4) == ".pdf" and
2070  preg_match("~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.pdf\$~", $entry)) {
2071  $file[] = $entry;
2072  }
2073  }
2074 
2075  // close import directory
2076  $dir->close();
2077 
2078  // sort files
2079  sort($file);
2080  reset($file);
2081 
2082  return $file;
2083  }
Create styles array
The data for the language used.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file

◆ getOnline()

ilObjContentObject::getOnline ( )

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

References $online.

Referenced by cloneObject(), and updateProperties().

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

◆ getPageHeader()

ilObjContentObject::getPageHeader ( )

get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER)

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

References $pg_header.

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

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

◆ getProgressIcons()

ilObjContentObject::getProgressIcons ( )

Get progress icons.

Returns
bool show progress icons

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

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

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

◆ getPublicAccessMode()

ilObjContentObject::getPublicAccessMode ( )

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

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

Referenced by cloneObject(), and updateProperties().

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

References $a_type.

Referenced by getPublicExportFiles(), and updateProperties().

2044  {
2045  return $this->public_export_file[$a_type];
2046  }
$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 3622 of file class.ilObjContentObject.php.

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

3623  {
3624  $dirs = array("xml", "scorm");
3625  $export_files = array();
3626 
3627  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
3628  $ot = ilObjectTranslation::getInstance($this->getId());
3629  if ($ot->getContentActivated()) {
3630  $langs = $ot->getLanguages();
3631  foreach ($langs as $l => $ldata) {
3632  $dirs[] = "html_" . $l;
3633  }
3634  $dirs[] = "html_all";
3635  } else {
3636  $dirs[] = "html";
3637  }
3638 
3639  foreach ($dirs as $dir) {
3640  $type = explode("_", $dir);
3641  $type = $type[0];
3642  if ($this->getPublicExportFile($type) != "") {
3643  if (is_file($this->getExportDirectory($dir) . "/" .
3644  $this->getPublicExportFile($type))) {
3645  $size = filesize($this->getExportDirectory($dir) . "/" .
3646  $this->getPublicExportFile($type));
3647  $export_files[] = array("type" => $type,
3648  "dir_type" => $dir,
3649  "file" => $this->getPublicExportFile($type),
3650  "size" => $size);
3651  }
3652  }
3653  }
3654 
3655  return $export_files;
3656  }
$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
Create styles array
The data for the language used.
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 279 of file class.ilObjContentObject.php.

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

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

◆ getStoreTries()

ilObjContentObject::getStoreTries ( )

Get store tries.

Returns
bool store tries

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

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

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

◆ getStyleSheetId()

ilObjContentObject::getStyleSheetId ( )

get ID of assigned style sheet object

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

References $style_id.

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

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

◆ getSupplyingExportFiles()

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

Get supplying export files.

Parameters

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

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

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

2425  {
2426  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
2427  include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
2428  include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
2429  include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
2430  $scripts = array(
2431  array("source" => ilYuiUtil::getLocalPath('yahoo/yahoo-min.js'),
2432  "target" => $a_target_dir . '/js/yahoo/yahoo-min.js',
2433  "type" => "js"),
2434  array("source" => ilYuiUtil::getLocalPath('yahoo-dom-event/yahoo-dom-event.js'),
2435  "target" => $a_target_dir . '/js/yahoo/yahoo-dom-event.js',
2436  "type" => "js"),
2437  array("source" => ilYuiUtil::getLocalPath('animation/animation-min.js'),
2438  "target" => $a_target_dir . '/js/yahoo/animation-min.js',
2439  "type" => "js"),
2440  array("source" => './Services/JavaScript/js/Basic.js',
2441  "target" => $a_target_dir . '/js/Basic.js',
2442  "type" => "js"),
2443  array("source" => './Services/Accordion/js/accordion.js',
2444  "target" => $a_target_dir . '/js/accordion.js',
2445  "type" => "js"),
2446  array("source" => './Services/Accordion/css/accordion.css',
2447  "target" => $a_target_dir . '/css/accordion.css',
2448  "type" => "css"),
2450  "target" => $a_target_dir . '/js/jquery.js',
2451  "type" => "js"),
2453  "target" => $a_target_dir . '/js/maphilight.js',
2454  "type" => "js"),
2456  "target" => $a_target_dir . '/js/jquery-ui-min.js',
2457  "type" => "js"),
2458  array("source" => './Services/COPage/js/ilCOPagePres.js',
2459  "target" => $a_target_dir . '/js/ilCOPagePres.js',
2460  "type" => "js"),
2461  array("source" => './Modules/Scorm2004/scripts/questions/pure.js',
2462  "target" => $a_target_dir . '/js/pure.js',
2463  "type" => "js"),
2464  array("source" => './Modules/Scorm2004/scripts/questions/question_handling.js',
2465  "target" => $a_target_dir . '/js/question_handling.js',
2466  "type" => "js"),
2467  array("source" => './Modules/TestQuestionPool/js/ilMatchingQuestion.js',
2468  "target" => $a_target_dir . '/js/ilMatchingQuestion.js',
2469  "type" => "js"),
2470  array("source" => './Modules/Scorm2004/templates/default/question_handling.css',
2471  "target" => $a_target_dir . '/css/question_handling.css',
2472  "type" => "css"),
2473  array("source" => './Modules/TestQuestionPool/templates/default/test_javascript.css',
2474  "target" => $a_target_dir . '/css/test_javascript.css',
2475  "type" => "css"),
2476  array("source" => './Modules/TestQuestionPool/js/ilAssMultipleChoice.js',
2477  "target" => $a_target_dir . '/js/ilAssMultipleChoice.js',
2478  "type" => "js"),
2480  "target" => $a_target_dir . "/" . ilPlayerUtil::getLocalMediaElementJsPath(),
2481  "type" => "js"),
2483  "target" => $a_target_dir . "/" . ilPlayerUtil::getLocalMediaElementCssPath(),
2484  "type" => "css"),
2486  "target" => $a_target_dir . "/" . ilExplorerBaseGUI::getLocalExplorerJsPath(),
2487  "type" => "js"),
2489  "target" => $a_target_dir . "/" . ilExplorerBaseGUI::getLocalJsTreeJsPath(),
2490  "type" => "js"),
2491  array("source" => './Modules/LearningModule/js/LearningModule.js',
2492  "target" => $a_target_dir . '/js/LearningModule.js',
2493  "type" => "js")
2494  );
2495 
2496  $mathJaxSetting = new ilSetting("MathJax");
2497  $use_mathjax = $mathJaxSetting->get("enable");
2498  if ($use_mathjax) {
2499  $scripts[] = array("source" => "",
2500  "target" => $mathJaxSetting->get("path_to_mathjax"),
2501  "type" => "js");
2502  }
2503 
2504  // auto linking js
2505  include_once("./Services/Link/classes/class.ilLinkifyUtil.php");
2506  foreach (ilLinkifyUtil::getLocalJsPaths() as $p) {
2507  if (is_int(strpos($p, "ExtLink"))) {
2508  $scripts[] = array("source" => $p,
2509  "target" => $a_target_dir . '/js/ilExtLink.js',
2510  "type" => "js");
2511  }
2512  if (is_int(strpos($p, "linkify"))) {
2513  $scripts[] = array("source" => $p,
2514  "target" => $a_target_dir . '/js/linkify.js',
2515  "type" => "js");
2516  }
2517  }
2518 
2519  return $scripts;
2520  }
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.
Create styles array
The data for the language used.
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 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 140 of file class.ilObjContentObject.php.

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

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

◆ getTOCMode()

ilObjContentObject::getTOCMode ( )

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

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

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

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

◆ getTree()

& ilObjContentObject::getTree ( )

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

References $lm_tree.

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

◆ getXMLZip()

ilObjContentObject::getXMLZip ( )

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

2926  {
2927  include_once("./Modules/LearningModule/classes/class.ilContObjectExport.php");
2928 
2929  $cont_exp = new ilContObjectExport($this, 'xml');
2930 
2931  $export_file = $cont_exp->buildExportFile();
2932  return $export_file;
2933  }
Export class for content objects.

◆ hasRating()

ilObjContentObject::hasRating ( )

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

References $rating.

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

3557  {
3558  return $this->rating;
3559  }
+ Here is the caller graph for this function:

◆ hasRatingPages()

ilObjContentObject::hasRatingPages ( )

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

References $rating_pages.

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

3567  {
3568  return $this->rating_pages;
3569  }
+ 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 1421 of file class.ilObjContentObject.php.

References ilObject\$tree.

Referenced by ilPageObjectGUI\showPage().

1422  {
1423  $tree = new ilTree($a_cont_obj_id);
1424  $tree->setTableNames('lm_tree', 'lm_data');
1425  $tree->setTreeTablePK("lm_id");
1426  if ($tree->isInTree($a_page_id)) {
1427  $succ = $tree->fetchSuccessorNode($a_page_id, "pg");
1428  if ($succ > 0) {
1429  return true;
1430  }
1431  }
1432  return false;
1433  }
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 329 of file class.ilObjContentObject.php.

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

◆ importFromDirectory()

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

Import lm from directory.

Parameters

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

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

Referenced by importFromZipFile().

3208  {
3209  $lng = $this->lng;
3210 
3211  $this->log->debug("import from directory " . $a_directory);
3212 
3213  // determine filename of xml file
3214  $subdir = basename($a_directory);
3215  $xml_file = $a_directory . "/" . $subdir . ".xml";
3216 
3217  // check directory exists within zip file
3218  if (!is_dir($a_directory)) {
3219  $this->log->error(sprintf($lng->txt("cont_no_subdir_in_zip"), $subdir));
3220  return sprintf($lng->txt("cont_no_subdir_in_zip"), $subdir);
3221  }
3222 
3223  // check whether xml file exists within zip file
3224  if (!is_file($xml_file)) {
3225  $this->log->error(sprintf($lng->txt("cont_zip_file_invalid"), $subdir . "/" . $subdir . ".xml"));
3226  return sprintf($lng->txt("cont_zip_file_invalid"), $subdir . "/" . $subdir . ".xml");
3227  }
3228 
3229  // import questions
3230  $this->log->debug("import qti");
3231  $qti_file = $a_directory . "/qti.xml";
3232  $qtis = array();
3233  if (is_file($qti_file)) {
3234  include_once "./Services/QTI/classes/class.ilQTIParser.php";
3235  include_once("./Modules/Test/classes/class.ilObjTest.php");
3236  $qtiParser = new ilQTIParser(
3237  $qti_file,
3239  0,
3240  ""
3241  );
3242  $result = $qtiParser->startParsing();
3243  $founditems = &$qtiParser->getFoundItems();
3244  $testObj = new ilObjTest(0, true);
3245  if (count($founditems) > 0) {
3246  $qtiParser = new ilQTIParser($qti_file, IL_MO_PARSE_QTI, 0, "");
3247  $qtiParser->setTestObject($testObj);
3248  $result = $qtiParser->startParsing();
3249  $qtis = array_merge($qtis, $qtiParser->getImportMapping());
3250  }
3251  }
3252 
3253  $this->log->debug("get ilContObjParser");
3254  include_once("./Modules/LearningModule/classes/class.ilContObjParser.php");
3255  $subdir = ".";
3256  $contParser = new ilContObjParser($this, $xml_file, $subdir, $a_directory);
3257  // smeyer: added \ilImportMapping lok im/export
3258  $contParser->setImportMapping($a_mapping);
3259  $contParser->setQuestionMapping($qtis);
3260  $contParser->startParsing();
3261  ilObject::_writeImportId($this->getId(), $this->getImportId());
3262  $this->MDUpdateListener('General');
3263 
3264  // import style
3265  $style_file = $a_directory . "/style.xml";
3266  $style_zip_file = $a_directory . "/style.zip";
3267  if (is_file($style_zip_file)) { // try to import style.zip first
3268  require_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3269  $style = new ilObjStyleSheet();
3270  $style->import($style_zip_file);
3271  $this->writeStyleSheetId($style->getId());
3272  } elseif (is_file($style_file)) { // try to import style.xml
3273  require_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3274  $style = new ilObjStyleSheet();
3275  $style->import($style_file);
3276  $this->writeStyleSheetId($style->getId());
3277  }
3278 
3279  // // validate
3280  if ($a_validate) {
3281  $mess = $this->validatePages();
3282  }
3283 
3284  if ($mess == "") {
3285  // handle internal links to this learning module
3286  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
3288  $this->getImportId(),
3289  $this->getType(),
3290  $this->getRefId()
3291  );
3292  }
3293 
3294  return $mess;
3295  }
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
Create styles array
The data for the language used.
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 3160 of file class.ilObjContentObject.php.

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

3165  {
3166  $lng = $this->lng;
3167 
3168  // create import directory
3169  $this->createImportDirectory();
3170 
3171  // copy uploaded file to import directory
3172  $file = pathinfo($a_filename);
3173  $full_path = $this->getImportDirectory() . "/" . $a_filename;
3174 
3175  ilUtil::moveUploadedFile(
3176  $a_tmp_file,
3177  $a_filename,
3178  $full_path
3179  );
3180 
3181  // unzip file
3182  ilUtil::unzip($full_path);
3183 
3184  $subdir = basename($file["basename"], "." . $file["extension"]);
3185 
3186  $mess = $this->importFromDirectory(
3187  $this->getImportDirectory() . "/" . $subdir,
3188  $a_validate
3189  );
3190 
3191 
3192  // delete import directory
3194 
3195  return $mess;
3196  }
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.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
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 1090 of file class.ilObjContentObject.php.

Referenced by cloneObject(), and updateProperties().

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

◆ isActiveDownloadsPublic()

ilObjContentObject::isActiveDownloadsPublic ( )

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

Referenced by cloneObject(), and updateProperties().

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

◆ isActiveHistoryUserComments()

ilObjContentObject::isActiveHistoryUserComments ( )

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

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

1136  {
1137  return $this->user_comments;
1138  }
+ Here is the caller graph for this function:

◆ isActiveLMMenu()

ilObjContentObject::isActiveLMMenu ( )

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

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

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

◆ isActiveNumbering()

ilObjContentObject::isActiveNumbering ( )

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

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

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

◆ isActivePreventGlossaryAppendix()

ilObjContentObject::isActivePreventGlossaryAppendix ( )

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

Referenced by cloneObject(), and updateProperties().

1061  {
1062  return $this->prevent_glossary_appendix_active;
1063  }
+ Here is the caller graph for this function:

◆ isActivePrintView()

ilObjContentObject::isActivePrintView ( )

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

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

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

◆ isActiveTOC()

ilObjContentObject::isActiveTOC ( )

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

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

1031  {
1032  return $this->toc_active;
1033  }
+ 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 3540 of file class.ilObjContentObject.php.

References ilObject\_lookupObjId().

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

3541  {
3542  if (!$a_as_obj_id && $a_id > 0 && $a_id == OH_REF_ID) {
3543  return true;
3544  }
3545  if ($a_as_obj_id && $a_id > 0 && $a_id == ilObject::_lookupObjId(OH_REF_ID)) {
3546  return true;
3547  }
3548  return false;
3549  }
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 3473 of file class.ilObjContentObject.php.

References $DIC, $ilDB, and array.

Referenced by ilLMPage\beforePageContentUpdate().

3474  {
3475  global $DIC;
3476 
3477  $ilDB = $DIC->database();
3478 
3479  // read auto glossaries
3480  $set = $ilDB->query(
3481  "SELECT * FROM lm_glossaries " .
3482  " WHERE lm_id = " . $ilDB->quote($a_lm_id, "integer")
3483  );
3484  $glos = array();
3485  while ($rec = $ilDB->fetchAssoc($set)) {
3486  $glos[] = $rec["glo_id"];
3487  }
3488  return $glos;
3489  }
global $DIC
Definition: saml.php:7
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ MDUpdateListener()

ilObjContentObject::MDUpdateListener (   $a_element)

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

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

Referenced by importFromDirectory().

3573  {
3574  parent::MDUpdateListener($a_element);
3575 
3576  include_once 'Services/MetaData/classes/class.ilMD.php';
3577 
3578  switch ($a_element) {
3579  case 'Educational':
3580  include_once("./Services/Object/classes/class.ilObjectLP.php");
3581  $obj_lp = ilObjectLP::getInstance($this->getId());
3582  if (in_array(
3583  $obj_lp->getCurrentMode(),
3585  )) {
3586  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
3588  }
3589  break;
3590 
3591  case 'General':
3592 
3593  // Update Title and description
3594  $md = new ilMD($this->getId(), 0, $this->getType());
3595  if (!is_object($md_gen = $md->getGeneral())) {
3596  return false;
3597  }
3598 
3599  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
3600  $ot = ilObjectTranslation::getInstance($this->getId());
3601  if ($ot->getContentActivated()) {
3602  $ot->setDefaultTitle($md_gen->getTitle());
3603 
3604  foreach ($md_gen->getDescriptionIds() as $id) {
3605  $md_des = $md_gen->getDescription($id);
3606  $ot->setDefaultDescription($md_des->getDescription());
3607  break;
3608  }
3609  $ot->save();
3610  }
3611  break;
3612 
3613  }
3614  return true;
3615  }
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
getId()
get object id public
getType()
get object type public
Create styles array
The data for the language used.
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 1110 of file class.ilObjContentObject.php.

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

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

◆ putInTree()

ilObjContentObject::putInTree (   $a_parent)

put content object in main tree

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

References ilObject\$tree.

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

◆ read()

ilObjContentObject::read ( )

read data of content object

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

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

109  {
110  $ilDB = $this->db;
111 
112  parent::read();
113  # echo "Content<br>\n";
114 
115  $this->lm_tree = new ilTree($this->getId());
116  $this->lm_tree->setTableNames('lm_tree', 'lm_data');
117  $this->lm_tree->setTreeTablePK("lm_id");
118 
119  $this->readProperties();
120 
121  // read auto glossaries
122  $set = $ilDB->query(
123  "SELECT * FROM lm_glossaries " .
124  " WHERE lm_id = " . $ilDB->quote($this->getId(), "integer")
125  );
126  $glos = array();
127  while ($rec = $ilDB->fetchAssoc($set)) {
128  $glos[] = $rec["glo_id"];
129  }
130  $this->setAutoGlossaries($glos);
131 
132  //parent::read();
133  }
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...
Create styles array
The data for the language used.
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 1163 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(), setOnline(), setPageHeader(), setProgressIcons(), setPublicAccessMode(), setPublicExportFile(), setPublicNotes(), setRating(), setRatingPages(), setRestrictForwardNavigation(), setStoreTries(), setStyleSheetId(), setTOCMode(), and ilUtil\yn2tf().

Referenced by createProperties(), and read().

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

References array, getAutoGlossaries(), and setAutoGlossaries().

401  {
402  $glo_ids = array();
403  foreach ($this->getAutoGlossaries() as $g) {
404  if ($g != $a_glo_id) {
405  $glo_ids[] = $g;
406  }
407  }
408  $this->setAutoGlossaries($glo_ids);
409  }
getAutoGlossaries()
Get auto glossaries.
Create styles array
The data for the language used.
setAutoGlossaries($a_val)
Set auto glossaries.
+ Here is the call graph for this function:

◆ setActiveDownloads()

ilObjContentObject::setActiveDownloads (   $a_down)

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

Referenced by readProperties().

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

◆ setActiveDownloadsPublic()

ilObjContentObject::setActiveDownloadsPublic (   $a_down)

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

Referenced by readProperties().

1096  {
1097  $this->downloads_public_active = $a_down;
1098  }
+ Here is the caller graph for this function:

◆ setActiveLMMenu()

ilObjContentObject::setActiveLMMenu (   $a_act_lm_menu)

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

Referenced by readProperties().

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

◆ setActiveNumbering()

ilObjContentObject::setActiveNumbering (   $a_num)

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

Referenced by readProperties().

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

◆ setActivePreventGlossaryAppendix()

ilObjContentObject::setActivePreventGlossaryAppendix (   $a_print)

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

Referenced by readProperties().

1056  {
1057  $this->prevent_glossary_appendix_active = $a_print;
1058  }
+ Here is the caller graph for this function:

◆ setActivePrintView()

ilObjContentObject::setActivePrintView (   $a_print)

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

Referenced by readProperties().

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

◆ setActiveTOC()

ilObjContentObject::setActiveTOC (   $a_toc)

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

Referenced by readProperties().

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

◆ setAutoGlossaries()

ilObjContentObject::setAutoGlossaries (   $a_val)

Set auto glossaries.

Parameters
array$a_valint

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

References ilObject\_lookupType(), and array.

Referenced by read(), and removeAutoGlossary().

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

Referenced by readProperties(), and updateProperties().

1116  {
1117  $this->clean_frames = $a_clean;
1118  }
+ Here is the caller graph for this function:

◆ setDescription()

ilObjContentObject::setDescription (   $a_description)

set description of content object

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

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

◆ setDisableDefaultFeedback()

ilObjContentObject::setDisableDefaultFeedback (   $a_val)

Set disable default feedback for questions.

Parameters
bool$a_valdisable default feedback

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

Referenced by readProperties().

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

◆ setFooterPage()

ilObjContentObject::setFooterPage (   $a_pg)

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

Referenced by readProperties().

1151  {
1152  $this->footer_page = $a_pg;
1153  }
+ 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 447 of file class.ilObjContentObject.php.

Referenced by readProperties().

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

◆ setHeaderPage()

ilObjContentObject::setHeaderPage (   $a_pg)

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

Referenced by readProperties().

1141  {
1142  $this->header_page = $a_pg;
1143  }
+ 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 1070 of file class.ilObjContentObject.php.

Referenced by readProperties().

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

◆ setHistoryUserComments()

ilObjContentObject::setHistoryUserComments (   $a_comm)

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

Referenced by readProperties().

1126  {
1127  $this->user_comments = $a_comm;
1128  }
+ 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 534 of file class.ilObjContentObject.php.

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

◆ setImportId()

ilObjContentObject::setImportId (   $a_id)

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

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

◆ setLayout()

ilObjContentObject::setLayout (   $a_layout)

set default page layout

Parameters
string$a_layoutdefault page layout

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

Referenced by readProperties().

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

◆ setLayoutPerPage()

ilObjContentObject::setLayoutPerPage (   $a_val)

Set layout per page.

Parameters
booleanlayout per page

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

Referenced by readProperties().

190  {
191  $this->layout_per_page = $a_val;
192  }
+ Here is the caller graph for this function:

◆ setOnline()

ilObjContentObject::setOnline (   $a_online)

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

Referenced by readProperties().

1006  {
1007  $this->online = $a_online;
1008  }
+ 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 974 of file class.ilObjContentObject.php.

Referenced by readProperties().

975  {
976  $this->pg_header = $a_pg_header;
977  }
+ 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 229 of file class.ilObjContentObject.php.

Referenced by readProperties().

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

◆ setPublicAccessMode()

ilObjContentObject::setPublicAccessMode (   $a_mode)

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

Referenced by readProperties().

1131  {
1132  $this->public_access_mode = $a_mode;
1133  }
+ 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 2031 of file class.ilObjContentObject.php.

References $a_type.

Referenced by readProperties().

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

◆ setPublicNotes()

ilObjContentObject::setPublicNotes (   $a_pub_notes)

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

Referenced by readProperties().

1106  {
1107  $this->pub_notes = $a_pub_notes;
1108  }
+ Here is the caller graph for this function:

◆ setRating()

ilObjContentObject::setRating (   $a_value)

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

Referenced by readProperties().

3552  {
3553  $this->rating = (bool) $a_value;
3554  }
+ Here is the caller graph for this function:

◆ setRatingPages()

ilObjContentObject::setRatingPages (   $a_value)

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

Referenced by readProperties().

3562  {
3563  $this->rating_pages = (bool) $a_value;
3564  }
+ 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 269 of file class.ilObjContentObject.php.

Referenced by readProperties().

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

◆ setStoreTries()

ilObjContentObject::setStoreTries (   $a_val)

Set store tries.

Parameters
bool$a_valstore tries

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

Referenced by readProperties().

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

◆ setStyleSheetId()

ilObjContentObject::setStyleSheetId (   $a_style_id)

set ID of assigned style sheet object

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

Referenced by readProperties().

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

◆ setTitle()

ilObjContentObject::setTitle (   $a_title)

set title of content object

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

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

◆ setTOCMode()

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

set toc mode

Parameters
string$a_toc_mode"chapters" | "pages"

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

Referenced by readProperties().

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

◆ update()

ilObjContentObject::update ( )

update complete object (meta data and properties)

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

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

294  {
295  $this->updateMetaData();
296  parent::update();
297  $this->updateProperties();
298  $this->updateAutoGlossaries();
299  }
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 307 of file class.ilObjContentObject.php.

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

Referenced by create(), and update().

308  {
309  $ilDB = $this->db;
310 
311  // update auto glossaries
312  $ilDB->manipulate(
313  "DELETE FROM lm_glossaries WHERE " .
314  " lm_id = " . $ilDB->quote($this->getId(), "integer")
315  );
316  foreach ($this->getAutoGlossaries() as $glo_id) {
317  $ilDB->manipulate("INSERT INTO lm_glossaries " .
318  "(lm_id, glo_id) VALUES (" .
319  $ilDB->quote($this->getId(), "integer") . "," .
320  $ilDB->quote($glo_id, "integer") .
321  ")");
322  }
323  }
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 1210 of file class.ilObjContentObject.php.

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

Referenced by update().

1211  {
1212  $ilDB = $this->db;
1213 
1214  // force clean_frames to be set, if layout per page is activated
1215  if ($this->getLayoutPerPage()) {
1216  $this->setCleanFrames(true);
1217  }
1218 
1219  $q = "UPDATE content_object SET " .
1220  " default_layout = " . $ilDB->quote($this->getLayout(), "text") . ", " .
1221  " stylesheet = " . $ilDB->quote($this->getStyleSheetId(), "integer") . "," .
1222  " page_header = " . $ilDB->quote($this->getPageHeader(), "text") . "," .
1223  " toc_mode = " . $ilDB->quote($this->getTOCMode(), "text") . "," .
1224  " is_online = " . $ilDB->quote(ilUtil::tf2yn($this->getOnline()), "text") . "," .
1225  " toc_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveTOC()), "text") . "," .
1226  " numbering = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveNumbering()), "text") . "," .
1227  " print_view_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActivePrintView()), "text") . "," .
1228  " no_glo_appendix = " . $ilDB->quote(ilUtil::tf2yn($this->isActivePreventGlossaryAppendix()), "text") . "," .
1229  " hide_head_foot_print = " . $ilDB->quote($this->getHideHeaderFooterPrint(), "integer") . "," .
1230  " downloads_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveDownloads()), "text") . "," .
1231  " downloads_public_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveDownloadsPublic()), "text") . "," .
1232  " clean_frames = " . $ilDB->quote(ilUtil::tf2yn($this->cleanFrames()), "text") . "," .
1233  " hist_user_comments = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveHistoryUserComments()), "text") . "," .
1234  " public_access_mode = " . $ilDB->quote($this->getPublicAccessMode(), "text") . "," .
1235  " public_xml_file = " . $ilDB->quote($this->getPublicExportFile("xml"), "text") . "," .
1236  " public_html_file = " . $ilDB->quote($this->getPublicExportFile("html"), "text") . "," .
1237  " public_scorm_file = " . $ilDB->quote($this->getPublicExportFile("scorm"), "text") . "," .
1238  " header_page = " . $ilDB->quote($this->getHeaderPage(), "integer") . "," .
1239  " footer_page = " . $ilDB->quote($this->getFooterPage(), "integer") . "," .
1240  " lm_menu_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveLMMenu()), "text") . ", " .
1241  " layout_per_page = " . $ilDB->quote($this->getLayoutPerPage(), "integer") . ", " .
1242  " rating = " . $ilDB->quote($this->hasRating(), "integer") . ", " .
1243  " rating_pages = " . $ilDB->quote($this->hasRatingPages(), "integer") . ", " .
1244  " disable_def_feedback = " . $ilDB->quote($this->getDisableDefaultFeedback(), "integer") . ", " .
1245  " progr_icons = " . $ilDB->quote($this->getProgressIcons(), "integer") . ", " .
1246  " store_tries = " . $ilDB->quote($this->getStoreTries(), "integer") . ", " .
1247  " restrict_forw_nav = " . $ilDB->quote($this->getRestrictForwardNavigation(), "integer") . ", " .
1248  " for_translation = " . $ilDB->quote((int) $this->getForTranslation(), "integer") . " " .
1249  " WHERE id = " . $ilDB->quote($this->getId(), "integer");
1250  $ilDB->manipulate($q);
1251  // #14661
1252  include_once("./Services/Notes/classes/class.ilNote.php");
1253  ilNote::activateComments($this->getId(), 0, $this->getType(), $this->publicNotes());
1254  }
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 3118 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().

3119  {
3120  include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
3121  include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
3122 
3123  $mess = "";
3124 
3125  $pages = ilLMPageObject::getPageList($this->getId());
3126  foreach ($pages as $page) {
3127  if (ilLMPage::_exists($this->getType(), $page["obj_id"])) {
3128  $cpage = new ilLMPage($page["obj_id"]);
3129  $cpage->buildDom();
3130  $error = @$cpage->validateDom();
3131 
3132  if ($error != "") {
3133  $this->lng->loadLanguageModule("content");
3134  ilUtil::sendInfo($this->lng->txt("cont_import_validation_errors"));
3135  $title = ilLMObject::_lookupTitle($page["obj_id"]);
3136  $page_obj = new ilLMPageObject($this, $page["obj_id"]);
3137  $mess.= $this->lng->txt("obj_pg") . ": " . $title;
3138  $mess.= '<div class="small">';
3139  foreach ($error as $e) {
3140  $err_mess = implode($e, " - ");
3141  if (!is_int(strpos($err_mess, ":0:"))) {
3142  $mess.= htmlentities($err_mess) . "<br />";
3143  }
3144  }
3145  $mess.= '</div>';
3146  $mess.= "<br />";
3147  }
3148  }
3149  }
3150 
3151  return $mess;
3152  }
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 734 of file class.ilObjContentObject.php.

References $DIC, and $ilDB.

Referenced by ilLearningModuleImporter\finalProcessing().

735  {
736  global $DIC;
737 
738  $ilDB = $DIC->database();
739 
740  $ilDB->manipulate(
741  "UPDATE content_object SET " .
742  " footer_page = " . $ilDB->quote($a_page_id, "integer") .
743  " WHERE id = " . $ilDB->quote($a_lm_id, "integer")
744  );
745  }
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 715 of file class.ilObjContentObject.php.

References $DIC, and $ilDB.

Referenced by ilLearningModuleImporter\finalProcessing().

716  {
717  global $DIC;
718 
719  $ilDB = $DIC->database();
720 
721  $ilDB->manipulate(
722  "UPDATE content_object SET " .
723  " header_page = " . $ilDB->quote($a_page_id, "integer") .
724  " WHERE id = " . $ilDB->quote($a_lm_id, "integer")
725  );
726  }
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 697 of file class.ilObjContentObject.php.

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

Referenced by importFromDirectory().

698  {
699  $ilDB = $this->db;
700 
701  $q = "UPDATE content_object SET " .
702  " stylesheet = " . $ilDB->quote((int) $a_style_id, "integer") .
703  " WHERE id = " . $ilDB->quote($this->getId(), "integer");
704  $ilDB->manipulate($q);
705 
706  $this->style_id = $a_style_id;
707  }
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.

Referenced by getOnline().

◆ $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: