ILIAS  release_7 Revision v7.30-3-g800a261c036
ilSCORM2004Page Class Reference

Class ilSCORM2004Page. More...

+ Inheritance diagram for ilSCORM2004Page:
+ Collaboration diagram for ilSCORM2004Page:

Public Member Functions

 getParentType ()
 Get parent type. More...
 
 afterConstructor ()
 After constructor. More...
 
 setScormLmId ($a_scormlmid)
 Set Scorm LM ID. More...
 
 getScormLmId ()
 Get Scorm LM ID. More...
 
 setGlossaryId ($a_val)
 Set glossary id. More...
 
 getGlossaryId ()
 Get glossary id. More...
 
 create ()
 Create new scorm 2004. More...
 
 createWithLayoutId ($a_layout_id)
 Create new scorm 2004 with page-layout. More...
 
 update ($a_validate=true, $a_no_history=false)
 update object data More...
 
 read ()
 Read wiki data. More...
 
 delete ()
 delete page and al related data More...
 
 exportXML (&$a_xml_writer, $a_mode="normal", $a_inst=0)
 export page object to xml (see ilias_co.dtd) More...
 
 exportXMLMetaData (&$a_xml_writer)
 export page alias to xml More...
 
 exportXMLPageContent (&$a_xml_writer, $a_inst=0)
 export page objects meta data to xml (see ilias_co.dtd) More...
 
 getMediaObjectIds ()
 get ids of all media objects within the page More...
 
 getFileItemIds ()
 get ids of all file items within the page More...
 
 performAutomaticModifications ()
 Perform automatic modifications (may be overwritten by sub classes) More...
 
 removeInvalidLinks ()
 Remove invalid links. More...
 
- Public Member Functions inherited from ilPageObject
 __construct ($a_id=0, $a_old_nr=0, $a_lang="-")
 Constructor @access public. More...
 
 afterConstructor ()
 After constructor. More...
 
 getParentType ()
 Get parent type. More...
 
 initPageConfig ()
 Init page config. More...
 
 setLanguage ($a_val)
 Set language. More...
 
 getLanguage ()
 Get language. More...
 
 setConcreteLang ($a_val)
 
 getConcreteLang ()
 
 setPageConfig ($a_val)
 Set page config object. More...
 
 getPageConfig ()
 Get page config object. More...
 
 setRenderMd5 ($a_rendermd5)
 Set Render MD5. More...
 
 getRenderMd5 ()
 Get Render MD5. More...
 
 setRenderedContent ($a_renderedcontent)
 Set Rendered Content. More...
 
 getRenderedContent ()
 Get Rendered Content. More...
 
 setRenderedTime ($a_renderedtime)
 Set Rendered Time. More...
 
 getRenderedTime ()
 Get Rendered Time. More...
 
 setLastChange ($a_lastchange)
 Set Last Change. More...
 
 getLastChange ()
 Get Last Change. More...
 
 setLastChangeUser ($a_val)
 Set last change user. More...
 
 getLastChangeUser ()
 Get last change user. More...
 
 setShowActivationInfo ($a_val)
 Set show page activation info. More...
 
 getShowActivationInfo ()
 Get show page activation info. More...
 
 read ()
 Read page data. More...
 
 buildDom ($a_force=false)
 
 freeDom ()
 
 getDom ()
 Deprecated php4DomDocument. More...
 
 getDomDoc ()
 Get dom doc (php5 dom document) More...
 
 setId ($a_id)
 set id More...
 
 getId ()
 
 setParentId ($a_id)
 
 getParentId ()
 
 addUpdateListener (&$a_object, $a_method, $a_parameters="")
 
 callUpdateListeners ()
 
 setActive ($a_active)
 set activation More...
 
 getActive ($a_check_scheduled_activation=false)
 get activation More...
 
 setActivationStart ($a_activationstart)
 Set Activation Start. More...
 
 getActivationStart ()
 Get Activation Start. More...
 
 setActivationEnd ($a_activationend)
 Set Activation End. More...
 
 getActivationEnd ()
 Get Activation End. More...
 
 getContentObject ($a_hier_id, $a_pc_id="")
 Get a content object of the page. More...
 
 getContentObjectForPcId ($pcid)
 Get content object for pc id. More...
 
 getParentContentObjectForPcId ($pcid)
 Get parent content object for pc id. More...
 
