ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjContentObject Class Reference

Class ilObjContentObject. More...

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

Public Member Functions

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

Static Public Member Functions

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

Data Fields

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

Protected Attributes

 $rating
 $rating_pages

Private Attributes

 $import_dir = ''

Detailed Description

Class ilObjContentObject.

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
Version
Id:
class.ilObjContentObject.php 60869 2015-09-25 09:31:11Z gitmgr

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

Member Function Documentation

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

checks wether the preconditions of a page are fulfilled or not

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

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

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

{
global $ilUser,$ilErr;
$lm_tree = new ilTree($cont_obj_id);
$lm_tree->setTableNames('lm_tree','lm_data');
$lm_tree->setTreeTablePK("lm_id");
if ($lm_tree->isInTree($page_id))
{
$path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
foreach ($path as $node)
{
if ($node["type"] == "st")
{
if (!ilConditionHandler::_checkAllConditionsOfTarget($cont_ref_id,$node["child"], "st"))
{
return false;
}
}
}
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::_deleteStyleAssignments (   $a_style_id)

delete all style references to style

Parameters
int$a_style_idstyle_id

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

References ilObject\getId().

Referenced by ilObjStyleSheet\delete().

{
global $ilDB;
$q = "UPDATE content_object SET ".
" stylesheet = ".$ilDB->quote(0, "integer").
" WHERE stylesheet = ".$ilDB->quote((int) $this->getId($a_style_id), "integer");
$ilDB->manipulate($q);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

gets all missing preconditions of page

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

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

Referenced by ilLMPresentationGUI\showPreconditionsOfPage().

{
$lm_tree = new ilTree($cont_obj_id);
$lm_tree->setTableNames('lm_tree','lm_data');
$lm_tree->setTreeTablePK("lm_id");
$conds = array();
if ($lm_tree->isInTree($page_id))
{
// get full path of page
$path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
foreach ($path as $node)
{
if ($node["type"] == "st")
{
// get all preconditions of upper chapters
$tconds = ilConditionHandler::_getConditionsOfTarget($cont_ref_id,$node["child"], "st");
foreach ($tconds as $tcond)
{
// store all missing preconditions
{
$conds[] = $tcond;
}
}
}
}
}
return $conds;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

get top chapter of page for that any precondition is missing

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

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

Referenced by ilLMPresentationGUI\showPreconditionsOfPage().

{
$lm_tree = new ilTree($cont_obj_id);
$lm_tree->setTableNames('lm_tree','lm_data');
$lm_tree->setTreeTablePK("lm_id");
$conds = array();
if ($lm_tree->isInTree($page_id))
{
// get full path of page
$path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId());
foreach ($path as $node)
{
if ($node["type"] == "st")
{
// get all preconditions of upper chapters
$tconds = ilConditionHandler::_getConditionsOfTarget($cont_obj_ref_id,$node["child"], "st");
foreach ($tconds as $tcond)
{
// look for missing precondition
{
return $node["child"];
}
}
}
}
}
return "";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::_getNrLMsIndividualStyles ( )

get number of learning modules with individual styles

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

Referenced by ilObjStyleSettingsGUI\editContentStylesObject().

{
global $ilDB;
// joining with style table (not perfectly nice)
$q = "SELECT count(*) as cnt FROM content_object, style_data ".
" WHERE stylesheet = style_data.id ".
" AND standard = ".$ilDB->quote(0, "integer");
$cset = $ilDB->query($q);
$crow = $ilDB->fetchAssoc($cset);
return (int) $crow["cnt"];
}

+ Here is the caller graph for this function:

ilObjContentObject::_getNrLMsNoStyle ( )

get number of learning modules assigned no style

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

Referenced by ilObjStyleSettingsGUI\editContentStylesObject().

{
global $ilDB;
$q = "SELECT count(*) as cnt FROM content_object ".
" WHERE stylesheet = ".$ilDB->quote(0, "integer");
$cset = $ilDB->query($q);
$crow = $ilDB->fetchAssoc($cset);
return (int) $crow["cnt"];
}

+ Here is the caller graph for this function:

ilObjContentObject::_getNrOfAssignedLMs (   $a_style_id)

gets the number of learning modules assigned to a content style

Parameters
int$a_style_idstyle id

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

Referenced by ilObjStyleSettingsGUI\editContentStylesObject().

{
global $ilDB;
$q = "SELECT count(*) as cnt FROM content_object ".
" WHERE stylesheet = ".$ilDB->quote($a_style_id, "integer");
$cset = $ilDB->query($q);
$crow = $ilDB->fetchAssoc($cset);
return (int) $crow["cnt"];
}

+ Here is the caller graph for this function:

ilObjContentObject::_lookupContObjIdByStyleId (   $a_style_id)

lookup style sheet ID

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

References $res.

Referenced by ilObjStyleSheet\_getClonableContentStyles().

{
global $ilDB;
$q = "SELECT id FROM content_object ".
" WHERE stylesheet = ".$ilDB->quote($a_style_id, "integer");
$res = $ilDB->query($q);
$obj_ids = array();
while($cont = $ilDB->fetchAssoc($res))
{
$obj_ids[] = $cont["id"];
}
return $obj_ids;
}

+ Here is the caller graph for this function:

static ilObjContentObject::_lookupDisableDefaultFeedback (   $a_id)
static

Lookup disable default feedback.

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

References $res.

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

{
global $ilDB;
$q = "SELECT disable_def_feedback FROM content_object ".
" WHERE id = ".$ilDB->quote($a_id, "integer");
$res = $ilDB->query($q);
$rec = $ilDB->fetchAssoc($res);
return $rec["disable_def_feedback"];
}

+ Here is the caller graph for this function:

ilObjContentObject::_lookupOnline (   $a_id)

check wether content object is online

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

References ilUtil\yn2tf().

{
global $ilDB;
//echo "class ilObjContentObject::_lookupOnline($a_id) called. Use Access class instead.";
$q = "SELECT is_online FROM content_object WHERE id = ".$ilDB->quote($a_id, "integer");
$lm_set = $ilDB->query($q);
$lm_rec = $ilDB->fetchAssoc($lm_set);
return ilUtil::yn2tf($lm_rec["is_online"]);
}

+ Here is the call graph for this function:

ilObjContentObject::_lookupStyleSheetId (   $a_cont_obj_id)

lookup style sheet ID

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

References $res.

Referenced by ilPCParagraphGUI\setStyle().

{
global $ilDB;
$q = "SELECT stylesheet FROM content_object ".
" WHERE id = ".$ilDB->quote($a_cont_obj_id, "integer");
$res = $ilDB->query($q);
$sheet = $ilDB->fetchAssoc($res);
return $sheet["stylesheet"];
}

+ Here is the caller graph for this function:

ilObjContentObject::_moveLMStyles (   $a_from_style,
  $a_to_style 
)

move learning modules from one style to another

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

References ilObject\$ilias.

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

{
global $ilDB, $ilias;
if ($a_from_style < 0) // change / delete all individual styles
{
$q = "SELECT stylesheet FROM content_object, style_data ".
" WHERE content_object.stylesheet = style_data.id ".
" AND style_data.standard = ".$ilDB->quote(0, "integer").
" AND content_object.stylesheet > ".$ilDB->quote(0, "integer");
$style_set = $ilDB->query($q);
while($style_rec = $ilDB->fetchAssoc($style_set))
{
// assign learning modules to new style
$q = "UPDATE content_object SET ".
" stylesheet = ".$ilDB->quote((int) $a_to_style, "integer").
" WHERE stylesheet = ".$ilDB->quote($style_rec["stylesheet"], "integer");
$ilDB->manipulate($q);
// delete style
$style_obj =& $ilias->obj_factory->getInstanceByObjId($style_rec["stylesheet"]);
$style_obj->delete();
}
}
else
{
$q = "UPDATE content_object SET ".
" stylesheet = ".$ilDB->quote((int) $a_to_style, "integer").
" WHERE stylesheet = ".$ilDB->quote($a_from_style, "integer");
$ilDB->manipulate($q);
}
}

+ Here is the caller graph for this function:

ilObjContentObject::addFirstChapterAndPage ( )

Add first chapter and page.

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

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

{
global $lng;
include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
include_once("./Modules/LearningModule/classes/class.ilStructureObject.php");
include_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
$root_id = $this->lm_tree->getRootId();
// chapter
$chap = new ilStructureObject($this);
$chap->setType("st");
$chap->setTitle($lng->txt("cont_new_chap"));
$chap->setLMId($this->getId());
$chap->create();
// page
$page = new ilLMPageObject($this);
$page->setType("pg");
$page->setTitle($lng->txt("cont_new_page"));
$page->setLMId($this->getId());
$page->create();
ilLMObject::putInTree($page, $chap->getId(), IL_FIRST_NODE);
}

+ Here is the call graph for this function:

ilObjContentObject::autoLinkGlossaryTerms (   $a_glo_id)

Auto link glossary terms.

Parameters
@return

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

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

{
// get terms
include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
$terms = ilGlossaryTerm::getTermList($a_glo_id);
// each get page: get content
include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
$pages = ilLMPage::getAllPages($this->getType(), $this->getId());
// determine terms that occur in the page
$found_pages = array();
foreach ($pages as $p)
{
$pg = new ilLMPage($p["id"]);
$c = $pg->getXMLContent();
foreach ($terms as $t)
{
if (is_int(stripos($c, $t["term"])))
{
$found_pages[$p["id"]]["terms"][] = $t;
if (!is_object($found_pages[$p["id"]]["page"]))
{
$found_pages[$p["id"]]["page"] = $pg;
}
}
}
reset($terms);
}
// ilPCParagraph autoLinkGlossariesPage with page and terms
include_once("./Services/COPage/classes/class.ilPCParagraph.php");
foreach ($found_pages as $id => $fp)
{
ilPCParagraph::autoLinkGlossariesPage($fp["page"], $fp["terms"]);
}
}

+ Here is the call graph for this function:

ilObjContentObject::checkTree ( )

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

References ilObject\getId().

Referenced by executeDragDrop().

{
$tree = new ilTree($this->getId());
$tree->setTableNames('lm_tree','lm_data');
$tree->setTreeTablePK("lm_id");
$tree->checkTree();
$tree->checkTreeChilds();
//echo "checked";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::cleanFrames ( )

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

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

{
return $this->clean_frames;
}

+ Here is the caller graph for this function:

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

Clone learning module.

public

Parameters
inttarget ref_id
intcopy id

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

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

{
global $ilDB, $ilUser, $ilias;
$new_obj = parent::cloneObject($a_target_id,$a_copy_id);
$this->cloneMetaData($new_obj);
//$new_obj->createProperties();
$new_obj->setTitle($this->getTitle());
$new_obj->setDescription($this->getDescription());
$new_obj->setLayoutPerPage($this->getLayoutPerPage());
$new_obj->setLayout($this->getLayout());
$new_obj->setTOCMode($this->getTOCMode());
$new_obj->setActiveLMMenu($this->isActiveLMMenu());
$new_obj->setActiveTOC($this->isActiveTOC());
$new_obj->setActiveNumbering($this->isActiveNumbering());
$new_obj->setActivePrintView($this->isActivePrintView());
$new_obj->setActivePreventGlossaryAppendix($this->isActivePreventGlossaryAppendix());
$new_obj->setActiveDownloads($this->isActiveDownloads());
$new_obj->setActiveDownloadsPublic($this->isActiveDownloadsPublic());
$new_obj->setPublicNotes($this->publicNotes());
$new_obj->setCleanFrames($this->cleanFrames());
$new_obj->setHistoryUserComments($this->isActiveHistoryUserComments());
$new_obj->setPublicAccessMode($this->getPublicAccessMode());
$new_obj->setPageHeader($this->getPageHeader());
$new_obj->setRating($this->hasRating());
$new_obj->setRatingPages($this->hasRatingPages());
$new_obj->update();
$new_obj->createLMTree();
// copy style
include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
if ($style_id > 0 &&
{
$style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
$new_id = $style_obj->ilClone();
$new_obj->setStyleSheetId($new_id);
$new_obj->update();
}
// copy content
$this->copyAllPagesAndChapters($new_obj);
// Copy learning progress settings
include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
$obj_settings = new ilLPObjSettings($this->getId());
$obj_settings->cloneSettings($new_obj->getId());
unset($obj_settings);
// copy (page) multilang settings
include_once("./Services/Object/classes/class.ilObjectTranslation.php");
$ot->copy($new_obj->getId());
return $new_obj;
}

+ Here is the call graph for this function:

ilObjContentObject::copyAllPagesAndChapters (   $a_target_obj)

Copy all pages and chapters.

Parameters
object$a_target_objtarget learning module

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

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

Referenced by cloneObject().

{
$parent_id = $a_target_obj->lm_tree->readRootId();
include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
include_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
// get all chapters of root lm
$chapters = $this->lm_tree->getChildsByType($this->lm_tree->readRootId(), "st");
$copied_nodes = array();
//$time = time();
foreach ($chapters as $chap)
{
$cid = ilLMObject::pasteTree($a_target_obj, $chap["child"], $parent_id,
IL_LAST_NODE, $time, $copied_nodes, true, $this);
$target = $cid;
}
// copy free pages
$pages = ilLMPageObject::getPageList($this->getId());
foreach ($pages as $p)
{
if (!$this->lm_tree->isInTree($p["obj_id"]))
{
$item = new ilLMPageObject($this, $p["obj_id"]);
$target_item = $item->copy($a_target_obj);
$copied_nodes[$item->getId()] = $target_item->getId();
}
}
$a_target_obj->checkTree();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::create (   $a_no_meta_data = false)

create content object

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

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

{
global $ilUser;
// meta data will be created by
// import parser
if (!$a_no_meta_data)
{
$this->createMetaData();
}
$this->createProperties();
}

+ Here is the call graph for this function:

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

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

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

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

Referenced by ilObjDlBook\export().

{
$lm_data_dir = ilUtil::getDataDir()."/lm_data";
if(!is_writable($lm_data_dir))
{
$this->ilias->raiseError("Content object Data Directory (".$lm_data_dir
.") not writeable.",$this->ilias->error_obj->FATAL);
}
// create learning module directory (data_dir/lm_data/lm_<id>)
$lm_dir = $lm_data_dir."/lm_".$this->getId();
ilUtil::makeDir($lm_dir);
if(!@is_dir($lm_dir))
{
$this->ilias->raiseError("Creation of Learning Module Directory failed.",$this->ilias->error_obj->FATAL);
}
// create Export subdirectory (data_dir/lm_data/lm_<id>/Export)
switch ($a_type)
{
// scorm
case "scorm":
$export_dir = $lm_dir."/export_scorm";
break;
default: // = xml
if (substr($a_type, 0, 4) == "html")
{
$export_dir = $lm_dir."/export_".$a_type;
}
else
{
$export_dir = $lm_dir."/export";
}
break;
}
ilUtil::makeDir($export_dir);
if(!@is_dir($export_dir))
{
$this->ilias->raiseError("Creation of Export Directory failed.",$this->ilias->error_obj->FATAL);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::createImportDirectory ( )

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

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

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

Referenced by importFromZipFile().

{
$lm_data_dir = ilUtil::getDataDir()."/lm_data";
if(!is_writable($lm_data_dir))
{
$this->ilias->raiseError("Content object Data Directory (".$lm_data_dir
.") not writeable.",$this->ilias->error_obj->FATAL);
}
// create learning module directory (data_dir/lm_data/lm_<id>)
$lm_dir = $lm_data_dir."/lm_".$this->getId();
ilUtil::makeDir($lm_dir);
if(!@is_dir($lm_dir))
{
$this->ilias->raiseError("Creation of Learning Module Directory failed.",$this->ilias->error_obj->FATAL);
}
// create import subdirectory (data_dir/lm_data/lm_<id>/import)
$import_dir = $lm_dir."/import";
if(!@is_dir($import_dir))
{
$this->ilias->raiseError("Creation of Import Directory failed.",$this->ilias->error_obj->FATAL);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::createLMTree ( )

create content object tree (that stores structure object hierarchie)

todo: rename LM to ConOb

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

References ilObject\getId().

{
$this->lm_tree =& new ilTree($this->getId());
$this->lm_tree->setTreeTablePK("lm_id");
$this->lm_tree->setTableNames('lm_tree','lm_data');
$this->lm_tree->addTree($this->getId(), 1);
}

+ Here is the call graph for this function:

ilObjContentObject::createProperties ( )

create new properties record

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

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

Referenced by create().

{
global $ilDB;
$q = "INSERT INTO content_object (id) VALUES (".$ilDB->quote($this->getId(), "integer").")";
$ilDB->manipulate($q);
$this->readProperties(); // to get db default values
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::delete ( )

delete learning module and all related data

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

public

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

Reimplemented from ilObject.

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

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

{
global $ilDB;
global $ilBench;
// always call parent delete function first!!
if (!parent::delete())
{
return false;
}
// delete lm object data
include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
// delete meta data of content object
$this->deleteMetaData();
// delete bibitem data
$nested = new ilNestedSetXML();
$nested->init($this->getId(), "bib");
$nested->deleteAllDBData();
// delete learning module tree
$this->lm_tree->removeTree($this->lm_tree->getTreeId());
// delete data directory
// delete content object record
$q = "DELETE FROM content_object WHERE id = ".
$ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($q);
// delete lm menu entries
$q = "DELETE FROM lm_menu WHERE lm_id = ".
$ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($q);
// remove auto glossary entries
$ilDB->manipulate("DELETE FROM lm_glossaries WHERE ".
" lm_id = ".$ilDB->quote($this->getId(), "integer")
);
return true;
}

+ Here is the call graph for this function:

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

Execute Drag Drop Action.

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

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

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

{
$lmtree = new ilTree($this->getId());
$lmtree->setTableNames('lm_tree','lm_data');
$lmtree->setTreeTablePK("lm_id");
//echo "-".$source_id."-".$target_id."-".$first_child."-".$as_subitem."-";
$source_obj = ilLMObjectFactory::getInstance($this, $source_id, true);
$source_obj->setLMId($this->getId());
if (!$first_child)
{
$target_obj = ilLMObjectFactory::getInstance($this, $target_id, true);
$target_obj->setLMId($this->getId());
$target_parent = $lmtree->getParentId($target_id);
}
// handle pages
if ($source_obj->getType() == "pg")
{
//echo "1";
if ($lmtree->isInTree($source_obj->getId()))
{
$node_data = $lmtree->getNodeData($source_obj->getId());
// cut on move
if ($movecopy == "move")
{
$parent_id = $lmtree->getParentId($source_obj->getId());
$lmtree->deleteTree($node_data);
// write history entry
require_once("./Services/History/classes/class.ilHistory.php");
ilHistory::_createEntry($source_obj->getId(), "cut",
array(ilLMObject::_lookupTitle($parent_id), $parent_id),
$this->getType().":pg");
ilHistory::_createEntry($parent_id, "cut_page",
array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
$this->getType().":st");
}
else
{
// copy page
$new_page =& $source_obj->copy();
$source_id = $new_page->getId();
$source_obj =& $new_page;
}
// paste page
if(!$lmtree->isInTree($source_obj->getId()))
{
if ($first_child) // as first child
{
$target_pos = IL_FIRST_NODE;
$parent = $target_id;
}
else if ($as_subitem) // as last child
{
$parent = $target_id;
$target_pos = IL_FIRST_NODE;
$pg_childs =& $lmtree->getChildsByType($parent, "pg");
if (count($pg_childs) != 0)
{
$target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
}
}
else // at position
{
$target_pos = $target_id;
$parent = $target_parent;
}
// insert page into tree
$lmtree->insertNode($source_obj->getId(),
$parent, $target_pos);
// write history entry
if ($movecopy == "move")
{
// write history comments
include_once("./Services/History/classes/class.ilHistory.php");
ilHistory::_createEntry($source_obj->getId(), "paste",
array(ilLMObject::_lookupTitle($parent), $parent),
$this->getType().":pg");
ilHistory::_createEntry($parent, "paste_page",
array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
$this->getType().":st");
}
}
}
}
// handle chapters
if ($source_obj->getType() == "st")
{
//echo "2";
$source_node = $lmtree->getNodeData($source_id);
$subnodes = $lmtree->getSubtree($source_node);
// check, if target is within subtree
foreach ($subnodes as $subnode)
{
if($subnode["obj_id"] == $target_id)
{
return;
}
}
$target_pos = $target_id;
if ($first_child) // as first subchapter
{
$target_pos = IL_FIRST_NODE;
$target_parent = $target_id;
$pg_childs =& $lmtree->getChildsByType($target_parent, "pg");
if (count($pg_childs) != 0)
{
$target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
}
}
else if ($as_subitem) // as last subchapter
{
$target_parent = $target_id;
$target_pos = IL_FIRST_NODE;
$childs =& $lmtree->getChilds($target_parent);
if (count($childs) != 0)
{
$target_pos = $childs[count($childs) - 1]["obj_id"];
}
}
// insert into
/*
if ($position == "into")
{
$target_parent = $target_id;
$target_pos = IL_FIRST_NODE;
// if target_pos is still first node we must skip all pages
if ($target_pos == IL_FIRST_NODE)
{
$pg_childs =& $lmtree->getChildsByType($target_parent, "pg");
if (count($pg_childs) != 0)
{
$target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
}
}
}
*/
// delete source tree
if ($movecopy == "move")
{
$lmtree->deleteTree($source_node);
}
else
{
// copy chapter (incl. subcontents)
$new_chapter =& $source_obj->copy($lmtree, $target_parent, $target_pos);
}
if (!$lmtree->isInTree($source_id))
{
$lmtree->insertNode($source_id, $target_parent, $target_pos);
// insert moved tree
if ($movecopy == "move")
{
foreach ($subnodes as $node)
{
if($node["obj_id"] != $source_id)
{
$lmtree->insertNode($node["obj_id"], $node["parent"]);
}
}
}
}
// check the tree
$this->checkTree();
}
$this->checkTree();
}

+ Here is the call graph for this function:

ilObjContentObject::exportFileItems (   $a_target_dir,
$expLog 
)

export files of file itmes

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

Referenced by exportXML().

{
include_once("./Modules/File/classes/class.ilObjFile.php");
foreach ($this->file_ids as $file_id)
{
$expLog->write(date("[y-m-d H:i:s] ")."File Item ".$file_id);
$file_obj = new ilObjFile($file_id, false);
$file_obj->export($a_target_dir);
unset($file_obj);
}
}

+ Here is the caller graph for this function:

ilObjContentObject::exportFO ( $a_xml_writer,
  $a_target_dir 
)

export object to fo

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

References $ilBench, and exportFOStructureObjects().

{
global $ilBench;
// fo:root (start)
$attrs = array();
$attrs["xmlns:fo"] = "http://www.w3.org/1999/XSL/Format";
$a_xml_writer->xmlStartTag("fo:root", $attrs);
// fo:layout-master-set (start)
$attrs = array();
$a_xml_writer->xmlStartTag("fo:layout-master-set", $attrs);
// fo:simple-page-master (start)
$attrs = array();
$attrs["master-name"] = "DinA4";
$attrs["page-height"] = "29.7cm";
$attrs["page-width"] = "21cm";
$attrs["margin-top"] = "4cm";
$attrs["margin-bottom"] = "1cm";
$attrs["margin-left"] = "2.8cm";
$attrs["margin-right"] = "7.3cm";
$a_xml_writer->xmlStartTag("fo:simple-page-master", $attrs);
// fo:region-body (complete)
$attrs = array();
$attrs["margin-top"] = "0cm";
$attrs["margin-bottom"] = "1.25cm";
$a_xml_writer->xmlElement("fo:region-body", $attrs);
// fo:region-before (complete)
$attrs = array();
$attrs["extent"] = "1cm";
$a_xml_writer->xmlElement("fo:region-before", $attrs);
// fo:region-after (complete)
$attrs = array();
$attrs["extent"] = "1cm";
$a_xml_writer->xmlElement("fo:region-after", $attrs);
// fo:simple-page-master (end)
$a_xml_writer->xmlEndTag("fo:simple-page-master");
// fo:layout-master-set (end)
$a_xml_writer->xmlEndTag("fo:layout-master-set");
// fo:page-sequence (start)
$attrs = array();
$attrs["master-reference"] = "DinA4";
$a_xml_writer->xmlStartTag("fo:page-sequence", $attrs);
// fo:flow (start)
$attrs = array();
$attrs["flow-name"] = "xsl-region-body";
$a_xml_writer->xmlStartTag("fo:flow", $attrs);
// StructureObjects
//$expLog->write(date("[y-m-d H:i:s] ")."Start Export Structure Objects");
$ilBench->start("ContentObjectExport", "exportFOStructureObjects");
$this->exportFOStructureObjects($a_xml_writer, $expLog);
$ilBench->stop("ContentObjectExport", "exportFOStructureObjects");
//$expLog->write(date("[y-m-d H:i:s] ")."Finished Export Structure Objects");*/
// fo:flow (end)
$a_xml_writer->xmlEndTag("fo:flow");
// fo:page-sequence (end)
$a_xml_writer->xmlEndTag("fo:page-sequence");
// fo:root (end)
$a_xml_writer->xmlEndTag("fo:root");
}

+ Here is the call graph for this function:

ilObjContentObject::exportFOStructureObjects ( $a_xml_writer)

export structure objects to fo

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

Referenced by exportFO().

{
$childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
foreach ($childs as $child)
{
if($child["type"] != "st")
{
continue;
}
$structure_obj = new ilStructureObject($this, $child["obj_id"]);
$structure_obj->exportFO($a_xml_writer, $expLog);
unset($structure_obj);
}
}

+ Here is the caller graph for this function:

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

export html package

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

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

Referenced by exportSCORM().

{
global $tpl, $ilBench, $ilLocator, $ilUser, $ilObjDataCache, $ilias;
$user_lang = $ilUser->getLanguage();
if ($a_lang != "")
{
$ilUser->setLanguage($a_lang);
$ilUser->setCurrentLanguage($a_lang);
$ilObjDataCache->deleteCachedEntry($this->getId());
}
// initialize temporary target directory
ilUtil::delDir($a_target_dir);
ilUtil::makeDir($a_target_dir);
$mob_dir = $a_target_dir."/mobs";
ilUtil::makeDir($mob_dir);
$file_dir = $a_target_dir."/files";
ilUtil::makeDir($file_dir);
$teximg_dir = $a_target_dir."/teximg";
ilUtil::makeDir($teximg_dir);
$style_dir = $a_target_dir."/style";
ilUtil::makeDir($style_dir);
$style_img_dir = $a_target_dir."/style/images";
ilUtil::makeDir($style_img_dir);
$content_style_dir = $a_target_dir."/content_style";
ilUtil::makeDir($content_style_dir);
$content_style_img_dir = $a_target_dir."/content_style/images";
ilUtil::makeDir($content_style_img_dir);
$GLOBALS["teximgcnt"] = 0;
// export system style sheet
$location_stylesheet = ilUtil::getStyleSheetLocation("filesystem");
$style_name = $ilUser->prefs["style"].".css";
copy($location_stylesheet, $style_dir."/".$style_name);
$fh = fopen($location_stylesheet, "r");
$css = fread($fh, filesize($location_stylesheet));
preg_match_all("/url\(([^\)]*)\)/",$css,$files);
foreach (array_unique($files[1]) as $fileref)
{
$fileref = dirname($location_stylesheet)."/".$fileref;
if (is_file($fileref))
{
copy($fileref, $style_img_dir."/".basename($fileref));
}
}
fclose($fh);
$location_stylesheet = ilUtil::getStyleSheetLocation();
// export content style sheet
$ilBench->start("ExportHTML", "exportContentStyle");
if ($this->getStyleSheetId() < 1)
{
$cont_stylesheet = "./Services/COPage/css/content.css";
$css = fread(fopen($cont_stylesheet,'r'),filesize($cont_stylesheet));
preg_match_all("/url\(([^\)]*)\)/",$css,$files);
foreach (array_unique($files[1]) as $fileref)
{
if (is_file(str_replace("..", ".", $fileref)))
{
copy(str_replace("..", ".", $fileref), $content_style_img_dir."/".basename($fileref));
}
$css = str_replace($fileref, "images/".basename($fileref),$css);
}
fwrite(fopen($content_style_dir."/content.css",'w'),$css);
}
else
{
$style = new ilObjStyleSheet($this->getStyleSheetId());
$style->writeCSSFile($content_style_dir."/content.css", "images");
$style->copyImagesToDir($content_style_img_dir);
}
$ilBench->stop("ExportHTML", "exportContentStyle");
// export syntax highlighting style
copy($syn_stylesheet, $a_target_dir."/syntaxhighlight.css");
// get learning module presentation gui class
include_once("./Modules/LearningModule/classes/class.ilLMPresentationGUI.php");
$_GET["cmd"] = "nop";
$lm_gui =& new ilLMPresentationGUI();
$lm_gui->setOfflineMode(true);
$lm_gui->setOfflineDirectory($a_target_dir);
$lm_gui->setExportFormat($a_export_format);
if ($a_lang != "")
{
if ($a_lang == $ot->getMasterLanguage())
{
$lm_gui->lang = "";
}
else
{
$lm_gui->lang = $a_lang;
}
}
// export pages
$ilBench->start("ExportHTML", "exportHTMLPages");
$this->exportHTMLPages($lm_gui, $a_target_dir, $lm_gui->lang);
$ilBench->stop("ExportHTML", "exportHTMLPages");
// export glossary terms
$ilBench->start("ExportHTML", "exportHTMLGlossaryTerms");
$this->exportHTMLGlossaryTerms($lm_gui, $a_target_dir);
$ilBench->stop("ExportHTML", "exportHTMLGlossaryTerms");
// export all media objects
$ilBench->start("ExportHTML", "exportHTMLMediaObjects");
$linked_mobs = array();
foreach ($this->offline_mobs as $mob)
{
if (ilObject::_exists($mob) && ilObject::_lookupType($mob) == "mob")
{
$this->exportHTMLMOB($a_target_dir, $lm_gui, $mob, "_blank", $linked_mobs);
}
}
$linked_mobs2 = array(); // mobs linked in link areas
foreach ($linked_mobs as $mob)
{
if (ilObject::_exists($mob))
{
$this->exportHTMLMOB($a_target_dir, $lm_gui, $mob, "_blank", $linked_mobs2);
}
}
$_GET["obj_type"] = "MediaObject";
$_GET["obj_id"] = $a_mob_id;
$_GET["cmd"] = "";
$ilBench->stop("ExportHTML", "exportHTMLMediaObjects");
// export all file objects
$ilBench->start("ExportHTML", "exportHTMLFileObjects");
foreach ($this->offline_files as $file)
{
$this->exportHTMLFile($a_target_dir, $file);
}
$ilBench->stop("ExportHTML", "exportHTMLFileObjects");
// export questions (images)
if (count($this->q_ids) > 0)
{
foreach ($this->q_ids as $q_id)
{
ilUtil::makeDirParents($a_target_dir."/assessment/0/".$q_id."/images");
ilUtil::rCopy(ilUtil::getWebspaceDir()."/assessment/0/".$q_id."/images",
$a_target_dir."/assessment/0/".$q_id."/images");
}
}
// export table of contents
$ilBench->start("ExportHTML", "exportHTMLTOC");
$ilLocator->clearItems();
if ($this->isActiveTOC())
{
$tpl = new ilTemplate("tpl.main.html", true, true);
//$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$content =& $lm_gui->showTableOfContents();
$file = $a_target_dir."/table_of_contents.html";
// open file
if (!($fp = @fopen($file,"w+")))
{
die ("<b>Error</b>: Could not open \"".$file."\" for writing".
" in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
}
chmod($file, 0770);
fwrite($fp, $content);
fclose($fp);
}
$ilBench->stop("ExportHTML", "exportHTMLTOC");
// export images
$ilBench->start("ExportHTML", "exportHTMLImages");
$image_dir = $a_target_dir."/images";
ilUtil::makeDir($image_dir);
ilUtil::makeDir($image_dir."/browser");
copy(ilUtil::getImagePath("enlarge.png", false, "filesystem"),
$image_dir."/enlarge.png");
copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
$image_dir."/browser/plus.png");
copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
$image_dir."/browser/minus.png");
copy(ilUtil::getImagePath("browser/blank.png", false, "filesystem"),
$image_dir."/browser/blank.png");
copy(ilUtil::getImagePath("spacer.png", false, "filesystem"),
$image_dir."/spacer.png");
copy(ilUtil::getImagePath("icon_st.png", false, "filesystem"),
$image_dir."/icon_st.png");
copy(ilUtil::getImagePath("icon_pg.png", false, "filesystem"),
$image_dir."/icon_pg.png");
copy(ilUtil::getImagePath("icon_st_s.png", false, "filesystem"),
$image_dir."/icon_st_s.png");
copy(ilUtil::getImagePath("icon_pg_s.png", false, "filesystem"),
$image_dir."/icon_pg_s.png");
copy(ilUtil::getImagePath("icon_lm.png", false, "filesystem"),
$image_dir."/icon_lm.png");
copy(ilUtil::getImagePath("icon_lm_s.png", false, "filesystem"),
$image_dir."/icon_lm_s.png");
copy(ilUtil::getImagePath("nav_arr_L.png", false, "filesystem"),
$image_dir."/nav_arr_L.png");
copy(ilUtil::getImagePath("nav_arr_R.png", false, "filesystem"),
$image_dir."/nav_arr_R.png");
copy(ilUtil::getImagePath("browser/forceexp.png", false, "filesystem"),
$image_dir."/browser/forceexp.png");
copy(ilUtil::getImagePath("download.png", false, "filesystem"),
$image_dir."/download.png");
$ilBench->stop("ExportHTML", "exportHTMLImages");
// export flv/mp3 player
$services_dir = $a_target_dir."/Services";
ilUtil::makeDir($services_dir);
$media_service_dir = $services_dir."/MediaObjects";
ilUtil::makeDir($media_service_dir);
include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
$flv_dir = $a_target_dir."/".ilPlayerUtil::getFlashVideoPlayerDirectory();
ilUtil::makeDir($flv_dir);
$mp3_dir = $media_service_dir."/flash_mp3_player";
ilUtil::makeDir($mp3_dir);
// copy(ilPlayerUtil::getFlashVideoPlayerFilename(true),
// $flv_dir."/".ilPlayerUtil::getFlashVideoPlayerFilename());
include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
// js files
ilUtil::makeDir($a_target_dir.'/js');
ilUtil::makeDir($a_target_dir.'/js/yahoo');
ilUtil::makeDir($a_target_dir.'/css');
include_once("./Services/YUI/classes/class.ilYuiUtil.php");
foreach (self::getSupplyingExportFiles($a_target_dir) as $f)
{
if ($f["source"] != "")
{
copy($f["source"], $f["target"]);
}
}
// template workaround: reset of template
$tpl = new ilTemplate("tpl.main.html", true, true);
$tpl->setVariable("LOCATION_STYLESHEET",$location_stylesheet);
$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
if ($a_lang != "")
{
$ilUser->setLanguage($user_lang);
$ilUser->setCurrentLanguage($user_lang);
}
// zip everything
if ($a_zip_file)
{
if ($a_lang == "")
{
$zip_target_dir = $this->getExportDirectory("html");
}
else
{
$zip_target_dir = $this->getExportDirectory("html_".$a_lang);
ilUtil::makeDir($zip_target_dir);
}
// zip it all
$date = time();
$zip_file = $zip_target_dir."/".$date."__".IL_INST_ID."__".
$this->getType()."_".$this->getId().".zip";
//echo "-".$a_target_dir."-".$zip_file."-"; exit;
ilUtil::zip($a_target_dir, $zip_file);
ilUtil::delDir($a_target_dir);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::exportHTMLFile (   $a_target_dir,
  $a_file_id 
)

export file object

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

References ilUtil\makeDir().

Referenced by exportHTML().

{
$file_dir = $a_target_dir."/files/file_".$a_file_id;
ilUtil::makeDir($file_dir);
include_once("./Modules/File/classes/class.ilObjFile.php");
$file_obj = new ilObjFile($a_file_id, false);
$source_file = $file_obj->getDirectory($file_obj->getVersion())."/".$file_obj->getFileName();
if (!is_file($source_file))
{
$source_file = $file_obj->getDirectory()."/".$file_obj->getFileName();
}
if (is_file($source_file))
{
copy($source_file, $file_dir."/".$file_obj->getFileName());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::exportHTMLGlossaryTerms ( $a_lm_gui,
  $a_target_dir 
)

export glossary terms

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

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

Referenced by exportHTML().

{
global $ilLocator;
foreach($this->offline_int_links as $int_link)
{
$ilLocator->clearItems();
if ($int_link["type"] == "git")
{
$tpl = new ilTemplate("tpl.main.html", true, true);
$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$_GET["obj_id"] = $int_link["id"];
$_GET["frame"] = "_blank";
$content =& $a_lm_gui->glossary();
$file = $a_target_dir."/term_".$int_link["id"].".html";
// open file
if (!($fp = @fopen($file,"w+")))
{
die ("<b>Error</b>: Could not open \"".$file."\" for writing".
" in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
}
chmod($file, 0770);
fwrite($fp, $content);
fclose($fp);
// store linked/embedded media objects of glosssary term
include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
$defs = ilGlossaryDefinition::getDefinitionList($int_link["id"]);
foreach($defs as $def)
{
$def_mobs = ilObjMediaObject::_getMobsOfObject("gdf:pg", $def["id"]);
foreach($def_mobs as $def_mob)
{
$this->offline_mobs[$def_mob] = $def_mob;
}
// get all files of page
$def_files = ilObjFile::_getFilesOfObject("gdf:pg", $page["obj_id"]);
$this->offline_files = array_merge($this->offline_files, $def_files);
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

export media object to html

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

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

Referenced by exportHTML().

{
global $tpl;
$mob_dir = $a_target_dir."/mobs";
$source_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob_id;
if (@is_dir($source_dir))
{
ilUtil::makeDir($mob_dir."/mm_".$a_mob_id);
ilUtil::rCopy($source_dir, $mob_dir."/mm_".$a_mob_id);
}
$tpl = new ilTemplate("tpl.main.html", true, true);
$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$_GET["obj_type"] = "MediaObject";
$_GET["mob_id"] = $a_mob_id;
$_GET["frame"] = $a_frame;
$_GET["cmd"] = "";
$content =& $a_lm_gui->media();
$file = $a_target_dir."/media_".$a_mob_id.".html";
// open file
if (!($fp = @fopen($file,"w+")))
{
die ("<b>Error</b>: Could not open \"".$file."\" for writing".
" in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
}
chmod($file, 0770);
fwrite($fp, $content);
fclose($fp);
// fullscreen
include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
$mob_obj = new ilObjMediaObject($a_mob_id);
if ($mob_obj->hasFullscreenItem())
{
$tpl = new ilTemplate("tpl.main.html", true, true);
$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$_GET["obj_type"] = "";
$_GET["frame"] = "";
$_GET["mob_id"] = $a_mob_id;
$_GET["cmd"] = "fullscreen";
$content =& $a_lm_gui->fullscreen();
$file = $a_target_dir."/fullscreen_".$a_mob_id.".html";
// open file
if (!($fp = @fopen($file,"w+")))
{
die ("<b>Error</b>: Could not open \"".$file."\" for writing".
" in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
}
chmod($file, 0770);
fwrite($fp, $content);
fclose($fp);
}
$linked_mobs = $mob_obj->getLinkedMediaObjects();
$a_linked_mobs = array_merge($a_linked_mobs, $linked_mobs);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

export all pages of learning module to html file

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

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

Referenced by exportHTML().

{
global $tpl, $ilBench, $ilLocator;
$pages = ilLMPageObject::getPageList($this->getId());
$lm_tree =& $this->getLMTree();
$first_page = $lm_tree->fetchSuccessorNode($lm_tree->getRootId(), "pg");
$this->first_page_id = $first_page["child"];
// iterate all learning module pages
$mobs = array();
$int_links = array();
$this->offline_files = array();
include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
// get html export id mapping
$lm_set = new ilSetting("lm");
$exp_id_map = array();
if ($lm_set->get("html_export_ids"))
{
foreach ($pages as $page)
{
$exp_id = ilLMPageObject::getExportId($this->getId(), $page["obj_id"]);
if (trim($exp_id) != "")
{
$exp_id_map[$page["obj_id"]] = trim($exp_id);
}
}
}
//exit;
if ($a_lang == "")
{
$a_lang = "-";
}
reset($pages);
foreach ($pages as $page)
{
if (ilLMPage::_exists($this->getType(), $page["obj_id"]))
{
$ilLocator->clearItems();
$ilBench->start("ExportHTML", "exportHTMLPage");
$ilBench->start("ExportHTML", "exportPageHTML");
$this->exportPageHTML($a_lm_gui, $a_target_dir, $page["obj_id"],
"", $exp_id_map);
$ilBench->stop("ExportHTML", "exportPageHTML");
// get all snippets of page
$pcs = ilPageContentUsage::getUsagesOfPage($page["obj_id"], $this->getType().":pg", 0, false, $a_lang);
foreach ($pcs as $pc)
{
if ($pc["type"] == "incl")
{
$incl_mobs = ilObjMediaObject::_getMobsOfObject("mep:pg", $pc["id"]);
foreach($incl_mobs as $incl_mob)
{
$mobs[$incl_mob] = $incl_mob;
}
}
}
// get all media objects of page
$pg_mobs = ilObjMediaObject::_getMobsOfObject($this->getType().":pg", $page["obj_id"], 0, $a_lang);
foreach($pg_mobs as $pg_mob)
{
$mobs[$pg_mob] = $pg_mob;
}
// get all internal links of page
$pg_links = ilInternalLink::_getTargetsOfSource($this->getType().":pg", $page["obj_id"], $a_lang);
$int_links = array_merge($int_links, $pg_links);
// get all files of page
include_once("./Modules/File/classes/class.ilObjFile.php");
$pg_files = ilObjFile::_getFilesOfObject($this->getType().":pg", $page["obj_id"], 0, $a_lang);
$this->offline_files = array_merge($this->offline_files, $pg_files);
// collect all questions
include_once("./Services/COPage/classes/class.ilPCQuestion.php");
$q_ids = ilPCQuestion::_getQuestionIdsForPage($this->getType(), $page["obj_id"], $a_lang);
foreach($q_ids as $q_id)
{
$this->q_ids[$q_id] = $q_id;
}
$ilBench->stop("ExportHTML", "exportHTMLPage");
}
}
$this->offline_mobs = $mobs;
$this->offline_int_links = $int_links;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

export page html

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

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

Referenced by exportHTMLPages().

{
global $tpl, $ilBench;
//echo "<br>B: export Page HTML ($a_lm_page_id)"; flush();
// template workaround: reset of template
$tpl = new ilTemplate("tpl.main.html", true, true);
$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$_GET["obj_id"] = $a_lm_page_id;
$_GET["frame"] = $a_frame;
if ($a_frame == "")
{
//if ($nid = ilLMObject::_lookupNID($a_lm_gui->lm->getId(), $a_lm_page_id, "pg"))
if (is_array($a_exp_id_map) && isset($a_exp_id_map[$a_lm_page_id]))
{
$file = $a_target_dir."/lm_pg_".$a_exp_id_map[$a_lm_page_id].".html";
}
else
{
$file = $a_target_dir."/lm_pg_".$a_lm_page_id.".html";
}
}
else
{
if ($a_frame != "toc")
{
$file = $a_target_dir."/frame_".$a_lm_page_id."_".$a_frame.".html";
}
else
{
$file = $a_target_dir."/frame_".$a_frame.".html";
}
}
// return if file is already existing
if (@is_file($file))
{
return;
}
$content =& $a_lm_gui->layout("main.xml", false);
// open file
if (!($fp = @fopen($file,"w+")))
{
die ("<b>Error</b>: Could not open \"".$file."\" for writing".
" in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
}
// set file permissions
chmod($file, 0770);
// write xml data into the file
fwrite($fp, $content);
// close file
fclose($fp);
if ($this->first_page_id == $a_lm_page_id && $a_frame == "")
{
copy($file, $a_target_dir."/index.html");
}
// write frames of frameset
$frameset = $a_lm_gui->getCurrentFrameSet();
foreach ($frameset as $frame)
{
$this->exportPageHTML($a_lm_gui, $a_target_dir, $a_lm_page_id, $frame);
}
}

+ Here is the caller graph for this function:

ilObjContentObject::exportSCORM (   $a_target_dir,
  $log 
)

export scorm package

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

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

{
ilUtil::delDir($a_target_dir);
ilUtil::makeDir($a_target_dir);
//ilUtil::makeDir($a_target_dir."/res");
// export everything to html
$this->exportHTML($a_target_dir."/res", $log, false, "scorm");
// build manifest file
include("./Modules/LearningModule/classes/class.ilContObjectManifestBuilder.php");
$man_builder = new ilContObjectManifestBuilder($this);
$man_builder->buildManifest();
$man_builder->dump($a_target_dir);
// copy scorm 1.2 schema definitions
copy("Modules/LearningModule/scorm_xsd/adlcp_rootv1p2.xsd", $a_target_dir."/adlcp_rootv1p2.xsd");
copy("Modules/LearningModule/scorm_xsd/imscp_rootv1p1p2.xsd", $a_target_dir."/imscp_rootv1p1p2.xsd");
copy("Modules/LearningModule/scorm_xsd/imsmd_rootv1p2p1.xsd", $a_target_dir."/imsmd_rootv1p2p1.xsd");
copy("Modules/LearningModule/scorm_xsd/ims_xml.xsd", $a_target_dir."/ims_xml.xsd");
// zip it all
$date = time();
$zip_file = $a_target_dir."/".$date."__".IL_INST_ID."__".
$this->getType()."_".$this->getId().".zip";
//echo "zip-".$a_target_dir."-to-".$zip_file;
ilUtil::zip(array($a_target_dir."/res",
$a_target_dir."/imsmanifest.xml",
$a_target_dir."/adlcp_rootv1p2.xsd",
$a_target_dir."/imscp_rootv1p1p2.xsd",
$a_target_dir."/ims_xml.xsd",
$a_target_dir."/imsmd_rootv1p2p1.xsd")
, $zip_file);
$dest_file = $this->getExportDirectory("scorm")."/".$date."__".IL_INST_ID."__".
$this->getType()."_".$this->getId().".zip";
rename($zip_file, $dest_file);
ilUtil::delDir($a_target_dir);
}

+ Here is the call graph for this function:

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

export object to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

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

{
global $ilBench;
$attrs = array();
switch($this->getType())
{
case "lm":
$attrs["Type"] = "LearningModule";
break;
case "dbk":
$attrs["Type"] = "LibObject";
break;
}
$a_xml_writer->xmlStartTag("ContentObject", $attrs);
// MetaData
$this->exportXMLMetaData($a_xml_writer);
// StructureObjects
//echo "ContObj:".$a_inst.":<br>";
$expLog->write(date("[y-m-d H:i:s] ")."Start Export Structure Objects");
$ilBench->start("ContentObjectExport", "exportStructureObjects");
$this->exportXMLStructureObjects($a_xml_writer, $a_inst, $expLog);
$ilBench->stop("ContentObjectExport", "exportStructureObjects");
$expLog->write(date("[y-m-d H:i:s] ")."Finished Export Structure Objects");
// PageObjects
$expLog->write(date("[y-m-d H:i:s] ")."Start Export Page Objects");
$ilBench->start("ContentObjectExport", "exportPageObjects");
$this->exportXMLPageObjects($a_xml_writer, $a_inst, $expLog);
$ilBench->stop("ContentObjectExport", "exportPageObjects");
$expLog->write(date("[y-m-d H:i:s] ")."Finished Export Page Objects");
// MediaObjects
$expLog->write(date("[y-m-d H:i:s] ")."Start Export Media Objects");
$ilBench->start("ContentObjectExport", "exportMediaObjects");
$this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
$ilBench->stop("ContentObjectExport", "exportMediaObjects");
$expLog->write(date("[y-m-d H:i:s] ")."Finished Export Media Objects");
// FileItems
$expLog->write(date("[y-m-d H:i:s] ")."Start Export File Items");
$ilBench->start("ContentObjectExport", "exportFileItems");
$this->exportFileItems($a_target_dir, $expLog);
$ilBench->stop("ContentObjectExport", "exportFileItems");
$expLog->write(date("[y-m-d H:i:s] ")."Finished Export File Items");
// Questions
if (count($this->q_ids) > 0)
{
$qti_file = fopen($a_target_dir."/qti.xml", "w");
include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
$pool = new ilObjQuestionPool();
fwrite($qti_file, $pool->toXML($this->q_ids));
fclose($qti_file);
}
// To do: implement version selection/detection
// Properties
$expLog->write(date("[y-m-d H:i:s] ")."Start Export Properties");
$this->exportXMLProperties($a_xml_writer, $expLog);
$expLog->write(date("[y-m-d H:i:s] ")."Finished Export Properties");
$a_xml_writer->xmlEndTag("ContentObject");
}

+ Here is the call graph for this function:

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

export media objects to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

References ilObject\_lookupType().

Referenced by exportXML().

{
include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
$linked_mobs = array();
// mobs directly embedded into pages
foreach ($this->mob_ids as $mob_id)
{
if ($mob_id > 0 && ilObject::_lookupType($mob_id) == "mob")
{
$expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
$media_obj = new ilObjMediaObject($mob_id);
$media_obj->exportXML($a_xml_writer, $a_inst);
$media_obj->exportFiles($a_target_dir);
$lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
$linked_mobs = array_merge($linked_mobs, $lmobs);
unset($media_obj);
}
}
// linked mobs (in map areas)
foreach ($linked_mobs as $mob_id)
{
if ($mob_id > 0)
{
$expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
$media_obj = new ilObjMediaObject($mob_id);
$media_obj->exportXML($a_xml_writer, $a_inst);
$media_obj->exportFiles($a_target_dir);
unset($media_obj);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::exportXMLMetaData ( $a_xml_writer)

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

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

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

Referenced by exportXML().

{
include_once("Services/MetaData/classes/class.ilMD2XML.php");
$md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
$md2xml->setExportMode(true);
$md2xml->startExport();
$a_xml_writer->appendXML($md2xml->getXML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

export page objects to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

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

Referenced by exportXML().

{
global $ilBench;
include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
$pages = ilLMPageObject::getPageList($this->getId());
foreach ($pages as $page)
{
if (ilLMPage::_exists($this->getType(), $page["obj_id"]))
{
$expLog->write(date("[y-m-d H:i:s] ")."Page Object ".$page["obj_id"]);
// export xml to writer object
$page_obj = new ilLMPageObject($this, $page["obj_id"]);
$page_obj->exportXML($a_xml_writer, "normal", $a_inst);
// collect media objects
$mob_ids = $page_obj->getMediaObjectIDs();
foreach($mob_ids as $mob_id)
{
$this->mob_ids[$mob_id] = $mob_id;
}
// collect all file items
$file_ids = $page_obj->getFileItemIds();
foreach($file_ids as $file_id)
{
$this->file_ids[$file_id] = $file_id;
}
// collect all questions
$q_ids = $page_obj->getQuestionIds();
foreach($q_ids as $q_id)
{
$this->q_ids[$q_id] = $q_id;
}
unset($page_obj);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::exportXMLProperties (   $a_xml_writer,
$expLog 
)

export properties of content object

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

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

Referenced by exportXML().

{
$attrs = array();
$a_xml_writer->xmlStartTag("Properties", $attrs);
// Layout
$attrs = array("Name" => "Layout", "Value" => $this->getLayout());
$a_xml_writer->xmlElement("Property", $attrs);
// Page Header
$attrs = array("Name" => "PageHeader", "Value" => $this->getPageHeader());
$a_xml_writer->xmlElement("Property", $attrs);
// TOC Mode
$attrs = array("Name" => "TOCMode", "Value" => $this->getTOCMode());
$a_xml_writer->xmlElement("Property", $attrs);
// LM Menu Activation
$attrs = array("Name" => "ActiveLMMenu", "Value" =>
$a_xml_writer->xmlElement("Property", $attrs);
// Numbering Activation
$attrs = array("Name" => "ActiveNumbering", "Value" =>
$a_xml_writer->xmlElement("Property", $attrs);
// Table of contents button activation
$attrs = array("Name" => "ActiveTOC", "Value" =>
$a_xml_writer->xmlElement("Property", $attrs);
// Print view button activation
$attrs = array("Name" => "ActivePrintView", "Value" =>
$a_xml_writer->xmlElement("Property", $attrs);
// Note that download button is not saved, because
// download files do not exist after import
// Clean frames
$attrs = array("Name" => "CleanFrames", "Value" =>
$a_xml_writer->xmlElement("Property", $attrs);
// Public notes activation
$attrs = array("Name" => "PublicNotes", "Value" =>
$a_xml_writer->xmlElement("Property", $attrs);
// History comments for authors activation
$attrs = array("Name" => "HistoryUserComments", "Value" =>
$a_xml_writer->xmlElement("Property", $attrs);
// Rating
$attrs = array("Name" => "Rating", "Value" =>
$a_xml_writer->xmlElement("Property", $attrs);
$attrs = array("Name" => "RatingPages", "Value" =>
$a_xml_writer->xmlElement("Property", $attrs);
// Header Page
if ($this->getHeaderPage() > 0)
{
$attrs = array("Name" => "HeaderPage", "Value" =>
"il_".IL_INST_ID."_pg_".$this->getHeaderPage());
$a_xml_writer->xmlElement("Property", $attrs);
}
// Footer Page
if ($this->getFooterPage() > 0)
{
$attrs = array("Name" => "FooterPage", "Value" =>
"il_".IL_INST_ID."_pg_".$this->getFooterPage());
$a_xml_writer->xmlElement("Property", $attrs);
}
$a_xml_writer->xmlEndTag("Properties");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

export structure objects to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

Referenced by exportXML().

{
include_once './Modules/LearningModule/classes/class.ilStructureObject.php';
$childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
foreach ($childs as $child)
{
if($child["type"] != "st")
{
continue;
}
$structure_obj = new ilStructureObject($this, $child["obj_id"]);
$structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
unset($structure_obj);
}
}

+ Here is the caller graph for this function:

ilObjContentObject::fixTree ( )

fix tree

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

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

{
global $ilDB;
$tree =& $this->getLMTree();
// check numbering, if errors, renumber
// it is very important to keep this step before deleting subtrees
// in the following steps
$set = $ilDB->query("SELECT DISTINCT l1.lm_id".
" FROM lm_tree l1".
" JOIN lm_tree l2 ON ( l1.child = l2.parent".
" AND l1.lm_id = l2.lm_id )".
" JOIN lm_data ON ( l1.child = lm_data.obj_id )".
" WHERE (l2.lft < l1.lft".
" OR l2.rgt > l1.rgt OR l2.lft > l1.rgt OR l2.rgt < l1.lft)".
" AND l1.lm_id = ".$ilDB->quote($this->getId(), "integer").
" ORDER BY lm_data.create_date DESC"
);
if ($rec = $ilDB->fetchAssoc($set))
{
$tree->renumber();
}
// delete subtrees that have no lm_data records
$nodes = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
foreach ($nodes as $node)
{
$q = "SELECT * FROM lm_data WHERE obj_id = ".
$ilDB->quote($node["child"], "integer");
$obj_set = $ilDB->query($q);
$obj_rec = $ilDB->fetchAssoc($obj_set);
if (!$obj_rec)
{
$node_data = $tree->getNodeData($node["child"]);
$tree->deleteTree($node_data);
}
}
// delete subtrees that have pages as parent
$nodes = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
foreach ($nodes as $node)
{
$q = "SELECT * FROM lm_data WHERE obj_id = ".
$ilDB->quote($node["parent"], "integer");
$obj_set = $ilDB->query($q);
$obj_rec = $ilDB->fetchAssoc($obj_set);
if ($obj_rec["type"] == "pg")
{
$node_data = $tree->getNodeData($node["child"]);
if ($tree->isInTree($node["child"]))
{
$tree->deleteTree($node_data);
}
}
}
// check for multi-references pages or chapters
// if errors -> create copies of them here
$set = $ilDB->query("SELECT DISTINCT l1.lm_id".
" FROM lm_tree l1".
" JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )".
" JOIN lm_data ON (l1.child = lm_data.obj_id)".
" WHERE l1.child <> 1".
" AND l1.lm_id <> lm_data.lm_id".
" AND l1.lm_id = ".$ilDB->quote($this->getId(), "integer"));
if ($rec = $ilDB->fetchAssoc($set))
{
$set = $ilDB->query("SELECT DISTINCT l1.child ".
" FROM lm_tree l1".
" JOIN lm_tree l2 ON ( l1.child = l2.child AND l1.lm_id <> l2.lm_id )".
" JOIN lm_data ON (l1.child = lm_data.obj_id)".
" WHERE l1.child <> 1".
" AND l1.lm_id <> lm_data.lm_id".
" AND l1.lm_id = ".$ilDB->quote($this->getId(), "integer"));
include_once("./Modules/LearningModule/classes/class.ilLMObjectFactory.php");
while ($rec = $ilDB->fetchAssoc($set))
{
$cobj = ilLMObjectFactory::getInstance($this, $rec["child"]);
if (is_object($cobj))
{
if ($cobj->getType() == "pg")
{
// make a copy of it
$pg_copy = $cobj->copy($this);
// replace the child in the tree with the copy (id)
$ilDB->manipulate("UPDATE lm_tree SET ".
" child = ".$ilDB->quote($pg_copy->getId(), "integer").
" WHERE child = ".$ilDB->quote($cobj->getId(), "integer").
" AND lm_id = ".$ilDB->quote($this->getId(), "integer")
);
}
else if ($cobj->getType() == "st")
{
// make a copy of it
$st_copy = $cobj->copy($this);
// replace the child in the tree with the copy (id)
$ilDB->manipulate("UPDATE lm_tree SET ".
" child = ".$ilDB->quote($st_copy->getId(), "integer").
" WHERE child = ".$ilDB->quote($cobj->getId(), "integer").
" AND lm_id = ".$ilDB->quote($this->getId(), "integer")
);
// make all childs refer to the copy now
$ilDB->manipulate("UPDATE lm_tree SET ".
" parent = ".$ilDB->quote($st_copy->getId(), "integer").
" WHERE parent = ".$ilDB->quote($cobj->getId(), "integer").
" AND lm_id = ".$ilDB->quote($this->getId(), "integer")
);
}
}
}
}
}

+ Here is the call graph for this function:

ilObjContentObject::getAutoGlossaries ( )

Get auto glossaries.

Returns
array int

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

References $auto_glossaries.

Referenced by removeAutoGlossary(), and updateAutoGlossaries().

+ Here is the caller graph for this function:

ilObjContentObject::getAvailableLayouts ( )

get all available lm layouts

static

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

References $file, and $ret.

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

{
$dir = opendir("./Modules/LearningModule/layouts/lm");
$layouts = array();
while($file = readdir($dir))
{
if ($file != "." && $file != ".." && $file != "CVS" && $file != ".svn")
{
// directories
if (@is_dir("./Modules/LearningModule/layouts/lm/".$file))
{
$layouts[$file] = $file;
}
}
}
asort($layouts);
// workaround: fix ordering
$ret = array(
'toc2win' => 'toc2win',
'toc2windyn' => 'toc2windyn',
'1window' => '1window',
'2window' => '2window',
'3window' => '3window',
'presentation' => 'presentation',
'fullscreen' => 'fullscreen'
);
foreach ($layouts as $l)
{
if (!in_array($l, $ret))
{
$ret[$l] = $l;
}
}
return $ret;
}

+ Here is the caller graph for this function:

ilObjContentObject::getDataDirectory ( )

get data directory

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

References ilUtil\getDataDir().

Referenced by delete().

{
return ilUtil::getDataDir()."/lm_data".
"/lm_".$this->getId();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::getDescription ( )

get description of content object

Returns
string description

Reimplemented from ilObject.

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

Referenced by cloneObject().

{
}

+ Here is the caller graph for this function:

ilObjContentObject::getDisableDefaultFeedback ( )

Get disable default feedback for questions.

Returns
bool disable default feedback

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

Referenced by updateProperties().

{
return $this->disable_def_feedback;
}

+ Here is the caller graph for this function:

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

get export directory of lm

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

References ilUtil\getDataDir().

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

{
switch ($a_type)
{
case "scorm":
$export_dir = ilUtil::getDataDir()."/lm_data"."/lm_".$this->getId()."/export_scorm";
break;
default: // = xml
if (substr($a_type, 0, 4) == "html")
{
$export_dir = ilUtil::getDataDir()."/lm_data"."/lm_".$this->getId()."/export_".$a_type;
}
else
{
$export_dir = ilUtil::getDataDir()."/lm_data"."/lm_".$this->getId()."/export";
}
break;
}
return $export_dir;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::getExportFiles ( )

get export files

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

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

{
$file = array();
$types = array("xml", "html", "scorm");
foreach ($types as $type)
{
$dir = $this->getExportDirectory($type);
// quit if import dir not available
if (!@is_dir($dir) or
!is_writeable($dir))
{
continue;
}
// open directory
$cdir = dir($dir);
// initialize array
// get files and save the in the array
while ($entry = $cdir->read())
{
if ($entry != "." and
$entry != ".." and
substr($entry, -4) == ".zip" and
ereg("^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.zip\$", $entry))
{
$file[$entry.$type] = array("type" => $type, "file" => $entry,
"size" => filesize($dir."/".$entry));
}
}
// close import directory
$cdir->close();
}
// sort files
ksort ($file);
reset ($file);
return $file;
}

+ Here is the call graph for this function:

ilObjContentObject::getFooterPage ( )

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

Referenced by exportXMLProperties(), and updateProperties().

{
return $this->footer_page;
}

+ Here is the caller graph for this function:

ilObjContentObject::getHeaderPage ( )

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

Referenced by exportXMLProperties(), and updateProperties().

{
return $this->header_page;
}

+ Here is the caller graph for this function:

ilObjContentObject::getHideHeaderFooterPrint ( )

Get hide header footer in print mode.

Returns
bool hide header and footer?

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

Referenced by updateProperties().

{
return $this->hide_header_footer_print;
}

+ Here is the caller graph for this function:

ilObjContentObject::getImportDirectory ( )

get import directory of lm

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

References $import_dir, and ilUtil\getDataDir().

Referenced by importFromZipFile().

{
if(strlen($this->import_dir))
{
}
"/lm_".$this->getId()."/import";
if(@is_dir($import_dir))
{
return $import_dir;
}
else
{
return false;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::getImportId ( )

get import id

public

Returns
string import id

Reimplemented from ilObject.

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

References ilObject\$import_id.

Referenced by importFromDirectory().

{
}

+ Here is the caller graph for this function:

ilObjContentObject::getLayout ( )

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

Returns
string default layout

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

References $layout.

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

{
return $this->layout;
}

+ Here is the caller graph for this function:

ilObjContentObject::getLayoutPerPage ( )

Get layout per page.

Returns
boolean layout per page

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

Referenced by cloneObject(), and updateProperties().

{
return $this->layout_per_page;
}

+ Here is the caller graph for this function:

& ilObjContentObject::getLMTree ( )

get content object tree

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

References $lm_tree.

Referenced by exportHTMLPages(), and fixTree().

{
}

+ Here is the caller graph for this function:

ilObjContentObject::getOfflineFiles (   $dir)

get offline files

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

References $file.

{
// quit if offline dir not available
if (!@is_dir($dir) or
!is_writeable($dir))
{
return array();
}
// open directory
$dir = dir($dir);
// initialize array
$file = array();
// get files and save the in the array
while ($entry = $dir->read())
{
if ($entry != "." and
$entry != ".." and
substr($entry, -4) == ".pdf" and
ereg("^[0-9]{10}_{2}[0-9]+_{2}(lm_)*[0-9]+\.pdf\$", $entry))
{
$file[] = $entry;
}
}
// close import directory
$dir->close();
// sort files
sort ($file);
reset ($file);
return $file;
}
ilObjContentObject::getOnline ( )

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

References $online.

Referenced by updateProperties().

{
return $this->online;
}

+ Here is the caller graph for this function:

ilObjContentObject::getPageHeader ( )

get page header mode (IL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER)

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

References $pg_header.

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

{
}

+ Here is the caller graph for this function:

ilObjContentObject::getPublicAccessMode ( )

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

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

Referenced by cloneObject(), and updateProperties().

{
return $this->public_access_mode;
}

+ Here is the caller graph for this function:

ilObjContentObject::getPublicExportFile (   $a_type)

get public export file

Parameters
string$a_typetype ("xml" / "html")
Returns
string $a_file file name

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

Referenced by updateProperties().

{
return $this->public_export_file[$a_type];
}

+ Here is the caller graph for this function:

ilObjContentObject::getStyleSheetId ( )

get ID of assigned style sheet object

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

References $style_id.

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

{
}

+ Here is the caller graph for this function:

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

Get supplying export files.

Parameters
@return

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

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

Referenced by ilLMPresentationGUI\layout().

{
include_once("./Services/YUI/classes/class.ilYuiUtil.php");
include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
$scripts = array(
array("source" => ilYuiUtil::getLocalPath('yahoo/yahoo-min.js'),
"target" => $a_target_dir.'/js/yahoo/yahoo-min.js',
"type" => "js"),
array("source" => ilYuiUtil::getLocalPath('yahoo-dom-event/yahoo-dom-event.js'),
"target" => $a_target_dir.'/js/yahoo/yahoo-dom-event.js',
"type" => "js"),
array("source" => ilYuiUtil::getLocalPath('animation/animation-min.js'),
"target" => $a_target_dir.'/js/yahoo/animation-min.js',
"type" => "js"),
array("source" => './Services/JavaScript/js/Basic.js',
"target" => $a_target_dir.'/js/Basic.js',
"type" => "js"),
array("source" => './Services/Accordion/js/accordion.js',
"target" => $a_target_dir.'/js/accordion.js',
"type" => "js"),
array("source" => './Services/Accordion/css/accordion.css',
"target" => $a_target_dir.'/css/accordion.css',
"type" => "css"),
array("source" => iljQueryUtil::getLocaljQueryPath(),
"target" => $a_target_dir.'/js/jquery.js',
"type" => "js"),
"target" => $a_target_dir.'/js/maphilight.js',
"type" => "js"),
"target" => $a_target_dir.'/js/jquery-ui-min.js',
"type" => "js"),
array("source" => './Services/COPage/js/ilCOPagePres.js',
"target" => $a_target_dir.'/js/ilCOPagePres.js',
"type" => "js"),
array("source" => './Modules/Scorm2004/scripts/questions/pure.js',
"target" => $a_target_dir.'/js/pure.js',
"type" => "js"),
array("source" => './Modules/Scorm2004/scripts/questions/question_handling.js',
"target" => $a_target_dir.'/js/question_handling.js',
"type" => "js"),
array("source" => './Modules/Scorm2004/templates/default/question_handling.css',
"target" => $a_target_dir.'/css/question_handling.css',
"type" => "css"),
"target" => $a_target_dir."/".ilPlayerUtil::getLocalMediaElementJsPath(),
"type" => "js"),
"target" => $a_target_dir."/".ilPlayerUtil::getLocalMediaElementCssPath(),
"type" => "css"),
"target" => $a_target_dir."/".ilExplorerBaseGUI::getLocalExplorerJsPath(),
"type" => "js"),
"target" => $a_target_dir."/".ilExplorerBaseGUI::getLocalJsTreeJsPath(),
"type" => "js"),
array("source" => './Modules/LearningModule/js/LearningModule.js',
"target" => $a_target_dir.'/js/LearningModule.js',
"type" => "js")
);
$mathJaxSetting = new ilSetting("MathJax");
$use_mathjax = $mathJaxSetting->get("enable");
if ($use_mathjax)
{
$scripts[] = array("source" => "",
"target" => $mathJaxSetting->get("path_to_mathjax"),
"type" => "js");
}
return $scripts;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::getTitle ( )

get title of content object

Returns
string title

Reimplemented from ilObject.

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

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

{
return parent::getTitle();
}

+ Here is the caller graph for this function:

ilObjContentObject::getTOCMode ( )

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

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

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

{
return $this->toc_mode;
}

+ Here is the caller graph for this function:

& ilObjContentObject::getTree ( )

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

References $lm_tree.

{
}
ilObjContentObject::getXMLZip ( )

Reimplemented from ilObject.

Reimplemented in ilObjDlBook.

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

{
include_once("./Modules/LearningModule/classes/class.ilContObjectExport.php");
$cont_exp = new ilContObjectExport($this,'xml');
$export_file = $cont_exp->buildExportFile();
return $export_file;
}
ilObjContentObject::hasRating ( )

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

References $rating.

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

{
return $this->rating;
}

+ Here is the caller graph for this function:

ilObjContentObject::hasRatingPages ( )

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

References $rating_pages.

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

{
}

+ Here is the caller graph for this function:

ilObjContentObject::hasSuccessorPage (   $a_cont_obj_id,
  $a_page_id 
)

checks if page has a successor page

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

Referenced by ilPageObjectGUI\showPage().

{
$tree = new ilTree($a_cont_obj_id);
$tree->setTableNames('lm_tree','lm_data');
$tree->setTreeTablePK("lm_id");
if ($tree->isInTree($a_page_id))
{
$succ = $tree->fetchSuccessorNode($a_page_id, "pg");
if ($succ > 0)
{
return true;
}
}
return false;
}

+ Here is the caller graph for this function:

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

Constructor public.

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

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

References ilObject\ilObject().

Referenced by ilObjDlBook\ilObjDlBook(), and ilObjLearningModule\ilObjLearningModule().

{
// this also calls read() method! (if $a_id is set)
$this->ilObject($a_id,$a_call_by_reference);
$this->mob_ids = array();
$this->file_ids = array();
$this->q_ids = array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::import ( )

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

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

{
// nothing to do. just display the dialogue in Out
return;
}
ilObjContentObject::importFromDirectory (   $a_directory,
  $a_validate = true 
)

Import lm from directory.

Parameters
@return

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

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

Referenced by importFromZipFile().

{
global $lng;
// determine filename of xml file
$subdir = basename($a_directory);
$xml_file = $a_directory."/".$subdir.".xml";
// check directory exists within zip file
if (!is_dir($a_directory))
{
return sprintf($lng->txt("cont_no_subdir_in_zip"), $subdir);
}
// check whether xml file exists within zip file
if (!is_file($xml_file))
{
return sprintf($lng->txt("cont_zip_file_invalid"), $subdir."/".$subdir.".xml");
}
// import questions
$qti_file = $a_directory."/qti.xml";
$qtis = array();
if (is_file($qti_file))
{
include_once "./Services/QTI/classes/class.ilQTIParser.php";
include_once("./Modules/Test/classes/class.ilObjTest.php");
$qtiParser = new ilQTIParser ($qti_file,
$result = $qtiParser->startParsing ();
$founditems = & $qtiParser->getFoundItems ();
$testObj = new ilObjTest(0, true);
if (count($founditems) > 0)
{
$qtiParser = new ilQTIParser($qti_file, IL_MO_PARSE_QTI, 0, "");
$qtiParser->setTestObject($testObj);
$result = $qtiParser->startParsing();
$qtis = array_merge($qtis, $qtiParser->getImportMapping());
}
}
include_once ("./Modules/LearningModule/classes/class.ilContObjParser.php");
$contParser = new ilContObjParser($this, $xml_file, $subdir, $qmapping);
$contParser->setQuestionMapping($qtis);
$contParser->startParsing();
$this->MDUpdateListener('General');
// import style
$style_file = $a_directory."/style.xml";
$style_zip_file = $a_directory."/style.zip";
if (is_file($style_zip_file)) // try to import style.zip first
{
require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
$style = new ilObjStyleSheet();
$style->import($style_zip_file);
$this->writeStyleSheetId($style->getId());
}
else if (is_file($style_file)) // try to import style.xml
{
require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
$style = new ilObjStyleSheet();
$style->import($style_file);
$this->writeStyleSheetId($style->getId());
}
// // validate
if ($a_validate)
{
$mess = $this->validatePages();
}
if ($mess == "")
{
// handle internal links to this learning module
include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
$this->getType(), $this->getRefId());
}
return $mess;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Import lm from zip file.

Parameters
@return

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

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

{
global $lng;
// create import directory
// copy uploaded file to import directory
$file = pathinfo($a_filename);
$full_path = $this->getImportDirectory()."/".$a_filename;
$a_filename, $full_path);
// unzip file
ilUtil::unzip($full_path);
$subdir = basename($file["basename"],".".$file["extension"]);
$mess = $this->importFromDirectory(
$this->getImportDirectory()."/".$subdir, $a_validate);
// this should only be true for help modules
if ($a_import_into_help_module > 0)
{
// search the zip file
$dir = $this->getImportDirectory()."/".$subdir;
$files = ilUtil::getDir($dir);
foreach ($files as $file)
{
if (is_int(strpos($file["entry"], "__help_")) &&
is_int(strpos($file["entry"], ".zip")))
{
include_once("./Services/Export/classes/class.ilImport.php");
$imp = new ilImport();
$imp->getMapping()->addMapping('Services/Help', 'help_module', 0, $a_import_into_help_module);
include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
$chaps = ilLMObject::getObjectList($this->getId(), "st");
foreach ($chaps as $chap)
{
$chap_arr = explode("_", $chap["import_id"]);
$imp->getMapping()->addMapping('Services/Help', 'help_chap',
$chap_arr[count($chap_arr) - 1], $chap["obj_id"]);
}
$imp->importEntity($dir."/".$file["entry"], $file["entry"],
"help", "Services/Help", true);
}
}
}
// delete import directory
return $mess;
}

+ Here is the call graph for this function:

ilObjContentObject::initDefaultRoles ( )

init default roles settings OBSOLETE.

DON'T USE, READ TEXT BELOW public

Returns
array object IDs of created local roles.

Reimplemented from ilObject.

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

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

{
return array();
global $rbacadmin, $rbacreview;
// create a local role folder
$rfoldObj = $this->createRoleFolder("Local roles","Role Folder of content object ".$this->getId());
// note: we don't need any roles here, local "author" roles must
// be created manually. subscription roles have been abandoned.
/*
// create author role and assign role to rolefolder...
$roleObj = $rfoldObj->createRole("author object ".$this->getRefId(),"author of content object ref id ".$this->getRefId());
$roles[] = $roleObj->getId();
// copy permissions from author template to new role
$rbacadmin->copyRolePermissions($this->getAuthorRoleTemplateId(), 8, $rfoldObj->getRefId(), $roleObj->getId());
// grant all allowed operations of role to current learning module
$rbacadmin->grantPermission($roleObj->getId(),
$rbacreview->getOperationsOfRole($roleObj->getId(), "lm", $rfoldObj->getRefId()),
$this->getRefId());*/
unset($rfoldObj);
//unset($roleObj);
return $roles ? $roles : array();
}

+ Here is the call graph for this function:

ilObjContentObject::isActiveDownloads ( )

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

Referenced by cloneObject(), and updateProperties().

{
return $this->downloads_active;
}

+ Here is the caller graph for this function:

ilObjContentObject::isActiveDownloadsPublic ( )

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

Referenced by cloneObject(), and updateProperties().

{
return $this->downloads_public_active;
}

+ Here is the caller graph for this function:

ilObjContentObject::isActiveHistoryUserComments ( )

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

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

{
return $this->user_comments;
}

+ Here is the caller graph for this function:

ilObjContentObject::isActiveLMMenu ( )

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

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

{
return $this->lm_menu_active;
}

+ Here is the caller graph for this function:

ilObjContentObject::isActiveNumbering ( )

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

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

{
return $this->numbering;
}

+ Here is the caller graph for this function:

ilObjContentObject::isActivePreventGlossaryAppendix ( )

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

Referenced by cloneObject(), and updateProperties().

{
return $this->prevent_glossary_appendix_active;
}

+ Here is the caller graph for this function:

ilObjContentObject::isActivePrintView ( )

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

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

{
return $this->print_view_active;
}

+ Here is the caller graph for this function:

ilObjContentObject::isActiveTOC ( )

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

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

{
return $this->toc_active;
}

+ Here is the caller graph for this function:

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

Is module an online module.

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

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

References ilObject\_lookupObjId().

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

{
if (!$a_as_obj_id && $a_id > 0 && $a_id == OH_REF_ID)
{
return true;
}
if ($a_as_obj_id && $a_id > 0 && $a_id == ilObject::_lookupObjId(OH_REF_ID))
{
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::lookupAutoGlossaries (   $a_lm_id)

Lookup auto glossaries.

Parameters
@return

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

Referenced by ilLMPage\beforePageContentUpdate().

{
global $ilDB;
// read auto glossaries
$set = $ilDB->query("SELECT * FROM lm_glossaries ".
" WHERE lm_id = ".$ilDB->quote($a_lm_id, "integer")
);
$glos = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$glos[] = $rec["glo_id"];
}
return $glos;
}

+ Here is the caller graph for this function:

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

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

public

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

Reimplemented from ilObject.

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

References $_GET, and ilObject\getType().

{
global $tree;
switch ($a_event)
{
case "link":
//var_dump("<pre>",$a_params,"</pre>");
//echo "Content Object ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
//exit;
break;
case "cut":
//echo "Content Object ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
//exit;
break;
case "copy":
//var_dump("<pre>",$a_params,"</pre>");
//echo "Content Object ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
//exit;
break;
case "paste":
//echo "Content Object ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
//exit;
break;
case "new":
//echo "Content Object ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
//exit;
break;
}
// At the beginning of the recursive process it avoids second call of the notify function with the same parameter
if ($a_node_id==$_GET["ref_id"])
{
$parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
$parent_type = $parent_obj->getType();
if($parent_type == $this->getType())
{
$a_node_id = (int) $tree->getParentId($a_node_id);
}
}
parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
}

+ Here is the call graph for this function:

ilObjContentObject::publicNotes ( )

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

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

{
return $this->pub_notes;
}

+ Here is the caller graph for this function:

ilObjContentObject::putInTree (   $a_parent)

put content object in main tree

Reimplemented from ilObject.

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

Referenced by addFirstChapterAndPage().

{
global $tree;
// put this object in tree under $a_parent
parent::putInTree($a_parent);
// make new tree for this object
//$tree->addTree($this->getId());
}

+ Here is the caller graph for this function:

ilObjContentObject::read ( )

read data of content object

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

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

{
global $ilDB;
# echo "Content<br>\n";
$this->lm_tree = new ilTree($this->getId());
$this->lm_tree->setTableNames('lm_tree','lm_data');
$this->lm_tree->setTreeTablePK("lm_id");
$this->readProperties();
// read auto glossaries
$set = $ilDB->query("SELECT * FROM lm_glossaries ".
" WHERE lm_id = ".$ilDB->quote($this->getId(), "integer")
);
$glos = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$glos[] = $rec["glo_id"];
}
$this->setAutoGlossaries($glos);
//parent::read();
}

+ Here is the call graph for this function:

ilObjContentObject::readProperties ( )

read content object properties

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

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

Referenced by createProperties(), and read().

{
global $ilDB;
$q = "SELECT * FROM content_object WHERE id = ".
$ilDB->quote($this->getId(), "integer");
$lm_set = $ilDB->query($q);
$lm_rec = $ilDB->fetchAssoc($lm_set);
$this->setLayout($lm_rec["default_layout"]);
$this->setStyleSheetId((int) $lm_rec["stylesheet"]);
$this->setPageHeader($lm_rec["page_header"]);
$this->setTOCMode($lm_rec["toc_mode"]);
$this->setOnline(ilUtil::yn2tf($lm_rec["is_online"]));
$this->setActiveTOC(ilUtil::yn2tf($lm_rec["toc_active"]));
$this->setActiveNumbering(ilUtil::yn2tf($lm_rec["numbering"]));
$this->setActivePrintView(ilUtil::yn2tf($lm_rec["print_view_active"]));
$this->setActivePreventGlossaryAppendix(ilUtil::yn2tf($lm_rec["no_glo_appendix"]));
$this->setHideHeaderFooterPrint($lm_rec["hide_head_foot_print"]);
$this->setActiveDownloads(ilUtil::yn2tf($lm_rec["downloads_active"]));
$this->setActiveDownloadsPublic(ilUtil::yn2tf($lm_rec["downloads_public_active"]));
$this->setActiveLMMenu(ilUtil::yn2tf($lm_rec["lm_menu_active"]));
$this->setCleanFrames(ilUtil::yn2tf($lm_rec["clean_frames"]));
$this->setPublicNotes(ilUtil::yn2tf($lm_rec["pub_notes"]));
$this->setHeaderPage((int) $lm_rec["header_page"]);
$this->setFooterPage((int) $lm_rec["footer_page"]);
$this->setHistoryUserComments(ilUtil::yn2tf($lm_rec["hist_user_comments"]));
$this->setPublicAccessMode($lm_rec["public_access_mode"]);
$this->setPublicExportFile("xml", $lm_rec["public_xml_file"]);
$this->setPublicExportFile("html", $lm_rec["public_html_file"]);
$this->setPublicExportFile("scorm", $lm_rec["public_scorm_file"]);
$this->setLayoutPerPage($lm_rec["layout_per_page"]);
$this->setRating($lm_rec["rating"]);
$this->setRatingPages($lm_rec["rating_pages"]);
$this->setDisableDefaultFeedback($lm_rec["disable_def_feedback"]);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::removeAutoGlossary (   $a_glo_id)

Remove auto glossary.

Parameters
@return

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

References getAutoGlossaries(), and setAutoGlossaries().

{
$glo_ids = array();
foreach($this->getAutoGlossaries() as $g)
{
if ($g != $a_glo_id)
{
$glo_ids[] = $g;
}
}
$this->setAutoGlossaries($glo_ids);
}

+ Here is the call graph for this function:

ilObjContentObject::setActiveDownloads (   $a_down)

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

Referenced by readProperties().

{
$this->downloads_active = $a_down;
}

+ Here is the caller graph for this function:

ilObjContentObject::setActiveDownloadsPublic (   $a_down)

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

Referenced by readProperties().

{
$this->downloads_public_active = $a_down;
}

+ Here is the caller graph for this function:

ilObjContentObject::setActiveLMMenu (   $a_act_lm_menu)

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

Referenced by readProperties().

{
$this->lm_menu_active = $a_act_lm_menu;
}

+ Here is the caller graph for this function:

ilObjContentObject::setActiveNumbering (   $a_num)

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

Referenced by readProperties().

{
$this->numbering = $a_num;
}

+ Here is the caller graph for this function:

ilObjContentObject::setActivePreventGlossaryAppendix (   $a_print)

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

Referenced by readProperties().

{
$this->prevent_glossary_appendix_active = $a_print;
}

+ Here is the caller graph for this function:

ilObjContentObject::setActivePrintView (   $a_print)

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

Referenced by readProperties().

{
$this->print_view_active = $a_print;
}

+ Here is the caller graph for this function:

ilObjContentObject::setActiveTOC (   $a_toc)

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

Referenced by readProperties().

{
$this->toc_active = $a_toc;
}

+ Here is the caller graph for this function:

ilObjContentObject::setAutoGlossaries (   $a_val)

Set auto glossaries.

Parameters
array$a_valint

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

References ilObject\_lookupType().

Referenced by read(), and removeAutoGlossary().

{
$this->auto_glossaries = array();
if (is_array($a_val))
{
foreach ($a_val as $v)
{
$v = (int) $v;
if ($v > 0 && ilObject::_lookupType($v) == "glo" &&
!in_array($v, $this->auto_glossaries))
{
$this->auto_glossaries[] = $v;
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::setCleanFrames (   $a_clean)

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

Referenced by readProperties(), and updateProperties().

{
$this->clean_frames = $a_clean;
}

+ Here is the caller graph for this function:

ilObjContentObject::setDescription (   $a_description)

set description of content object

Reimplemented from ilObject.

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

{
parent::setDescription($a_description);
// $this->meta_data->setDescription($a_description);
}
ilObjContentObject::setDisableDefaultFeedback (   $a_val)

Set disable default feedback for questions.

Parameters
bool$a_valdisable default feedback

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

Referenced by readProperties().

{
$this->disable_def_feedback = $a_val;
}

+ Here is the caller graph for this function:

ilObjContentObject::setFooterPage (   $a_pg)

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

Referenced by readProperties().

{
$this->footer_page = $a_pg;
}

+ Here is the caller graph for this function:

ilObjContentObject::setHeaderPage (   $a_pg)

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

Referenced by readProperties().

{
$this->header_page = $a_pg;
}

+ Here is the caller graph for this function:

ilObjContentObject::setHideHeaderFooterPrint (   $a_val)

Set hide header footer in print mode.

Parameters
bool$a_valhide header and footer?

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

Referenced by readProperties().

{
$this->hide_header_footer_print = $a_val;
}

+ Here is the caller graph for this function:

ilObjContentObject::setHistoryUserComments (   $a_comm)

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

Referenced by readProperties().

{
$this->user_comments = $a_comm;
}

+ Here is the caller graph for this function:

ilObjContentObject::setImportDirectory (   $a_import_dir)

Set import directory for further use in ilContObjParser.

Parameters
stringimport directory
Returns
void

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

{
$this->import_dir = $a_import_dir;
}
ilObjContentObject::setImportId (   $a_import_id)

set import id

public

Parameters
string$a_import_idimport id

Reimplemented from ilObject.

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

{
$this->import_id = $a_id;
}
ilObjContentObject::setLayout (   $a_layout)

set default page layout

Parameters
string$a_layoutdefault page layout

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

Referenced by readProperties().

{
$this->layout = $a_layout;
}

+ Here is the caller graph for this function:

ilObjContentObject::setLayoutPerPage (   $a_val)

Set layout per page.

Parameters
booleanlayout per page

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

Referenced by readProperties().

{
$this->layout_per_page = $a_val;
}

+ Here is the caller graph for this function:

ilObjContentObject::setOnline (   $a_online)

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

Referenced by readProperties().

{
$this->online = $a_online;
}

+ Here is the caller graph for this function:

ilObjContentObject::setPageHeader (   $a_pg_header = IL_CHAPTER_TITLE)

set page header mode

Parameters
string$a_pg_headerIL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER

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

Referenced by readProperties().

{
$this->pg_header = $a_pg_header;
}

+ Here is the caller graph for this function:

ilObjContentObject::setPublicAccessMode (   $a_mode)

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

Referenced by readProperties().

{
$this->public_access_mode = $a_mode;
}

+ Here is the caller graph for this function:

ilObjContentObject::setPublicExportFile (   $a_type,
  $a_file 
)

specify public export file for type

Parameters
string$a_typetype ("xml" / "html")
string$a_filefile name

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

Referenced by readProperties().

{
$this->public_export_file[$a_type] = $a_file;
}

+ Here is the caller graph for this function:

ilObjContentObject::setPublicNotes (   $a_pub_notes)

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

Referenced by readProperties().

{
$this->pub_notes = $a_pub_notes;
}

+ Here is the caller graph for this function:

ilObjContentObject::setRating (   $a_value)

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

Referenced by readProperties().

{
$this->rating = (bool)$a_value;
}

+ Here is the caller graph for this function:

ilObjContentObject::setRatingPages (   $a_value)

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

Referenced by readProperties().

{
$this->rating_pages = (bool)$a_value;
}

+ Here is the caller graph for this function:

ilObjContentObject::setStyleSheetId (   $a_style_id)

set ID of assigned style sheet object

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

Referenced by readProperties().

{
$this->style_id = $a_style_id;
}

+ Here is the caller graph for this function:

ilObjContentObject::setTitle (   $a_title)

set title of content object

Reimplemented from ilObject.

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

{
parent::setTitle($a_title);
// $this->meta_data->setTitle($a_title);
}
ilObjContentObject::setTOCMode (   $a_toc_mode = "chapters")

set toc mode

Parameters
string$a_toc_mode"chapters" | "pages"

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

Referenced by readProperties().

{
$this->toc_mode = $a_toc_mode;
}

+ Here is the caller graph for this function:

ilObjContentObject::update ( )

update complete object (meta data and properties)

Reimplemented from ilObject.

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

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

+ Here is the call graph for this function:

ilObjContentObject::updateAutoGlossaries ( )

Update auto glossaries.

Parameters
@return

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

References getAutoGlossaries().

Referenced by create(), and update().

{
global $ilDB;
// update auto glossaries
$ilDB->manipulate("DELETE FROM lm_glossaries WHERE ".
" lm_id = ".$ilDB->quote($this->getId(), "integer")
);
foreach ($this->getAutoGlossaries() as $glo_id)
{
$ilDB->manipulate("INSERT INTO lm_glossaries ".
"(lm_id, glo_id) VALUES (".
$ilDB->quote($this->getId(), "integer").",".
$ilDB->quote($glo_id, "integer").
")");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::updateProperties ( )

Update content object properties.

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

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

Referenced by update().

{
global $ilDB;
// force clean_frames to be set, if layout per page is activated
if ($this->getLayoutPerPage())
{
$this->setCleanFrames(true);
}
$q = "UPDATE content_object SET ".
" default_layout = ".$ilDB->quote($this->getLayout(), "text").", ".
" stylesheet = ".$ilDB->quote($this->getStyleSheetId(), "integer").",".
" page_header = ".$ilDB->quote($this->getPageHeader(), "text").",".
" toc_mode = ".$ilDB->quote($this->getTOCMode(), "text").",".
" is_online = ".$ilDB->quote(ilUtil::tf2yn($this->getOnline()), "text").",".
" toc_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveTOC()), "text").",".
" numbering = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveNumbering()), "text").",".
" print_view_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActivePrintView()), "text").",".
" no_glo_appendix = ".$ilDB->quote(ilUtil::tf2yn($this->isActivePreventGlossaryAppendix()), "text").",".
" hide_head_foot_print = ".$ilDB->quote($this->getHideHeaderFooterPrint(), "integer").",".
" downloads_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveDownloads()), "text").",".
" downloads_public_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveDownloadsPublic()), "text").",".
" clean_frames = ".$ilDB->quote(ilUtil::tf2yn($this->cleanFrames()), "text").",".
" pub_notes = ".$ilDB->quote(ilUtil::tf2yn($this->publicNotes()), "text").",".
" hist_user_comments = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveHistoryUserComments()), "text").",".
" public_access_mode = ".$ilDB->quote($this->getPublicAccessMode(), "text").",".
" public_xml_file = ".$ilDB->quote($this->getPublicExportFile("xml"), "text").",".
" public_html_file = ".$ilDB->quote($this->getPublicExportFile("html"), "text").",".
" public_scorm_file = ".$ilDB->quote($this->getPublicExportFile("scorm"), "text").",".
" header_page = ".$ilDB->quote($this->getHeaderPage(), "integer").",".
" footer_page = ".$ilDB->quote($this->getFooterPage(), "integer").",".
" lm_menu_active = ".$ilDB->quote(ilUtil::tf2yn($this->isActiveLMMenu()), "text").", ".
" layout_per_page = ".$ilDB->quote($this->getLayoutPerPage(), "integer").", ".
" rating = ".$ilDB->quote($this->hasRating(), "integer").", ".
" rating_pages = ".$ilDB->quote($this->hasRatingPages(), "integer").", ".
" disable_def_feedback = ".$ilDB->quote($this->getDisableDefaultFeedback(), "integer")." ".
" WHERE id = ".$ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($q);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::validatePages ( )

Validate all pages.

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

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

Referenced by importFromDirectory().

{
include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
$mess = "";
$pages = ilLMPageObject::getPageList($this->getId());
foreach ($pages as $page)
{
if (ilLMPage::_exists($this->getType(), $page["obj_id"]))
{
$cpage = new ilLMPage($page["obj_id"]);
$cpage->buildDom();
$error = @$cpage->validateDom();
if ($error != "")
{
$this->lng->loadLanguageModule("content");
ilUtil::sendInfo($this->lng->txt("cont_import_validation_errors"));
$title = ilLMObject::_lookupTitle($page["obj_id"]);
$page_obj = new ilLMPageObject($this, $page["obj_id"]);
$mess.= $this->lng->txt("obj_pg").": ".$title;
$mess.= '<div class="small">';
foreach ($error as $e)
{
$err_mess = implode($e, " - ");
if (!is_int(strpos($err_mess, ":0:")))
{
$mess.= htmlentities($err_mess)."<br />";
}
}
$mess.= '</div>';
$mess.= "<br />";
}
}
}
return $mess;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::writeStyleSheetId (   $a_style_id)

write ID of assigned style sheet object to db

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

References ilObject\getId().

Referenced by importFromDirectory().

{
global $ilDB;
$q = "UPDATE content_object SET ".
" stylesheet = ".$ilDB->quote((int) $a_style_id, "integer").
" WHERE id = ".$ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($q);
$this->style_id = $a_style_id;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilObjContentObject::$auto_glossaries = array()

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

Referenced by getAutoGlossaries().

ilObjContentObject::$import_dir = ''
private

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

Referenced by createImportDirectory(), and getImportDirectory().

ilObjContentObject::$layout

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

Referenced by getLayout().

ilObjContentObject::$meta_data

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

ilObjContentObject::$online

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

Referenced by getOnline().

ilObjContentObject::$pg_header

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

Referenced by getPageHeader().

ilObjContentObject::$rating
protected

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

Referenced by hasRating().

ilObjContentObject::$rating_pages
protected

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

Referenced by hasRatingPages().

ilObjContentObject::$style_id

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

Referenced by cloneObject(), and getStyleSheetId().


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