ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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...
 
 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_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...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 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
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 

Static Protected Member Functions

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

Protected Attributes

 $rating
 
 $rating_pages
 
 $log
 

Private Attributes

 $import_dir = ''
 

Detailed Description

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

References array, and ilLoggerFactory\getLogger().

46  {
47  // this also calls read() method! (if $a_id is set)
48  parent::__construct($a_id,$a_call_by_reference);
49 
50  $this->log = ilLoggerFactory::getLogger('lm');
51 
52  $this->mob_ids = array();
53  $this->file_ids = array();
54  $this->q_ids = array();
55  }
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 1310 of file class.ilObjContentObject.php.

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

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

1311  {
1312  global $ilUser,$ilErr;
1313 
1314  $lm_tree = new ilTree($cont_obj_id);
1315  $lm_tree->setTableNames('lm_tree','lm_data');
1316  $lm_tree->setTreeTablePK("lm_id");
1317 
1318  if ($lm_tree->isInTree($page_id))
1319  {
1320  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1321  foreach ($path as $node)
1322  {
1323  if ($node["type"] == "st")
1324  {
1325  if (!ilConditionHandler::_checkAllConditionsOfTarget($cont_ref_id,$node["child"], "st"))
1326  {
1327  return false;
1328  }
1329  }
1330  }
1331  }
1332 
1333  return true;
1334  }
global $ilErr
Definition: raiseError.php:16
$path
Definition: aliased.php:25
$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 923 of file class.ilObjContentObject.php.

References $ilDB.

Referenced by ilObjStyleSheet\delete().

924  {
925  global $ilDB;
926 
927  $q = "UPDATE content_object SET ".
928  " stylesheet = ".$ilDB->quote(0, "integer").
929  " WHERE stylesheet = ".$ilDB->quote((int) $a_style_id, "integer");
930 
931  $ilDB->manipulate($q);
932  }
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 1339 of file class.ilObjContentObject.php.

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

Referenced by ilLMPresentationGUI\showPreconditionsOfPage().