getContentNode ($a_hier_id, $a_pc_id="")
 Get content node from dom. More...
 
 checkForTag ($a_content_tag, $a_hier_id, $a_pc_id="")
 Get content node from dom. More...
 
 lookforhier ($a_hier_id)
 
getNode ()
 
 setXMLContent ($a_xml, $a_encoding="UTF-8")
 set xml content of page, start with <PageObject...>, end with </PageObject>, comply with ILIAS DTD, omit MetaData, use utf-8! More...
 
 appendXMLContent ($a_xml)
 append xml content to page setXMLContent must be called before and the same encoding must be used More...
 
 getXMLContent ($a_incl_head=false)
 get xml content of page More...
 
 copyXmlContent ($a_clone_mobs=false)
 Copy content of page; replace page components with copies where necessary (e.g. More...
 
 handleCopiedContent ($a_dom, $a_self_ass=true, $a_clone_mobs=false)
 Handle copied content This function copies items, that must be copied, if page content is duplicated. More...
 
 newIIMCopies ($temp_dom)
 Replaces media objects in interactive images with copies of the interactive images. More...
 
 newMobCopies ($temp_dom)
 Replaces media objects with copies. More...
 
 newQuestionCopies (&$temp_dom)
 Replaces existing question content elements with new copies. More...
 
 removeQuestions (&$temp_dom)
 Remove questions from document. More...
 
 countPageContents ()
 Remove questions from document. More...
 
 getXMLFromDom ( $a_incl_head=false, $a_append_mobs=false, $a_append_bib=false, $a_append_str="", $a_omit_pageobject_tag=false, $style_id=0)
 get xml content of page from dom (use this, if any changes are made to the document) More...
 
 getLanguageVariablesXML ($style_id=0)
 Get language variables as XML. More...
 
 appendLangVarXML (&$xml, $var)
 
 getFirstParagraphText ()
 
 getParagraphForPCID ($pcid)
 
 setParagraphContent ($a_hier_id, $a_content)
 Set content of paragraph. More...
 
 setContainsIntLink ($a_contains_link)
 lm parser set this flag to true, if the page contains intern links (this method should only be called by the import parser) todo: move to ilLMPageObject !? More...
 
 containsIntLink ()
 returns true, if page was marked as containing an intern link (via setContainsIntLink) (this method should only be called by the import parser) More...
 
 setImportMode ($a_val)
 Set import mode. More...
 
 getImportMode ()
 Get import mode. More...
 
 needsImportParsing ($a_parse="")
 
 setContainsQuestion ($a_val)
 Set contains question. More...
 
 getContainsQuestion ()
 Get contains question. More...
 
 collectMediaObjects ($a_inline_only=true)
 get all media objects, that are referenced and used within the page More...
 
 getInternalLinks ($a_cnt_multiple=false)
 get all internal links that are used within the page More...
 
 getMultimediaXML ()
 get a xml string that contains all media object elements, that are referenced by any media alias in the page More...
 
 getMediaAliasElement ($a_mob_id, $a_nr=1)
 get complete media object (alias) element More...
 
 validateDom (bool $throw=false)
 Validate the page content agains page DTD. More...
 
 addHierIDs ()
 Add hierarchical ID (e.g. More...
 
 getHierIds ()
 get all hierarchical ids More...
 
 getFirstRowIds ()
 get ids of all first table rows More...
 
 getFirstColumnIds ()
 get ids of all first table columns More...
 
 getListItemIds ()
 get ids of all list items More...
 
 getFileItemIds ()
 get ids of all file items More...
 
 stripHierIDs ()
 strip all hierarchical id attributes out of the dom tree More...
 
 getHierIdsForPCIds ($a_pc_ids)
 Get hier ids for a set of pc ids. More...
 
 getHierIdForPcId ($pcid)
 
 getPCIdsForHierIds ($hier_ids)
 Get hier ids for a set of pc ids. More...
 
 getPCIdForHierId ($hier_id)
 
 addFileSizes ()
 add file sizes More...
 
 resolveIntLinks ($a_link_map=null)
 Resolves all internal link targets of the page, if targets are available (after import) More...
 
 resolveMediaAliases ($a_mapping, $a_reuse_existing_by_import=false)
 Resolve media aliases (after import) More...
 
 resolveIIMMediaAliases ($a_mapping)
 Resolve iim media aliases (in ilContObjParse) More...
 
 resolveFileItems ($a_mapping)
 Resolve file items (after import) More...
 
 resolveQuestionReferences ($a_mapping)
 Resolve all quesion references (after import) More...
 
 moveIntLinks ($a_from_to)
 Move internal links from one destination to another. More...
 
 handleImportRepositoryLink ($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
 
 handleRepositoryLinksOnCopy ($a_mapping, $a_source_ref_id)
 Handle repository links on copy process. More...
 
 createFromXML ()
 Create new page object with current xml content. More...
 
 updateFromXML ()
 Updates page object with current xml content This function is currently (4.4.0 alpha) called by: More...
 
 afterUpdate ()
 After update. More...
 
 update ($a_validate=true, $a_no_history=false)
 update complete page content in db (dom xml content is used) More...
 
 delete ()
 delete page object More...
 
 saveStyleUsage ($a_domdoc, $a_old_nr=0)
 Save all style class/template usages. More...
 
 deleteStyleUsages ($a_old_nr=0)
 Delete style usages. More...
 
 getLastUpdateOfIncludedElements ()
 Get last update of included elements (media objects and files). More...
 
 deleteInternalLinks ()
 Delete internal links. More...
 
 saveInternalLinks ($a_domdoc)
 save internal links of page More...
 
 create ()
 create new page (with current xml data) More...
 
 deleteContent ($a_hid, $a_update=true, $a_pcid="")
 delete content object with hierarchical id $a_hid More...
 
 deleteContents ($a_hids, $a_update=true, $a_self_ass=false)
 Delete multiple content objects. More...
 
 cutContents ($a_hids)
 Copy contents to clipboard and cut them from the page. More...
 
 copyContents ($a_hids)
 Copy contents to clipboard. More...
 
 pasteContents ($a_hier_id, $a_self_ass=false)
 Paste contents from pc clipboard. More...
 
 switchEnableMultiple ($a_hids, $a_update=true, $a_self_ass=false)
 (De-)activate elements More...
 
 deleteContentFromHierId ($a_hid, $a_update=true)
 delete content object with hierarchical id >= $a_hid More...
 
 deleteContentBeforeHierId ($a_hid, $a_update=true)
 delete content object with hierarchical id < $a_hid More...
 
 insertContent (&$a_cont_obj, $a_pos, $a_mode=IL_INSERT_AFTER, $a_pcid="", bool $remove_placeholder=true)
 insert a content node before/after a sibling or as first child of a parent More...
 
 insertContentNode (&$a_cont_node, $a_pos, $a_mode=IL_INSERT_AFTER, $a_pcid="")
 insert a content node before/after a sibling or as first child of a parent More...
 
 moveContentBefore ($a_source, $a_target, $a_spcid="", $a_tpcid="")
 move content object from position $a_source before position $a_target (both hierarchical content ids) More...
 
 moveContentAfter ($a_source, $a_target, $a_spcid="", $a_tpcid="")
 move content object from position $a_source before position $a_target (both hierarchical content ids) More...
 
 bbCode2XML (&$a_content)
 transforms bbCode to corresponding xml More...
 
 insertInstIntoIDs ($a_inst, $a_res_ref_to_obj_id=true)
 inserts installation id into ids (e.g. More...
 
 checkPCIds ()
 Check, whether (all) page content hashes are set. More...
 
 getAllPCIds ()
 Get all pc ids. More...
 
 hasDuplicatePCIds ()
 Get all pc ids. More...
 
 getDuplicatePCIds ()
 Get all duplicate PC Ids. More...
 
 existsPCId ($a_pc_id)
 existsPCId More...
 
 generatePcId ($a_pc_ids=false)
 Generate new pc id. More...
 
 insertPCIds ()
 Insert Page Content IDs. More...
 
 getPageContentsHashes ()
 Get page contents hashes. More...
 
 getQuestionIds ()
 Get question ids. More...
 
 send_paragraph ($par_id, $filename)
 
 getFO ()
 get fo page content More...
 
 registerOfflineHandler ($handler)
 
 getOfflineHandler ()
 Get offline handler. More...
 
 containsDeactivatedElements ($a_content)
 Check whether content contains deactivated elements. More...
 
 getHistoryEntries ()
 Get History Entries. More...
 
 getHistoryEntry ($a_old_nr)
 Get History Entry. More...
 
 getHistoryInfo ($a_nr)
 Get information about a history entry, its predecessor and its successor. More...
 
 addChangeDivClasses ($a_hashes)
 
 compareVersion ($a_left, $a_right)
 Compares to revisions of the page. More...
 
 increaseViewCnt ()
 Increase view cnt. More...
 
 writeRenderedContent ($a_content, $a_md5)
 Write rendered content. More...
 
 containsIntLinks ($a_content)
 Check whether content contains internal links. More...
 
 performAutomaticModifications ()
 Perform automatic modifications (may be overwritten by sub classes) More...
 
 saveInitialOpenedContent ($a_type, $a_id, $a_target)
 Save initial opened content. More...
 
 getInitialOpenedContent ()
 Get initial opened content. More...
 
 beforePageContentUpdate ($a_page_content)
 Before page content update Note: This one is "work in progress", currently only text paragraphs call this hook It is called before the page content object invokes the update procedure of ilPageObject. More...
 
 copy ($a_id, $a_parent_type="", $a_parent_id=0, $a_clone_mobs=false)
 Copy page. More...
 
 copyPageToTranslation ($a_target_lang)
 Copy page to translation. More...
 
 getEditLock ()
 Get page lock. More...
 
 releasePageLock ()
 Release page lock. More...
 
 getEditLockInfo ()
 Get edit lock info. More...
 
 getContentTemplates ()
 Get content templates. More...
 
 getEffectiveEditLockTime ()
 
 getAllFileObjIds ()
 Get all file object ids. More...
 
 resolveResources ($ref_mapping)
 Resolve resources. More...
 
 getRepoObjId ()
 Get object id of repository object that contains this page, return 0 if page does not belong to a repo object. More...
 
 getPCModel ()
 Get page component model. More...
 
 assignCharacteristic ($targets, $char_par, $char_sec, $char_med)
 Assign characteristic. More...
 

Protected Attributes

 $glossary_id = 0
 
 $mobs_contained = array()
 
 $files_contained = array()
 
- Protected Attributes inherited from ilPageObject
 $obj_definition
 
 $db
 
 $user
 
 $lng
 
 $tree
 
 $id
 
 $language = "-"
 
 $import_mode = false
 
 $log
 
 $page_record = array()
 
 $active = false
 
 $page_config
 
 $concrete_lang
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageObject
static _exists ($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
 Checks whether page exists. More...
 
static _existsAndNotEmpty ($a_parent_type, $a_id, $a_lang="-")
 Checks whether page exists and is not empty (may return true on some empty pages) More...
 
static preloadActivationDataByParentId ($a_parent_id)
 Preload activation data by Parent Id. More...
 
static _lookupActive ($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
 lookup activation status More...
 
static _isScheduledActivation ($a_id, $a_parent_type, $a_lang="-")
 Check whether page is activated by time schedule. More...
 
static _writeActive ( $a_id, $a_parent_type, $a_active, $a_reset_scheduled_activation=true, $a_lang="-")
 write activation status More...
 
static _lookupActivationData ($a_id, $a_parent_type, $a_lang="-")
 Lookup activation data. More...
 
static lookupParentId ($a_id, $a_type)
 Lookup parent id. More...
 
static _writeParentId ($a_parent_type, $a_pg_id, $a_par_id)
 Write parent id. More...
 
static _handleImportRepositoryLinks ($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
 Change targest of repository links. More...
 
static _moveContentAfterHierId (&$a_source_page, &$a_target_page, $a_hid)
 move content of hierarchical id >= $a_hid to other page More...
 
static _lookupContainsDeactivatedElements ($a_id, $a_parent_type, $a_lang="-")
 lookup whether page contains deactivated elements More...
 
static getRecentChanges ($a_parent_type, $a_parent_id, $a_period=30, $a_lang="")
 Get recent pages changes for parent object. More...
 
static getAllPages ($a_parent_type, $a_parent_id, $a_lang="-")
 Get all pages for parent object. More...
 
static getNewPages ($a_parent_type, $a_parent_id, $a_lang="-")
 Get new pages. More...
 
static getParentObjectContributors ($a_parent_type, $a_parent_id, $a_lang="-")
 Get all contributors for parent object. More...
 
static getPageContributors ($a_parent_type, $a_page_id, $a_lang="-")
 Get all contributors for parent object. More...
 
static getPagesWithLinks ($a_parent_type, $a_parent_id, $a_lang="-")
 Get all pages for parent object that contain internal links. More...
 
static lookupTranslations ($a_parent_type, $a_id)
 Lookup translations. More...
 
static truncateHTML ( $a_text, $a_length=100, $a_ending='...', $a_exact=false, $a_consider_html=true)
 Truncate (html) string. More...
 
static getLastChangeByParent ($a_parent_type, $a_parent_id, $a_lang="")
 Get all pages for parent object. More...
 
- Data Fields inherited from ilPageObject
 $dom
 
 $xml
 
 $encoding
 
 $node
 
 $cur_dtd = "ilias_pg_5_4.dtd"
 
 $contains_int_link
 
 $needs_parsing
 
 $parent_type
 
 $parent_id
 
 $update_listeners
 
 $update_listener_cnt
 
 $offline_handler
 
 $dom_builded
 
 $history_saved
 
- Static Public Attributes inherited from ilPageObject
static $exists = array()
 
- Protected Member Functions inherited from ilPageObject
 __afterUpdate ($a_domdoc, $a_xml, $a_creation=false, $a_empty=false)
 After update event handler (internal). More...
 
 __beforeDelete ()
 Before deletion handler (internal). More...
 
 __afterHistoryEntry ($a_old_domdoc, $a_old_content, $a_old_nr)
 Before deletion handler (internal). More...
 
- Static Protected Attributes inherited from ilPageObject
static $activation_data = array()
 

Detailed Description

Class ilSCORM2004Page.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 14 of file class.ilSCORM2004Page.php.

Member Function Documentation

◆ afterConstructor()

ilSCORM2004Page::afterConstructor ( )

After constructor.

Parameters

return

Reimplemented from ilPageObject.

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

37 {
38 $this->getPageConfig()->configureByObjectId($this->getParentId());
39 }
getPageConfig()
Get page config object.

References ilPageObject\getPageConfig(), and ilPageObject\getParentId().

+ Here is the call graph for this function:

◆ create()

ilSCORM2004Page::create ( )

Create new scorm 2004.

Reimplemented from ilPageObject.

Definition at line 85 of file class.ilSCORM2004Page.php.

86 {
88
89 // maybe we need an additional table here?
90
91 // create page object
92 parent::create();
93 }
global $ilDB

References ilPageObject\$db, and $ilDB.

◆ createWithLayoutId()

ilSCORM2004Page::createWithLayoutId (   $a_layout_id)

Create new scorm 2004 with page-layout.

Definition at line 99 of file class.ilSCORM2004Page.php.

100 {
101 include_once("./Services/COPage/Layout/classes/class.ilPageLayout.php");
102
103 //get XML Data for Layout
104 $layout_obj = new ilPageLayout($a_layout_id);
105
106 parent::setXMLContent($layout_obj->getXMLContent());
107 // create page object
108 parent::create();
109 }
Class ilPageLayout.

◆ delete()

ilSCORM2004Page::delete ( )

delete page and al related data

@access public

Reimplemented from ilPageObject.

Definition at line 147 of file class.ilSCORM2004Page.php.

148 {
150
151 // maybe we need an additional table here?
152
153 // delete co page
154 parent::delete();
155
156 return true;
157 }

References ilPageObject\$db, and $ilDB.

◆ exportXML()

ilSCORM2004Page::exportXML ( $a_xml_writer,
  $a_mode = "normal",
  $a_inst = 0 
)

export page object to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

168 {
169 $attrs = array();
170 $a_xml_writer->xmlStartTag("PageObject", $attrs);
171
172 switch ($a_mode) {
173 case "normal":
174 // MetaData
175 $this->exportXMLMetaData($a_xml_writer);
176
177 // PageContent
178 $this->exportXMLPageContent($a_xml_writer, $a_inst);
179 break;
180
181 case "alias":
182 $attrs = array();
183 $attrs["OriginId"] = "il_" . $a_inst .
184 "_pg_" . $this->getId();
185 $a_xml_writer->xmlElement("PageAlias", $attrs);
186 break;
187 }
188
189 $a_xml_writer->xmlEndTag("PageObject");
190 }
exportXMLMetaData(&$a_xml_writer)
export page alias to xml
exportXMLPageContent(&$a_xml_writer, $a_inst=0)
export page objects meta data to xml (see ilias_co.dtd)

References exportXMLMetaData(), exportXMLPageContent(), and ilPageObject\getId().

+ Here is the call graph for this function:

◆ exportXMLMetaData()

ilSCORM2004Page::exportXMLMetaData ( $a_xml_writer)

export page alias to xml

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

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 217 of file class.ilSCORM2004Page.php.

218 {
219 include_once("Services/MetaData/classes/class.ilMD2XML.php");
220 $md2xml = new ilMD2XML($this->getParentId(), $this->getId(), gettype($this));
221 $md2xml->setExportMode(true);
222 $md2xml->startExport();
223 $a_xml_writer->appendXML($md2xml->getXML());
224 }

References ilPageObject\getId(), and ilPageObject\getParentId().

Referenced by exportXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXMLPageContent()

ilSCORM2004Page::exportXMLPageContent ( $a_xml_writer,
  $a_inst = 0 
)

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

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 247 of file class.ilSCORM2004Page.php.

248 {
249 $this->buildDom();
250 $this->insertInstIntoIDs($a_inst);
251 $cont_obj = $this->getContentObject("pg");
252 $this->mobs_contained = $this->collectMediaObjects(false);
253 include_once("./Services/COPage/classes/class.ilPCFileList.php");
254 $this->files_contained = ilPCFileList::collectFileItems($this, $this->getDomDoc());
255 $xml = $this->getXMLFromDom(false, false, false, "", true);
256 $xml = str_replace("&", "&amp;", $xml);
257 $a_xml_writer->appendXML($xml);
258
259 $this->freeDom();
260 }
static collectFileItems($a_page, $a_domdoc)
Get all file items that are used within the page.
insertInstIntoIDs($a_inst, $a_res_ref_to_obj_id=true)
inserts installation id into ids (e.g.
getXMLFromDom( $a_incl_head=false, $a_append_mobs=false, $a_append_bib=false, $a_append_str="", $a_omit_pageobject_tag=false, $style_id=0)
get xml content of page from dom (use this, if any changes are made to the document)
buildDom($a_force=false)
getContentObject($a_hier_id, $a_pc_id="")
Get a content object of the page.
collectMediaObjects($a_inline_only=true)
get all media objects, that are referenced and used within the page
getDomDoc()
Get dom doc (php5 dom document)

References ilPageObject\$xml, ilPageObject\buildDom(), ilPCFileList\collectFileItems(), ilPageObject\collectMediaObjects(), ilPageObject\freeDom(), ilPageObject\getContentObject(), ilPageObject\getDomDoc(), ilPageObject\getXMLFromDom(), and ilPageObject\insertInstIntoIDs().

Referenced by exportXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFileItemIds()

ilSCORM2004Page::getFileItemIds ( )

get ids of all file items within the page

note: this method must be called afer exportXMLPageContent

Reimplemented from ilPageObject.

Definition at line 278 of file class.ilSCORM2004Page.php.

279 {
281 }

References $files_contained.

◆ getGlossaryId()

ilSCORM2004Page::getGlossaryId ( )

Get glossary id.

Returns
int glossary id

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

References $glossary_id.

Referenced by performAutomaticModifications().

+ Here is the caller graph for this function:

◆ getMediaObjectIds()

ilSCORM2004Page::getMediaObjectIds ( )

get ids of all media objects within the page

note: this method must be called afer exportXMLPageContent

Definition at line 268 of file class.ilSCORM2004Page.php.

269 {
271 }

References $mobs_contained.

◆ getParentType()

ilSCORM2004Page::getParentType ( )

Get parent type.

Returns
string parent type

Reimplemented from ilPageObject.

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

26 {
27 return "sahs";
28 }

◆ getScormLmId()

ilSCORM2004Page::getScormLmId ( )

Get Scorm LM ID.

Returns
int Scorm LM ID

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

58 {
59 return $this->scormlmid;
60 }

◆ performAutomaticModifications()

ilSCORM2004Page::performAutomaticModifications ( )

Perform automatic modifications (may be overwritten by sub classes)

Reimplemented from ilPageObject.

Definition at line 286 of file class.ilSCORM2004Page.php.

287 {
288 // disabled this due to #0011195
289 // this does not really work well. Besides creating duplicates, it does not ensure that all
290 // glossary terms are in the assigned glossary. Copying whole pages does not trigger
291 // this procedure. Moreover if no glossary is attached copying pages will still create links
292 // in the target SCORM LM. The SCORM Export seesm to work well, even if terms are in other glossaries
293
294 return;
295
296 if ($this->getGlossaryId() > 0) {
297 // we fix glossary links here
298 $this->buildDom();
299 $xpc = xpath_new_context($this->dom);
300 $path = "//IntLink[@Type='GlossaryItem']";
301 $res = xpath_eval($xpc, $path);
302 for ($i = 0; $i < count($res->nodeset); $i++) {
303 $target = $res->nodeset[$i]->get_attribute("Target");
304 //echo "<br>".$target;
305 $tarr = explode("_", $target);
306 $term_id = $tarr[count($tarr) - 1];
307 if (is_int(strpos($target, "__")) && $term_id > 0) {
308 //echo "<br>-".ilGlossaryTerm::_lookGlossaryID($term_id)."-".$this->getGlossaryId()."-";
309 if (ilGlossaryTerm::_lookGlossaryID($term_id) != $this->getGlossaryId()) {
310 // copy the glossary term from glossary a to b
311 $new_id = ilGlossaryTerm::_copyTerm($term_id, $this->getGlossaryId());
312 $res->nodeset[$i]->set_attribute("Target", "il__git_" . $new_id);
313 }
314 }
315 }
316 }
317 //exit;
318 }
static _lookGlossaryID($term_id)
get glossary id form term id
static _copyTerm($a_term_id, $a_glossary_id)
Copy a term to a glossary.
getGlossaryId()
Get glossary id.
xpath_eval($xpath_context, $eval_str, $contextnode=null)
xpath_new_context($dom_document)
$i
Definition: metadata.php:24
foreach($_POST as $key=> $value) $res

References $i, $res, ilGlossaryTerm\_copyTerm(), ilGlossaryTerm\_lookGlossaryID(), ilPageObject\buildDom(), getGlossaryId(), xpath_eval(), and xpath_new_context().

+ Here is the call graph for this function:

◆ read()

ilSCORM2004Page::read ( )

Read wiki data.

Reimplemented from ilPageObject.

Definition at line 131 of file class.ilSCORM2004Page.php.

132 {
134
135 // maybe we need an additional table here?
136
137 // get co page
138 parent::read();
139 }

References ilPageObject\$db, and $ilDB.

◆ removeInvalidLinks()

ilSCORM2004Page::removeInvalidLinks ( )

Remove invalid links.

Parameters

return

Definition at line 326 of file class.ilSCORM2004Page.php.

327 {
328 $this->buildDom();
329
330 // find all Keyw tags
331 $xpath = new DOMXPath($this->getDomDoc());
332 $nodes = $xpath->query('//Paragraph//IntLink');
333 $to_del = array();
334 foreach ($nodes as $node) {
335 if (in_array($node->getAttribute("Type"), array("File", "GlossaryItem"))) {
336 continue;
337 }
338 $to_del[] = $node;
339 $parent = $node->parentNode;
340 $childs = array();
341 foreach ($node->childNodes as $c) {
342 $childs[] = $c;
343 }
344 foreach ($childs as $c) {
345 $node->removeChild($c);
346 $parent->insertBefore($c, $node);
347 }
348 }
349 foreach ($to_del as $n) {
350 $p = $n->parentNode;
351 $p->removeChild($n);
352 }
353 $this->update();
354 }
$n
Definition: RandomTest.php:85
update($a_validate=true, $a_no_history=false)
update object data
$c
Definition: cli.php:37

References $c, $n, ilPageObject\$node, ilPageObject\buildDom(), ilPageObject\getDomDoc(), and update().

+ Here is the call graph for this function:

◆ setGlossaryId()

ilSCORM2004Page::setGlossaryId (   $a_val)

Set glossary id.

Parameters
intglossary id

Definition at line 67 of file class.ilSCORM2004Page.php.

68 {
69 $this->glossary_id = $a_val;
70 }

◆ setScormLmId()

ilSCORM2004Page::setScormLmId (   $a_scormlmid)

Set Scorm LM ID.

Parameters
int$a_scormlmidScorm LM ID

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

48 {
49 $this->scormlmid = $a_scormlmid;
50 }

◆ update()

ilSCORM2004Page::update (   $a_validate = true,
  $a_no_history = false 
)

update object data

@access public

Returns
boolean

Reimplemented from ilPageObject.

Definition at line 117 of file class.ilSCORM2004Page.php.

118 {
120
121 // maybe we need an additional table here?
122
123 parent::update($a_validate, $a_no_history);
124
125 return true;
126 }

References ilPageObject\$db, and $ilDB.

Referenced by removeInvalidLinks().

+ Here is the caller graph for this function:

Field Documentation

◆ $files_contained

ilSCORM2004Page::$files_contained = array()
protected

Definition at line 18 of file class.ilSCORM2004Page.php.

Referenced by getFileItemIds().

◆ $glossary_id

ilSCORM2004Page::$glossary_id = 0
protected

Definition at line 16 of file class.ilSCORM2004Page.php.

Referenced by getGlossaryId().

◆ $mobs_contained

ilSCORM2004Page::$mobs_contained = array()
protected

Definition at line 17 of file class.ilSCORM2004Page.php.

Referenced by getMediaObjectIds().


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