ILIAS  Release_4_1_x_branch Revision 61804
 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_upload=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.
getTree ()
 update ()
 update complete object (meta data and properties)
 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)
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 ()
 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")
 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)
 export all pages of learning module to html file
 exportPageHTML (&$a_lm_gui, $a_target_dir, $a_lm_page_id, $a_frame="")
 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)
 Import lm from zip file.
 importFromDirectory ($a_directory, $a_validate=true)
 Import lm from directory.
- 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)
 _lookupObjIdByImportId ($a_import_id)
 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
 _lookupDescription ($a_id)
 lookup object description
 _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
 _lookupObjectId ($a_ref_id)
 lookup object id
 _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
 setRegisterMode ($a_bool)
 isUserRegistered ($a_user_id=0)
 requireRegistration ()
 getHTMLDirectory ()
 cloneObject ($a_target_id, $a_copy_id=0)
 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.

Static Public Member Functions

static getSupplyingExportFiles ($a_target_dir=".")
 Get supplying export files.
- Static Public Member Functions inherited from ilObject
static _getAllReferences ($a_id)
 get all reference ids of object
static _lookupTitle ($a_id)
 lookup object title
static _getIdsForTitle ($title, $type= '', $partialmatch=false)
static _lookupObjId ($a_id)
static _lookupType ($a_id, $a_reference=false)
 lookup object type
 _exists ($a_id, $a_reference=false)
 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)
 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.

Data Fields

 $lm_tree
 $meta_data
 $layout
 $style_id
 $pg_header
 $online
- Data Fields inherited from ilObject
const TITLE_LENGTH = 128
 max length of object title
 $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

Private Attributes

 $import_dir = ''

Detailed Description

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

References $ilErr, $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 633 of file class.ilObjContentObject.php.

References $ilDB, and 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 985 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 1020 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 599 of file class.ilObjContentObject.php.

References $ilDB.

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

References $ilDB.

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

References $ilDB.

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

References $ilDB, and $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:

ilObjContentObject::_lookupOnline (   $a_id)

check wether content object is online

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

References $ilDB, and 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 548 of file class.ilObjContentObject.php.

References $ilDB, and $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 512 of file class.ilObjContentObject.php.

References $ilDB, and 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::checkTree ( )

Definition at line 1136 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 783 of file class.ilObjContentObject.php.

Referenced by exportXMLProperties(), and updateProperties().

{
return $this->clean_frames;
}

+ Here is the caller graph for this function:

ilObjContentObject::create (   $a_upload = false)

create content object

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

References ilObject\create(), ilObject\createMetaData(), and createProperties().

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

+ 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 340 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)
{
// html
case "html":
$export_dir = $lm_dir."/export_html";
break;
// scorm
case "scorm":
$export_dir = $lm_dir."/export_scorm";
break;
default: // = xml
$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 266 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 243 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 901 of file class.ilObjContentObject.php.

References $ilDB, 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 413 of file class.ilObjContentObject.php.

References $ilBench, $ilDB, 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);
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 2331 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("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("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 1402 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 2217 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 2297 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" 
)

export html package

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

References $_GET, $file, $files, $GLOBALS, $ilBench, $tpl, ilObject\_exists(), ilObject\_lookupType(), ilUtil\delDir(), exportHTMLFile(), exportHTMLGlossaryTerms(), exportHTMLMOB(), exportHTMLPages(), getExportDirectory(), ilObject\getId(), ilUtil\getImagePath(), getStyleSheetId(), ilUtil\getStyleSheetLocation(), ilObjStyleSheet\getSyntaxStylePath(), ilObject\getType(), isActiveTOC(), ilUtil\makeDir(), and ilUtil\zip().

Referenced by exportSCORM().