1340  {
1341  $lm_tree = new ilTree($cont_obj_id);
1342  $lm_tree->setTableNames('lm_tree','lm_data');
1343  $lm_tree->setTreeTablePK("lm_id");
1344 
1345  $conds = array();
1346  if ($lm_tree->isInTree($page_id))
1347  {
1348  // get full path of page
1349  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1350  foreach ($path as $node)
1351  {
1352  if ($node["type"] == "st")
1353  {
1354  // get all preconditions of upper chapters
1355  $tconds = ilConditionHandler::_getConditionsOfTarget($cont_ref_id,$node["child"], "st");
1356  foreach ($tconds as $tcond)
1357  {
1358  // store all missing preconditions
1359  if (!ilConditionHandler::_checkCondition($tcond["id"]))
1360  {
1361  $conds[] = $tcond;
1362  }
1363  }
1364  }
1365  }
1366  }
1367 
1368  return $conds;
1369  }
static _checkCondition($a_id, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
$path
Definition: aliased.php:25
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 1374 of file class.ilObjContentObject.php.

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

Referenced by ilLMPresentationGUI\showPreconditionsOfPage().

1375  {
1376  $lm_tree = new ilTree($cont_obj_id);
1377  $lm_tree->setTableNames('lm_tree','lm_data');
1378  $lm_tree->setTreeTablePK("lm_id");
1379 
1380  $conds = array();
1381  if ($lm_tree->isInTree($page_id))
1382  {
1383  // get full path of page
1384  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1385  foreach ($path as $node)
1386  {
1387  if ($node["type"] == "st")
1388  {
1389  // get all preconditions of upper chapters
1390  $tconds = ilConditionHandler::_getConditionsOfTarget($cont_obj_ref_id,$node["child"], "st");
1391  foreach ($tconds as $tcond)
1392  {
1393  // look for missing precondition
1394  if (!ilConditionHandler::_checkCondition($tcond["id"]))
1395  {
1396  return $node["child"];
1397  }
1398  }
1399  }
1400  }
1401  }
1402 
1403  return "";
1404  }
static _checkCondition($a_id, $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
$path
Definition: aliased.php:25
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 889 of file class.ilObjContentObject.php.

References $ilDB.

Referenced by ilContentStyleSettingsGUI\edit().

890  {
891  global $ilDB;
892 
893  // joining with style table (not perfectly nice)
894  $q = "SELECT count(*) as cnt FROM content_object, style_data ".
895  " WHERE stylesheet = style_data.id ".
896  " AND standard = ".$ilDB->quote(0, "integer");
897  $cset = $ilDB->query($q);
898  $crow = $ilDB->fetchAssoc($cset);
899 
900  return (int) $crow["cnt"];
901  }
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 906 of file class.ilObjContentObject.php.

References $ilDB.

Referenced by ilContentStyleSettingsGUI\edit().

907  {
908  global $ilDB;
909 
910  $q = "SELECT count(*) as cnt FROM content_object ".
911  " WHERE stylesheet = ".$ilDB->quote(0, "integer");
912  $cset = $ilDB->query($q);
913  $crow = $ilDB->fetchAssoc($cset);
914 
915  return (int) $crow["cnt"];
916  }
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 873 of file class.ilObjContentObject.php.

References $ilDB.

Referenced by ilContentStyleSettingsGUI\edit().

874  {
875  global $ilDB;
876 
877  $q = "SELECT count(*) as cnt FROM content_object ".
878  " WHERE stylesheet = ".$ilDB->quote($a_style_id, "integer");
879  $cset = $ilDB->query($q);
880  $crow = $ilDB->fetchAssoc($cset);
881 
882  return (int) $crow["cnt"];
883  }
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 780 of file class.ilObjContentObject.php.

References $ilDB, $ilLog, and $res.

781  {
782  global $ilDB, $ilLog;
783 
784  $q = "SELECT ".$a_field." FROM content_object ".
785  " WHERE id = ".$ilDB->quote($a_obj_id, "integer");
786 
787  $res = $ilDB->query($q);
788  $rec = $ilDB->fetchAssoc($res);
789 
790  return $rec[$a_field];
791  }
global $ilDB

◆ _lookupContObjIdByStyleId()

static ilObjContentObject::_lookupContObjIdByStyleId (   $a_style_id)
static

lookup style sheet ID

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

References $ilDB, $res, and array.

Referenced by ilObjStyleSheet\_getClonableContentStyles().

823  {
824  global $ilDB;
825 
826  $q = "SELECT id FROM content_object ".
827  " WHERE stylesheet = ".$ilDB->quote($a_style_id, "integer");
828  $res = $ilDB->query($q);
829  $obj_ids = array();
830  while($cont = $ilDB->fetchAssoc($res))
831  {
832  $obj_ids[] = $cont["id"];
833  }
834  return $obj_ids;
835  }
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 840 of file class.ilObjContentObject.php.

References $ilDB, and $res.

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

841  {
842  global $ilDB;
843 
844  $q = "SELECT disable_def_feedback FROM content_object ".
845  " WHERE id = ".$ilDB->quote($a_id, "integer");
846  $res = $ilDB->query($q);
847  $rec = $ilDB->fetchAssoc($res);
848 
849  return $rec["disable_def_feedback"];
850  }
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 1250 of file class.ilObjContentObject.php.

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

1251  {
1252  global $ilDB;
1253 
1254 //echo "class ilObjContentObject::_lookupOnline($a_id) called. Use Access class instead.";
1255 
1256  $q = "SELECT is_online FROM content_object WHERE id = ".$ilDB->quote($a_id, "integer");
1257  $lm_set = $ilDB->query($q);
1258  $lm_rec = $ilDB->fetchAssoc($lm_set);
1259 
1260  return ilUtil::yn2tf($lm_rec["is_online"]);
1261  }
$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 799 of file class.ilObjContentObject.php.

Referenced by ilLMPageGUI\processAnswer().

800  {
801  return self::_lookup($a_obj_id, "restrict_forw_nav");
802  }
+ Here is the caller graph for this function:

◆ _lookupStoreTries()

static ilObjContentObject::_lookupStoreTries (   $a_id)
static

Lookup disable default feedback.

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

References $ilDB, and $res.

Referenced by ilLMPageGUI\__construct().

856  {
857  global $ilDB;
858 
859  $q = "SELECT store_tries FROM content_object ".
860  " WHERE id = ".$ilDB->quote($a_id, "integer");
861  $res = $ilDB->query($q);
862  $rec = $ilDB->fetchAssoc($res);
863 
864  return $rec["store_tries"];
865  }
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 807 of file class.ilObjContentObject.php.

References $ilDB, and $res.

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

808  {
809  global $ilDB;
810 
811  $q = "SELECT stylesheet FROM content_object ".
812  " WHERE id = ".$ilDB->quote($a_cont_obj_id, "integer");
813  $res = $ilDB->query($q);
814  $sheet = $ilDB->fetchAssoc($res);
815 
816  return $sheet["stylesheet"];
817  }
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 740 of file class.ilObjContentObject.php.

References $ilDB, and ilObject\$ilias.

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

741  {
742  global $ilDB, $ilias;
743 
744  if ($a_from_style < 0) // change / delete all individual styles
745  {
746  $q = "SELECT stylesheet FROM content_object, style_data ".
747  " WHERE content_object.stylesheet = style_data.id ".
748  " AND style_data.standard = ".$ilDB->quote(0, "integer").
749  " AND content_object.stylesheet > ".$ilDB->quote(0, "integer");
750  $style_set = $ilDB->query($q);
751  while($style_rec = $ilDB->fetchAssoc($style_set))
752  {
753  // assign learning modules to new style
754  $q = "UPDATE content_object SET ".
755  " stylesheet = ".$ilDB->quote((int) $a_to_style, "integer").
756  " WHERE stylesheet = ".$ilDB->quote($style_rec["stylesheet"], "integer");
757  $ilDB->manipulate($q);
758 
759  // delete style
760  $style_obj = $ilias->obj_factory->getInstanceByObjId($style_rec["stylesheet"]);
761  $style_obj->delete();
762  }
763  }
764  else
765  {
766  $q = "UPDATE content_object SET ".
767  " stylesheet = ".$ilDB->quote((int) $a_to_style, "integer").
768  " WHERE stylesheet = ".$ilDB->quote($a_from_style, "integer");
769  $ilDB->manipulate($q);
770  }
771  }
global $ilDB
+ Here is the caller graph for this function:

◆ addFirstChapterAndPage()

ilObjContentObject::addFirstChapterAndPage ( )

Add first chapter and page.

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

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

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

◆ autoLinkGlossaryTerms()

ilObjContentObject::autoLinkGlossaryTerms (   $a_glo_id)

Auto link glossary terms.

Parameters

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

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

3506  {
3507  // get terms
3508  include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
3509  $terms = ilGlossaryTerm::getTermList($a_glo_id);
3510 
3511  // each get page: get content
3512  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
3513  $pages = ilLMPage::getAllPages($this->getType(), $this->getId());
3514 
3515  // determine terms that occur in the page
3516  $found_pages = array();
3517  foreach ($pages as $p)
3518  {
3519  $pg = new ilLMPage($p["id"]);
3520  $c = $pg->getXMLContent();
3521  foreach ($terms as $t)
3522  {
3523  if (is_int(stripos($c, $t["term"])))
3524  {
3525  $found_pages[$p["id"]]["terms"][] = $t;
3526  if (!is_object($found_pages[$p["id"]]["page"]))
3527  {
3528  $found_pages[$p["id"]]["page"] = $pg;
3529  }
3530  }
3531  }
3532  reset($terms);
3533  }
3534 
3535  // ilPCParagraph autoLinkGlossariesPage with page and terms
3536  include_once("./Services/COPage/classes/class.ilPCParagraph.php");
3537  foreach ($found_pages as $id => $fp)
3538  {
3539  ilPCParagraph::autoLinkGlossariesPage($fp["page"], $fp["terms"]);
3540  }
3541 
3542 
3543  }
static getAllPages($a_parent_type, $a_parent_id, $a_lang="-")
Get all pages for parent object.
static autoLinkGlossariesPage($a_page, $a_terms)
Auto link glossary of whole page.
getId()
get object id public
static getTermList($a_glo_id, $searchterm="", $a_first_letter="", $a_def="", $a_tax_node=0, $a_add_amet_fields=false, array $a_amet_filter=null, $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:

◆ checkTree()

ilObjContentObject::checkTree ( )

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

References ilObject\getId().

Referenced by executeDragDrop().

1427  {
1428  $tree = new ilTree($this->getId());
1429  $tree->setTableNames('lm_tree','lm_data');
1430  $tree->setTreeTablePK("lm_id");
1431  $tree->checkTree();
1432  $tree->checkTreeChilds();
1433 //echo "checked";
1434  }
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 1093 of file class.ilObjContentObject.php.

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

1094  {
1095  return $this->clean_frames;
1096  }
+ 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 3310 of file class.ilObjContentObject.php.

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

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

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

Referenced by cloneObject().

3429  {
3430  $parent_id = $a_target_obj->lm_tree->readRootId();
3431 
3432  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
3433  include_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
3434 
3435  // get all chapters of root lm
3436  $chapters = $this->lm_tree->getChildsByType($this->lm_tree->readRootId(), "st");
3437  $copied_nodes = array();
3438  //$time = time();
3439  foreach ($chapters as $chap)
3440  {
3441  $cid = ilLMObject::pasteTree($a_target_obj, $chap["child"], $parent_id,
3442  IL_LAST_NODE, $time, $copied_nodes, true, $this);
3443  $target = $cid;
3444  }
3445 
3446  // copy free pages
3447  $pages = ilLMPageObject::getPageList($this->getId());
3448  foreach ($pages as $p)
3449  {
3450  if (!$this->lm_tree->isInTree($p["obj_id"]))
3451  {
3452  $item = new ilLMPageObject($this, $p["obj_id"]);
3453  $target_item = $item->copy($a_target_obj);
3454  $copied_nodes[$item->getId()] = $target_item->getId();
3455  }
3456  }
3457 
3458  // Add mapping for pages and chapters
3459  include_once './Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
3461  foreach($copied_nodes as $old_id => $new_id)
3462  {
3463  $options->appendMapping(
3464  $this->getRefId().'_'.$old_id,
3465  $a_target_obj->getRefId().'_'.$new_id
3466  );
3467  }
3468 
3469  ilLMObject::updateInternalLinks($copied_nodes);
3470 
3471  $a_target_obj->checkTree();
3472 
3473  return $copied_nodes;
3474  }
static updateInternalLinks($a_copied_nodes, $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
static pasteTree($a_target_lm, $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_source_lm=null)
Paste item (tree) from clipboard to current lm.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
Class ilLMPageObject.
if(!is_array($argv)) $options
getId()
get object id public
Create styles array
The data for the language used.
const IL_LAST_NODE
Definition: class.ilTree.php:4
getRefId()
get reference id public
static getPageList($lm_id)
static
+ 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 60 of file class.ilObjContentObject.php.

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

61  {
62  global $ilUser;
63 
64  parent::create();
65 
66  // meta data will be created by
67  // import parser
68  if (!$a_no_meta_data)
69  {
70  $this->createMetaData();
71  }
72 
73  $this->createProperties();
74  $this->updateAutoGlossaries();
75  }
createMetaData()
create meta data entry
updateAutoGlossaries()
Update auto glossaries.
$ilUser
Definition: imgupload.php:18
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 529 of file class.ilObjContentObject.php.

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

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

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

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

Referenced by importFromZipFile().

456  {
457  $lm_data_dir = ilUtil::getDataDir()."/lm_data";
458  if(!is_writable($lm_data_dir))
459  {
460  $this->ilias->raiseError("Content object Data Directory (".$lm_data_dir
461  .") not writeable.",$this->ilias->error_obj->FATAL);
462  }
463 
464  // create learning module directory (data_dir/lm_data/lm_<id>)
465  $lm_dir = $lm_data_dir."/lm_".$this->getId();
466  ilUtil::makeDir($lm_dir);
467  if(!@is_dir($lm_dir))
468  {
469  $this->ilias->raiseError("Creation of Learning Module Directory failed.",$this->ilias->error_obj->FATAL);
470  }
471 
472  // create import subdirectory (data_dir/lm_data/lm_<id>/import)
473  $import_dir = $lm_dir."/import";
475  if(!@is_dir($import_dir))
476  {
477  $this->ilias->raiseError("Creation of Import Directory failed.",$this->ilias->error_obj->FATAL);
478  }
479  }
getId()
get object id public
redirection script todo: (a better solution should control the processing via a xml file) ...
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createLMTree()

ilObjContentObject::createLMTree ( )

create content object tree (that stores structure object hierarchie)

todo: rename LM to ConOb

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

References ilObject\getId().

332  {
333  $this->lm_tree = new ilTree($this->getId());
334  $this->lm_tree->setTreeTablePK("lm_id");
335  $this->lm_tree->setTableNames('lm_tree','lm_data');
336  $this->lm_tree->addTree($this->getId(), 1);
337  }
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 1233 of file class.ilObjContentObject.php.

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

Referenced by create().

1234  {
1235  global $ilDB;
1236 
1237  $q = "INSERT INTO content_object (id) VALUES (".$ilDB->quote($this->getId(), "integer").")";
1238  $ilDB->manipulate($q);
1239 
1240  // #14661
1241  include_once("./Services/Notes/classes/class.ilNote.php");
1242  ilNote::activateComments($this->getId(), 0, $this->getType(), true);
1243 
1244  $this->readProperties(); // to get db default values
1245  }
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 607 of file class.ilObjContentObject.php.

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

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

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

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

References date.

Referenced by exportXML().

1768  {
1769  include_once("./Modules/File/classes/class.ilObjFile.php");
1770 
1771  foreach ($this->file_ids as $file_id)
1772  {
1773  $expLog->write(date("[y-m-d H:i:s] ")."File Item ".$file_id);
1774  $file_obj = new ilObjFile($file_id, false);
1775  $file_obj->export($a_target_dir);
1776  unset($file_obj);
1777  }
1778  }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Class ilObjFile.
+ Here is the caller graph for this function:

◆ exportFO()

ilObjContentObject::exportFO ( $a_xml_writer,
  $a_target_dir 
)

export object to fo

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

References $ilBench, array, and exportFOStructureObjects().

2821  {
2822  global $ilBench;
2823 
2824  // fo:root (start)
2825  $attrs = array();
2826  $attrs["xmlns:fo"] = "http://www.w3.org/1999/XSL/Format";
2827  $a_xml_writer->xmlStartTag("fo:root", $attrs);
2828 
2829  // fo:layout-master-set (start)
2830  $attrs = array();
2831  $a_xml_writer->xmlStartTag("fo:layout-master-set", $attrs);
2832 
2833  // fo:simple-page-master (start)
2834  $attrs = array();
2835  $attrs["master-name"] = "DinA4";
2836  $attrs["page-height"] = "29.7cm";
2837  $attrs["page-width"] = "21cm";
2838  $attrs["margin-top"] = "4cm";
2839  $attrs["margin-bottom"] = "1cm";
2840  $attrs["margin-left"] = "2.8cm";
2841  $attrs["margin-right"] = "7.3cm";
2842  $a_xml_writer->xmlStartTag("fo:simple-page-master", $attrs);
2843 
2844  // fo:region-body (complete)
2845  $attrs = array();
2846  $attrs["margin-top"] = "0cm";
2847  $attrs["margin-bottom"] = "1.25cm";
2848  $a_xml_writer->xmlElement("fo:region-body", $attrs);
2849 
2850  // fo:region-before (complete)
2851  $attrs = array();
2852  $attrs["extent"] = "1cm";
2853  $a_xml_writer->xmlElement("fo:region-before", $attrs);
2854 
2855  // fo:region-after (complete)
2856  $attrs = array();
2857  $attrs["extent"] = "1cm";
2858  $a_xml_writer->xmlElement("fo:region-after", $attrs);
2859 
2860  // fo:simple-page-master (end)
2861  $a_xml_writer->xmlEndTag("fo:simple-page-master");
2862 
2863  // fo:layout-master-set (end)
2864  $a_xml_writer->xmlEndTag("fo:layout-master-set");
2865 
2866  // fo:page-sequence (start)
2867  $attrs = array();
2868  $attrs["master-reference"] = "DinA4";
2869  $a_xml_writer->xmlStartTag("fo:page-sequence", $attrs);
2870 
2871  // fo:flow (start)
2872  $attrs = array();
2873  $attrs["flow-name"] = "xsl-region-body";
2874  $a_xml_writer->xmlStartTag("fo:flow", $attrs);
2875 
2876 
2877  // StructureObjects
2878  //$expLog->write(date("[y-m-d H:i:s] ")."Start Export Structure Objects");
2879  $ilBench->start("ContentObjectExport", "exportFOStructureObjects");
2880  $this->exportFOStructureObjects($a_xml_writer, $expLog);
2881  $ilBench->stop("ContentObjectExport", "exportFOStructureObjects");
2882  //$expLog->write(date("[y-m-d H:i:s] ")."Finished Export Structure Objects");*/
2883 
2884  // fo:flow (end)
2885  $a_xml_writer->xmlEndTag("fo:flow");
2886 
2887  // fo:page-sequence (end)
2888  $a_xml_writer->xmlEndTag("fo:page-sequence");
2889 
2890  // fo:root (end)
2891  $a_xml_writer->xmlEndTag("fo:root");
2892  }
exportFOStructureObjects(&$a_xml_writer)
export structure objects to fo
Create styles array
The data for the language used.
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ exportFOStructureObjects()

ilObjContentObject::exportFOStructureObjects ( $a_xml_writer)

export structure objects to fo

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

Referenced by exportFO().

2901  {
2902  $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
2903  foreach ($childs as $child)
2904  {
2905  if($child["type"] != "st")
2906  {
2907  continue;
2908  }
2909 
2910  $structure_obj = new ilStructureObject($this, $child["obj_id"]);
2911  $structure_obj->exportFO($a_xml_writer, $expLog);
2912  unset($structure_obj);
2913  }
2914  }
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 2050 of file class.ilObjContentObject.php.

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

2051  {
2052  global $tpl, $ilBench, $ilLocator, $ilUser, $ilObjDataCache, $ilias;
2053 
2054  $user_lang = $ilUser->getLanguage();
2055 
2056  // initialize temporary target directory
2057  ilUtil::delDir($a_target_dir);
2058  ilUtil::makeDir($a_target_dir);
2059  $mob_dir = $a_target_dir."/mobs";
2060  ilUtil::makeDir($mob_dir);
2061  $file_dir = $a_target_dir."/files";
2062  ilUtil::makeDir($file_dir);
2063  $teximg_dir = $a_target_dir."/teximg";
2064  ilUtil::makeDir($teximg_dir);
2065  $style_dir = $a_target_dir."/style";
2066  ilUtil::makeDir($style_dir);
2067  $style_img_dir = $a_target_dir."/style/images";
2068  ilUtil::makeDir($style_img_dir);
2069  $content_style_dir = $a_target_dir."/content_style";
2070  ilUtil::makeDir($content_style_dir);
2071  $content_style_img_dir = $a_target_dir."/content_style/images";
2072  ilUtil::makeDir($content_style_img_dir);
2073  $GLOBALS["teximgcnt"] = 0;
2074 
2075  // init the mathjax rendering for HTML export
2076  include_once './Services/MathJax/classes/class.ilMathJax.php';
2078 
2079  // export system style sheet
2080  $location_stylesheet = ilUtil::getStyleSheetLocation("filesystem");
2081  $style_name = $ilUser->prefs["style"].".css";
2082  copy($location_stylesheet, $style_dir."/".$style_name);
2083  $fh = fopen($location_stylesheet, "r");
2084  $css = fread($fh, filesize($location_stylesheet));
2085  preg_match_all("/url\(([^\)]*)\)/",$css,$files);
2086  foreach (array_unique($files[1]) as $fileref)
2087  {
2088  $css_fileref = str_replace(array("'", '"'), "", $fileref);
2089  $fileref = dirname($location_stylesheet)."/".$css_fileref;
2090  if (is_file($fileref))
2091  {
2092 //echo "<br>make dir: ".dirname($style_dir."/".$css_fileref);
2093  ilUtil::makeDirParents(dirname($style_dir."/".$css_fileref));
2094 //echo "<br>copy: ".$fileref." TO ".$style_dir."/".$css_fileref;
2095  copy($fileref, $style_dir."/".$css_fileref);
2096  }
2097  }
2098  fclose($fh);
2099  $location_stylesheet = ilUtil::getStyleSheetLocation();
2100 
2101  // export content style sheet
2102  $ilBench->start("ExportHTML", "exportContentStyle");
2103  if ($this->getStyleSheetId() < 1)
2104  {
2105  $cont_stylesheet = "./Services/COPage/css/content.css";
2106 
2107  $css = fread(fopen($cont_stylesheet,'r'),filesize($cont_stylesheet));
2108  preg_match_all("/url\(([^\)]*)\)/",$css,$files);
2109  foreach (array_unique($files[1]) as $fileref)
2110  {
2111  if (is_file(str_replace("..", ".", $fileref)))
2112  {
2113  copy(str_replace("..", ".", $fileref), $content_style_img_dir."/".basename($fileref));
2114  }
2115  $css = str_replace($fileref, "images/".basename($fileref),$css);
2116  }
2117  fwrite(fopen($content_style_dir."/content.css",'w'),$css);
2118  }
2119  else
2120  {
2121  $style = new ilObjStyleSheet($this->getStyleSheetId());
2122  $style->writeCSSFile($content_style_dir."/content.css", "images");
2123  $style->copyImagesToDir($content_style_img_dir);
2124  }
2125  $ilBench->stop("ExportHTML", "exportContentStyle");
2126 
2127  // export syntax highlighting style
2128  $syn_stylesheet = ilObjStyleSheet::getSyntaxStylePath();
2129  copy($syn_stylesheet, $a_target_dir."/syntaxhighlight.css");
2130 
2131  // get learning module presentation gui class
2132  include_once("./Modules/LearningModule/classes/class.ilLMPresentationGUI.php");
2133  $_GET["cmd"] = "nop";
2134  $get_transl = $_GET["transl"];
2135  $_GET["transl"] = "";
2136  $lm_gui = new ilLMPresentationGUI();
2137  $lm_gui->setOfflineMode(true, ($a_lang == "all"));
2138  $lm_gui->setOfflineDirectory($a_target_dir);
2139  $lm_gui->setExportFormat($a_export_format);
2140 
2141  $ot = ilObjectTranslation::getInstance($this->getId());
2142  $langs = array();
2143  if ($a_lang != "all")
2144  {
2145  $langs = array($a_lang);
2146  }
2147  else
2148  {
2149  $ot_langs = $ot->getLanguages();
2150  foreach ($ot_langs as $otl)
2151  {
2152  $langs[] = $otl["lang_code"];
2153  }
2154  }
2155 
2156  // init collector arrays
2157  $this->offline_mobs = array();
2158  $this->offline_int_links = array();
2159  $this->offline_files = array();
2160 
2161  // iterate all languages
2162  foreach ($langs as $lang)
2163  {
2164 
2165  if ($lang != "")
2166  {
2167  $ilUser->setLanguage($lang);
2168  $ilUser->setCurrentLanguage($lang);
2169  }
2170  else
2171  {
2172  $ilUser->setLanguage($user_lang);
2173  $ilUser->setCurrentLanguage($user_lang);
2174  }
2175 
2176  if ($lang != "")
2177  {
2178  if ($lang == $ot->getMasterLanguage())
2179  {
2180  $lm_gui->lang = "";
2181  }
2182  else
2183  {
2184  $lm_gui->lang = $lang;
2185  }
2186  }
2187 
2188  // export pages
2189  $ilBench->start("ExportHTML", "exportHTMLPages");
2190  // now: forward ("all" info to export files and links)
2191  $this->exportHTMLPages($lm_gui, $a_target_dir, $lm_gui->lang, ($a_lang == "all"));
2192  $ilBench->stop("ExportHTML", "exportHTMLPages");
2193 
2194  // export table of contents
2195  $ilLocator->clearItems();
2196  if ($this->isActiveTOC())
2197  {
2198  $tpl = new ilTemplate("tpl.main.html", true, true);
2199 
2200  $GLOBALS["tpl"] = $tpl;
2201 
2202  $lm_gui->tpl = $tpl;
2203  $content = $lm_gui->showTableOfContents();
2204  //var_dump($content); exit;
2205  if ($a_lang == "all")
2206  {
2207  $file = $a_target_dir . "/table_of_contents_".$lang.".html";
2208  }
2209  else
2210  {
2211  $file = $a_target_dir . "/table_of_contents.html";
2212  }
2213 
2214  // open file
2215  if (!($fp = @fopen($file,"w+")))
2216  {
2217  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2218  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2219  }
2220  chmod($file, 0770);
2221  fwrite($fp, $content);
2222  fclose($fp);
2223  }
2224  }
2225 
2226  // export glossary terms
2227  $ilBench->start("ExportHTML", "exportHTMLGlossaryTerms");
2228  $this->exportHTMLGlossaryTerms($lm_gui, $a_target_dir);
2229  $ilBench->stop("ExportHTML", "exportHTMLGlossaryTerms");
2230 
2231  // export all media objects
2232  $ilBench->start("ExportHTML", "exportHTMLMediaObjects");
2233  $linked_mobs = array();
2234  foreach ($this->offline_mobs as $mob)
2235  {
2236  if (ilObject::_exists($mob) && ilObject::_lookupType($mob) == "mob")
2237  {
2238  $this->exportHTMLMOB($a_target_dir, $lm_gui, $mob, "_blank", $linked_mobs);
2239  }
2240  }
2241  $linked_mobs2 = array(); // mobs linked in link areas
2242  foreach ($linked_mobs as $mob)
2243  {
2244  if (ilObject::_exists($mob))
2245  {
2246  $this->exportHTMLMOB($a_target_dir, $lm_gui, $mob, "_blank", $linked_mobs2);
2247  }
2248  }
2249  $_GET["obj_type"] = "MediaObject";
2250  $_GET["obj_id"] = $a_mob_id;
2251  $_GET["cmd"] = "";
2252  $ilBench->stop("ExportHTML", "exportHTMLMediaObjects");
2253 
2254  // export all file objects
2255  $ilBench->start("ExportHTML", "exportHTMLFileObjects");
2256  foreach ($this->offline_files as $file)
2257  {
2258  $this->exportHTMLFile($a_target_dir, $file);
2259  }
2260  $ilBench->stop("ExportHTML", "exportHTMLFileObjects");
2261 
2262  // export questions (images)
2263  if (count($this->q_ids) > 0)
2264  {
2265  foreach ($this->q_ids as $q_id)
2266  {
2267  ilUtil::makeDirParents($a_target_dir."/assessment/0/".$q_id."/images");
2268  ilUtil::rCopy(ilUtil::getWebspaceDir()."/assessment/0/".$q_id."/images",
2269  $a_target_dir."/assessment/0/".$q_id."/images");
2270  }
2271  }
2272 
2273  // export images
2274  $ilBench->start("ExportHTML", "exportHTMLImages");
2275  $image_dir = $a_target_dir."/images";
2276  ilUtil::makeDir($image_dir);
2277  ilUtil::makeDir($image_dir."/browser");
2278  copy(ilUtil::getImagePath("enlarge.svg", false, "filesystem"),
2279  $image_dir."/enlarge.svg");
2280  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
2281  $image_dir."/browser/plus.png");
2282  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
2283  $image_dir."/browser/minus.png");
2284  copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
2285  $image_dir."/browser/blank.png");
2286  copy(ilUtil::getImagePath("spacer.png", false, "filesystem"),
2287  $image_dir."/spacer.png");
2288  copy(ilUtil::getImagePath("icon_st.svg", false, "filesystem"),
2289  $image_dir."/icon_st.svg");
2290  copy(ilUtil::getImagePath("icon_pg.svg", false, "filesystem"),
2291  $image_dir."/icon_pg.svg");
2292  copy(ilUtil::getImagePath("icon_lm.svg", false, "filesystem"),
2293  $image_dir."/icon_lm.svg");
2294  copy(ilUtil::getImagePath("nav_arr_L.png", false, "filesystem"),
2295  $image_dir."/nav_arr_L.png");
2296  copy(ilUtil::getImagePath("nav_arr_R.png", false, "filesystem"),
2297  $image_dir."/nav_arr_R.png");
2298 
2299  $ilBench->stop("ExportHTML", "exportHTMLImages");
2300 
2301  // export flv/mp3 player
2302  $services_dir = $a_target_dir."/Services";
2303  ilUtil::makeDir($services_dir);
2304  $media_service_dir = $services_dir."/MediaObjects";
2305  ilUtil::makeDir($media_service_dir);
2306  include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
2307  $flv_dir = $a_target_dir."/".ilPlayerUtil::getFlashVideoPlayerDirectory();
2308  ilUtil::makeDir($flv_dir);
2309  $mp3_dir = $media_service_dir."/flash_mp3_player";
2310  ilUtil::makeDir($mp3_dir);
2311 // copy(ilPlayerUtil::getFlashVideoPlayerFilename(true),
2312 // $flv_dir."/".ilPlayerUtil::getFlashVideoPlayerFilename());
2314  include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
2317 
2318  // js files
2319  ilUtil::makeDir($a_target_dir.'/js');
2320  ilUtil::makeDir($a_target_dir.'/js/yahoo');
2321  ilUtil::makeDir($a_target_dir.'/css');
2322  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
2323  foreach (self::getSupplyingExportFiles($a_target_dir) as $f)
2324  {
2325  if ($f["source"] != "")
2326  {
2327  copy($f["source"], $f["target"]);
2328  }
2329  }
2330 
2331  // template workaround: reset of template
2332  $tpl = new ilTemplate("tpl.main.html", true, true);
2333  $tpl->setVariable("LOCATION_STYLESHEET",$location_stylesheet);
2334  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2335 
2336  if ($a_lang != "")
2337  {
2338  $ilUser->setLanguage($user_lang);
2339  $ilUser->setCurrentLanguage($user_lang);
2340  }
2341 
2342  // zip everything
2343  if ($a_zip_file)
2344  {
2345  if ($a_lang == "")
2346  {
2347  $zip_target_dir = $this->getExportDirectory("html");
2348  }
2349  else
2350  {
2351  $zip_target_dir = $this->getExportDirectory("html_".$a_lang);
2352  ilUtil::makeDir($zip_target_dir);
2353  }
2354 
2355  // zip it all
2356  $date = time();
2357  $zip_file = $zip_target_dir."/".$date."__".IL_INST_ID."__".
2358  $this->getType()."_".$this->getId().".zip";
2359 //echo "-".$a_target_dir."-".$zip_file."-"; exit;
2360  ilUtil::zip($a_target_dir, $zip_file);
2361  ilUtil::delDir($a_target_dir);
2362  }
2363  }
$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
global $tpl
Definition: ilias.php:8
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.
global $ilBench
Definition: ilias.php:18
Class ilObjStyleSheet.
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349
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 2474 of file class.ilObjContentObject.php.

References ilUtil\makeDir().

Referenced by exportHTML().

2475  {
2476  $file_dir = $a_target_dir."/files/file_".$a_file_id;
2477  ilUtil::makeDir($file_dir);
2478  include_once("./Modules/File/classes/class.ilObjFile.php");
2479  $file_obj = new ilObjFile($a_file_id, false);
2480  $source_file = $file_obj->getDirectory($file_obj->getVersion())."/".$file_obj->getFileName();
2481  if (!is_file($source_file))
2482  {
2483  $source_file = $file_obj->getDirectory()."/".$file_obj->getFileName();
2484  }
2485  if (is_file($source_file))
2486  {
2487  copy($source_file, $file_dir."/".$file_obj->getFileName());
2488  }
2489  }
Class ilObjFile.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportHTMLGlossaryTerms()

ilObjContentObject::exportHTMLGlossaryTerms ( $a_lm_gui,
  $a_target_dir 
)

export glossary terms

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

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

Referenced by exportHTML().

2563  {
2564  global $ilLocator;
2565 
2566  foreach($this->offline_int_links as $int_link)
2567  {
2568  $ilLocator->clearItems();
2569  if ($int_link["type"] == "git")
2570  {
2571  $tpl = new ilTemplate("tpl.main.html", true, true);
2572  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2573 
2574  $_GET["obj_id"] = $int_link["id"];
2575  $_GET["frame"] = "_blank";
2576  $content = $a_lm_gui->glossary();
2577  $file = $a_target_dir."/term_".$int_link["id"].".html";
2578 
2579  // open file
2580  if (!($fp = @fopen($file,"w+")))
2581  {
2582  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2583  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2584  }
2585  chmod($file, 0770);
2586  fwrite($fp, $content);
2587  fclose($fp);
2588 
2589  // store linked/embedded media objects of glosssary term
2590  include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
2591  $defs = ilGlossaryDefinition::getDefinitionList($int_link["id"]);
2592  foreach($defs as $def)
2593  {
2594  $def_mobs = ilObjMediaObject::_getMobsOfObject("gdf:pg", $def["id"]);
2595  foreach($def_mobs as $def_mob)
2596  {
2597  $this->offline_mobs[$def_mob] = $def_mob;
2598  include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
2599  $this->log->debug("HTML Export: Add media object $def_mob (".ilObject::_lookupTitle($def_mob).") ".
2600  " due to glossary entry ".$int_link["id"]." (".ilGlossaryTerm::_lookGlossaryTerm($int_link["id"]).").");
2601  }
2602 
2603  // get all files of page
2604  $def_files = ilObjFile::_getFilesOfObject("gdf:pg", $page["obj_id"]);
2605  $this->offline_files = array_merge($this->offline_files, $def_files);
2606 
2607  }
2608 
2609  }
2610  }
2611  }
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
global $tpl
Definition: ilias.php:8
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
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 2494 of file class.ilObjContentObject.php.

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

Referenced by exportHTML().

2495  {
2496  global $tpl;
2497 
2498  $mob_dir = $a_target_dir."/mobs";
2499 
2500  $source_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob_id;
2501  if (@is_dir($source_dir))
2502  {
2503  ilUtil::makeDir($mob_dir."/mm_".$a_mob_id);
2504  ilUtil::rCopy($source_dir, $mob_dir."/mm_".$a_mob_id);
2505  }
2506 
2507  $tpl = new ilTemplate("tpl.main.html", true, true);
2508  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2509  $_GET["obj_type"] = "MediaObject";
2510  $_GET["mob_id"] = $a_mob_id;
2511  $_GET["frame"] = $a_frame;
2512  $_GET["cmd"] = "";
2513  $content = $a_lm_gui->media();
2514  $file = $a_target_dir."/media_".$a_mob_id.".html";
2515 
2516  // open file
2517  if (!($fp = @fopen($file,"w+")))
2518  {
2519  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2520  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2521  }
2522  chmod($file, 0770);
2523  fwrite($fp, $content);
2524  fclose($fp);
2525 
2526  // fullscreen
2527  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2528  $mob_obj = new ilObjMediaObject($a_mob_id);
2529  if ($mob_obj->hasFullscreenItem())
2530  {
2531  $tpl = new ilTemplate("tpl.main.html", true, true);
2532  $tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
2533  $_GET["obj_type"] = "";
2534  $_GET["frame"] = "";
2535  $_GET["mob_id"] = $a_mob_id;
2536  $_GET["cmd"] = "fullscreen";
2537  $content = $a_lm_gui->fullscreen();
2538  $file = $a_target_dir."/fullscreen_".$a_mob_id.".html";
2539 
2540  // open file
2541  if (!($fp = @fopen($file,"w+")))
2542  {
2543  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2544  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2545  }
2546  chmod($file, 0770);
2547  fwrite($fp, $content);
2548  fclose($fp);
2549  }
2550  $linked_mobs = $mob_obj->getLinkedMediaObjects();
2551  foreach ($linked_mobs as $id)
2552  {
2553  $this->log->debug("HTML Export: Add media object $id (".ilObject::_lookupTitle($id).") ".
2554  " due to media object ".$a_mob_id." (".ilObject::_lookupTitle($a_mob_id).").");
2555  }
2556  $a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
2557  }
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
global $tpl
Definition: ilias.php:8
special template class to simplify handling of ITX/PEAR
Class ilObjMediaObject.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
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 2616 of file class.ilObjContentObject.php.

References $ilBench, $lm_set, $mobs, $tpl, 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().

2617  {
2618  global $tpl, $ilBench, $ilLocator;
2619 
2620  $pages = ilLMPageObject::getPageList($this->getId());
2621 
2622  $lm_tree = $this->getLMTree();
2623  $first_page = $lm_tree->fetchSuccessorNode($lm_tree->getRootId(), "pg");
2624  $this->first_page_id = $first_page["child"];
2625 
2626  // iterate all learning module pages
2627  $mobs = array();
2628  $int_links = array();
2629  $this->offline_files = array();
2630 
2631  include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
2632  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2633 
2634  // get html export id mapping
2635  $lm_set = new ilSetting("lm");
2636  $exp_id_map = array();
2637 
2638  if ($lm_set->get("html_export_ids"))
2639  {
2640  foreach ($pages as $page)
2641  {
2642  $exp_id = ilLMPageObject::getExportId($this->getId(), $page["obj_id"]);
2643  if (trim($exp_id) != "")
2644  {
2645  $exp_id_map[$page["obj_id"]] = trim($exp_id);
2646  }
2647  }
2648  }
2649 //exit;
2650  if ($a_lang == "")
2651  {
2652  $a_lang = "-";
2653  }
2654 
2655  reset($pages);
2656  foreach ($pages as $page)
2657  {
2658  if (ilLMPage::_exists($this->getType(), $page["obj_id"]))
2659  {
2660  $ilLocator->clearItems();
2661  $ilBench->start("ExportHTML", "exportHTMLPage");
2662  $ilBench->start("ExportHTML", "exportPageHTML");
2663  $this->exportPageHTML($a_lm_gui, $a_target_dir, $page["obj_id"],
2664  "", $exp_id_map, $a_lang, $a_all_languages);
2665  $ilBench->stop("ExportHTML", "exportPageHTML");
2666 
2667  // get all snippets of page
2668  $pcs = ilPageContentUsage::getUsagesOfPage($page["obj_id"], $this->getType().":pg", 0, false, $a_lang);
2669  foreach ($pcs as $pc)
2670  {
2671  if ($pc["type"] == "incl")
2672  {
2673  $incl_mobs = ilObjMediaObject::_getMobsOfObject("mep:pg", $pc["id"]);
2674  foreach($incl_mobs as $incl_mob)
2675  {
2676  $mobs[$incl_mob] = $incl_mob;
2677  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
2678  $this->log->debug("HTML Export: Add media object $incl_mob (".ilObject::_lookupTitle($incl_mob).") ".
2679  " due to snippet ".$pc["id"]." in page ".$page["obj_id"]." (".ilLMObject::_lookupTitle($page["obj_id"]).").");
2680  }
2681  }
2682  }
2683 
2684  // get all media objects of page
2685  $pg_mobs = ilObjMediaObject::_getMobsOfObject($this->getType().":pg", $page["obj_id"], 0, $a_lang);
2686  foreach($pg_mobs as $pg_mob)
2687  {
2688  $mobs[$pg_mob] = $pg_mob;
2689  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
2690  $this->log->debug("HTML Export: Add media object $pg_mob (".ilObject::_lookupTitle($pg_mob).") ".
2691  " due to page ".$page["obj_id"]." (".ilLMObject::_lookupTitle($page["obj_id"]).").");
2692  }
2693 
2694  // get all internal links of page
2695  $pg_links = ilInternalLink::_getTargetsOfSource($this->getType().":pg", $page["obj_id"], $a_lang);
2696  $int_links = array_merge($int_links, $pg_links);
2697 
2698  // get all files of page
2699  include_once("./Modules/File/classes/class.ilObjFile.php");
2700  $pg_files = ilObjFile::_getFilesOfObject($this->getType().":pg", $page["obj_id"], 0, $a_lang);
2701  $this->offline_files = array_merge($this->offline_files, $pg_files);
2702 
2703  // collect all questions
2704  include_once("./Services/COPage/classes/class.ilPCQuestion.php");
2705  $q_ids = ilPCQuestion::_getQuestionIdsForPage($this->getType(), $page["obj_id"], $a_lang);
2706  foreach($q_ids as $q_id)
2707  {
2708  $this->q_ids[$q_id] = $q_id;
2709  }
2710 
2711  $ilBench->stop("ExportHTML", "exportHTMLPage");
2712  }
2713  }
2714  foreach ($mobs as $m)
2715  {
2716  $this->offline_mobs[$m] = $m;
2717  }
2718  foreach ($int_links as $k => $v)
2719  {
2720  $this->offline_int_links[$k] = $v;
2721  }
2722  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
ILIAS Setting Class.
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
global $tpl
Definition: ilias.php:8
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
global $ilBench
Definition: ilias.php:18
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 2729 of file class.ilObjContentObject.php.

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

Referenced by exportHTMLPages().

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

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

2005  {
2006  ilUtil::delDir($a_target_dir);
2007  ilUtil::makeDir($a_target_dir);
2008  //ilUtil::makeDir($a_target_dir."/res");
2009 
2010  // export everything to html
2011  $this->exportHTML($a_target_dir."/res", $log, false, "scorm");
2012 
2013  // build manifest file
2014  include("./Modules/LearningModule/classes/class.ilContObjectManifestBuilder.php");
2015  $man_builder = new ilContObjectManifestBuilder($this);
2016  $man_builder->buildManifest();
2017  $man_builder->dump($a_target_dir);
2018 
2019  // copy scorm 1.2 schema definitions
2020  copy("Modules/LearningModule/scorm_xsd/adlcp_rootv1p2.xsd", $a_target_dir."/adlcp_rootv1p2.xsd");
2021  copy("Modules/LearningModule/scorm_xsd/imscp_rootv1p1p2.xsd", $a_target_dir."/imscp_rootv1p1p2.xsd");
2022  copy("Modules/LearningModule/scorm_xsd/imsmd_rootv1p2p1.xsd", $a_target_dir."/imsmd_rootv1p2p1.xsd");
2023  copy("Modules/LearningModule/scorm_xsd/ims_xml.xsd", $a_target_dir."/ims_xml.xsd");
2024 
2025  // zip it all
2026  $date = time();
2027  $zip_file = $a_target_dir."/".$date."__".IL_INST_ID."__".
2028  $this->getType()."_".$this->getId().".zip";
2029  //echo "zip-".$a_target_dir."-to-".$zip_file;
2030  ilUtil::zip(array($a_target_dir."/res",
2031  $a_target_dir."/imsmanifest.xml",
2032  $a_target_dir."/adlcp_rootv1p2.xsd",
2033  $a_target_dir."/imscp_rootv1p1p2.xsd",
2034  $a_target_dir."/ims_xml.xsd",
2035  $a_target_dir."/imsmd_rootv1p2p1.xsd")
2036  , $zip_file);
2037 
2038  $dest_file = $this->getExportDirectory("scorm")."/".$date."__".IL_INST_ID."__".
2039  $this->getType()."_".$this->getId().".zip";
2040 
2041  rename($zip_file, $dest_file);
2042  ilUtil::delDir($a_target_dir);
2043 
2044  }
getExportDirectory($a_type="xml")
get export directory of lm
exportHTML($a_target_dir, $log, $a_zip_file=true, $a_export_format="html", $a_lang="")
export html package
getId()
get object id public
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
getType()
get object type public
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
Content Object (ILIAS native learning module / digilib book) Manifest export class.
+ Here is the call graph for this function:

◆ exportXML()

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

export object to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

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

1566  {
1567  global $ilBench;
1568 
1569  $attrs = array();
1570  switch($this->getType())
1571  {
1572  case "lm":
1573  $attrs["Type"] = "LearningModule";
1574  break;
1575  }
1576  $a_xml_writer->xmlStartTag("ContentObject", $attrs);
1577 
1578  // MetaData
1579  $this->exportXMLMetaData($a_xml_writer);
1580 
1581  // StructureObjects
1582 //echo "ContObj:".$a_inst.":<br>";
1583  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Structure Objects");
1584  $ilBench->start("ContentObjectExport", "exportStructureObjects");
1585  $this->exportXMLStructureObjects($a_xml_writer, $a_inst, $expLog);
1586  $ilBench->stop("ContentObjectExport", "exportStructureObjects");
1587  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Structure Objects");
1588 
1589  // PageObjects
1590  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Page Objects");
1591  $ilBench->start("ContentObjectExport", "exportPageObjects");
1592  $this->exportXMLPageObjects($a_xml_writer, $a_inst, $expLog);
1593  $ilBench->stop("ContentObjectExport", "exportPageObjects");
1594  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Page Objects");
1595 
1596  // MediaObjects
1597  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Media Objects");
1598  $ilBench->start("ContentObjectExport", "exportMediaObjects");
1599  $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
1600  $ilBench->stop("ContentObjectExport", "exportMediaObjects");
1601  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Media Objects");
1602 
1603  // FileItems
1604  $expLog->write(date("[y-m-d H:i:s] ")."Start Export File Items");
1605  $ilBench->start("ContentObjectExport", "exportFileItems");
1606  $this->exportFileItems($a_target_dir, $expLog);
1607  $ilBench->stop("ContentObjectExport", "exportFileItems");
1608  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export File Items");
1609 
1610  // Questions
1611  if (count($this->q_ids) > 0)
1612  {
1613  $qti_file = fopen($a_target_dir."/qti.xml", "w");
1614  include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
1615  $pool = new ilObjQuestionPool();
1616  fwrite($qti_file, $pool->questionsToXML($this->q_ids));
1617  fclose($qti_file);
1618  }
1619 
1620  // To do: implement version selection/detection
1621  // Properties
1622  $expLog->write(date("[y-m-d H:i:s] ")."Start Export Properties");
1623  $this->exportXMLProperties($a_xml_writer, $expLog);
1624  $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Properties");
1625 
1626  $a_xml_writer->xmlEndTag("ContentObject");
1627  }
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.
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ exportXMLMediaObjects()

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

export media objects to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

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

Referenced by exportXML().

1726  {
1727  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1728 
1729  $linked_mobs = array();
1730 
1731  // mobs directly embedded into pages
1732  foreach ($this->mob_ids as $mob_id)
1733  {
1734  if ($mob_id > 0 && ilObject::_lookupType($mob_id) == "mob")
1735  {
1736  $expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
1737  $media_obj = new ilObjMediaObject($mob_id);
1738  $media_obj->exportXML($a_xml_writer, $a_inst);
1739  $media_obj->exportFiles($a_target_dir);
1740 
1741  $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
1742  $linked_mobs = array_merge($linked_mobs, $lmobs);
1743 
1744  unset($media_obj);
1745  }
1746  }
1747 
1748  // linked mobs (in map areas)
1749  foreach ($linked_mobs as $mob_id)
1750  {
1751  if ($mob_id > 0)
1752  {
1753  $expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
1754  $media_obj = new ilObjMediaObject($mob_id);
1755  $media_obj->exportXML($a_xml_writer, $a_inst);
1756  $media_obj->exportFiles($a_target_dir);
1757  unset($media_obj);
1758  }
1759  }
1760 
1761  }
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 1635 of file class.ilObjContentObject.php.

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

Referenced by exportXML().

1636  {
1637  include_once("Services/MetaData/classes/class.ilMD2XML.php");
1638  $md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
1639  $md2xml->setExportMode(true);
1640  $md2xml->startExport();
1641  $a_xml_writer->appendXML($md2xml->getXML());
1642  }
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 1675 of file class.ilObjContentObject.php.

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

Referenced by exportXML().

1676  {
1677  global $ilBench;
1678 
1679  include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
1680  include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
1681 
1682  $pages = ilLMPageObject::getPageList($this->getId());
1683  foreach ($pages as $page)
1684  {
1685  if (ilLMPage::_exists($this->getType(), $page["obj_id"]))
1686  {
1687  $expLog->write(date("[y-m-d H:i:s] ")."Page Object ".$page["obj_id"]);
1688 
1689  // export xml to writer object
1690  $page_obj = new ilLMPageObject($this, $page["obj_id"]);
1691  $page_obj->exportXML($a_xml_writer, "normal", $a_inst);
1692 
1693  // collect media objects
1694  $mob_ids = $page_obj->getMediaObjectIDs();
1695  foreach($mob_ids as $mob_id)
1696  {
1697  $this->mob_ids[$mob_id] = $mob_id;
1698  }
1699 
1700  // collect all file items
1701  $file_ids = $page_obj->getFileItemIds();
1702  foreach($file_ids as $file_id)
1703  {
1704  $this->file_ids[$file_id] = $file_id;
1705  }
1706 
1707  // collect all questions
1708  $q_ids = $page_obj->getQuestionIds();
1709  foreach($q_ids as $q_id)
1710  {
1711  $this->q_ids[$q_id] = $q_id;
1712  }
1713 
1714  unset($page_obj);
1715  }
1716  }
1717  }
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
global $ilBench
Definition: ilias.php:18
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 1784 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().

1785  {
1786  $attrs = array();
1787  $a_xml_writer->xmlStartTag("Properties", $attrs);
1788 
1789  // Layout
1790  $attrs = array("Name" => "Layout", "Value" => $this->getLayout());
1791  $a_xml_writer->xmlElement("Property", $attrs);
1792 
1793  // Page Header
1794  $attrs = array("Name" => "PageHeader", "Value" => $this->getPageHeader());
1795  $a_xml_writer->xmlElement("Property", $attrs);
1796 
1797  // TOC Mode
1798  $attrs = array("Name" => "TOCMode", "Value" => $this->getTOCMode());
1799  $a_xml_writer->xmlElement("Property", $attrs);
1800 
1801  // LM Menu Activation
1802  $attrs = array("Name" => "ActiveLMMenu", "Value" =>
1803  ilUtil::tf2yn($this->isActiveLMMenu()));
1804  $a_xml_writer->xmlElement("Property", $attrs);
1805 
1806  // Numbering Activation
1807  $attrs = array("Name" => "ActiveNumbering", "Value" =>
1808  ilUtil::tf2yn($this->isActiveNumbering()));
1809  $a_xml_writer->xmlElement("Property", $attrs);
1810 
1811  // Table of contents button activation
1812  $attrs = array("Name" => "ActiveTOC", "Value" =>
1813  ilUtil::tf2yn($this->isActiveTOC()));
1814  $a_xml_writer->xmlElement("Property", $attrs);
1815 
1816  // Print view button activation
1817  $attrs = array("Name" => "ActivePrintView", "Value" =>
1818  ilUtil::tf2yn($this->isActivePrintView()));
1819  $a_xml_writer->xmlElement("Property", $attrs);
1820 
1821  // Note that download button is not saved, because
1822  // download files do not exist after import
1823 
1824  // Clean frames
1825  $attrs = array("Name" => "CleanFrames", "Value" =>
1826  ilUtil::tf2yn($this->cleanFrames()));
1827  $a_xml_writer->xmlElement("Property", $attrs);
1828 
1829  // Public notes activation
1830  $attrs = array("Name" => "PublicNotes", "Value" =>
1831  ilUtil::tf2yn($this->publicNotes()));
1832  $a_xml_writer->xmlElement("Property", $attrs);
1833 
1834  // History comments for authors activation
1835  $attrs = array("Name" => "HistoryUserComments", "Value" =>
1837  $a_xml_writer->xmlElement("Property", $attrs);
1838 
1839  // Rating
1840  $attrs = array("Name" => "Rating", "Value" =>
1841  ilUtil::tf2yn($this->hasRating()));
1842  $a_xml_writer->xmlElement("Property", $attrs);
1843  $attrs = array("Name" => "RatingPages", "Value" =>
1844  ilUtil::tf2yn($this->hasRatingPages()));
1845  $a_xml_writer->xmlElement("Property", $attrs);
1846 
1847  // Header Page
1848  if ($this->getHeaderPage() > 0)
1849  {
1850  $attrs = array("Name" => "HeaderPage", "Value" =>
1851  "il_".IL_INST_ID."_pg_".$this->getHeaderPage());
1852  $a_xml_writer->xmlElement("Property", $attrs);
1853  }
1854 
1855  // Footer Page
1856  if ($this->getFooterPage() > 0)
1857  {
1858  $attrs = array("Name" => "FooterPage", "Value" =>
1859  "il_".IL_INST_ID."_pg_".$this->getFooterPage());
1860  $a_xml_writer->xmlElement("Property", $attrs);
1861  }
1862 
1863  // layout per page
1864  $attrs = array("Name" => "LayoutPerPage", "Value" =>
1865  $this->getLayoutPerPage());
1866  $a_xml_writer->xmlElement("Property", $attrs);
1867 
1868  // progress icons
1869  $attrs = array("Name" => "ProgressIcons", "Value" =>
1870  $this->getProgressIcons());
1871  $a_xml_writer->xmlElement("Property", $attrs);
1872 
1873  // store tries
1874  $attrs = array("Name" => "StoreTries", "Value" =>
1875  $this->getStoreTries());
1876  $a_xml_writer->xmlElement("Property", $attrs);
1877 
1878  // restrict forward navigation
1879  $attrs = array("Name" => "RestrictForwardNavigation", "Value" =>
1880  $this->getRestrictForwardNavigation());
1881  $a_xml_writer->xmlElement("Property", $attrs);
1882 
1883  // disable default feedback
1884  $attrs = array("Name" => "DisableDefaultFeedback", "Value" =>
1885  $this->getDisableDefaultFeedback());
1886  $a_xml_writer->xmlElement("Property", $attrs);
1887 
1888  $a_xml_writer->xmlEndTag("Properties");
1889  }
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 1650 of file class.ilObjContentObject.php.

Referenced by exportXML().

1651  {
1652  include_once './Modules/LearningModule/classes/class.ilStructureObject.php';
1653 
1654  $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
1655  foreach ($childs as $child)
1656  {
1657  if($child["type"] != "st")
1658  {
1659  continue;
1660  }
1661 
1662  $structure_obj = new ilStructureObject($this, $child["obj_id"]);
1663  $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
1664  unset($structure_obj);
1665  }
1666  }
Class ilStructreObject.
+ Here is the caller graph for this function:

◆ fixTree()

ilObjContentObject::fixTree ( )

fix tree

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

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

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

◆ getAutoGlossaries()

ilObjContentObject::getAutoGlossaries ( )

Get auto glossaries.

Returns
array int

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

References $auto_glossaries.

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

367  {
368  return $this->auto_glossaries;
369  }
+ Here is the caller graph for this function:

◆ getAvailableLayouts()

static ilObjContentObject::getAvailableLayouts ( )
static

get all available lm layouts

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

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

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

1267  {
1268  $dir = opendir("./Modules/LearningModule/layouts/lm");
1269 
1270  $layouts = array();
1271 
1272  while($file = readdir($dir))
1273  {
1274  if ($file != "." && $file != ".." && $file != "CVS" && $file != ".svn")
1275  {
1276  // directories
1277  if (@is_dir("./Modules/LearningModule/layouts/lm/".$file))
1278  {
1279  $layouts[$file] = $file;
1280  }
1281  }
1282  }
1283  asort($layouts);
1284 
1285  // workaround: fix ordering
1286  $ret = array(
1287  'toc2win' => 'toc2win',
1288  'toc2windyn' => 'toc2windyn',
1289  '1window' => '1window',
1290  '2window' => '2window',
1291  '3window' => '3window',
1292  'presentation' => 'presentation',
1293  'fullscreen' => 'fullscreen'
1294  );
1295 
1296  foreach ($layouts as $l)
1297  {
1298  if (!in_array($l, $ret))
1299  {
1300  $ret[$l] = $l;
1301  }
1302  }
1303 
1304  return $ret;
1305  }
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 484 of file class.ilObjContentObject.php.

References ilUtil\getDataDir().

Referenced by delete().

485  {
486  return ilUtil::getDataDir()."/lm_data".
487  "/lm_".$this->getId();
488  }
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 133 of file class.ilObjContentObject.php.

Referenced by cloneObject().

134  {
135  return parent::getDescription();
136  }
+ 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 193 of file class.ilObjContentObject.php.

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

194  {
195  return $this->disable_def_feedback;
196  }
+ Here is the caller graph for this function:

◆ getExportDirectory()

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

get export directory of lm

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

References $a_type, and ilUtil\getDataDir().

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

575  {
576  switch ($a_type)
577  {
578  case "scorm":
579  $export_dir = ilUtil::getDataDir()."/lm_data"."/lm_".$this->getId()."/export_scorm";
580  break;
581 
582  default: // = xml
583  if (substr($a_type, 0, 4) == "html")
584  {
585  $export_dir = ilUtil::getDataDir()."/lm_data"."/lm_".$this->getId()."/export_".$a_type;
586  }
587  else
588  {
589  $export_dir = ilUtil::getDataDir()."/lm_data"."/lm_".$this->getId()."/export";
590  }
591  break;
592  }
593  return $export_dir;
594  }
$a_type
Definition: workflow.php:93
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 1894 of file class.ilObjContentObject.php.

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

1895  {
1896  $file = array();
1897 
1898  $types = array("xml", "html", "scorm");
1899 
1900  foreach ($types as $type)
1901  {
1902  $dir = $this->getExportDirectory($type);
1903  // quit if import dir not available
1904  if (!@is_dir($dir) or
1905  !is_writeable($dir))
1906  {
1907  continue;
1908  }
1909 
1910  // open directory
1911  $cdir = dir($dir);
1912 
1913  // initialize array
1914 
1915  // get files and save the in the array
1916  while ($entry = $cdir->read())
1917  {
1918  if ($entry != "." and
1919  $entry != ".." and
1920  substr($entry, -4) == ".zip" and
1921  preg_match("~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.zip\$~", $entry))
1922  {
1923  $file[$entry.$type] = array("type" => $type, "file" => $entry,
1924  "size" => filesize($dir."/".$entry));
1925  }
1926  }
1927 
1928  // close import directory
1929  $cdir->close();
1930  }
1931 
1932  // sort files
1933  ksort ($file);
1934  reset ($file);
1935  return $file;
1936  }
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 1128 of file class.ilObjContentObject.php.

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

1129  {
1130  return $this->footer_page;
1131  }
+ 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 436 of file class.ilObjContentObject.php.

References $for_translation.

Referenced by updateProperties().

437  {
438  return $this->for_translation;
439  }
+ Here is the caller graph for this function:

◆ getHeaderPage()

ilObjContentObject::getHeaderPage ( )

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

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

1119  {
1120  return $this->header_page;
1121  }
+ 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 1053 of file class.ilObjContentObject.php.

Referenced by updateProperties().

1054  {
1055  return $this->hide_header_footer_print;
1056  }
+ Here is the caller graph for this function:

◆ getImportDirectory()

ilObjContentObject::getImportDirectory ( )

get import directory of lm

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

References $import_dir, and ilUtil\getDataDir().

Referenced by importFromZipFile().

494  {
495  if(strlen($this->import_dir))
496  {
497  return $this->import_dir;
498  }
499 
500  $import_dir = ilUtil::getDataDir()."/lm_data".
501  "/lm_".$this->getId()."/import";
502  if(@is_dir($import_dir))
503  {
504  return $import_dir;
505  }
506  else
507  {
508  return false;
509  }
510  }
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 148 of file class.ilObjContentObject.php.

References ilObject\$import_id.

Referenced by importFromDirectory().

149  {
150  return $this->import_id;
151  }
+ 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 658 of file class.ilObjContentObject.php.

References $layout.

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

659  {
660  return $this->layout;
661  }
+ Here is the caller graph for this function:

◆ getLayoutPerPage()

ilObjContentObject::getLayoutPerPage ( )

Get layout per page.

Returns
boolean layout per page

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

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

174  {
175  return $this->layout_per_page;
176  }
+ Here is the caller graph for this function:

◆ getLMTree()

& ilObjContentObject::getLMTree ( )

get content object tree

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

References $lm_tree.

Referenced by exportHTMLPages(), and fixTree().

445  {
446  return $this->lm_tree;
447  }
+ Here is the caller graph for this function:

◆ getOfflineFiles()

ilObjContentObject::getOfflineFiles (   $dir)

get offline files

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

References $file, and array.

1965  {
1966  // quit if offline dir not available
1967  if (!@is_dir($dir) or
1968  !is_writeable($dir))
1969  {
1970  return array();
1971  }
1972 
1973  // open directory
1974  $dir = dir($dir);
1975 
1976  // initialize array
1977  $file = array();
1978 
1979  // get files and save the in the array
1980  while ($entry = $dir->read())
1981  {
1982  if ($entry != "." and
1983  $entry != ".." and
1984  substr($entry, -4) == ".pdf" and
1985  preg_match("~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.pdf\$~", $entry))
1986  {
1987  $file[] = $entry;
1988  }
1989  }
1990 
1991  // close import directory
1992  $dir->close();
1993 
1994  // sort files
1995  sort ($file);
1996  reset ($file);
1997 
1998  return $file;
1999  }
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 983 of file class.ilObjContentObject.php.

References $online.

Referenced by cloneObject(), and updateProperties().

984  {
985  return $this->online;
986  }
+ 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 937 of file class.ilObjContentObject.php.

References $pg_header.

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

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

◆ getProgressIcons()

ilObjContentObject::getProgressIcons ( )

Get progress icons.

Returns
bool show progress icons

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

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

214  {
215  return $this->progr_icons;
216  }
+ Here is the caller graph for this function:

◆ getPublicAccessMode()

ilObjContentObject::getPublicAccessMode ( )

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

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

Referenced by cloneObject(), and updateProperties().

964  {
965  return $this->public_access_mode;
966  }
+ 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 1956 of file class.ilObjContentObject.php.

References $a_type.

Referenced by getPublicExportFiles(), and updateProperties().

1957  {
1958  return $this->public_export_file[$a_type];
1959  }
$a_type
Definition: workflow.php:93
+ 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 3642 of file class.ilObjContentObject.php.

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

3643  {
3644  $dirs = array("xml", "scorm");
3645  $export_files = array();
3646 
3647  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
3648  $ot = ilObjectTranslation::getInstance($this->getId());
3649  if ($ot->getContentActivated())
3650  {
3651  $langs = $ot->getLanguages();
3652  foreach ($langs as $l => $ldata)
3653  {
3654  $dirs[] = "html_".$l;
3655  }
3656  $dirs[] = "html_all";
3657  }
3658  else
3659  {
3660  $dirs[] = "html";
3661  }
3662 
3663  foreach($dirs as $dir)
3664  {
3665  $type = explode("_", $dir);
3666  $type = $type[0];
3667  if ($this->getPublicExportFile($type) != "")
3668  {
3669  if (is_file($this->getExportDirectory($dir)."/".
3670  $this->getPublicExportFile($type)))
3671  {
3672  $size = filesize($this->getExportDirectory($dir)."/".
3673  $this->getPublicExportFile($type));
3674  $export_files[] = array("type" => $type,
3675  "dir_type" => $dir,
3676  "file" => $this->getPublicExportFile($type),
3677  "size" => $size);
3678  }
3679  }
3680  }
3681 
3682  return $export_files;
3683  }
$size
Definition: RandomTest.php:79
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 253 of file class.ilObjContentObject.php.

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

254  {
255  return $this->restrict_forw_nav;
256  }
+ Here is the caller graph for this function:

◆ getStoreTries()

ilObjContentObject::getStoreTries ( )

Get store tries.

Returns
bool store tries

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

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

234  {
235  return $this->store_tries;
236  }
+ Here is the caller graph for this function:

◆ getStyleSheetId()

ilObjContentObject::getStyleSheetId ( )

get ID of assigned style sheet object

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

References $style_id.

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

677  {
678  return $this->style_id;
679  }
+ Here is the caller graph for this function:

◆ getSupplyingExportFiles()

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

Get supplying export files.

Parameters

Definition at line 2371 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().

2372  {
2373  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
2374  include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
2375  include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
2376  include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
2377  $scripts = array(
2378  array("source" => ilYuiUtil::getLocalPath('yahoo/yahoo-min.js'),
2379  "target" => $a_target_dir.'/js/yahoo/yahoo-min.js',
2380  "type" => "js"),
2381  array("source" => ilYuiUtil::getLocalPath('yahoo-dom-event/yahoo-dom-event.js'),
2382  "target" => $a_target_dir.'/js/yahoo/yahoo-dom-event.js',
2383  "type" => "js"),
2384  array("source" => ilYuiUtil::getLocalPath('animation/animation-min.js'),
2385  "target" => $a_target_dir.'/js/yahoo/animation-min.js',
2386  "type" => "js"),
2387  array("source" => './Services/JavaScript/js/Basic.js',
2388  "target" => $a_target_dir.'/js/Basic.js',
2389  "type" => "js"),
2390  array("source" => './Services/Accordion/js/accordion.js',
2391  "target" => $a_target_dir.'/js/accordion.js',
2392  "type" => "js"),
2393  array("source" => './Services/Accordion/css/accordion.css',
2394  "target" => $a_target_dir.'/css/accordion.css',
2395  "type" => "css"),
2397  "target" => $a_target_dir.'/js/jquery.js',
2398  "type" => "js"),
2400  "target" => $a_target_dir.'/js/maphilight.js',
2401  "type" => "js"),
2403  "target" => $a_target_dir.'/js/jquery-ui-min.js',
2404  "type" => "js"),
2405  array("source" => './Services/COPage/js/ilCOPagePres.js',
2406  "target" => $a_target_dir.'/js/ilCOPagePres.js',
2407  "type" => "js"),
2408  array("source" => './Modules/Scorm2004/scripts/questions/pure.js',
2409  "target" => $a_target_dir.'/js/pure.js',
2410  "type" => "js"),
2411  array("source" => './Modules/Scorm2004/scripts/questions/question_handling.js',
2412  "target" => $a_target_dir.'/js/question_handling.js',
2413  "type" => "js"),
2414  array("source" => './Modules/TestQuestionPool/js/ilMatchingQuestion.js',
2415  "target" => $a_target_dir.'/js/ilMatchingQuestion.js',
2416  "type" => "js"),
2417  array("source" => './Modules/Scorm2004/templates/default/question_handling.css',
2418  "target" => $a_target_dir.'/css/question_handling.css',
2419  "type" => "css"),
2420  array("source" => './Modules/TestQuestionPool/templates/default/test_javascript.css',
2421  "target" => $a_target_dir.'/css/test_javascript.css',
2422  "type" => "css"),
2424  "target" => $a_target_dir."/".ilPlayerUtil::getLocalMediaElementJsPath(),
2425  "type" => "js"),
2427  "target" => $a_target_dir."/".ilPlayerUtil::getLocalMediaElementCssPath(),
2428  "type" => "css"),
2430  "target" => $a_target_dir."/".ilExplorerBaseGUI::getLocalExplorerJsPath(),
2431  "type" => "js"),
2433  "target" => $a_target_dir."/".ilExplorerBaseGUI::getLocalJsTreeJsPath(),
2434  "type" => "js"),
2435  array("source" => './Modules/LearningModule/js/LearningModule.js',
2436  "target" => $a_target_dir.'/js/LearningModule.js',
2437  "type" => "js")
2438  );
2439 
2440  $mathJaxSetting = new ilSetting("MathJax");
2441  $use_mathjax = $mathJaxSetting->get("enable");
2442  if ($use_mathjax)
2443  {
2444  $scripts[] = array("source" => "",
2445  "target" => $mathJaxSetting->get("path_to_mathjax"),
2446  "type" => "js");
2447  }
2448 
2449  // auto linking js
2450  include_once("./Services/Link/classes/class.ilLinkifyUtil.php");
2451  foreach (ilLinkifyUtil::getLocalJsPaths() as $p)
2452  {
2453  if (is_int(strpos($p, "ExtLink")))
2454  {
2455  $scripts[] = array("source" => $p,
2456  "target" => $a_target_dir.'/js/ilExtLink.js',
2457  "type" => "js");
2458  }
2459  if (is_int(strpos($p, "linkify")))
2460  {
2461  $scripts[] = array("source" => $p,
2462  "target" => $a_target_dir.'/js/linkify.js',
2463  "type" => "js");
2464  }
2465  }
2466 
2467  return $scripts;
2468 
2469  }
ILIAS Setting Class.
static getLocaljQueryUIPath()
Get local path of jQuery UI file.
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.
if(strpos($jquery_path, './')===0) else if(strpos($jquery_path, '.')===0) $mathJaxSetting
Definition: latex.php:36
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.
static getLocaljQueryPath()
Get local path of jQuery file.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTitle()

