ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjContentObject Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 create (bool $a_no_meta_data=false)
 create content object More...
 
 read ()
 
 setLayoutPerPage (bool $a_val)
 
 getLayoutPerPage ()
 
 setDisableDefaultFeedback (bool $a_val)
 Set disable default feedback for questions. More...
 
 getDisableDefaultFeedback ()
 
 setProgressIcons (bool $a_val)
 
 getProgressIcons ()
 
 setStoreTries (bool $a_val)
 
 getStoreTries ()
 
 setRestrictForwardNavigation (bool $a_val)
 
 getRestrictForwardNavigation ()
 
 getTree ()
 
 update ()
 
 updateAutoGlossaries ()
 
 import ()
 if implemented, this function should be called from an Out/GUI-Object More...
 
 createLMTree ()
 
 setAutoGlossaries (array $a_val)
 
 getAutoGlossaries ()
 
 removeAutoGlossary (int $a_glo_id)
 
 setForTranslation (bool $a_val)
 Set for translation (lm has been imported for translation purposes) More...
 
 getForTranslation ()
 
 getLMTree ()
 
 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 ()
 
 getImportDirectory ()
 
 setImportDirectory (string $a_import_dir)
 
 createExportDirectory (string $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 (string $a_type="xml")
 
 getLayout ()
 
 setLayout (string $a_layout)
 
 getPageHeader ()
 get page header mode (ilLMOBject::CHAPTER_TITLE | ilLMOBject::PAGE_TITLE | ilLMOBject::NO_HEADER) More...
 
 setPageHeader (string $a_pg_header=ilLMObject::CHAPTER_TITLE)
 set page header mode More...
 
 getTOCMode ()
 get toc mode ("chapters" | "pages") More...
 
 getPublicAccessMode ()
 get public access mode ("complete" | "selected") More...
 
 setTOCMode (string $a_toc_mode="chapters")
 set toc mode More...
 
 setActiveLMMenu (bool $a_act_lm_menu)
 
 isActiveLMMenu ()
 
 setActiveTOC (bool $a_toc)
 
 isActiveTOC ()
 
 setActiveNumbering (bool $a_num)
 
 isActiveNumbering ()
 
 setActivePrintView (bool $a_print)
 
 isActivePrintView ()
 
 setActivePreventGlossaryAppendix (bool $a_print)
 
 isActivePreventGlossaryAppendix ()
 
 setHideHeaderFooterPrint (bool $a_val)
 Set hide header footer in print mode. More...
 
 getHideHeaderFooterPrint ()
 
 setActiveDownloads (bool $a_down)
 
 isActiveDownloads ()
 
 setActiveDownloadsPublic (bool $a_down)
 
 isActiveDownloadsPublic ()
 
 setPublicNotes (bool $a_pub_notes)
 
 publicNotes ()
 
 setCleanFrames (bool $a_clean)
 
 cleanFrames ()
 
 setHistoryUserComments (bool $a_comm)
 
 setPublicAccessMode (string $a_mode)
 
 isActiveHistoryUserComments ()
 
 setHeaderPage (int $a_pg)
 
 getHeaderPage ()
 
 setFooterPage (int $a_pg)
 
 getFooterPage ()
 
 readProperties ()
 
 updateProperties ()
 
 createProperties ()
 create new properties record More...
 
 checkTree ()
 
 fixTree ()
 
 checkStructure ()
 Check tree (this has been copied from fixTree due to a bug fixing, should be reorganised) More...
 
 exportXML (ilXmlWriter $a_xml_writer, int $a_inst, string $a_target_dir, ilLog $expLog)
 
 exportXMLMetaData (ilXmlWriter $a_xml_writer)
 
 exportXMLStructureObjects (ilXmlWriter $a_xml_writer, int $a_inst, ilLog $expLog)
 
 exportXMLPageObjects (ilXmlWriter $a_xml_writer, int $a_inst, ilLog $expLog)
 
 exportXMLMediaObjects (ilXmlWriter $a_xml_writer, int $a_inst, string $a_target_dir, ilLog $expLog)
 
 exportFileItems (string $a_target_dir, ilLog $expLog)
 
 exportXMLProperties (ilXmlWriter $a_xml_writer, ilLog $expLog)
 
 getExportFiles ()
 
 setPublicExportFile (string $a_type, string $a_file)
 specify public export file for type More...
 
 getPublicExportFile (string $a_type)
 
 getOfflineFiles (string $dir)
 
 executeDragDrop (int $source_id, int $target_id, bool $first_child, bool $as_subitem=false, string $movecopy="move")
 
 validatePages ()
 Validate all pages. More...
 
 copyAllPagesAndChapters (ilObjLearningModule $a_target_obj, int $a_copy_id=0)
 
 autoLinkGlossaryTerms (int $a_glo_ref_id)
 
 setRating (bool $a_value)
 
 hasRating ()
 
 setRatingPages (bool $a_value)
 
 hasRatingPages ()
 
 getPublicExportFiles ()
 Get public export files. More...
 
 isInfoEnabled ()
 
- Public Member Functions inherited from ilObject
 getObjectProperties ()
 
 flushObjectProperties ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $description)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 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. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static writeHeaderPage (int $a_lm_id, int $a_page_id)
 
static writeFooterPage (int $a_lm_id, int $a_page_id)
 
static _moveLMStyles (int $a_from_style, int $a_to_style)
 move learning modules from one style to another More...
 
static _lookupRestrictForwardNavigation (int $a_obj_id)
 
static _lookupStyleSheetId (int $a_cont_obj_id)
 
static _lookupContObjIdByStyleId (int $a_style_id)
 
static _lookupDisableDefaultFeedback (int $a_id)
 
static _lookupStoreTries (int $a_id)
 
static _getNrOfAssignedLMs (int $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 (int $a_style_id)
 delete all style references to style More...
 
static getAvailableLayouts ()
 get all available lm layouts More...
 
static _checkPreconditionsOfPage (int $cont_ref_id, int $cont_obj_id, int $page_id)
 checks whether the preconditions of a page are fulfilled or not More...
 
static _getMissingPreconditionsOfPage (int $cont_ref_id, int $cont_obj_id, int $page_id)
 gets all missing preconditions of page More...
 
static _getMissingPreconditionsTopChapter (int $cont_obj_ref_id, int $cont_obj_id, int $page_id)
 get top chapter of page for that any precondition is missing More...
 
static hasSuccessorPage (int $a_cont_obj_id, int $a_page_id)
 checks if page has a successor page More...
 
static lookupAutoGlossaries (int $a_lm_id)
 
static isOnlineHelpModule (int $a_id, bool $a_as_obj_id=false)
 Is module an online module. More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, \ilDBInterface $ilDB=null)
 

Data Fields

ilLMTree $lm_tree
 
string $layout = ''
 
int $style_id = 0
 
string $pg_header = ''
 
bool $online = false
 
bool $for_translation = false
 
array $auto_glossaries = array()
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 

Protected Member Functions

 doMDUpdateListener (string $a_element)
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 

Static Protected Member Functions

static _lookup (int $a_obj_id, string $a_field)
 

Protected Attributes

ILIAS Notes Service $notes
 
array $q_ids = []
 
array $mob_ids = []
 
array $file_ids = []
 
array $public_export_file = []
 
int $header_page = 0
 
int $footer_page = 0
 
bool $user_comments = false
 
bool $clean_frames = false
 
bool $pub_notes = false
 
bool $downloads_public_active = false
 
bool $downloads_active = false
 
bool $hide_header_footer_print = false
 
bool $prevent_glossary_appendix_active = false
 
bool $print_view_active = false
 
bool $numbering = false
 
bool $toc_active = false
 
bool $lm_menu_active = false
 
string $public_access_mode = ''
 
string $toc_mode = ''
 
bool $restrict_forw_nav = false
 
bool $store_tries = false
 
bool $progr_icons = false
 
bool $disable_def_feedback = false
 
bool $layout_per_page = false
 
ilObjUser $user
 
ilLocatorGUI $locator
 
bool $rating = false
 
bool $rating_pages = false
 
ilObjLearningModule $lm
 
ILIAS Style Content DomainService $content_style_domain
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Private Attributes

string $import_dir = ''
 
ilGlobalTemplateInterface $main_tpl
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Sascha Hofmann sasch.nosp@m.ahof.nosp@m.mann@.nosp@m.gmx..nosp@m.de

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

Member Function Documentation

◆ _checkPreconditionsOfPage()

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

checks whether the preconditions of a page are fulfilled or not

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

References $path, ilConditionHandler\_checkAllConditionsOfTarget(), ilTree\getPathFull(), ilTree\isInTree(), ilTree\readRootId(), ilTree\setTableNames(), and ilTree\setTreeTablePK().

Referenced by ilLMNavigationRendererGUI\addDropdown(), ilLMContentRendererGUI\determineStatus(), ilLMPresentationGUI\showPrintView(), and ilLMPresentationGUI\showPrintViewSelection().