{
global $tpl, $ilBench, $ilLocator, $ilUser;
// 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);
// export pages
$ilBench->start("ExportHTML", "exportHTMLPages");
$this->exportHTMLPages($lm_gui, $a_target_dir);
$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 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.gif", false, "filesystem"),
$image_dir."/enlarge.gif");
copy(ilUtil::getImagePath("browser/blank.gif", false, "filesystem"),
$image_dir."/browser/plus.gif");
copy(ilUtil::getImagePath("browser/blank.gif", false, "filesystem"),
$image_dir."/browser/minus.gif");
copy(ilUtil::getImagePath("browser/blank.gif", false, "filesystem"),
$image_dir."/browser/blank.gif");
copy(ilUtil::getImagePath("spacer.gif", false, "filesystem"),
$image_dir."/spacer.gif");
copy(ilUtil::getImagePath("icon_st.gif", false, "filesystem"),
$image_dir."/icon_st.gif");
copy(ilUtil::getImagePath("icon_pg.gif", false, "filesystem"),
$image_dir."/icon_pg.gif");
copy(ilUtil::getImagePath("icon_st_s.gif", false, "filesystem"),
$image_dir."/icon_st_s.gif");
copy(ilUtil::getImagePath("icon_pg_s.gif", false, "filesystem"),
$image_dir."/icon_pg_s.gif");
copy(ilUtil::getImagePath("icon_lm.gif", false, "filesystem"),
$image_dir."/icon_lm.gif");
copy(ilUtil::getImagePath("icon_lm_s.gif", false, "filesystem"),
$image_dir."/icon_lm_s.gif");
copy(ilUtil::getImagePath("nav_arr_L.gif", false, "filesystem"),
$image_dir."/nav_arr_L.gif");
copy(ilUtil::getImagePath("nav_arr_R.gif", false, "filesystem"),
$image_dir."/nav_arr_R.gif");
copy(ilUtil::getImagePath("browser/forceexp.gif", false, "filesystem"),
$image_dir."/browser/forceexp.gif");
copy(ilUtil::getImagePath("download.gif", false, "filesystem"),
$image_dir."/download.gif");
$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);
$flv_dir = $media_service_dir."/flash_flv_player";
ilUtil::makeDir($flv_dir);
$mp3_dir = $media_service_dir."/flash_mp3_player";
ilUtil::makeDir($mp3_dir);
copy("./Services/MediaObjects/flash_flv_player/flvplayer.swf",
$flv_dir."/flvplayer.swf");
copy("./Services/MediaObjects/flash_mp3_player/mp3player.swf",
$mp3_dir."/mp3player.swf");
// 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)
{
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");
// zip everything
$ilBench->start("ExportHTML", "zip");
if (true)
{
if ($a_zip_file)
{
// zip it all
$date = time();
$zip_file = $this->getExportDirectory("html")."/".$date."__".IL_INST_ID."__".
$this->getType()."_".$this->getId().".zip";
ilUtil::zip($a_target_dir, $zip_file);
ilUtil::delDir($a_target_dir);
}
}
$ilBench->stop("ExportHTML", "zip");
}

+ 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 1925 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 2008 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 1945 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 
)

export all pages of learning module to html file

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

References $ilBench, $lm_tree, $mobs, $tpl, ilPageObject\_exists(), ilObjFile\_getFilesOfObject(), ilObjMediaObject\_getMobsOfObject(), ilInternalLink\_getTargetsOfSource(), exportPageHTML(), 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");
foreach ($pages as $page)
{
if (ilPageObject::_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"]);
$ilBench->stop("ExportHTML", "exportPageHTML");
// get all snippets of page
$pcs = ilPageContentUsage::getUsagesOfPage($page["obj_id"], $this->getType().":pg");
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"]);
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"]);
$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"]);
$this->offline_files = array_merge($this->offline_files, $pg_files);
$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 = "" 
)

export page html

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

References $_GET, $file, $ilBench, $tpl, and ilLMObject\_lookupNID().

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"))
{
$file = $a_target_dir."/lm_pg_".$nid.".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;
}
$ilBench->start("ExportHTML", "layout");
$ilBench->start("ExportHTML", "layout_".$a_frame);
$content =& $a_lm_gui->layout("main.xml", false);
$ilBench->stop("ExportHTML", "layout_".$a_frame);
$ilBench->stop("ExportHTML", "layout");
// 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
$ilBench->start("ExportHTML", "getCurrentFrameSet");
$frameset = $a_lm_gui->getCurrentFrameSet();
$ilBench->stop("ExportHTML", "getCurrentFrameSet");
foreach ($frameset as $frame)
{
$this->exportPageHTML($a_lm_gui, $a_target_dir, $a_lm_page_id, $frame);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::exportSCORM (   $a_target_dir,
  $log 
)

export scorm package

Definition at line 1606 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 1197 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 1360 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 1271 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 1311 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";
$pages = ilLMPageObject::getPageList($this->getId());
foreach ($pages as $page)
{
if (ilPageObject::_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 1419 of file class.ilObjContentObject.php.

References cleanFrames(), getFooterPage(), getHeaderPage(), getLayout(), getPageHeader(), getTOCMode(), 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);
// 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 1286 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 1149 of file class.ilObjContentObject.php.

References $ilDB, and getLMTree().

{
global $ilDB;
$tree =& $this->getLMTree();
// 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);
}
}
}
}