ilObjContentObject::getTitle ( )

get title of content object

Returns
string title

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

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

115  {
116  return parent::getTitle();
117  }
+ Here is the caller graph for this function:

◆ getTOCMode()

ilObjContentObject::getTOCMode ( )

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

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

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

956  {
957  return $this->toc_mode;
958  }
+ Here is the caller graph for this function:

◆ getTree()

& ilObjContentObject::getTree ( )

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

References $lm_tree.

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

◆ getXMLZip()

ilObjContentObject::getXMLZip ( )

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

2917  {
2918  include_once("./Modules/LearningModule/classes/class.ilContObjectExport.php");
2919 
2920  $cont_exp = new ilContObjectExport($this,'xml');
2921 
2922  $export_file = $cont_exp->buildExportFile();
2923  return $export_file;
2924  }
Export class for content objects.

◆ hasRating()

ilObjContentObject::hasRating ( )

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

References $rating.

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

3574  {
3575  return $this->rating;
3576  }
+ Here is the caller graph for this function:

◆ hasRatingPages()

ilObjContentObject::hasRatingPages ( )

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

References $rating_pages.

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

3584  {
3585  return $this->rating_pages;
3586  }
+ 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 1409 of file class.ilObjContentObject.php.

Referenced by ilPageObjectGUI\showPage().