1032  : bool {
1033  $lm_tree = new ilTree($cont_obj_id);
1034  $lm_tree->setTableNames('lm_tree', 'lm_data');
1035  $lm_tree->setTreeTablePK("lm_id");
1036 
1037  if ($lm_tree->isInTree($page_id)) {
1038  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1039  foreach ($path as $node) {
1040  if ($node["type"] == "st") {
1041  if (!ilConditionHandler::_checkAllConditionsOfTarget($cont_ref_id, $node["child"], "st")) {
1042  return false;
1043  }
1044  }
1045  }
1046  }
1047 
1048  return true;
1049  }
isInTree(?int $a_node_id)
get all information of a node.
setTreeTablePK(string $a_column_name)
set column containing primary key in tree table
getPathFull(int $a_endnode_id, int $a_startnode_id=0)
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnod...
$path
Definition: ltiservices.php:32
setTableNames(string $a_table_tree, string $a_table_obj_data, string $a_table_obj_reference="")
set table names The primary key of the table containing your object_data must be &#39;obj_id&#39; You may use...
static _checkAllConditionsOfTarget(int $a_target_ref_id, int $a_target_id, string $a_target_type="", int $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteStyleAssignments()

static ilObjContentObject::_deleteStyleAssignments ( int  $a_style_id)
static

delete all style references to style

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

References $DIC, $ilDB, and $q.

Referenced by ilObjStyleSheet\delete().

692  : void {
693  global $DIC;
694 
695  $ilDB = $DIC->database();
696 
697  $q = "UPDATE content_object SET " .
698  " stylesheet = " . $ilDB->quote(0, "integer") .
699  " WHERE stylesheet = " . $ilDB->quote($a_style_id, "integer");
700 
701  $ilDB->manipulate($q);
702  }
global $DIC
Definition: feed.php:28
$q
Definition: shib_logout.php:21
+ Here is the caller graph for this function:

◆ _getMissingPreconditionsOfPage()

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

gets all missing preconditions of page

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

References $path, ilConditionHandler\_checkCondition(), ilConditionHandler\_getPersistedConditionsOfTarget(), ilTree\getPathFull(), ilTree\isInTree(), ilTree\readRootId(), ilTree\setTableNames(), and ilTree\setTreeTablePK().

Referenced by ilLMContentRendererGUI\renderPreconditionsOfPage().

1058  : array {
1059  $lm_tree = new ilTree($cont_obj_id);
1060  $lm_tree->setTableNames('lm_tree', 'lm_data');
1061  $lm_tree->setTreeTablePK("lm_id");
1062 
1063  $conds = array();
1064  if ($lm_tree->isInTree($page_id)) {
1065  // get full path of page
1066  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1067  foreach ($path as $node) {
1068  if ($node["type"] == "st") {
1069  // get all preconditions of upper chapters
1070  $tconds = ilConditionHandler::_getPersistedConditionsOfTarget($cont_ref_id, $node["child"], "st");
1071  foreach ($tconds as $tcond) {
1072  // store all missing preconditions
1073  if (!ilConditionHandler::_checkCondition($tcond)) {
1074  $conds[] = $tcond;
1075  }
1076  }
1077  }
1078  }
1079  }
1080 
1081  return $conds;
1082  }
isInTree(?int $a_node_id)
get all information of a node.
setTreeTablePK(string $a_column_name)
set column containing primary key in tree table
getPathFull(int $a_endnode_id, int $a_startnode_id=0)
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnod...
$path
Definition: ltiservices.php:32
setTableNames(string $a_table_tree, string $a_table_obj_data, string $a_table_obj_reference="")
set table names The primary key of the table containing your object_data must be &#39;obj_id&#39; You may use...
static _checkCondition(array $condition, int $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
static _getPersistedConditionsOfTarget(int $a_target_ref_id, int $a_target_obj_id, string $a_target_type="")
get all persisted conditions of target object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getMissingPreconditionsTopChapter()

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

get top chapter of page for that any precondition is missing

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

References $path, ilConditionHandler\_checkCondition(), ilConditionHandler\_getPersistedConditionsOfTarget(), ilTree\getPathFull(), ilTree\isInTree(), ilTree\readRootId(), ilTree\setTableNames(), and ilTree\setTreeTablePK().

Referenced by ilLMContentRendererGUI\renderPreconditionsOfPage().

1091  : int {
1092  $lm_tree = new ilTree($cont_obj_id);
1093  $lm_tree->setTableNames('lm_tree', 'lm_data');
1094  $lm_tree->setTreeTablePK("lm_id");
1095 
1096  if ($lm_tree->isInTree($page_id)) {
1097  // get full path of page
1098  $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
1099  foreach ($path as $node) {
1100  if ($node["type"] == "st") {
1101  // get all preconditions of upper chapters
1102  $tconds = ilConditionHandler::_getPersistedConditionsOfTarget($cont_obj_ref_id, $node["child"], "st");
1103  foreach ($tconds as $tcond) {
1104  // look for missing precondition
1105  if (!ilConditionHandler::_checkCondition($tcond)) {
1106  return (int) $node["child"];
1107  }
1108  }
1109  }
1110  }
1111  }
1112 
1113  return 0;
1114  }
isInTree(?int $a_node_id)
get all information of a node.
setTreeTablePK(string $a_column_name)
set column containing primary key in tree table
getPathFull(int $a_endnode_id, int $a_startnode_id=0)
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnod...
$path
Definition: ltiservices.php:32
setTableNames(string $a_table_tree, string $a_table_obj_data, string $a_table_obj_reference="")
set table names The primary key of the table containing your object_data must be &#39;obj_id&#39; You may use...
static _checkCondition(array $condition, int $a_usr_id=0)
checks wether a single condition is fulfilled every trigger object type must implement a static metho...
static _getPersistedConditionsOfTarget(int $a_target_ref_id, int $a_target_obj_id, string $a_target_type="")
get all persisted conditions of target object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getNrLMsIndividualStyles()

static ilObjContentObject::_getNrLMsIndividualStyles ( )
static

get number of learning modules with individual styles

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

References $DIC, $ilDB, and $q.

Referenced by ilContentStyleSettingsGUI\edit().

654  : int
655  {
656  global $DIC;
657 
658  $ilDB = $DIC->database();
659 
660  // joining with style table (not perfectly nice)
661  $q = "SELECT count(*) as cnt FROM content_object, style_data " .
662  " WHERE stylesheet = style_data.id " .
663  " AND standard = " . $ilDB->quote(0, "integer");
664  $cset = $ilDB->query($q);
665  $crow = $ilDB->fetchAssoc($cset);
666 
667  return (int) $crow["cnt"];
668  }
global $DIC
Definition: feed.php:28
$q
Definition: shib_logout.php:21
+ Here is the caller graph for this function:

◆ _getNrLMsNoStyle()

static ilObjContentObject::_getNrLMsNoStyle ( )
static

get number of learning modules assigned no style

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

References $DIC, $ilDB, and $q.

Referenced by ilContentStyleSettingsGUI\edit().

673  : int
674  {
675  global $DIC;
676 
677  $ilDB = $DIC->database();
678 
679  $q = "SELECT count(*) as cnt FROM content_object " .
680  " WHERE stylesheet = " . $ilDB->quote(0, "integer");
681  $cset = $ilDB->query($q);
682  $crow = $ilDB->fetchAssoc($cset);
683 
684  return (int) $crow["cnt"];
685  }
global $DIC
Definition: feed.php:28
$q
Definition: shib_logout.php:21
+ Here is the caller graph for this function:

◆ _getNrOfAssignedLMs()

static ilObjContentObject::_getNrOfAssignedLMs ( int  $a_style_id)
static

gets the number of learning modules assigned to a content style

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

References $DIC, $ilDB, and $q.

Referenced by ilContentStyleSettingsGUI\edit().

636  : int
637  {
638  global $DIC;
639 
640  $ilDB = $DIC->database();
641 
642  $q = "SELECT count(*) as cnt FROM content_object " .
643  " WHERE stylesheet = " . $ilDB->quote($a_style_id, "integer");
644  $cset = $ilDB->query($q);
645  $crow = $ilDB->fetchAssoc($cset);
646 
647  return (int) ($crow["cnt"] ?? 0);
648  }
global $DIC
Definition: feed.php:28
$q
Definition: shib_logout.php:21
+ Here is the caller graph for this function:

◆ _lookup()

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

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

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

554  : string {
555  global $DIC;
556 
557  $ilDB = $DIC->database();
558 
559  $q = "SELECT " . $a_field . " FROM content_object " .
560  " WHERE id = " . $ilDB->quote($a_obj_id, "integer");
561 
562  $res = $ilDB->query($q);
563  $rec = $ilDB->fetchAssoc($res);
564 
565  return $rec[$a_field];
566  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$q
Definition: shib_logout.php:21

◆ _lookupContObjIdByStyleId()

static ilObjContentObject::_lookupContObjIdByStyleId ( int  $a_style_id)
static

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

References $DIC, $ilDB, $q, $res, and ILIAS\Repository\int().

Referenced by ilObjStyleSheet\_getClonableContentStyles().

588  : array
589  {
590  global $DIC;
591 
592  $ilDB = $DIC->database();
593 
594  $q = "SELECT id FROM content_object " .
595  " WHERE stylesheet = " . $ilDB->quote($a_style_id, "integer");
596  $res = $ilDB->query($q);
597  $obj_ids = array();
598  while ($cont = $ilDB->fetchAssoc($res)) {
599  $obj_ids[] = (int) $cont["id"];
600  }
601  return $obj_ids;
602  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$q
Definition: shib_logout.php:21
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupDisableDefaultFeedback()

static ilObjContentObject::_lookupDisableDefaultFeedback ( int  $a_id)
static

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

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

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

604  : bool
605  {
606  global $DIC;
607 
608  $ilDB = $DIC->database();
609 
610  $q = "SELECT disable_def_feedback FROM content_object " .
611  " WHERE id = " . $ilDB->quote($a_id, "integer");
612  $res = $ilDB->query($q);
613  $rec = $ilDB->fetchAssoc($res);
614 
615  return (bool) ($rec["disable_def_feedback"] ?? false);
616  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$q
Definition: shib_logout.php:21
+ Here is the caller graph for this function:

◆ _lookupRestrictForwardNavigation()

static ilObjContentObject::_lookupRestrictForwardNavigation ( int  $a_obj_id)
static

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

Referenced by ilLMPageGUI\processAnswer().

570  : string {
571  return self::_lookup($a_obj_id, "restrict_forw_nav");
572  }
+ Here is the caller graph for this function:

◆ _lookupStoreTries()

static ilObjContentObject::_lookupStoreTries ( int  $a_id)
static

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

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

Referenced by ilLMPageGUI\__construct().

618  : bool
619  {
620  global $DIC;
621 
622  $ilDB = $DIC->database();
623 
624  $q = "SELECT store_tries FROM content_object " .
625  " WHERE id = " . $ilDB->quote($a_id, "integer");
626  $res = $ilDB->query($q);
627  $rec = $ilDB->fetchAssoc($res);
628 
629  return (bool) ($rec["store_tries"] ?? false);
630  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$q
Definition: shib_logout.php:21
+ Here is the caller graph for this function:

◆ _lookupStyleSheetId()

static ilObjContentObject::_lookupStyleSheetId ( int  $a_cont_obj_id)
static

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

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

Referenced by ilPCParagraphGUI\setStyle().

574  : int
575  {
576  global $DIC;
577 
578  $ilDB = $DIC->database();
579 
580  $q = "SELECT stylesheet FROM content_object " .
581  " WHERE id = " . $ilDB->quote($a_cont_obj_id, "integer");
582  $res = $ilDB->query($q);
583  $sheet = $ilDB->fetchAssoc($res);
584 
585  return (int) $sheet["stylesheet"];
586  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$q
Definition: shib_logout.php:21
+ Here is the caller graph for this function:

◆ _moveLMStyles()

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

move learning modules from one style to another

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

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

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

521  : void {
522  global $DIC;
523 
524  $ilDB = $DIC->database();
525 
526  if ($a_from_style < 0) { // change / delete all individual styles
527  $q = "SELECT stylesheet FROM content_object, style_data " .
528  " WHERE content_object.stylesheet = style_data.id " .
529  " AND style_data.standard = " . $ilDB->quote(0, "integer") .
530  " AND content_object.stylesheet > " . $ilDB->quote(0, "integer");
531  $style_set = $ilDB->query($q);
532  while ($style_rec = $ilDB->fetchAssoc($style_set)) {
533  // assign learning modules to new style
534  $q = "UPDATE content_object SET " .
535  " stylesheet = " . $ilDB->quote($a_to_style, "integer") .
536  " WHERE stylesheet = " . $ilDB->quote($style_rec["stylesheet"], "integer");
537  $ilDB->manipulate($q);
538 
539  // delete style
540  $style_obj = ilObjectFactory::getInstanceByObjId($style_rec["stylesheet"]);
541  $style_obj->delete();
542  }
543  } else {
544  $q = "UPDATE content_object SET " .
545  " stylesheet = " . $ilDB->quote($a_to_style, "integer") .
546  " WHERE stylesheet = " . $ilDB->quote($a_from_style, "integer");
547  $ilDB->manipulate($q);
548  }
549  }
global $DIC
Definition: feed.php:28
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
$q
Definition: shib_logout.php:21
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ autoLinkGlossaryTerms()

ilObjContentObject::autoLinkGlossaryTerms ( int  $a_glo_ref_id)

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

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

2092  : void {
2093  // get terms
2094  $terms = ilGlossaryTerm::getTermList([$a_glo_ref_id]);
2095 
2096  // each get page: get content
2097  $pages = ilLMPage::getAllPages($this->getType(), $this->getId());
2098 
2099  // determine terms that occur in the page
2100  $found_pages = array();
2101  foreach ($pages as $p) {
2102  $pg = new ilLMPage($p["id"]);
2103  $c = $pg->getXMLContent();
2104  foreach ($terms as $t) {
2105  if (is_int(stripos($c, $t["term"]))) {
2106  $found_pages[$p["id"]]["terms"][] = $t;
2107  if (!is_object($found_pages[$p["id"]]["page"] ?? null)) {
2108  $found_pages[$p["id"]]["page"] = $pg;
2109  }
2110  }
2111  }
2112  reset($terms);
2113  }
2114 
2115  // ilPCParagraph autoLinkGlossariesPage with page and terms
2116  foreach ($found_pages as $id => $fp) {
2117  ilPCParagraph::autoLinkGlossariesPage($fp["page"], $fp["terms"]);
2118  }
2119  }
static autoLinkGlossariesPage(ilPageObject $a_page, array $a_terms)
Auto link glossary of whole page.
static getTermList(array $a_glo_ref_id, string $searchterm="", string $a_first_letter="", string $a_def="", int $a_tax_node=0, bool $a_add_amet_fields=false, array $a_amet_filter=null, bool $a_include_references=false)
Get all terms for given set of glossary ids.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAllPages(string $a_parent_type, int $a_parent_id, string $a_lang="-")
Get all pages for parent object.
+ Here is the call graph for this function:

◆ checkStructure()

ilObjContentObject::checkStructure ( )

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

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

References ilObject\$db, $ilDB, $q, ilObject\$tree, ilPageObject\_exists(), ilObject\getId(), getLMTree(), ilTree\getNodeData(), ilTree\getRootId(), ilTree\getSubTree(), and ilTree\isInTree().

1274  : array
1275  {
1276  $issues = [];
1277  $ilDB = $this->db;
1278 
1279  $tree = $this->getLMTree();
1280 
1281  // check numbering, if errors, renumber
1282  // it is very important to keep this step before deleting subtrees
1283  // in the following steps
1284  $set = $ilDB->query(
1285  "SELECT l1.child, l1.lft l1lft, l1.rgt l1rgt, l2.parent, l2.lft l2lft, l2.rgt l2rgt" .
1286  " FROM lm_tree l1" .
1287  " JOIN lm_tree l2 ON ( l1.child = l2.parent" .
1288  " AND l1.lm_id = l2.lm_id )" .
1289  " JOIN lm_data ON ( l1.child = lm_data.obj_id )" .
1290  " WHERE (l2.lft < l1.lft" .
1291  " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)" .
1292  " AND l1.lm_id = " . $ilDB->quote($this->getId(), "integer") .
1293  " ORDER BY lm_data.create_date DESC"
1294  );
1295  while ($rec = $ilDB->fetchAssoc($set)) {
1296  $issues[] = "Tree numbering: " . print_r($rec, true);
1297  }
1298 
1299  // delete subtrees that have no lm_data records (changed due to #20637)
1300  $set = $ilDB->query("SELECT * FROM lm_tree WHERE lm_tree.lm_id = " . $ilDB->quote($this->getId(), "integer"));
1301  while ($node = $ilDB->fetchAssoc($set)) {
1302  $q = "SELECT * FROM lm_data WHERE obj_id = " .
1303  $ilDB->quote($node["child"], "integer");
1304  $obj_set = $ilDB->query($q);
1305  $obj_rec = $ilDB->fetchAssoc($obj_set);
1306  if (!$obj_rec) {
1307  $issues[] = "Tree entry without data entry: " . print_r($node, true);
1308  }
1309  }
1310 
1311  // delete subtrees that have pages as parent
1312  $nodes = $tree->getSubTree($tree->getNodeData($tree->getRootId()));
1313  foreach ($nodes as $node) {
1314  $q = "SELECT * FROM lm_data WHERE obj_id = " .
1315  $ilDB->quote($node["parent"], "integer");
1316  $obj_set = $ilDB->query($q);
1317  $obj_rec = $ilDB->fetchAssoc($obj_set);
1318  if (($obj_rec["type"] ?? "") == "pg") {
1319  $node_data = $tree->getNodeData($node["child"]);
1320  if ($tree->isInTree($node["child"])) {
1321  $issues[] = "Subtree with page parent: " . print_r($node_data, true);
1322  }
1323  }
1324  }
1325 
1326  // check for multi-references pages or chapters
1327  // if errors -> create copies of them here
1328  $set = $ilDB->query("SELECT DISTINCT l1.lm_id" .
1329  " FROM lm_tree l1" .
1330  " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1331  " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1332  " WHERE l1.child <> 1" .
1333  " AND l1.lm_id <> lm_data.lm_id" .
1334  " AND l1.lm_id = " . $ilDB->quote($this->getId(), "integer"));
1335  if ($rec = $ilDB->fetchAssoc($set)) {
1336  $set = $ilDB->query("SELECT DISTINCT l1.child " .
1337  " FROM lm_tree l1" .
1338  " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1339  " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1340  " WHERE l1.child <> 1" .
1341  " AND l1.lm_id <> lm_data.lm_id" .
1342  " AND l1.lm_id = " . $ilDB->quote($this->getId(), "integer"));
1343  while ($rec = $ilDB->fetchAssoc($set)) {
1344  $set3 = $ilDB->queryF(
1345  "SELECT * FROM lm_tree " .
1346  " WHERE child = %s ",
1347  array("integer"),
1348  array($rec["child"])
1349  );
1350  while ($rec3 = $ilDB->fetchAssoc($set3)) {
1351  $issues[] = "Multi-reference item: " . print_r($rec3, true);
1352  }
1353  }
1354  }
1355 
1356  // missing copage entries
1357  $set = $ilDB->queryF(
1358  "SELECT * FROM lm_data " .
1359  " WHERE lm_id = %s AND type = %s",
1360  array("integer", "text"),
1361  array($this->getId(), "pg")
1362  );
1363  while ($rec = $ilDB->fetchAssoc($set)) {
1364  if (!ilPageObject::_exists("lm", $rec["obj_id"], "-")) {
1365  $issues[] = "Missing COPage: " . print_r($rec, true);
1366  }
1367  }
1368 
1369 
1370  return $issues;
1371  }
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
ilTree $tree
isInTree(?int $a_node_id)
get all information of a node.
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
ilDBInterface $db
$q
Definition: shib_logout.php:21
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
+ Here is the call graph for this function:

◆ checkTree()

ilObjContentObject::checkTree ( )
Exceptions
ilInvalidTreeStructureException

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

References ilObject\$tree, ilTree\checkTree(), ilTree\checkTreeChilds(), and ilObject\getId().

Referenced by copyAllPagesAndChapters(), and executeDragDrop().

1138  : void
1139  {
1140  $tree = new ilLMTree($this->getId());
1141  $tree->checkTree();
1143  }
checkTreeChilds(bool $a_no_zero_child=true)
check, if all childs of tree nodes exist in object table
ilTree $tree
checkTree()
check consistence of tree all left & right values are checked if they are exists only once ...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanFrames()

ilObjContentObject::cleanFrames ( )

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

References $clean_frames.

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

845  : bool
846  {
847  return $this->clean_frames;
848  }
+ Here is the caller graph for this function:

◆ copyAllPagesAndChapters()

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

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

References ilCopyWizardOptions\_getInstance(), checkTree(), ilObject\getId(), ilLMPageObject\getPageList(), ilObject\getRefId(), ilTree\POS_LAST_NODE, and ilLMObject\updateInternalLinks().

Referenced by validatePages().

2023  : array {
2024  $parent_id = $a_target_obj->lm_tree->readRootId();
2025  $time = null;
2026 
2027  // get all chapters of root lm
2028  $chapters = $this->lm_tree->getChildsByType($this->lm_tree->readRootId(), "st");
2029  $copied_nodes = array();
2030  //$time = time();
2031  foreach ($chapters as $chap) {
2032  $cid = ilLMObject::pasteTree(
2033  $a_target_obj,
2034  $chap["child"],
2035  $parent_id,
2037  (string) $time,
2038  $copied_nodes,
2039  true,
2040  $this->lm
2041  );
2042  $target = $cid;
2043  }
2044 
2045  // copy free pages
2046  $pages = ilLMPageObject::getPageList($this->getId());
2047  foreach ($pages as $p) {
2048  if (!$this->lm_tree->isInTree($p["obj_id"])) {
2049  $item = new ilLMPageObject($this->lm, $p["obj_id"]);
2050  $target_item = $item->copy($a_target_obj);
2051  $copied_nodes[$item->getId()] = $target_item->getId();
2052  }
2053  }
2054 
2055  // Add mapping for pages and chapters
2056  $options = ilCopyWizardOptions::_getInstance($a_copy_id);
2057  foreach ($copied_nodes as $old_id => $new_id) {
2058  $options->appendMapping(
2059  $this->getRefId() . '_' . $old_id,
2060  $a_target_obj->getRefId() . '_' . $new_id
2061  );
2062  }
2063 
2064  ilLMObject::updateInternalLinks($copied_nodes);
2065 
2066  $a_target_obj->checkTree();
2067 
2068  return $copied_nodes;
2069  }
static updateInternalLinks(array $a_copied_nodes, string $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const POS_LAST_NODE
static getPageList(int $lm_id)
static _getInstance(int $a_copy_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilObjContentObject::create ( bool  $a_no_meta_data = false)

create content object

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

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

105  : int {
106  $id = parent::create();
107 
108  // meta data will be created by
109  // import parser
110  if (!$a_no_meta_data) {
111  $this->createMetaData();
112  }
113 
114  $this->createProperties();
115  $this->updateAutoGlossaries();
116  return $id;
117  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
createProperties()
create new properties record
+ Here is the call graph for this function:

◆ createExportDirectory()

ilObjContentObject::createExportDirectory ( string  $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 377 of file class.ilObjContentObject.php.

References ilObject\$error, $ilErr, ilFileUtils\getDataDir(), ilObject\getId(), ilFileUtils\makeDir(), and ilFileUtils\makeDirParents().

379  : void {
381 
382  $lm_data_dir = ilFileUtils::getDataDir() . "/lm_data";
383  // create learning module directory (data_dir/lm_data/lm_<id>)
384  $lm_dir = $lm_data_dir . "/lm_" . $this->getId();
386  if (!is_dir($lm_dir)) {
387  $ilErr->raiseError("Creation of Learning Module Directory failed.", $ilErr->FATAL);
388  }
389  // create Export subdirectory (data_dir/lm_data/lm_<id>/Export)
390  switch ($a_type) {
391  default: // = xml
392  if (substr($a_type, 0, 4) == "html") {
393  $export_dir = $lm_dir . "/export_" . $a_type;
394  } else {
395  $export_dir = $lm_dir . "/export";
396  }
397  break;
398  }
399  ilFileUtils::makeDir($export_dir);
400 
401  if (!is_dir($export_dir)) {
402  $ilErr->raiseError("Creation of Export Directory failed.", $ilErr->FATAL);
403  }
404  }
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
$ilErr
Definition: raiseError.php:17
static getDataDir()
get data directory (outside webspace)
ilErrorHandling $error
static makeDir(string $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:

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

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

321  : void
322  {
324 
325  $lm_data_dir = ilFileUtils::getDataDir() . "/lm_data";
326  if (!is_writable($lm_data_dir)) {
327  $ilErr->raiseError("Content object Data Directory (" . $lm_data_dir
328  . ") not writeable.", $ilErr->FATAL);
329  }
330 
331  // create learning module directory (data_dir/lm_data/lm_<id>)
332  $lm_dir = $lm_data_dir . "/lm_" . $this->getId();
333  ilFileUtils::makeDir($lm_dir);
334  if (!is_dir($lm_dir)) {
335  $ilErr->raiseError("Creation of Learning Module Directory failed.", $ilErr->FATAL);
336  }
337 
338  // create import subdirectory (data_dir/lm_data/lm_<id>/import)
339  $import_dir = $lm_dir . "/import";
341  if (!is_dir($import_dir)) {
342  $ilErr->raiseError("Creation of Import Directory failed.", $ilErr->FATAL);
343  }
344  }
$ilErr
Definition: raiseError.php:17
static getDataDir()
get data directory (outside webspace)
ilErrorHandling $error
static makeDir(string $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:

◆ createLMTree()

ilObjContentObject::createLMTree ( )

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

References ilObject\getId().

235  : void
236  {
237  $this->lm_tree = new ilLMTree($this->getId(), false);
238  $this->lm_tree->addTree($this->getId(), 1);
239  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ createProperties()

ilObjContentObject::createProperties ( )

create new properties record

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

References ilObject\$db, $ilDB, ilObject\getId(), ilDBInterface\insert(), ilLMObject\PAGE_TITLE, and readProperties().

Referenced by create().

970  : void
971  {
972  $ilDB = $this->db;
973 
974  $this->db->insert("content_object", [
975  "id" => ["integer", $this->getId()],
976  "page_header" => ["text", ilLMObject::PAGE_TITLE]
977  ]);
978 
979  // #14661
980  $this->notes->domain()->activateComments($this->getId());
981 
982  $this->readProperties(); // to get db default values
983  }
insert(string $table_name, array $values)
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doMDUpdateListener()

ilObjContentObject::doMDUpdateListener ( string  $a_element)
protected

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

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

2166  : void {
2167  switch ($a_element) {
2168  case 'Educational':
2169  $obj_lp = ilObjectLP::getInstance($this->getId());
2170  if (in_array(
2171  $obj_lp->getCurrentMode(),
2173  )) {
2175  }
2176  break;
2177 
2178  case 'General':
2179 
2180  // Update Title and description
2181  $md = new ilMD($this->getId(), 0, $this->getType());
2182  if (!is_object($md_gen = $md->getGeneral())) {
2183  return;
2184  }
2185 
2186  $ot = ilObjectTranslation::getInstance($this->getId());
2187  if ($ot->getContentActivated()) {
2188  $ot->setDefaultTitle($md_gen->getTitle());
2189 
2190  foreach ($md_gen->getDescriptionIds() as $id) {
2191  $md_des = $md_gen->getDescription($id);
2192  $ot->setDefaultDescription($md_des->getDescription());
2193  break;
2194  }
2195  $ot->save();
2196  }
2197  break;
2198  }
2199  }
static getInstance(int $obj_id)
static _refreshStatus(int $a_obj_id, ?array $a_users=null)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static getInstance(int $obj_id)
+ Here is the call graph for this function:

◆ executeDragDrop()

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

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

References ilHistory\_createEntry(), ilLMObject\_lookupTitle(), checkTree(), ilObject\getId(), ilLMObjectFactory\getInstance(), ilObject\getType(), and ilTree\POS_FIRST_NODE.

1738  : void {
1739  if ($source_id === $target_id) {
1740  return;
1741  }
1742  $lmtree = new ilTree($this->getId());
1743  $lmtree->setTableNames('lm_tree', 'lm_data');
1744  $lmtree->setTreeTablePK("lm_id");
1745  //echo "-".$source_id."-".$target_id."-".$first_child."-".$as_subitem."-";
1746  $source_obj = ilLMObjectFactory::getInstance($this->lm, $source_id, true);
1747  $source_obj->setLMId($this->getId());
1748 
1749  if (!$first_child) {
1750  $target_obj = ilLMObjectFactory::getInstance($this->lm, $target_id, true);
1751  $target_obj->setLMId($this->getId());
1752  $target_parent = $lmtree->getParentId($target_id);
1753  }
1754 
1755  // handle pages
1756  if ($source_obj->getType() == "pg") {
1757  //echo "1";
1758  if ($lmtree->isInTree($source_obj->getId())) {
1759  $node_data = $lmtree->getNodeData($source_obj->getId());
1760 
1761  // cut on move
1762  if ($movecopy == "move") {
1763  $parent_id = $lmtree->getParentId($source_obj->getId());
1764  $lmtree->deleteTree($node_data);
1765 
1766  // write history entry
1768  $source_obj->getId(),
1769  "cut",
1770  array(ilLMObject::_lookupTitle($parent_id), $parent_id),
1771  $this->getType() . ":pg"
1772  );
1774  $parent_id,
1775  "cut_page",
1776  array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
1777  $this->getType() . ":st"
1778  );
1779  } else {
1780  // copy page
1781  $new_page = $source_obj->copy($this->lm);
1782  $source_id = $new_page->getId();
1783  $source_obj = $new_page;
1784  }
1785 
1786  // paste page
1787  if (!$lmtree->isInTree($source_obj->getId())) {
1788  if ($first_child) { // as first child
1789  $target_pos = ilTree::POS_FIRST_NODE;
1790  $parent = $target_id;
1791  } elseif ($as_subitem) { // as last child
1792  $parent = $target_id;
1793  $target_pos = ilTree::POS_FIRST_NODE;
1794  $pg_childs = $lmtree->getChildsByType($parent, "pg");
1795  if (count($pg_childs) != 0) {
1796  $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
1797  }
1798  } else { // at position
1799  $target_pos = $target_id;
1800  $parent = $target_parent;
1801  }
1802 
1803  // insert page into tree
1804  $lmtree->insertNode(
1805  $source_obj->getId(),
1806  $parent,
1807  $target_pos
1808  );
1809 
1810  // write history entry
1811  if ($movecopy == "move") {
1812  // write history comments
1814  $source_obj->getId(),
1815  "paste",
1816  array(ilLMObject::_lookupTitle($parent), $parent),
1817  $this->getType() . ":pg"
1818  );
1820  $parent,
1821  "paste_page",
1822  array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
1823  $this->getType() . ":st"
1824  );
1825  }
1826  }
1827  }
1828  }
1829 
1830  // handle chapters
1831  if ($source_obj->getType() == "st") {
1832  //echo "2";
1833  $source_node = $lmtree->getNodeData($source_id);
1834  $subnodes = $lmtree->getSubTree($source_node);
1835 
1836  // check, if target is within subtree
1837  foreach ($subnodes as $subnode) {
1838  if ($subnode["obj_id"] == $target_id) {
1839  return;
1840  }
1841  }
1842 
1843  $target_pos = $target_id;
1844 
1845  if ($first_child) { // as first subchapter
1846  $target_pos = ilTree::POS_FIRST_NODE;
1847  $target_parent = $target_id;
1848 
1849  $pg_childs = $lmtree->getChildsByType($target_parent, "pg");
1850  if (count($pg_childs) != 0) {
1851  $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
1852  }
1853  } elseif ($as_subitem) { // as last subchapter
1854  $target_parent = $target_id;
1855  $target_pos = ilTree::POS_FIRST_NODE;
1856  $childs = $lmtree->getChilds($target_parent);
1857  if (count($childs) != 0) {
1858  $target_pos = $childs[count($childs) - 1]["obj_id"];
1859  }
1860  }
1861 
1862  // delete source tree
1863  if ($movecopy == "move") {
1864  $lmtree->deleteTree($source_node);
1865  } else {
1866  // copy chapter (incl. subcontents)
1867  throw new ilException("ilObjContentObject: Not implemented");
1868  //$new_chapter = $source_obj->copy($lmtree, $target_parent, $target_pos);
1869  }
1870 
1871  if (!$lmtree->isInTree($source_id)) {
1872  $lmtree->insertNode($source_id, $target_parent, $target_pos);
1873 
1874  // insert moved tree
1875  foreach ($subnodes as $node) {
1876  if ($node["obj_id"] != $source_id) {
1877  $lmtree->insertNode($node["obj_id"], $node["parent"]);
1878  }
1879  }
1880  }
1881 
1882  // check the tree
1883  $this->checkTree();
1884  }
1885 
1886  $this->checkTree();
1887  }
static _createEntry(int $a_obj_id, string $a_action, array $a_info_params=[], string $a_obj_type="", string $a_user_comment="", bool $a_update_last=false)
Creates a new history entry for an object.
static getInstance(ilObjLearningModule $a_content_obj, int $a_id=0, bool $a_halt=true)
static _lookupTitle(int $a_obj_id)
const POS_FIRST_NODE
+ Here is the call graph for this function:

◆ exportFileItems()

ilObjContentObject::exportFileItems ( string  $a_target_dir,
ilLog  $expLog 
)

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

References ilLog\write().

Referenced by exportXML().

1529  : void {
1530  foreach ($this->file_ids as $file_id) {
1531  $expLog->write(date("[y-m-d H:i:s] ") . "File Item " . $file_id);
1532  $file_obj = new ilObjFile($file_id, false);
1533  $file_obj->export($a_target_dir);
1534  unset($file_obj);
1535  }
1536  }
Class ilObjFile.
write(string $a_msg, $a_log_level=null)
logging
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXML()

ilObjContentObject::exportXML ( ilXmlWriter  $a_xml_writer,
int  $a_inst,
string  $a_target_dir,
ilLog  $expLog 
)

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

References exportFileItems(), exportXMLMediaObjects(), exportXMLMetaData(), exportXMLPageObjects(), exportXMLProperties(), exportXMLStructureObjects(), ilObject\getType(), ilLog\write(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

1378  : void {
1379  $attrs = array();
1380  switch ($this->getType()) {
1381  case "lm":
1382  $attrs["Type"] = "LearningModule";
1383  break;
1384  }
1385  $a_xml_writer->xmlStartTag("ContentObject", $attrs);
1386 
1387  // MetaData
1388  $this->exportXMLMetaData($a_xml_writer);
1389 
1390  // StructureObjects
1391  //echo "ContObj:".$a_inst.":<br>";
1392  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Structure Objects");
1393  $this->exportXMLStructureObjects($a_xml_writer, $a_inst, $expLog);
1394  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Structure Objects");
1395 
1396  // PageObjects
1397  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Page Objects");
1398  $this->exportXMLPageObjects($a_xml_writer, $a_inst, $expLog);
1399  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Page Objects");
1400 
1401  // MediaObjects
1402  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Media Objects");
1403  $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
1404  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Media Objects");
1405 
1406  // FileItems
1407  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export File Items");
1408  $this->exportFileItems($a_target_dir, $expLog);
1409  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export File Items");
1410 
1411  // Questions
1412  if (count($this->q_ids) > 0) {
1413  $qti_file = fopen($a_target_dir . "/qti.xml", "w");
1414  $pool = new ilObjQuestionPool();
1415  fwrite($qti_file, $pool->questionsToXML($this->q_ids));
1416  fclose($qti_file);
1417  }
1418 
1419  // To do: implement version selection/detection
1420  // Properties
1421  $expLog->write(date("[y-m-d H:i:s] ") . "Start Export Properties");
1422  $this->exportXMLProperties($a_xml_writer, $expLog);
1423  $expLog->write(date("[y-m-d H:i:s] ") . "Finished Export Properties");
1424 
1425  $a_xml_writer->xmlEndTag("ContentObject");
1426  }
exportXMLMediaObjects(ilXmlWriter $a_xml_writer, int $a_inst, string $a_target_dir, ilLog $expLog)
exportXMLMetaData(ilXmlWriter $a_xml_writer)
xmlEndTag(string $tag)
Writes an endtag.
exportFileItems(string $a_target_dir, ilLog $expLog)
exportXMLStructureObjects(ilXmlWriter $a_xml_writer, int $a_inst, ilLog $expLog)
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
write(string $a_msg, $a_log_level=null)
logging
exportXMLProperties(ilXmlWriter $a_xml_writer, ilLog $expLog)
exportXMLPageObjects(ilXmlWriter $a_xml_writer, int $a_inst, ilLog $expLog)
+ Here is the call graph for this function:

◆ exportXMLMediaObjects()

ilObjContentObject::exportXMLMediaObjects ( ilXmlWriter  $a_xml_writer,
int  $a_inst,
string  $a_target_dir,
ilLog  $expLog 
)

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

References ilObject\_lookupType(), and ilLog\write().

Referenced by exportXML().

1496  : void {
1497  $linked_mobs = array();
1498 
1499  // mobs directly embedded into pages
1500  foreach ($this->mob_ids as $mob_id) {
1501  if ($mob_id > 0 && ilObject::_lookupType($mob_id) == "mob") {
1502  $expLog->write(date("[y-m-d H:i:s] ") . "Media Object " . $mob_id);
1503  $media_obj = new ilObjMediaObject($mob_id);
1504  $media_obj->exportXML($a_xml_writer, $a_inst);
1505  $media_obj->exportFiles($a_target_dir);
1506 
1507  $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
1508  $linked_mobs = array_merge($linked_mobs, $lmobs);
1509 
1510  unset($media_obj);
1511  }
1512  }
1513 
1514  // linked mobs (in map areas)
1515  foreach ($linked_mobs as $mob_id) {
1516  if ($mob_id > 0) {
1517  $expLog->write(date("[y-m-d H:i:s] ") . "Media Object " . $mob_id);
1518  $media_obj = new ilObjMediaObject($mob_id);
1519  $media_obj->exportXML($a_xml_writer, $a_inst);
1520  $media_obj->exportFiles($a_target_dir);
1521  unset($media_obj);
1522  }
1523  }
1524  }
write(string $a_msg, $a_log_level=null)
logging
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLMetaData()

ilObjContentObject::exportXMLMetaData ( ilXmlWriter  $a_xml_writer)

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

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

Referenced by exportXML().

1430  : void {
1431  $md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
1432  $md2xml->setExportMode(true);
1433  $md2xml->startExport();
1434  $a_xml_writer->appendXML($md2xml->getXML());
1435  }
appendXML(string $a_str)
append xml string to document
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLPageObjects()

ilObjContentObject::exportXMLPageObjects ( ilXmlWriter  $a_xml_writer,
int  $a_inst,
ilLog  $expLog 
)

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

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

Referenced by exportXML().

1458  : void {
1459  $pages = ilLMPageObject::getPageList($this->getId());
1460  foreach ($pages as $page) {
1461  if (ilLMPage::_exists($this->getType(), $page["obj_id"])) {
1462  $expLog->write(date("[y-m-d H:i:s] ") . "Page Object " . $page["obj_id"]);
1463 
1464  // export xml to writer object
1465  $page_obj = new ilLMPageObject($this->lm, $page["obj_id"]);
1466  $page_obj->exportXML($a_xml_writer, "normal", $a_inst);
1467 
1468  // collect media objects
1469  $mob_ids = $page_obj->getMediaObjectIds();
1470  foreach ($mob_ids as $mob_id) {
1471  $this->mob_ids[$mob_id] = $mob_id;
1472  }
1473 
1474  // collect all file items
1475  $file_ids = $page_obj->getFileItemIds();
1476  foreach ($file_ids as $file_id) {
1477  $this->file_ids[$file_id] = $file_id;
1478  }
1479 
1480  // collect all questions
1481  $q_ids = $page_obj->getQuestionIds();
1482  foreach ($q_ids as $q_id) {
1483  $this->q_ids[$q_id] = $q_id;
1484  }
1485 
1486  unset($page_obj);
1487  }
1488  }
1489  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
static getPageList(int $lm_id)
write(string $a_msg, $a_log_level=null)
logging
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLProperties()

ilObjContentObject::exportXMLProperties ( ilXmlWriter  $a_xml_writer,
ilLog  $expLog 
)

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

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

Referenced by exportXML().

1541  : void {
1542  $attrs = array();
1543  $a_xml_writer->xmlStartTag("Properties", $attrs);
1544 
1545  // Layout
1546  $attrs = array("Name" => "Layout", "Value" => $this->getLayout());
1547  $a_xml_writer->xmlElement("Property", $attrs);
1548 
1549  // Page Header
1550  $attrs = array("Name" => "PageHeader", "Value" => $this->getPageHeader());
1551  $a_xml_writer->xmlElement("Property", $attrs);
1552 
1553  // TOC Mode
1554  $attrs = array("Name" => "TOCMode", "Value" => $this->getTOCMode());
1555  $a_xml_writer->xmlElement("Property", $attrs);
1556 
1557  // LM Menu Activation
1558  $attrs = array("Name" => "ActiveLMMenu", "Value" =>
1559  ilUtil::tf2yn($this->isActiveLMMenu()));
1560  $a_xml_writer->xmlElement("Property", $attrs);
1561 
1562  // Numbering Activation
1563  $attrs = array("Name" => "ActiveNumbering", "Value" =>
1564  ilUtil::tf2yn($this->isActiveNumbering()));
1565  $a_xml_writer->xmlElement("Property", $attrs);
1566 
1567  // Table of contents button activation
1568  $attrs = array("Name" => "ActiveTOC", "Value" =>
1569  ilUtil::tf2yn($this->isActiveTOC()));
1570  $a_xml_writer->xmlElement("Property", $attrs);
1571 
1572  // Print view button activation
1573  $attrs = array("Name" => "ActivePrintView", "Value" =>
1574  ilUtil::tf2yn($this->isActivePrintView()));
1575  $a_xml_writer->xmlElement("Property", $attrs);
1576 
1577  // Note that download button is not saved, because
1578  // download files do not exist after import
1579 
1580  // Clean frames
1581  $attrs = array("Name" => "CleanFrames", "Value" =>
1582  ilUtil::tf2yn($this->cleanFrames()));
1583  $a_xml_writer->xmlElement("Property", $attrs);
1584 
1585  // Public notes activation
1586  $attrs = array("Name" => "PublicNotes", "Value" =>
1587  ilUtil::tf2yn($this->publicNotes()));
1588  $a_xml_writer->xmlElement("Property", $attrs);
1589 
1590  // History comments for authors activation
1591  $attrs = array("Name" => "HistoryUserComments", "Value" =>
1593  $a_xml_writer->xmlElement("Property", $attrs);
1594 
1595  // Rating
1596  $attrs = array("Name" => "Rating", "Value" =>
1597  ilUtil::tf2yn($this->hasRating()));
1598  $a_xml_writer->xmlElement("Property", $attrs);
1599  $attrs = array("Name" => "RatingPages", "Value" =>
1600  ilUtil::tf2yn($this->hasRatingPages()));
1601  $a_xml_writer->xmlElement("Property", $attrs);
1602 
1603  // Header Page
1604  if ($this->getHeaderPage() > 0) {
1605  $attrs = array("Name" => "HeaderPage", "Value" =>
1606  "il_" . IL_INST_ID . "_pg_" . $this->getHeaderPage());
1607  $a_xml_writer->xmlElement("Property", $attrs);
1608  }
1609 
1610  // Footer Page
1611  if ($this->getFooterPage() > 0) {
1612  $attrs = array("Name" => "FooterPage", "Value" =>
1613  "il_" . IL_INST_ID . "_pg_" . $this->getFooterPage());
1614  $a_xml_writer->xmlElement("Property", $attrs);
1615  }
1616 
1617  // layout per page
1618  $attrs = array("Name" => "LayoutPerPage", "Value" =>
1619  $this->getLayoutPerPage());
1620  $a_xml_writer->xmlElement("Property", $attrs);
1621 
1622  // progress icons
1623  $attrs = array("Name" => "ProgressIcons", "Value" =>
1624  $this->getProgressIcons());
1625  $a_xml_writer->xmlElement("Property", $attrs);
1626 
1627  // store tries
1628  $attrs = array("Name" => "StoreTries", "Value" =>
1629  $this->getStoreTries());
1630  $a_xml_writer->xmlElement("Property", $attrs);
1631 
1632  // restrict forward navigation
1633  $attrs = array("Name" => "RestrictForwardNavigation", "Value" =>
1634  $this->getRestrictForwardNavigation());
1635  $a_xml_writer->xmlElement("Property", $attrs);
1636 
1637  // disable default feedback
1638  $attrs = array("Name" => "DisableDefaultFeedback", "Value" =>
1639  $this->getDisableDefaultFeedback());
1640  $a_xml_writer->xmlElement("Property", $attrs);
1641 
1642  $a_xml_writer->xmlEndTag("Properties");
1643  }
const IL_INST_ID
Definition: constants.php:40
static tf2yn(bool $a_tf)
xmlEndTag(string $tag)
Writes an endtag.
getPageHeader()
get page header mode (ilLMOBject::CHAPTER_TITLE | ilLMOBject::PAGE_TITLE | ilLMOBject::NO_HEADER) ...
getTOCMode()
get toc mode ("chapters" | "pages")
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLStructureObjects()

ilObjContentObject::exportXMLStructureObjects ( ilXmlWriter  $a_xml_writer,
int  $a_inst,
ilLog  $expLog 
)

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

Referenced by exportXML().

1441  : void {
1442  $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
1443  foreach ($childs as $child) {
1444  if ($child["type"] != "st") {
1445  continue;
1446  }
1447 
1448  $structure_obj = new ilStructureObject($this->lm, $child["obj_id"]);
1449  $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
1450  unset($structure_obj);
1451  }
1452  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ fixTree()

ilObjContentObject::fixTree ( )

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

References ilObject\$db, $ilDB, $q, ilObject\$tree, ilPageObject\_exists(), ilTree\deleteTree(), ilObject\getId(), ilLMObjectFactory\getInstance(), getLMTree(), ilTree\getNodeData(), ilTree\getRootId(), ilTree\getSubTree(), ilTree\isInTree(), and ilTree\renumber().

1145  : void
1146  {
1147  $ilDB = $this->db;
1148 
1149  $tree = $this->getLMTree();
1150 
1151  // check numbering, if errors, renumber
1152  // it is very important to keep this step before deleting subtrees
1153  // in the following steps
1154  $set = $ilDB->query(
1155  "SELECT DISTINCT l1.lm_id" .
1156  " FROM lm_tree l1" .
1157  " JOIN lm_tree l2 ON ( l1.child = l2.parent" .
1158  " AND l1.lm_id = l2.lm_id )" .
1159  " JOIN lm_data ON ( l1.child = lm_data.obj_id )" .
1160  " WHERE (l2.lft < l1.lft" .
1161  " OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)" .
1162  " AND l1.lm_id = " . $ilDB->quote($this->getId(), "integer") .
1163  " ORDER BY lm_data.create_date DESC"
1164  );
1165  if ($rec = $ilDB->fetchAssoc($set)) {
1166  $tree->renumber();
1167  }
1168 
1169  // delete subtrees that have no lm_data records (changed due to #20637)
1170  $set = $ilDB->query("SELECT * FROM lm_tree WHERE lm_tree.lm_id = " . $ilDB->quote($this->getId(), "integer"));
1171  while ($node = $ilDB->fetchAssoc($set)) {
1172  $q = "SELECT * FROM lm_data WHERE obj_id = " .
1173  $ilDB->quote($node["child"], "integer");
1174  $obj_set = $ilDB->query($q);
1175  $obj_rec = $ilDB->fetchAssoc($obj_set);
1176  if (!$obj_rec) {
1177  $node_data = $tree->getNodeData($node["child"]);
1178  $node_data["child"] = $node["child"];
1179  $tree->deleteTree($node_data);
1180  }
1181  }
1182 
1183  // delete subtrees that have pages as parent
1184  $nodes = $tree->getSubTree($tree->getNodeData($tree->getRootId()));
1185  foreach ($nodes as $node) {
1186  $q = "SELECT * FROM lm_data WHERE obj_id = " .
1187  $ilDB->quote($node["parent"], "integer");
1188  $obj_set = $ilDB->query($q);
1189  $obj_rec = $ilDB->fetchAssoc($obj_set);
1190  if (($obj_rec["type"] ?? "") == "pg") {
1191  $node_data = $tree->getNodeData($node["child"]);
1192  if ($tree->isInTree($node["child"])) {
1193  $tree->deleteTree($node_data);
1194  }
1195  }
1196  }
1197 
1198  // check for multi-references pages or chapters
1199  // if errors -> create copies of them here
1200  $set = $ilDB->query("SELECT DISTINCT l1.lm_id" .
1201  " FROM lm_tree l1" .
1202  " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1203  " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1204  " WHERE l1.child <> 1" .
1205  " AND l1.lm_id <> lm_data.lm_id" .
1206  " AND l1.lm_id = " . $ilDB->quote($this->getId(), "integer"));
1207  if ($rec = $ilDB->fetchAssoc($set)) {
1208  $set = $ilDB->query("SELECT DISTINCT l1.child " .
1209  " FROM lm_tree l1" .
1210  " JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )" .
1211  " JOIN lm_data ON (l1.child = lm_data.obj_id)" .
1212  " WHERE l1.child <> 1" .
1213  " AND l1.lm_id <> lm_data.lm_id" .
1214  " AND l1.lm_id = " . $ilDB->quote($this->getId(), "integer"));
1215  while ($rec = $ilDB->fetchAssoc($set)) {
1216  $cobj = ilLMObjectFactory::getInstance($this->lm, $rec["child"]);
1217 
1218  if (is_object($cobj)) {
1219  if ($cobj->getType() == "pg") {
1220  // make a copy of it
1221  $pg_copy = $cobj->copy($this->lm);
1222 
1223  // replace the child in the tree with the copy (id)
1224  $ilDB->manipulate(
1225  "UPDATE lm_tree SET " .
1226  " child = " . $ilDB->quote($pg_copy->getId(), "integer") .
1227  " WHERE child = " . $ilDB->quote($cobj->getId(), "integer") .
1228  " AND lm_id = " . $ilDB->quote($this->getId(), "integer")
1229  );
1230  } elseif ($cobj->getType() == "st") {
1231  // make a copy of it
1232  $st_copy = $cobj->copy($this->lm);
1233 
1234  // replace the child in the tree with the copy (id)
1235  $ilDB->manipulate(
1236  "UPDATE lm_tree SET " .
1237  " child = " . $ilDB->quote($st_copy->getId(), "integer") .
1238  " WHERE child = " . $ilDB->quote($cobj->getId(), "integer") .
1239  " AND lm_id = " . $ilDB->quote($this->getId(), "integer")
1240  );
1241 
1242  // make all childs refer to the copy now
1243  $ilDB->manipulate(
1244  "UPDATE lm_tree SET " .
1245  " parent = " . $ilDB->quote($st_copy->getId(), "integer") .
1246  " WHERE parent = " . $ilDB->quote($cobj->getId(), "integer") .
1247  " AND lm_id = " . $ilDB->quote($this->getId(), "integer")
1248  );
1249  }
1250  }
1251  }
1252  }
1253 
1254  // missing copage entries
1255  $set = $ilDB->queryF(
1256  "SELECT * FROM lm_data " .
1257  " WHERE lm_id = %s AND type = %s",
1258  array("integer", "text"),
1259  array($this->getId(), "pg")
1260  );
1261  while ($rec = $ilDB->fetchAssoc($set)) {
1262  if (!ilPageObject::_exists("lm", $rec["obj_id"], "-")) {
1263  $lm_page = new ilLMPage();
1264  $lm_page->setId($rec["obj_id"]);
1265  $lm_page->setParentId($this->getId());
1266  $lm_page->create(false);
1267  }
1268  }
1269  }
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
static getInstance(ilObjLearningModule $a_content_obj, int $a_id=0, bool $a_halt=true)
ilTree $tree
isInTree(?int $a_node_id)
get all information of a node.
deleteTree(array $a_node)
delete node and the whole subtree under this node
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
ilDBInterface $db
renumber(int $node_id=1, int $i=1)
Wrapper for renumber.
$q
Definition: shib_logout.php:21
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getAutoGlossaries()

ilObjContentObject::getAutoGlossaries ( )

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

References $auto_glossaries.

Referenced by ilLMGlossaryTableGUI\__construct(), removeAutoGlossary(), updateAutoGlossaries(), and validatePages().

255  : array
256  {
257  return $this->auto_glossaries;
258  }
+ Here is the caller graph for this function:

◆ getAvailableLayouts()

static ilObjContentObject::getAvailableLayouts ( )
static

get all available lm layouts

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

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

989  : array
990  {
991  $dir = opendir("./Modules/LearningModule/layouts/lm");
992 
993  $layouts = array();
994 
995  while ($file = readdir($dir)) {
996  if ($file != "." && $file != ".." && $file != "CVS" && $file != ".svn") {
997  // directories
998  if (is_dir("./Modules/LearningModule/layouts/lm/" . $file)) {
999  $layouts[$file] = $file;
1000  }
1001  }
1002  }
1003  asort($layouts);
1004 
1005  // workaround: fix ordering
1006  $ret = array(
1007  'toc2win' => 'toc2win',
1008  'toc2windyn' => 'toc2windyn',
1009  '1window' => '1window',
1010  '2window' => '2window',
1011  '3window' => '3window',
1012  'presentation' => 'presentation',
1013  'fullscreen' => 'fullscreen'
1014  );
1015 
1016  foreach ($layouts as $l) {
1017  if (!in_array($l, $ret)) {
1018  $ret[$l] = $l;
1019  }
1020  }
1021 
1022  return $ret;
1023  }
+ Here is the caller graph for this function:

◆ getDataDirectory()

ilObjContentObject::getDataDirectory ( )

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

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

Referenced by getExportDirectory().

346  : string
347  {
348  return ilFileUtils::getDataDir() . "/lm_data" .
349  "/lm_" . $this->getId();
350  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDisableDefaultFeedback()

ilObjContentObject::getDisableDefaultFeedback ( )

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

References $disable_def_feedback.

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

159  : bool
160  {
162  }
+ Here is the caller graph for this function:

◆ getExportDirectory()

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

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

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

Referenced by getExportFiles(), and getPublicExportFiles().

408  : string {
409  switch ($a_type) {
410  default: // = xml
411  if (substr($a_type, 0, 4) == "html") {
412  $export_dir = ilFileUtils::getDataDir() . "/lm_data" . "/lm_" . $this->getId() . "/export_" . $a_type;
413  } else {
414  $export_dir = ilFileUtils::getDataDir() . "/lm_data" . "/lm_" . $this->getId() . "/export";
415  }
416  break;
417  }
418  return $export_dir;
419  }
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 ( )

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

References ilObject\$type, and getExportDirectory().

1645  : array
1646  {
1647  $file = array();
1648 
1649  $types = array("xml", "html");
1650 
1651  foreach ($types as $type) {
1652  $dir = $this->getExportDirectory($type);
1653  // quit if import dir not available
1654  if (!is_dir($dir) or
1655  !is_writeable($dir)) {
1656  continue;
1657  }
1658 
1659  // open directory
1660  $cdir = dir($dir);
1661 
1662  // initialize array
1663 
1664  // get files and save the in the array
1665  while ($entry = $cdir->read()) {
1666  if ($entry != "." and
1667  $entry != ".." and
1668  substr($entry, -4) == ".zip" and
1669  preg_match("~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.zip\$~", $entry)) {
1670  $file[$entry . $type] = array("type" => $type, "file" => $entry,
1671  "size" => filesize($dir . "/" . $entry));
1672  }
1673  }
1674 
1675  // close import directory
1676  $cdir->close();
1677  }
1678 
1679  // sort files
1680  ksort($file);
1681  return $file;
1682  }
string $type
getExportDirectory(string $a_type="xml")
+ Here is the call graph for this function:

◆ getFooterPage()

ilObjContentObject::getFooterPage ( )

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

References $footer_page.

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

880  : int
881  {
882  return $this->footer_page;
883  }
+ Here is the caller graph for this function:

◆ getForTranslation()

ilObjContentObject::getForTranslation ( )

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

References $for_translation.

Referenced by updateProperties().

305  : bool
306  {
307  return $this->for_translation;
308  }
+ Here is the caller graph for this function:

◆ getHeaderPage()

ilObjContentObject::getHeaderPage ( )

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

References $header_page.

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

870  : int
871  {
872  return $this->header_page;
873  }
+ Here is the caller graph for this function:

◆ getHideHeaderFooterPrint()

ilObjContentObject::getHideHeaderFooterPrint ( )

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

References $hide_header_footer_print.

Referenced by updateProperties().

805  : bool
806  {
808  }
+ Here is the caller graph for this function:

◆ getImportDirectory()

ilObjContentObject::getImportDirectory ( )

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

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

352  : string
353  {
354  if (strlen($this->import_dir)) {
355  return $this->import_dir;
356  }
357 
358  $import_dir = ilFileUtils::getDataDir() . "/lm_data" .
359  "/lm_" . $this->getId() . "/import";
360  if (is_dir($import_dir)) {
361  return $import_dir;
362  }
363  return "";
364  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:

◆ getLayout()

ilObjContentObject::getLayout ( )

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

References $layout.

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

474  : string
475  {
476  return $this->layout;
477  }
+ Here is the caller graph for this function:

◆ getLayoutPerPage()

ilObjContentObject::getLayoutPerPage ( )

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

References $layout_per_page.

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

146  : bool
147  {
148  return $this->layout_per_page;
149  }
+ Here is the caller graph for this function:

◆ getLMTree()

ilObjContentObject::getLMTree ( )

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

References $lm_tree.

Referenced by checkStructure(), and fixTree().

310  : ilLMTree
311  {
312  return $this->lm_tree;
313  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getOfflineFiles()

ilObjContentObject::getOfflineFiles ( string  $dir)

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

1701  : array {
1702  // quit if offline dir not available
1703  if (!is_dir($dir) or
1704  !is_writeable($dir)) {
1705  return array();
1706  }
1707 
1708  // open directory
1709  $dir = dir($dir);
1710 
1711  // initialize array
1712  $file = array();
1713 
1714  // get files and save the in the array
1715  while ($entry = $dir->read()) {
1716  if ($entry != "." and
1717  $entry != ".." and
1718  substr($entry, -4) == ".pdf" and
1719  preg_match("~^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.pdf\$~", $entry)) {
1720  $file[] = $entry;
1721  }
1722  }
1723 
1724  // close import directory
1725  $dir->close();
1726 
1727  // sort files
1728  sort($file);
1729  return $file;
1730  }

◆ getPageHeader()

ilObjContentObject::getPageHeader ( )

get page header mode (ilLMOBject::CHAPTER_TITLE | ilLMOBject::PAGE_TITLE | ilLMOBject::NO_HEADER)

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

References $pg_header.

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

707  : string
708  {
709  return $this->pg_header;
710  }
+ Here is the caller graph for this function:

◆ getProgressIcons()

ilObjContentObject::getProgressIcons ( )

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

References $progr_icons.

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

169  : bool
170  {
171  return $this->progr_icons;
172  }
+ Here is the caller graph for this function:

◆ getPublicAccessMode()

ilObjContentObject::getPublicAccessMode ( )

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

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

References $public_access_mode.

Referenced by updateProperties(), and validatePages().

733  : string
734  {
736  }
+ Here is the caller graph for this function:

◆ getPublicExportFile()

ilObjContentObject::getPublicExportFile ( string  $a_type)

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

Referenced by getPublicExportFiles(), and updateProperties().

1694  : string
1695  {
1696  return $this->public_export_file[$a_type] ?? "";
1697  }
+ 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 directory type, e.g. html_de

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

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

2206  : array
2207  {
2208  $dirs = array("xml");
2209  $export_files = array();
2210 
2211  $ot = ilObjectTranslation::getInstance($this->getId());
2212  if ($ot->getContentActivated()) {
2213  $langs = $ot->getLanguages();
2214  foreach ($langs as $l => $ldata) {
2215  $dirs[] = "html_" . $l;
2216  }
2217  $dirs[] = "html_all";
2218  } else {
2219  $dirs[] = "html";
2220  }
2221 
2222  foreach ($dirs as $dir) {
2223  $type = explode("_", $dir);
2224  $type = $type[0];
2225  if ($this->getPublicExportFile($type) != "") {
2226  if (is_file($this->getExportDirectory($dir) . "/" .
2227  $this->getPublicExportFile($type))) {
2228  $size = filesize($this->getExportDirectory($dir) . "/" .
2229  $this->getPublicExportFile($type));
2230  $export_files[] = array("type" => $type,
2231  "dir_type" => $dir,
2232  "file" => $this->getPublicExportFile($type),
2233  "size" => $size);
2234  }
2235  }
2236  }
2237 
2238  return $export_files;
2239  }
string $type
getExportDirectory(string $a_type="xml")
static getInstance(int $obj_id)
+ Here is the call graph for this function:

◆ getRestrictForwardNavigation()

ilObjContentObject::getRestrictForwardNavigation ( )

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

References $restrict_forw_nav.

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

189  : bool
190  {
192  }
+ Here is the caller graph for this function:

◆ getStoreTries()

ilObjContentObject::getStoreTries ( )

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

References $store_tries.

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

179  : bool
180  {
181  return $this->store_tries;
182  }
+ Here is the caller graph for this function:

◆ getTOCMode()

ilObjContentObject::getTOCMode ( )

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

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

References $toc_mode.

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

725  : string
726  {
727  return $this->toc_mode;
728  }
+ Here is the caller graph for this function:

◆ getTree()

ilObjContentObject::getTree ( )

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

References $lm_tree.

194  : ilLMTree
195  {
196  return $this->lm_tree;
197  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ hasRating()

ilObjContentObject::hasRating ( )

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

References $rating.

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

2148  : bool
2149  {
2150  return $this->rating;
2151  }
+ Here is the caller graph for this function:

◆ hasRatingPages()

ilObjContentObject::hasRatingPages ( )

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

References $rating_pages.

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

2158  : bool
2159  {
2160  return $this->rating_pages;
2161  }
+ Here is the caller graph for this function:

◆ hasSuccessorPage()

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

checks if page has a successor page

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

References ilObject\$tree, ilTree\fetchSuccessorNode(), ilTree\isInTree(), ilTree\setTableNames(), and ilTree\setTreeTablePK().

Referenced by ilPageObjectGUI\showPage().

1122  : bool {
1123  $tree = new ilTree($a_cont_obj_id);
1124  $tree->setTableNames('lm_tree', 'lm_data');
1125  $tree->setTreeTablePK("lm_id");
1126  if ($tree->isInTree($a_page_id)) {
1127  $succ = $tree->fetchSuccessorNode($a_page_id, "pg");
1128  if ($succ > 0) {
1129  return true;
1130  }
1131  }
1132  return false;
1133  }
fetchSuccessorNode(int $a_node_id, string $a_type="")
get node data of successor node
ilTree $tree
isInTree(?int $a_node_id)
get all information of a node.
setTreeTablePK(string $a_column_name)
set column containing primary key in tree table
setTableNames(string $a_table_tree, string $a_table_obj_data, string $a_table_obj_reference="")
set table names The primary key of the table containing your object_data must be &#39;obj_id&#39; You may use...
+ Here is the call graph for this function:
+ 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 230 of file class.ilObjContentObject.php.

230  : void
231  {
232  // nothing to do. just display the dialogue in Out
233  }

◆ isActiveDownloads()

ilObjContentObject::isActiveDownloads ( )

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

References $downloads_active.

Referenced by updateProperties(), and validatePages().

815  : bool
816  {
818  }
+ Here is the caller graph for this function:

◆ isActiveDownloadsPublic()

ilObjContentObject::isActiveDownloadsPublic ( )

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

References $downloads_public_active.

Referenced by updateProperties(), and validatePages().

825  : bool
826  {
828  }
+ Here is the caller graph for this function:

◆ isActiveHistoryUserComments()

ilObjContentObject::isActiveHistoryUserComments ( )

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

References $user_comments.

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

860  : bool
861  {
862  return $this->user_comments;
863  }
+ Here is the caller graph for this function:

◆ isActiveLMMenu()

ilObjContentObject::isActiveLMMenu ( )

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

References $lm_menu_active.

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

752  : bool
753  {
754  return $this->lm_menu_active;
755  }
+ Here is the caller graph for this function:

◆ isActiveNumbering()

ilObjContentObject::isActiveNumbering ( )

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

References $numbering.

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

772  : bool
773  {
774  return $this->numbering;
775  }
+ Here is the caller graph for this function:

◆ isActivePreventGlossaryAppendix()

ilObjContentObject::isActivePreventGlossaryAppendix ( )

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

References $prevent_glossary_appendix_active.

Referenced by updateProperties(), and validatePages().

792  : bool
793  {
795  }
+ Here is the caller graph for this function:

◆ isActivePrintView()

ilObjContentObject::isActivePrintView ( )

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

References $print_view_active.

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

782  : bool
783  {
785  }
+ Here is the caller graph for this function:

◆ isActiveTOC()

ilObjContentObject::isActiveTOC ( )

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

References $toc_active.

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

762  : bool
763  {
764  return $this->toc_active;
765  }
+ Here is the caller graph for this function:

◆ isInfoEnabled()

ilObjContentObject::isInfoEnabled ( )

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

References ilObject\getId(), and ilObjContentObjectAccess\isInfoEnabled().

2241  : bool
2242  {
2244  }
+ Here is the call graph for this function:

◆ isOnlineHelpModule()

static ilObjContentObject::isOnlineHelpModule ( int  $a_id,
bool  $a_as_obj_id = false 
)
static

Is module an online module.

Returns
bool true, if current learning module is an online help lm

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

References ilObject\_lookupObjId().

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

2133  : bool {
2134  if (!$a_as_obj_id && $a_id > 0 && $a_id === (int) OH_REF_ID) {
2135  return true;
2136  }
2137  if ($a_as_obj_id && $a_id > 0 && $a_id === ilObject::_lookupObjId((int) OH_REF_ID)) {
2138  return true;
2139  }
2140  return false;
2141  }
static _lookupObjId(int $ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupAutoGlossaries()

static ilObjContentObject::lookupAutoGlossaries ( int  $a_lm_id)
static

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

References $DIC, and $ilDB.

Referenced by ilLMPage\beforePageContentUpdate().

2073  : array {
2074  global $DIC;
2075 
2076  $ilDB = $DIC->database();
2077 
2078  // read auto glossaries
2079  $set = $ilDB->query(
2080  "SELECT * FROM lm_glossaries " .
2081  " WHERE lm_id = " . $ilDB->quote($a_lm_id, "integer")
2082  );
2083  $glos = array();
2084  while ($rec = $ilDB->fetchAssoc($set)) {
2085  $glos[] = $rec["glo_id"];
2086  }
2087  return $glos;
2088  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ publicNotes()

ilObjContentObject::publicNotes ( )

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

References $pub_notes.

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

835  : bool
836  {
837  return $this->pub_notes;
838  }
+ Here is the caller graph for this function:

◆ read()

ilObjContentObject::read ( )

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

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

119  : void
120  {
121  $ilDB = $this->db;
122 
123  parent::read();
124 
125  $this->lm_tree = new ilLMTree($this->getId());
126 
127  $this->readProperties();
128 
129  // read auto glossaries
130  $set = $ilDB->query(
131  "SELECT * FROM lm_glossaries " .
132  " WHERE lm_id = " . $ilDB->quote($this->getId(), "integer")
133  );
134  $glos = array();
135  while ($rec = $ilDB->fetchAssoc($set)) {
136  $glos[] = $rec["glo_id"];
137  }
138  $this->setAutoGlossaries($glos);
139  }
ilDBInterface $db
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ readProperties()

ilObjContentObject::readProperties ( )

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

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

Referenced by createProperties(), and read().

885  : void
886  {
887  $ilDB = $this->db;
888 
889  $q = "SELECT * FROM content_object WHERE id = " .
890  $ilDB->quote($this->getId(), "integer");
891  $lm_set = $ilDB->query($q);
892  $lm_rec = $ilDB->fetchAssoc($lm_set);
893  $this->setLayout((string) $lm_rec["default_layout"]);
894  $this->setPageHeader((string) $lm_rec["page_header"]);
895  $this->setTOCMode((string) $lm_rec["toc_mode"]);
896  $this->setActiveTOC(ilUtil::yn2tf($lm_rec["toc_active"]));
897  $this->setActiveNumbering(ilUtil::yn2tf($lm_rec["numbering"]));
898  $this->setActivePrintView(ilUtil::yn2tf($lm_rec["print_view_active"]));
899  $this->setActivePreventGlossaryAppendix(ilUtil::yn2tf($lm_rec["no_glo_appendix"]));
900  $this->setHideHeaderFooterPrint((bool) $lm_rec["hide_head_foot_print"]);
901  $this->setActiveDownloads(ilUtil::yn2tf($lm_rec["downloads_active"]));
902  $this->setActiveDownloadsPublic(ilUtil::yn2tf($lm_rec["downloads_public_active"]));
903  $this->setActiveLMMenu(ilUtil::yn2tf($lm_rec["lm_menu_active"]));
904  $this->setCleanFrames(ilUtil::yn2tf($lm_rec["clean_frames"]));
905  $this->setHeaderPage((int) $lm_rec["header_page"]);
906  $this->setFooterPage((int) $lm_rec["footer_page"]);
907  $this->setHistoryUserComments(ilUtil::yn2tf($lm_rec["hist_user_comments"]));
908  $this->setPublicAccessMode((string) $lm_rec["public_access_mode"]);
909  $this->setPublicExportFile("xml", (string) $lm_rec["public_xml_file"]);
910  $this->setPublicExportFile("html", (string) $lm_rec["public_html_file"]);
911  $this->setLayoutPerPage((bool) $lm_rec["layout_per_page"]);
912  $this->setRating((bool) $lm_rec["rating"]);
913  $this->setRatingPages((bool) $lm_rec["rating_pages"]);
914  $this->setDisableDefaultFeedback((bool) $lm_rec["disable_def_feedback"]);
915  $this->setProgressIcons((bool) $lm_rec["progr_icons"]);
916  $this->setStoreTries((bool) $lm_rec["store_tries"]);
917  $this->setRestrictForwardNavigation((bool) $lm_rec["restrict_forw_nav"]);
918 
919  // #14661
920  $this->setPublicNotes($this->notes->domain()->commentsActive($this->getId()));
921 
922  $this->setForTranslation((bool) $lm_rec["for_translation"]);
923  }
setActiveLMMenu(bool $a_act_lm_menu)
setActiveDownloadsPublic(bool $a_down)
setPageHeader(string $a_pg_header=ilLMObject::CHAPTER_TITLE)
set page header mode
setForTranslation(bool $a_val)
Set for translation (lm has been imported for translation purposes)
setRestrictForwardNavigation(bool $a_val)
setTOCMode(string $a_toc_mode="chapters")
set toc mode
ilDBInterface $db
setPublicExportFile(string $a_type, string $a_file)
specify public export file for type
setPublicNotes(bool $a_pub_notes)
setActivePreventGlossaryAppendix(bool $a_print)
$lm_set
$q
Definition: shib_logout.php:21
setDisableDefaultFeedback(bool $a_val)
Set disable default feedback for questions.
static yn2tf(string $a_yn)
setHideHeaderFooterPrint(bool $a_val)
Set hide header footer in print mode.
setPublicAccessMode(string $a_mode)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeAutoGlossary()

ilObjContentObject::removeAutoGlossary ( int  $a_glo_id)

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

References ilObject\$lng, getAutoGlossaries(), ilObject\getId(), ilTree\POS_FIRST_NODE, ilLMObject\putInTree(), setAutoGlossaries(), and ilLanguage\txt().

260  : void
261  {
262  $glo_ids = array();
263  foreach ($this->getAutoGlossaries() as $g) {
264  if ($g != $a_glo_id) {
265  $glo_ids[] = $g;
266  }
267  }
268  $this->setAutoGlossaries($glo_ids);
269  }
+ Here is the call graph for this function:

◆ setActiveDownloads()

ilObjContentObject::setActiveDownloads ( bool  $a_down)

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

Referenced by readProperties().

810  : void
811  {
812  $this->downloads_active = $a_down;
813  }
+ Here is the caller graph for this function:

◆ setActiveDownloadsPublic()

ilObjContentObject::setActiveDownloadsPublic ( bool  $a_down)

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

Referenced by readProperties().

820  : void
821  {
822  $this->downloads_public_active = $a_down;
823  }
+ Here is the caller graph for this function:

◆ setActiveLMMenu()

ilObjContentObject::setActiveLMMenu ( bool  $a_act_lm_menu)

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

Referenced by readProperties().

747  : void
748  {
749  $this->lm_menu_active = $a_act_lm_menu;
750  }
+ Here is the caller graph for this function:

◆ setActiveNumbering()

ilObjContentObject::setActiveNumbering ( bool  $a_num)

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

Referenced by readProperties().

767  : void
768  {
769  $this->numbering = $a_num;
770  }
+ Here is the caller graph for this function:

◆ setActivePreventGlossaryAppendix()

ilObjContentObject::setActivePreventGlossaryAppendix ( bool  $a_print)

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

Referenced by readProperties().

787  : void
788  {
789  $this->prevent_glossary_appendix_active = $a_print;
790  }
+ Here is the caller graph for this function:

◆ setActivePrintView()

ilObjContentObject::setActivePrintView ( bool  $a_print)

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

Referenced by readProperties().

777  : void
778  {
779  $this->print_view_active = $a_print;
780  }
+ Here is the caller graph for this function:

◆ setActiveTOC()

ilObjContentObject::setActiveTOC ( bool  $a_toc)

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

Referenced by readProperties().

757  : void
758  {
759  $this->toc_active = $a_toc;
760  }
+ Here is the caller graph for this function:

◆ setAutoGlossaries()

ilObjContentObject::setAutoGlossaries ( array  $a_val)

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

References ilObject\_lookupType(), and ILIAS\Repository\int().

Referenced by read(), and removeAutoGlossary().

241  : void
242  {
243  $this->auto_glossaries = array();
244  if (is_array($a_val)) {
245  foreach ($a_val as $v) {
246  $v = (int) $v;
247  if ($v > 0 && ilObject::_lookupType($v) == "glo" &&
248  !in_array($v, $this->auto_glossaries)) {
249  $this->auto_glossaries[] = $v;
250  }
251  }
252  }
253  }
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCleanFrames()

ilObjContentObject::setCleanFrames ( bool  $a_clean)

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

Referenced by readProperties(), and updateProperties().

840  : void
841  {
842  $this->clean_frames = $a_clean;
843  }
+ Here is the caller graph for this function:

◆ setDisableDefaultFeedback()

ilObjContentObject::setDisableDefaultFeedback ( bool  $a_val)

Set disable default feedback for questions.

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

Referenced by readProperties().

154  : void
155  {
156  $this->disable_def_feedback = $a_val;
157  }
+ Here is the caller graph for this function:

◆ setFooterPage()

ilObjContentObject::setFooterPage ( int  $a_pg)

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

Referenced by readProperties().

875  : void
876  {
877  $this->footer_page = $a_pg;
878  }
+ Here is the caller graph for this function:

◆ setForTranslation()

ilObjContentObject::setForTranslation ( bool  $a_val)

Set for translation (lm has been imported for translation purposes)

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

Referenced by readProperties().

300  : void
301  {
302  $this->for_translation = $a_val;
303  }
+ Here is the caller graph for this function:

◆ setHeaderPage()

ilObjContentObject::setHeaderPage ( int  $a_pg)

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

Referenced by readProperties().

865  : void
866  {
867  $this->header_page = $a_pg;
868  }
+ Here is the caller graph for this function:

◆ setHideHeaderFooterPrint()

ilObjContentObject::setHideHeaderFooterPrint ( bool  $a_val)

Set hide header footer in print mode.

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

Referenced by readProperties().

800  : void
801  {
802  $this->hide_header_footer_print = $a_val;
803  }
+ Here is the caller graph for this function:

◆ setHistoryUserComments()

ilObjContentObject::setHistoryUserComments ( bool  $a_comm)

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

Referenced by readProperties().

850  : void
851  {
852  $this->user_comments = $a_comm;
853  }
+ Here is the caller graph for this function:

◆ setImportDirectory()

ilObjContentObject::setImportDirectory ( string  $a_import_dir)

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

366  : void
367  {
368  $this->import_dir = $a_import_dir;
369  }

◆ setLayout()

ilObjContentObject::setLayout ( string  $a_layout)

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

Referenced by readProperties().

479  : void
480  {
481  $this->layout = $a_layout;
482  }
+ Here is the caller graph for this function:

◆ setLayoutPerPage()

ilObjContentObject::setLayoutPerPage ( bool  $a_val)

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

Referenced by readProperties().

141  : void
142  {
143  $this->layout_per_page = $a_val;
144  }
+ Here is the caller graph for this function:

◆ setPageHeader()

ilObjContentObject::setPageHeader ( string  $a_pg_header = ilLMObject::CHAPTER_TITLE)

set page header mode

Parameters
string$a_pg_headerilLMOBject::CHAPTER_TITLE | ilLMOBject::PAGE_TITLE | ilLMOBject::NO_HEADER

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

Referenced by readProperties().

718  : void {
719  $this->pg_header = $a_pg_header;
720  }
+ Here is the caller graph for this function:

◆ setProgressIcons()

ilObjContentObject::setProgressIcons ( bool  $a_val)

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

Referenced by readProperties().

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

◆ setPublicAccessMode()

ilObjContentObject::setPublicAccessMode ( string  $a_mode)

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

Referenced by readProperties().

855  : void
856  {
857  $this->public_access_mode = $a_mode;
858  }
+ Here is the caller graph for this function:

◆ setPublicExportFile()

ilObjContentObject::setPublicExportFile ( string  $a_type,
string  $a_file 
)

specify public export file for type

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

Referenced by readProperties().

1690  : void {
1691  $this->public_export_file[$a_type] = $a_file;
1692  }
+ Here is the caller graph for this function:

◆ setPublicNotes()

ilObjContentObject::setPublicNotes ( bool  $a_pub_notes)

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

Referenced by readProperties().

830  : void
831  {
832  $this->pub_notes = $a_pub_notes;
833  }
+ Here is the caller graph for this function:

◆ setRating()

ilObjContentObject::setRating ( bool  $a_value)

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

Referenced by readProperties().

2143  : void
2144  {
2145  $this->rating = $a_value;
2146  }
+ Here is the caller graph for this function:

◆ setRatingPages()

ilObjContentObject::setRatingPages ( bool  $a_value)

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

Referenced by readProperties().

2153  : void
2154  {
2155  $this->rating_pages = $a_value;
2156  }
+ Here is the caller graph for this function:

◆ setRestrictForwardNavigation()

ilObjContentObject::setRestrictForwardNavigation ( bool  $a_val)

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

Referenced by readProperties().

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

◆ setStoreTries()

ilObjContentObject::setStoreTries ( bool  $a_val)

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

Referenced by readProperties().

174  : void
175  {
176  $this->store_tries = $a_val;
177  }
+ Here is the caller graph for this function:

◆ setTOCMode()

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

set toc mode

Parameters
string$a_toc_mode"chapters" | "pages"

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

Referenced by readProperties().

742  : void
743  {
744  $this->toc_mode = $a_toc_mode;
745  }
+ Here is the caller graph for this function:

◆ update()

ilObjContentObject::update ( )

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

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

199  : bool
200  {
201  $this->updateMetaData();
202  parent::update();
203  $this->updateProperties();
204  $this->updateAutoGlossaries();
205  return true;
206  }
+ Here is the call graph for this function:

◆ updateAutoGlossaries()

ilObjContentObject::updateAutoGlossaries ( )

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

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

Referenced by create(), and update().

208  : void
209  {
210  $ilDB = $this->db;
211 
212  // update auto glossaries
213  $ilDB->manipulate(
214  "DELETE FROM lm_glossaries WHERE " .
215  " lm_id = " . $ilDB->quote($this->getId(), "integer")
216  );
217  foreach ($this->getAutoGlossaries() as $glo_id) {
218  $ilDB->manipulate("INSERT INTO lm_glossaries " .
219  "(lm_id, glo_id) VALUES (" .
220  $ilDB->quote($this->getId(), "integer") . "," .
221  $ilDB->quote($glo_id, "integer") .
222  ")");
223  }
224  }
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateProperties()

ilObjContentObject::updateProperties ( )

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

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

Referenced by update().

925  : void
926  {
927  $ilDB = $this->db;
928 
929  // force clean_frames to be set, if layout per page is activated
930  if ($this->getLayoutPerPage()) {
931  $this->setCleanFrames(true);
932  }
933 
934  $q = "UPDATE content_object SET " .
935  " default_layout = " . $ilDB->quote($this->getLayout(), "text") . ", " .
936  " page_header = " . $ilDB->quote($this->getPageHeader(), "text") . "," .
937  " toc_mode = " . $ilDB->quote($this->getTOCMode(), "text") . "," .
938  " toc_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveTOC()), "text") . "," .
939  " numbering = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveNumbering()), "text") . "," .
940  " print_view_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActivePrintView()), "text") . "," .
941  " no_glo_appendix = " . $ilDB->quote(ilUtil::tf2yn($this->isActivePreventGlossaryAppendix()), "text") . "," .
942  " hide_head_foot_print = " . $ilDB->quote($this->getHideHeaderFooterPrint(), "integer") . "," .
943  " downloads_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveDownloads()), "text") . "," .
944  " downloads_public_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveDownloadsPublic()), "text") . "," .
945  " clean_frames = " . $ilDB->quote(ilUtil::tf2yn($this->cleanFrames()), "text") . "," .
946  " hist_user_comments = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveHistoryUserComments()), "text") . "," .
947  " public_access_mode = " . $ilDB->quote($this->getPublicAccessMode(), "text") . "," .
948  " public_xml_file = " . $ilDB->quote($this->getPublicExportFile("xml"), "text") . "," .
949  " public_html_file = " . $ilDB->quote($this->getPublicExportFile("html"), "text") . "," .
950  " header_page = " . $ilDB->quote($this->getHeaderPage(), "integer") . "," .
951  " footer_page = " . $ilDB->quote($this->getFooterPage(), "integer") . "," .
952  " lm_menu_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveLMMenu()), "text") . ", " .
953  " layout_per_page = " . $ilDB->quote($this->getLayoutPerPage(), "integer") . ", " .
954  " rating = " . $ilDB->quote($this->hasRating(), "integer") . ", " .
955  " rating_pages = " . $ilDB->quote($this->hasRatingPages(), "integer") . ", " .
956  " disable_def_feedback = " . $ilDB->quote($this->getDisableDefaultFeedback(), "integer") . ", " .
957  " progr_icons = " . $ilDB->quote($this->getProgressIcons(), "integer") . ", " .
958  " store_tries = " . $ilDB->quote($this->getStoreTries(), "integer") . ", " .
959  " restrict_forw_nav = " . $ilDB->quote($this->getRestrictForwardNavigation(), "integer") . ", " .
960  " for_translation = " . $ilDB->quote((int) $this->getForTranslation(), "integer") . " " .
961  " WHERE id = " . $ilDB->quote($this->getId(), "integer");
962  $ilDB->manipulate($q);
963  // #14661
964  $this->notes->domain()->activateComments($this->getId(), $this->publicNotes());
965  }
static tf2yn(bool $a_tf)
getPublicAccessMode()
get public access mode ("complete" | "selected")
getPageHeader()
get page header mode (ilLMOBject::CHAPTER_TITLE | ilLMOBject::PAGE_TITLE | ilLMOBject::NO_HEADER) ...
ilDBInterface $db
getTOCMode()
get toc mode ("chapters" | "pages")
$q
Definition: shib_logout.php:21
+ 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 1892 of file class.ilObjContentObject.php.

References Vendor\Package\$e, ilObject\$error, ilObject\$title, ilPageObject\_exists(), ilCopyWizardOptions\_getInstance(), ilLMObject\_lookupTitle(), cleanFrames(), ilObject\cloneMetaData(), copyAllPagesAndChapters(), getAutoGlossaries(), ilObject\getDescription(), getDisableDefaultFeedback(), getFooterPage(), getHeaderPage(), ilObject\getId(), ilObjectTranslation\getInstance(), getLayout(), getLayoutPerPage(), ilObject\getOfflineStatus(), getPageHeader(), ilLMPageObject\getPageList(), getProgressIcons(), getPublicAccessMode(), getRestrictForwardNavigation(), getStoreTries(), getTOCMode(), ilObject\getType(), hasRating(), hasRatingPages(), isActiveDownloads(), isActiveDownloadsPublic(), isActiveHistoryUserComments(), isActiveLMMenu(), isActiveNumbering(), isActivePreventGlossaryAppendix(), isActivePrintView(), isActiveTOC(), ILIAS\Repository\lng(), publicNotes(), and ilLMMenuEditor\writeActive().

1892  : string
1893  {
1894  $mess = "";
1895 
1896  $pages = ilLMPageObject::getPageList($this->getId());
1897  foreach ($pages as $page) {
1898  if (ilLMPage::_exists($this->getType(), $page["obj_id"])) {
1899  $cpage = new ilLMPage($page["obj_id"]);
1900  $cpage->buildDom();
1901  $error = $cpage->validateDom();
1902 
1903  if ($error != "") {
1904  $this->lng->loadLanguageModule("content");
1905  $this->main_tpl->setOnScreenMessage('info', $this->lng->txt("cont_import_validation_errors"));
1906  $title = ilLMObject::_lookupTitle($page["obj_id"]);
1907  $page_obj = new ilLMPageObject($this->lm, $page["obj_id"]);
1908  $mess .= $this->lng->txt("obj_pg") . ": " . $title;
1909  $mess .= '<div class="small">';
1910  foreach ($error as $e) {
1911  $err_mess = implode(" - ", $e);
1912  if (!is_int(strpos($err_mess, ":0:"))) {
1913  $mess .= htmlentities($err_mess) . "<br />";
1914  }
1915  }
1916  $mess .= '</div>';
1917  $mess .= "<br />";
1918  }
1919  }
1920  }
1921 
1922  return $mess;
1923  }
string $title
static _lookupTitle(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
static getPageList(int $lm_id)
ilErrorHandling $error
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ writeFooterPage()

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

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

References $DIC, and $ilDB.

Referenced by ilLearningModuleImporter\finalProcessing().

502  : void {
503  global $DIC;
504 
505  $ilDB = $DIC->database();
506 
507  $ilDB->manipulate(
508  "UPDATE content_object SET " .
509  " footer_page = " . $ilDB->quote($a_page_id, "integer") .
510  " WHERE id = " . $ilDB->quote($a_lm_id, "integer")
511  );
512  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ writeHeaderPage()

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

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

References $DIC, and $ilDB.

Referenced by ilLearningModuleImporter\finalProcessing().

487  : void {
488  global $DIC;
489 
490  $ilDB = $DIC->database();
491 
492  $ilDB->manipulate(
493  "UPDATE content_object SET " .
494  " header_page = " . $ilDB->quote($a_page_id, "integer") .
495  " WHERE id = " . $ilDB->quote($a_lm_id, "integer")
496  );
497  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

Field Documentation

◆ $auto_glossaries

array ilObjContentObject::$auto_glossaries = array()

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

Referenced by getAutoGlossaries().

◆ $clean_frames

bool ilObjContentObject::$clean_frames = false
protected

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

Referenced by cleanFrames().

◆ $content_style_domain

ILIAS Style Content DomainService ilObjContentObject::$content_style_domain
protected

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

◆ $disable_def_feedback

bool ilObjContentObject::$disable_def_feedback = false
protected

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

Referenced by getDisableDefaultFeedback().

◆ $downloads_active

bool ilObjContentObject::$downloads_active = false
protected

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

Referenced by isActiveDownloads().

◆ $downloads_public_active

bool ilObjContentObject::$downloads_public_active = false
protected

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

Referenced by isActiveDownloadsPublic().

◆ $file_ids

array ilObjContentObject::$file_ids = []
protected

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

◆ $footer_page

int ilObjContentObject::$footer_page = 0
protected

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

Referenced by getFooterPage().

◆ $for_translation

bool ilObjContentObject::$for_translation = false

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

Referenced by getForTranslation().

◆ $header_page

int ilObjContentObject::$header_page = 0
protected

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

Referenced by getHeaderPage().

◆ $hide_header_footer_print

bool ilObjContentObject::$hide_header_footer_print = false
protected

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

Referenced by getHideHeaderFooterPrint().

◆ $import_dir

string ilObjContentObject::$import_dir = ''
private

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

Referenced by getImportDirectory().

◆ $layout

string ilObjContentObject::$layout = ''

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

Referenced by getLayout().

◆ $layout_per_page

bool ilObjContentObject::$layout_per_page = false
protected

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

Referenced by getLayoutPerPage().

◆ $lm

ilObjLearningModule ilObjContentObject::$lm
protected

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

◆ $lm_menu_active

bool ilObjContentObject::$lm_menu_active = false
protected

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

Referenced by isActiveLMMenu().

◆ $lm_tree

ilLMTree ilObjContentObject::$lm_tree

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

Referenced by getLMTree(), and getTree().

◆ $locator

ilLocatorGUI ilObjContentObject::$locator
protected

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

◆ $main_tpl

ilGlobalTemplateInterface ilObjContentObject::$main_tpl
private

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

◆ $mob_ids

array ilObjContentObject::$mob_ids = []
protected

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

◆ $notes

ILIAS Notes Service ilObjContentObject::$notes
protected

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

◆ $numbering

bool ilObjContentObject::$numbering = false
protected

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

Referenced by isActiveNumbering().

◆ $online

bool ilObjContentObject::$online = false

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

◆ $pg_header

string ilObjContentObject::$pg_header = ''

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

Referenced by getPageHeader().

◆ $prevent_glossary_appendix_active

bool ilObjContentObject::$prevent_glossary_appendix_active = false
protected

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

Referenced by isActivePreventGlossaryAppendix().

◆ $print_view_active

bool ilObjContentObject::$print_view_active = false
protected

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

Referenced by isActivePrintView().

◆ $progr_icons

bool ilObjContentObject::$progr_icons = false
protected

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

Referenced by getProgressIcons().

◆ $pub_notes

bool ilObjContentObject::$pub_notes = false
protected

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

Referenced by publicNotes().

◆ $public_access_mode

string ilObjContentObject::$public_access_mode = ''
protected

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

Referenced by getPublicAccessMode().

◆ $public_export_file

array ilObjContentObject::$public_export_file = []
protected

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

◆ $q_ids

array ilObjContentObject::$q_ids = []
protected

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

◆ $rating

bool ilObjContentObject::$rating = false
protected

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

Referenced by hasRating().

◆ $rating_pages

bool ilObjContentObject::$rating_pages = false
protected

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

Referenced by hasRatingPages().

◆ $restrict_forw_nav

bool ilObjContentObject::$restrict_forw_nav = false
protected

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

Referenced by getRestrictForwardNavigation().

◆ $store_tries

bool ilObjContentObject::$store_tries = false
protected

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

Referenced by getStoreTries().

◆ $style_id

int ilObjContentObject::$style_id = 0

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

◆ $toc_active

bool ilObjContentObject::$toc_active = false
protected

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

Referenced by isActiveTOC().

◆ $toc_mode

string ilObjContentObject::$toc_mode = ''
protected

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

Referenced by getTOCMode().

◆ $user

ilObjUser ilObjContentObject::$user
protected

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

◆ $user_comments

bool ilObjContentObject::$user_comments = false
protected

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

Referenced by isActiveHistoryUserComments().


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