+ Here is the call graph for this function:

ilObjContentObject::getAvailableLayouts ( )

get all available lm layouts

static

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

References $dir, and $file.

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

{
// read sdir, copy files and copy directories recursively
$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);
return $layouts;
}

+ Here is the caller graph for this function:

ilObjContentObject::getDataDirectory ( )

get data directory

Definition at line 295 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 151 of file class.ilObjContentObject.php.

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

get export directory of lm

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

References ilUtil\getDataDir().

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

{
switch ($a_type)
{
case "html":
$export_dir = ilUtil::getDataDir()."/lm_data"."/lm_".$this->getId()."/export_html";
break;
case "scorm":
$export_dir = ilUtil::getDataDir()."/lm_data"."/lm_".$this->getId()."/export_scorm";
break;
default: // = xml
$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 1496 of file class.ilObjContentObject.php.

References $dir, $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 818 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 808 of file class.ilObjContentObject.php.

Referenced by exportXMLProperties(), and updateProperties().

{
return $this->header_page;
}

+ Here is the caller graph for this function:

ilObjContentObject::getImportDirectory ( )

get import directory of lm

Definition at line 304 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 166 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 463 of file class.ilObjContentObject.php.

References $layout.

Referenced by 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 191 of file class.ilObjContentObject.php.

Referenced by updateProperties().

{
return $this->layout_per_page;
}

+ Here is the caller graph for this function:

& ilObjContentObject::getLMTree ( )

get content object tree

Definition at line 255 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 1566 of file class.ilObjContentObject.php.

References $dir, and $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 693 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 647 of file class.ilObjContentObject.php.

References $pg_header.

Referenced by exportXMLProperties(), and updateProperties().

{
}

+ Here is the caller graph for this function:

ilObjContentObject::getPublicAccessMode ( )

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

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

Referenced by 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 1558 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 481 of file class.ilObjContentObject.php.

References $style_id.

Referenced by 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 1885 of file class.ilObjContentObject.php.

References ilYuiUtil\getLocalPath().

Referenced by ilLMPresentationGUI\layout().

{
include_once("./Services/YUI/classes/class.ilYuiUtil.php");
return 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" => './Modules/Scorm2004/scripts/questions/jquery.js',
"target" => $a_target_dir.'/js/jquery.js',
"type" => "js"),
array("source" => './Modules/Scorm2004/scripts/questions/jquery-ui-min.js',
"target" => $a_target_dir.'/js/jquery-ui-min.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")
);
}

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

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

{
return parent::getTitle();
}

+ Here is the caller graph for this function:

ilObjContentObject::getTOCMode ( )

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

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

Referenced by exportXMLProperties(), and updateProperties().

{
return $this->toc_mode;
}

+ Here is the caller graph for this function:

& ilObjContentObject::getTree ( )

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

References $lm_tree.

{
}
ilObjContentObject::getXMLZip ( )

Reimplemented from ilObject.

Reimplemented in ilObjDlBook.

Definition at line 2313 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::hasSuccessorPage (   $a_cont_obj_id,
  $a_page_id 
)

checks if page has a successor page

Definition at line 1119 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 38 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 215 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 2603 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("./Services/COPage/classes/class.ilPageObject.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 
)

Import lm from zip file.

Parameters
@return

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

References $file, ilObject\$lng, createImportDirectory(), ilUtil\delDir(), getImportDirectory(), 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);
// 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 80 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 753 of file class.ilObjContentObject.php.

Referenced by updateProperties().

{
return $this->downloads_active;
}

+ Here is the caller graph for this function:

ilObjContentObject::isActiveDownloadsPublic ( )

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

Referenced by updateProperties().

{
return $this->downloads_public_active;
}

+ Here is the caller graph for this function:

ilObjContentObject::isActiveHistoryUserComments ( )

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

Referenced by exportXMLProperties(), and updateProperties().

{
return $this->user_comments;
}

+ Here is the caller graph for this function:

ilObjContentObject::isActiveLMMenu ( )

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

Referenced by exportXMLProperties(), and updateProperties().

{
return $this->lm_menu_active;
}

+ Here is the caller graph for this function:

ilObjContentObject::isActiveNumbering ( )

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

Referenced by exportXMLProperties(), and updateProperties().

{
return $this->numbering;
}

+ Here is the caller graph for this function:

ilObjContentObject::isActivePreventGlossaryAppendix ( )

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

Referenced by updateProperties().

{
return $this->prevent_glossary_appendix_active;
}

+ Here is the caller graph for this function:

ilObjContentObject::isActivePrintView ( )

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

Referenced by exportXMLProperties(), and updateProperties().

{
return $this->print_view_active;
}

+ Here is the caller graph for this function:

ilObjContentObject::isActiveTOC ( )

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

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

{
return $this->toc_active;
}

+ 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 1062 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 773 of file class.ilObjContentObject.php.

Referenced by 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 226 of file class.ilObjContentObject.php.

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

read data of content object

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

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

{
# 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();
//parent::read();
}

+ Here is the call graph for this function:

ilObjContentObject::readProperties ( )

read content object properties

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

References $ilDB, ilObject\getId(), setActiveDownloads(), setActiveDownloadsPublic(), setActiveLMMenu(), setActiveNumbering(), setActivePreventGlossaryAppendix(), setActivePrintView(), setActiveTOC(), setCleanFrames(), setFooterPage(), setHeaderPage(), setHistoryUserComments(), setLayout(), setLayoutPerPage(), setOnline(), setPageHeader(), setPublicAccessMode(), setPublicExportFile(), setPublicNotes(), 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->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"]);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjContentObject::setActiveDownloads (   $a_down)

Definition at line 748 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 758 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 698 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 718 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 738 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 728 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 708 of file class.ilObjContentObject.php.

Referenced by readProperties().

{
$this->toc_active = $a_toc;
}

+ Here is the caller graph for this function:

ilObjContentObject::setCleanFrames (   $a_clean)

Definition at line 778 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 159 of file class.ilObjContentObject.php.

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

Definition at line 813 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 803 of file class.ilObjContentObject.php.

Referenced by readProperties().

{
$this->header_page = $a_pg;
}

+ Here is the caller graph for this function:

ilObjContentObject::setHistoryUserComments (   $a_comm)

Definition at line 788 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 329 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 171 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 473 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 181 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 688 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 657 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 793 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 1546 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 768 of file class.ilObjContentObject.php.

Referenced by readProperties().

{
$this->pub_notes = $a_pub_notes;
}

+ Here is the caller graph for this function:

ilObjContentObject::setStyleSheetId (   $a_style_id)

set ID of assigned style sheet object

Definition at line 489 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 140 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 683 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 204 of file class.ilObjContentObject.php.

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

{
$this->updateMetaData();
$this->updateProperties();
}

+ Here is the call graph for this function:

ilObjContentObject::updateProperties ( )

Update content object properties.

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

References $ilDB, cleanFrames(), getFooterPage(), getHeaderPage(), ilObject\getId(), getLayout(), getLayoutPerPage(), getOnline(), getPageHeader(), getPublicAccessMode(), getPublicExportFile(), getStyleSheetId(), getTOCMode(), 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").",".
" 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")." ".
" 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 2521 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 "./Services/COPage/classes/class.ilPageObject.php";
$mess = "";
$pages = ilLMPageObject::getPageList($this->getId());
foreach ($pages as $page)
{
if (ilPageObject::_exists($this->getType(), $page["obj_id"]))
{
$cpage = new ilPageObject($this->getType(), $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 497 of file class.ilObjContentObject.php.

References $ilDB, and 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::$import_dir = ''
private

Definition at line 30 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::$style_id

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

Referenced by getStyleSheetId().


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