1410  {
1411  $tree = new ilTree($a_cont_obj_id);
1412  $tree->setTableNames('lm_tree','lm_data');
1413  $tree->setTreeTablePK("lm_id");
1414  if ($tree->isInTree($a_page_id))
1415  {
1416  $succ = $tree->fetchSuccessorNode($a_page_id, "pg");
1417  if ($succ > 0)
1418  {
1419  return true;
1420  }
1421  }
1422  return false;
1423  }
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 303 of file class.ilObjContentObject.php.

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

◆ importFromDirectory()

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

Import lm from directory.

Parameters

Definition at line 3209 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().

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

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

3173  {
3174  global $lng;
3175 
3176  // create import directory
3177  $this->createImportDirectory();
3178 
3179  // copy uploaded file to import directory
3180  $file = pathinfo($a_filename);
3181  $full_path = $this->getImportDirectory()."/".$a_filename;
3182 
3183  ilUtil::moveUploadedFile($a_tmp_file,
3184  $a_filename, $full_path);
3185 
3186  // unzip file
3187  ilUtil::unzip($full_path);
3188 
3189  $subdir = basename($file["basename"],".".$file["extension"]);
3190 
3191  $mess = $this->importFromDirectory(
3192  $this->getImportDirectory()."/".$subdir, $a_validate);
3193 
3194 
3195  // delete import directory
3197 
3198  return $mess;
3199  }
getImportDirectory()
get import directory of lm
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
createImportDirectory()
creates data directory for import files (data_dir/lm_data/lm_<id>/import, depending on data directory...
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 1063 of file class.ilObjContentObject.php.

Referenced by cloneObject(), and updateProperties().

1064  {
1065  return $this->downloads_active;
1066  }
+ Here is the caller graph for this function:

◆ isActiveDownloadsPublic()

ilObjContentObject::isActiveDownloadsPublic ( )

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

Referenced by cloneObject(), and updateProperties().

1074  {
1075  return $this->downloads_public_active;
1076  }
+ Here is the caller graph for this function:

◆ isActiveHistoryUserComments()

ilObjContentObject::isActiveHistoryUserComments ( )

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

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

1109  {
1110  return $this->user_comments;
1111  }
+ Here is the caller graph for this function:

◆ isActiveLMMenu()

ilObjContentObject::isActiveLMMenu ( )

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

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

994  {
995  return $this->lm_menu_active;
996  }
+ Here is the caller graph for this function:

◆ isActiveNumbering()

ilObjContentObject::isActiveNumbering ( )

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

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

1014  {
1015  return $this->numbering;
1016  }
+ Here is the caller graph for this function:

◆ isActivePreventGlossaryAppendix()

ilObjContentObject::isActivePreventGlossaryAppendix ( )

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

Referenced by cloneObject(), and updateProperties().

1034  {
1035  return $this->prevent_glossary_appendix_active;
1036  }
+ Here is the caller graph for this function:

◆ isActivePrintView()

ilObjContentObject::isActivePrintView ( )

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

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

1024  {
1025  return $this->print_view_active;
1026  }
+ Here is the caller graph for this function:

◆ isActiveTOC()

ilObjContentObject::isActiveTOC ( )

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

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

1004  {
1005  return $this->toc_active;
1006  }
+ 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 3555 of file class.ilObjContentObject.php.

References ilObject\_lookupObjId().

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

3556  {
3557  if (!$a_as_obj_id && $a_id > 0 && $a_id == OH_REF_ID)
3558  {
3559  return true;
3560  }
3561  if ($a_as_obj_id && $a_id > 0 && $a_id == ilObject::_lookupObjId(OH_REF_ID))
3562  {
3563  return true;
3564  }
3565  return false;
3566  }
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 3483 of file class.ilObjContentObject.php.

References $ilDB, and array.

Referenced by ilLMPage\beforePageContentUpdate().

3484  {
3485  global $ilDB;
3486 
3487  // read auto glossaries
3488  $set = $ilDB->query("SELECT * FROM lm_glossaries ".
3489  " WHERE lm_id = ".$ilDB->quote($a_lm_id, "integer")
3490  );
3491  $glos = array();
3492  while ($rec = $ilDB->fetchAssoc($set))
3493  {
3494  $glos[] = $rec["glo_id"];
3495  }
3496  return $glos;
3497  }
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 3589 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().

3590  {
3591  parent::MDUpdateListener($a_element);
3592 
3593  include_once 'Services/MetaData/classes/class.ilMD.php';
3594 
3595  switch($a_element)
3596  {
3597  case 'Educational':
3598  include_once("./Services/Object/classes/class.ilObjectLP.php");
3599  $obj_lp = ilObjectLP::getInstance($this->getId());
3600  if(in_array($obj_lp->getCurrentMode(),
3602  {
3603  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
3605  }
3606  break;
3607 
3608  case 'General':
3609 
3610  // Update Title and description
3611  $md = new ilMD($this->getId(),0, $this->getType());
3612  if(!is_object($md_gen = $md->getGeneral()))
3613  {
3614  return false;
3615  }
3616 
3617  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
3618  $ot = ilObjectTranslation::getInstance($this->getId());
3619  if ($ot->getContentActivated())
3620  {
3621  $ot->setDefaultTitle($md_gen->getTitle());
3622 
3623  foreach($md_gen->getDescriptionIds() as $id)
3624  {
3625  $md_des = $md_gen->getDescription($id);
3626  $ot->setDefaultDescription($md_des->getDescription());
3627  break;
3628  }
3629  $ot->save();
3630  }
3631  break;
3632 
3633  }
3634  return true;
3635  }
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 1083 of file class.ilObjContentObject.php.

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

1084  {
1085  return $this->pub_notes;
1086  }
+ Here is the caller graph for this function:

◆ putInTree()

ilObjContentObject::putInTree (   $a_parent)

put content object in main tree

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

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

◆ read()

ilObjContentObject::read ( )

read data of content object

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

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

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

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

1137  {
1138  global $ilDB;
1139 
1140  $q = "SELECT * FROM content_object WHERE id = ".
1141  $ilDB->quote($this->getId(), "integer");
1142  $lm_set = $ilDB->query($q);
1143  $lm_rec = $ilDB->fetchAssoc($lm_set);
1144  $this->setLayout($lm_rec["default_layout"]);
1145  $this->setStyleSheetId((int) $lm_rec["stylesheet"]);
1146  $this->setPageHeader($lm_rec["page_header"]);
1147  $this->setTOCMode($lm_rec["toc_mode"]);
1148  $this->setOnline(ilUtil::yn2tf($lm_rec["is_online"]));
1149  $this->setActiveTOC(ilUtil::yn2tf($lm_rec["toc_active"]));
1150  $this->setActiveNumbering(ilUtil::yn2tf($lm_rec["numbering"]));
1151  $this->setActivePrintView(ilUtil::yn2tf($lm_rec["print_view_active"]));
1152  $this->setActivePreventGlossaryAppendix(ilUtil::yn2tf($lm_rec["no_glo_appendix"]));
1153  $this->setHideHeaderFooterPrint($lm_rec["hide_head_foot_print"]);
1154  $this->setActiveDownloads(ilUtil::yn2tf($lm_rec["downloads_active"]));
1155  $this->setActiveDownloadsPublic(ilUtil::yn2tf($lm_rec["downloads_public_active"]));
1156  $this->setActiveLMMenu(ilUtil::yn2tf($lm_rec["lm_menu_active"]));
1157  $this->setCleanFrames(ilUtil::yn2tf($lm_rec["clean_frames"]));
1158  $this->setHeaderPage((int) $lm_rec["header_page"]);
1159  $this->setFooterPage((int) $lm_rec["footer_page"]);
1160  $this->setHistoryUserComments(ilUtil::yn2tf($lm_rec["hist_user_comments"]));
1161  $this->setPublicAccessMode($lm_rec["public_access_mode"]);
1162  $this->setPublicExportFile("xml", $lm_rec["public_xml_file"]);
1163  $this->setPublicExportFile("html", $lm_rec["public_html_file"]);
1164  $this->setPublicExportFile("scorm", $lm_rec["public_scorm_file"]);
1165  $this->setLayoutPerPage($lm_rec["layout_per_page"]);
1166  $this->setRating($lm_rec["rating"]);
1167  $this->setRatingPages($lm_rec["rating_pages"]);
1168  $this->setDisableDefaultFeedback($lm_rec["disable_def_feedback"]);
1169  $this->setProgressIcons($lm_rec["progr_icons"]);
1170  $this->setStoreTries($lm_rec["store_tries"]);
1171  $this->setRestrictForwardNavigation($lm_rec["restrict_forw_nav"]);
1172 
1173  // #14661
1174  include_once("./Services/Notes/classes/class.ilNote.php");
1175  $this->setPublicNotes(ilNote::commentsActivated($this->getId(), 0, $this->getType()));
1176 
1177  $this->setForTranslation($lm_rec["for_translation"]);
1178  }
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 377 of file class.ilObjContentObject.php.

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

378  {
379  $glo_ids = array();
380  foreach($this->getAutoGlossaries() as $g)
381  {
382  if ($g != $a_glo_id)
383  {
384  $glo_ids[] = $g;
385  }
386  }
387  $this->setAutoGlossaries($glo_ids);
388  }
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 1058 of file class.ilObjContentObject.php.

Referenced by readProperties().

1059  {
1060  $this->downloads_active = $a_down;
1061  }
+ Here is the caller graph for this function:

◆ setActiveDownloadsPublic()

ilObjContentObject::setActiveDownloadsPublic (   $a_down)

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

Referenced by readProperties().

1069  {
1070  $this->downloads_public_active = $a_down;
1071  }
+ Here is the caller graph for this function:

◆ setActiveLMMenu()

ilObjContentObject::setActiveLMMenu (   $a_act_lm_menu)

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

Referenced by readProperties().

989  {
990  $this->lm_menu_active = $a_act_lm_menu;
991  }
+ Here is the caller graph for this function:

◆ setActiveNumbering()

ilObjContentObject::setActiveNumbering (   $a_num)

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

Referenced by readProperties().

1009  {
1010  $this->numbering = $a_num;
1011  }
+ Here is the caller graph for this function:

◆ setActivePreventGlossaryAppendix()

ilObjContentObject::setActivePreventGlossaryAppendix (   $a_print)

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

Referenced by readProperties().

1029  {
1030  $this->prevent_glossary_appendix_active = $a_print;
1031  }
+ Here is the caller graph for this function:

◆ setActivePrintView()

ilObjContentObject::setActivePrintView (   $a_print)

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

Referenced by readProperties().

1019  {
1020  $this->print_view_active = $a_print;
1021  }
+ Here is the caller graph for this function:

◆ setActiveTOC()

ilObjContentObject::setActiveTOC (   $a_toc)

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

Referenced by readProperties().

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

◆ setAutoGlossaries()

ilObjContentObject::setAutoGlossaries (   $a_val)

Set auto glossaries.

Parameters
array$a_valint

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

References ilObject\_lookupType(), and array.

Referenced by read(), and removeAutoGlossary().

345  {
346  $this->auto_glossaries = array();
347  if (is_array($a_val))
348  {
349  foreach ($a_val as $v)
350  {
351  $v = (int) $v;
352  if ($v > 0 && ilObject::_lookupType($v) == "glo" &&
353  !in_array($v, $this->auto_glossaries))
354  {
355  $this->auto_glossaries[] = $v;
356  }
357  }
358  }
359  }
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 1088 of file class.ilObjContentObject.php.

Referenced by readProperties(), and updateProperties().

1089  {
1090  $this->clean_frames = $a_clean;
1091  }
+ Here is the caller graph for this function:

◆ setDescription()

ilObjContentObject::setDescription (   $a_description)

set description of content object

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

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

◆ setDisableDefaultFeedback()

ilObjContentObject::setDisableDefaultFeedback (   $a_val)

Set disable default feedback for questions.

Parameters
bool$a_valdisable default feedback

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

Referenced by readProperties().

184  {
185  $this->disable_def_feedback = $a_val;
186  }
+ Here is the caller graph for this function:

◆ setFooterPage()

ilObjContentObject::setFooterPage (   $a_pg)

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

Referenced by readProperties().

1124  {
1125  $this->footer_page = $a_pg;
1126  }
+ 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 426 of file class.ilObjContentObject.php.

Referenced by readProperties().

427  {
428  $this->for_translation = $a_val;
429  }
+ Here is the caller graph for this function:

◆ setHeaderPage()

ilObjContentObject::setHeaderPage (   $a_pg)

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

Referenced by readProperties().

1114  {
1115  $this->header_page = $a_pg;
1116  }
+ 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 1043 of file class.ilObjContentObject.php.

Referenced by readProperties().

1044  {
1045  $this->hide_header_footer_print = $a_val;
1046  }
+ Here is the caller graph for this function:

◆ setHistoryUserComments()

ilObjContentObject::setHistoryUserComments (   $a_comm)

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

Referenced by readProperties().

1099  {
1100  $this->user_comments = $a_comm;
1101  }
+ 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 518 of file class.ilObjContentObject.php.

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

◆ setImportId()

ilObjContentObject::setImportId (   $a_id)

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

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

◆ setLayout()

ilObjContentObject::setLayout (   $a_layout)

set default page layout

Parameters
string$a_layoutdefault page layout

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

Referenced by readProperties().

669  {
670  $this->layout = $a_layout;
671  }
+ Here is the caller graph for this function:

◆ setLayoutPerPage()

ilObjContentObject::setLayoutPerPage (   $a_val)

Set layout per page.

Parameters
booleanlayout per page

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

Referenced by readProperties().

164  {
165  $this->layout_per_page = $a_val;
166  }
+ Here is the caller graph for this function:

◆ setOnline()

ilObjContentObject::setOnline (   $a_online)

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

Referenced by readProperties().

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

Referenced by readProperties().

948  {
949  $this->pg_header = $a_pg_header;
950  }
+ 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 203 of file class.ilObjContentObject.php.

Referenced by readProperties().

204  {
205  $this->progr_icons = $a_val;
206  }
+ Here is the caller graph for this function:

◆ setPublicAccessMode()

ilObjContentObject::setPublicAccessMode (   $a_mode)

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

Referenced by readProperties().

1104  {
1105  $this->public_access_mode = $a_mode;
1106  }
+ 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 1944 of file class.ilObjContentObject.php.

References $a_type.

Referenced by readProperties().

1945  {
1946  $this->public_export_file[$a_type] = $a_file;
1947  }
$a_type
Definition: workflow.php:93
+ Here is the caller graph for this function:

◆ setPublicNotes()

ilObjContentObject::setPublicNotes (   $a_pub_notes)

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

Referenced by readProperties().

1079  {
1080  $this->pub_notes = $a_pub_notes;
1081  }
+ Here is the caller graph for this function:

◆ setRating()

ilObjContentObject::setRating (   $a_value)

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

Referenced by readProperties().

3569  {
3570  $this->rating = (bool)$a_value;
3571  }
+ Here is the caller graph for this function:

◆ setRatingPages()

ilObjContentObject::setRatingPages (   $a_value)

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

Referenced by readProperties().

3579  {
3580  $this->rating_pages = (bool)$a_value;
3581  }
+ 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 243 of file class.ilObjContentObject.php.

Referenced by readProperties().

244  {
245  $this->restrict_forw_nav = $a_val;
246  }
+ Here is the caller graph for this function:

◆ setStoreTries()

ilObjContentObject::setStoreTries (   $a_val)

Set store tries.

Parameters
bool$a_valstore tries

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

Referenced by readProperties().

224  {
225  $this->store_tries = $a_val;
226  }
+ Here is the caller graph for this function:

◆ setStyleSheetId()

ilObjContentObject::setStyleSheetId (   $a_style_id)

set ID of assigned style sheet object

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

Referenced by readProperties().

685  {
686  $this->style_id = $a_style_id;
687  }
+ Here is the caller graph for this function:

◆ setTitle()

ilObjContentObject::setTitle (   $a_title)

set title of content object

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

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

◆ setTOCMode()

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

set toc mode

Parameters
string$a_toc_mode"chapters" | "pages"

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

Referenced by readProperties().

974  {
975  $this->toc_mode = $a_toc_mode;
976  }
+ Here is the caller graph for this function:

◆ update()

ilObjContentObject::update ( )

update complete object (meta data and properties)

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

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

268  {
269  $this->updateMetaData();
270  parent::update();
271  $this->updateProperties();
272  $this->updateAutoGlossaries();
273  }
updateMetaData()
update meta data entry
updateAutoGlossaries()
Update auto glossaries.
updateProperties()
Update content object properties.
+ Here is the call graph for this function:

◆ updateAutoGlossaries()

ilObjContentObject::updateAutoGlossaries ( )

Update auto glossaries.

Parameters

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

References $ilDB, and getAutoGlossaries().

Referenced by create(), and update().

282  {
283  global $ilDB;
284 
285  // update auto glossaries
286  $ilDB->manipulate("DELETE FROM lm_glossaries WHERE ".
287  " lm_id = ".$ilDB->quote($this->getId(), "integer")
288  );
289  foreach ($this->getAutoGlossaries() as $glo_id)
290  {
291  $ilDB->manipulate("INSERT INTO lm_glossaries ".
292  "(lm_id, glo_id) VALUES (".
293  $ilDB->quote($this->getId(), "integer").",".
294  $ilDB->quote($glo_id, "integer").
295  ")");
296  }
297  }
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 1183 of file class.ilObjContentObject.php.

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

Referenced by update().

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

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

Referenced by importFromDirectory().

3125  {
3126  include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
3127  include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
3128 
3129  $mess = "";
3130 
3131  $pages = ilLMPageObject::getPageList($this->getId());
3132  foreach ($pages as $page)
3133  {
3134  if (ilLMPage::_exists($this->getType(), $page["obj_id"]))
3135  {
3136  $cpage = new ilLMPage($page["obj_id"]);
3137  $cpage->buildDom();
3138  $error = @$cpage->validateDom();
3139 
3140  if ($error != "")
3141  {
3142  $this->lng->loadLanguageModule("content");
3143  ilUtil::sendInfo($this->lng->txt("cont_import_validation_errors"));
3144  $title = ilLMObject::_lookupTitle($page["obj_id"]);
3145  $page_obj = new ilLMPageObject($this, $page["obj_id"]);
3146  $mess.= $this->lng->txt("obj_pg").": ".$title;
3147  $mess.= '<div class="small">';
3148  foreach ($error as $e)
3149  {
3150  $err_mess = implode($e, " - ");
3151  if (!is_int(strpos($err_mess, ":0:")))
3152  {
3153  $mess.= htmlentities($err_mess)."<br />";
3154  }
3155  }
3156  $mess.= '</div>';
3157  $mess.= "<br />";
3158  }
3159  }
3160  }
3161 
3162  return $mess;
3163  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
$error
Definition: Error.php:17
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 726 of file class.ilObjContentObject.php.

References $ilDB.

Referenced by ilLearningModuleImporter\finalProcessing().

727  {
728  global $ilDB;
729 
730  $ilDB->manipulate("UPDATE content_object SET ".
731  " footer_page = ".$ilDB->quote($a_page_id, "integer").
732  " WHERE id = ".$ilDB->quote($a_lm_id, "integer")
733  );
734  }
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 710 of file class.ilObjContentObject.php.

References $ilDB.

Referenced by ilLearningModuleImporter\finalProcessing().

711  {
712  global $ilDB;
713 
714  $ilDB->manipulate("UPDATE content_object SET ".
715  " header_page = ".$ilDB->quote($a_page_id, "integer").
716  " WHERE id = ".$ilDB->quote($a_lm_id, "integer")
717  );
718  }
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 692 of file class.ilObjContentObject.php.

References $ilDB, and ilObject\getId().

Referenced by importFromDirectory().

693  {
694  global $ilDB;
695 
696  $q = "UPDATE content_object SET ".
697  " stylesheet = ".$ilDB->quote((int) $a_style_id, "integer").
698  " WHERE id = ".$ilDB->quote($this->getId(), "integer");
699  $ilDB->manipulate($q);
700 
701  $this->style_id = $a_style_id;
702  }
getId()
get object id public
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $auto_glossaries

ilObjContentObject::$auto_glossaries = array()

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

Referenced by getAutoGlossaries().

◆ $for_translation

ilObjContentObject::$for_translation = 0

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

Referenced by getForTranslation().

◆ $import_dir

ilObjContentObject::$import_dir = ''
private

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

Referenced by createImportDirectory(), and getImportDirectory().

◆ $layout

ilObjContentObject::$layout

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

Referenced by getLayout().

◆ $lm_tree

ilObjContentObject::$lm_tree

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

Referenced by getLMTree(), and getTree().

◆ $log

ilObjContentObject::$log
protected

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

Referenced by exportSCORM().

◆ $meta_data

ilObjContentObject::$meta_data

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

◆ $online

ilObjContentObject::$online

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

Referenced by getOnline().

◆ $pg_header

ilObjContentObject::$pg_header

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

Referenced by getPageHeader().

◆ $rating

ilObjContentObject::$rating
protected

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

Referenced by hasRating().

◆ $rating_pages

ilObjContentObject::$rating_pages
protected

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

Referenced by hasRatingPages().

◆ $style_id

ilObjContentObject::$style_id

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

Referenced by getStyleSheetId().


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