ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSCORM2004Page Class Reference

Class ilSCORM2004Page. More...

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

Public Member Functions

 __construct ($a_id=0, $a_old_nr=0)
 Constructor public.
 setScormLmId ($a_scormlmid)
 Set Scorm LM ID.
 getScormLmId ()
 Get Scorm LM ID.
 create ()
 Create new scorm 2004.
 createWithLayoutId ($a_layout_id)
 Create new scorm 2004 with page-layout.
 update ($a_validate=true, $a_no_history=false)
 update object data
 read ()
 Read wiki data.
 delete ()
 delete page and al related data
 saveInternalLinks ($a_xml)
 save internal links of page.
 exportXML (&$a_xml_writer, $a_mode="normal", $a_inst=0)
 export page object to xml (see ilias_co.dtd)
 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)
 getMediaObjectIds ()
 get ids of all media objects within the page
 getFileItemIds ()
 get ids of all file items within the page
- Public Member Functions inherited from ilPageObject
 ilPageObject ($a_parent_type, $a_id=0, $a_old_nr=0, $a_halt=true)
 Constructor public.
 haltOnError ($a_halt)
 setRenderMd5 ($a_rendermd5)
 Set Render MD5.
 getRenderMd5 ()
 Get Render MD5.
 setRenderedContent ($a_renderedcontent)
 Set Rendered Content.
 getRenderedContent ()
 Get Rendered Content.
 setRenderedTime ($a_renderedtime)
 Set Rendered Time.
 getRenderedTime ()
 Get Rendered Time.
 setLastChange ($a_lastchange)
 Set Last Change.
 getLastChange ()
 Get Last Change.
 setLayoutMode ($a_layout_mode)
 Set Layout Mode.
 getLayoutMode ()
 Get Layout Mode enabled/disabled.
 _existsAndNotEmpty ($a_parent_type, $a_id)
 checks whether page exists and is not empty (may return true on some empty pages)
 buildDom ($a_force=false)
 freeDom ()
getDom ()
 setId ($a_id)
 set id
 getId ()
 setParentId ($a_id)
 getParentId ()
 setParentType ($a_type)
 getParentType ()
 addUpdateListener (&$a_object, $a_method, $a_parameters="")
 callUpdateListeners ()
 setActive ($a_active)
 set activation
 getActive ($a_check_scheduled_activation=false)
 get activation
 _lookupActive ($a_id, $a_parent_type, $a_check_scheduled_activation=false)
 lookup activation status
 _writeActive ($a_id, $a_parent_type, $a_active, $a_reset_scheduled_activation=true)
 write activation status
 setActivationStart ($a_activationstart)
 Set Activation Start.
 getActivationStart ()
 Get Activation Start.
 setActivationEnd ($a_activationend)
 Set Activation End.
 getActivationEnd ()
 Get Activation End.
getContentObject ($a_hier_id, $a_pc_id="")
getContentNode ($a_hier_id, $a_pc_id="")
 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!
 appendXMLContent ($a_xml)
 append xml content to page setXMLContent must be called before and the same encoding must be used
 getXMLContent ($a_incl_head=false)
 get xml content of page
 copyXmlContent ($a_new_question_copies=true)
 Copy content of page; replace page components with copies where necessary (e.g.
 newQuestionCopies (&$temp_dom)
 Replaces existing question content elements with new copies.
 getXMLFromDom ($a_incl_head=false, $a_append_mobs=false, $a_append_bib=false, $a_append_str="", $a_omit_pageobject_tag=false)
 get xml content of page from dom (use this, if any changes are made to the document)
 getLanguageVariablesXML ()
 get language variables as XML
 appendLangVarXML (&$xml, $var)
 getFirstParagraphText ()
 setParagraphContent ($a_hier_id, $a_content)
 Set content of paragraph.
 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)
 containsIntLink ()
 returns true, if page was marked as containing an intern link (via setContainsIntLink) (this method should only be called by the import parser)
 needsImportParsing ($a_parse="")
 getBibliographyXML ()
 get a xml string that contains all Bibliography elements, that are referenced by any bibitem alias in the page
 collectMediaObjects ($a_inline_only=true)
 get all media objects, that are referenced and used within the page
 getInternalLinks ()
 get all internal links that are used within the page
 collectFileItems ($a_xml="")
 get all file items that are used within the page
 getMultimediaXML ()
 get a xml string that contains all media object elements, that are referenced by any media alias in the page
 getMediaAliasElement ($a_mob_id, $a_nr=1)
 get complete media object (alias) element
 validateDom ()
 Validate the page content agains page DTD.
 addHierIDs ()
 Add hierarchical ID (e.g.
 getHierIds ()
 get all hierarchical ids
 getFirstRowIds ()
 get ids of all first table rows
 getFirstColumnIds ()
 get ids of all first table columns
 getListItemIds ()
 get ids of all list items
 stripHierIDs ()
 strip all hierarchical id attributes out of the dom tree
 addFileSizes ()
 add file sizes
 resolveIntLinks ()
 Resolves all internal link targets of the page, if targets are available (after import)
 moveIntLinks ($a_from_to)
 Move internal links from one destination to another.
 handleImportRepositoryLink ($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
 createFromXML ()
 create new page object with current xml content
 updateFromXML ()
 updates page object with current xml content
 update ($a_validate=true, $a_no_history=false, $skip_handle_usages=false)
 update complete page content in db (dom xml content is used)
 saveMetaKeywords ($a_xml)
 save all keywords
 saveMobUsage ($a_xml, $a_old_nr=0)
 save all usages of media objects (media aliases, media objects, internal links)
 saveFileUsage ($a_xml="", $a_old_nr=0)
 save file usages
 saveContentIncludeUsage ($a_xml="", $a_old_nr=0)
 save content include usages
 collectContentIncludes ($a_xml="")
 get all content includes that are used within the page
 saveStyleUsage ($a_xml, $a_old_nr=0)
 Save all style class/template usages.
 getLastUpdateOfIncludedElements ()
 Get last update of included elements (media objects and files).
 saveAnchors ($a_xml)
 save anchors
 deleteContent ($a_hid, $a_update=true, $a_pcid="")
 delete content object with hierarchical id $a_hid
 deleteContents ($a_hids, $a_update=true)
 delete multiple content objects
 cutContents ($a_hids)
 Copy contents to clipboard and cut them from the page.
 copyContents ($a_hids)
 Copy contents to clipboard.
 pasteContents ($a_hier_id)
 Paste contents from pc clipboard.
 switchEnableMultiple ($a_hids, $a_update=true)
 gui function set enabled if is not enabled and vice versa
 deleteContentFromHierId ($a_hid, $a_update=true)
 delete content object with hierarchical id >= $a_hid
 deleteContentBeforeHierId ($a_hid, $a_update=true)
 delete content object with hierarchical id < $a_hid
 _moveContentAfterHierId (&$a_source_page, &$a_target_page, $a_hid)
 move content of hierarchical id >= $a_hid to other page
 insertContent (&$a_cont_obj, $a_pos, $a_mode=IL_INSERT_AFTER, $a_pcid="")
 insert a content node before/after a sibling or as first child of a parent
 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
 moveContentBefore ($a_source, $a_target, $a_spcid="", $a_tpcid="")
 move content object from position $a_source before position $a_target (both hierarchical content ids)
 moveContentAfter ($a_source, $a_target, $a_spcid="", $a_tpcid="")
 move content object from position $a_source before position $a_target (both hierarchical content ids)
 bbCode2XML (&$a_content)
 transforms bbCode to corresponding xml
 insertInstIntoIDs ($a_inst, $a_res_ref_to_obj_id=true)
 inserts installation id into ids (e.g.
 highlightText ($a_text, $proglang, $autoindent)
 Highligths Text with given ProgLang.
 hasHighlighter ($hfile_ext)
 insertSourceCodeParagraphs ($a_output, $outputmode="presentation")
 depending on the SubCharacteristic and ShowLineNumbers attribute the line numbers and html tags for the syntax highlighting will be inserted using the dom xml functions
 checkPCIds ()
 Check, whether (all) page content hashes are set.
 insertPCIds ()
 Insert Page Content IDs.
 getPageContentsHashes ()
 Get page contents hashes.
 getQuestionIds ()
 Get page contents hashes.
 send_paragraph ($par_id, $filename)
 getFO ()
 get fo page content
 registerOfflineHandler ($handler)
 _lookupContainsDeactivatedElements ($a_id, $a_parent_type)
 lookup whether page contains deactivated elements
 containsDeactivatedElements ($a_content)
 Check whether content contains deactivated elements.
 getHistoryEntries ()
 Get History Entries.
 getHistoryEntry ($a_old_nr)
 Get History Entry.
 getHistoryInfo ($a_nr)
 Get information about a history entry, its predecessor and its successor.
 addChangeDivClasses ($a_hashes)
 compareVersion ($a_left, $a_right)
 Compares to revisions of the page.
 increaseViewCnt ()
 increase view cnt
 writeRenderedContent ($a_content, $a_md5)
 Write rendered content.
 containsIntLinks ($a_content)
 Check whether content contains internal links.

Static Public Member Functions

static _getQuestionIdsForPage ($a_parent_type, $a_page_id)
 Get all questions of a page.
- Static Public Member Functions inherited from ilPageObject
static _exists ($a_parent_type, $a_id)
 checks whether page exists
static _isScheduledActivation ($a_id, $a_parent_type)
 Check whether page is activated by time schedule.
static lookupParentId ($a_id, $a_type)
 Lookup parent id.
static _handleImportRepositoryLinks ($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
 Change targest of repository links.
static _deleteAnchors ($a_parent_type, $a_page_id)
 Delete anchors of a page.
static _saveAnchor ($a_parent_type, $a_page_id, $a_anchor_name)
 Save an anchor.
static _readAnchors ($a_parent_type, $a_page_id)
 Read anchors of a page.
static getRecentChanges ($a_parent_type, $a_parent_id, $a_period=30)
 Get recent pages changes for parent object.
static getAllPages ($a_parent_type, $a_parent_id)
 Get all pages for parent object.
static getNewPages ($a_parent_type, $a_parent_id)
 Get new pages.
static getParentObjectContributors ($a_parent_type, $a_parent_id)
 Get all contributors for parent object.
static getPageContributors ($a_parent_type, $a_page_id)
 Get all contributors for parent object.
static getPagesWithLinks ($a_parent_type, $a_parent_id)
 Get all pages for parent object that contain internal links.

Additional Inherited Members

- Data Fields inherited from ilPageObject
 $id
 $ilias
 $dom
 $xml
 $encoding
 $node
 $cur_dtd = "ilias_pg_3_11.dtd"
 $contains_int_link
 $needs_parsing
 $parent_type
 $parent_id
 $update_listeners
 $update_listener_cnt
 $offline_handler
 $dom_builded
 $history_saved
 $layout_mode
- Static Public Attributes inherited from ilPageObject
static $exists = 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.

Constructor & Destructor Documentation

ilSCORM2004Page::__construct (   $a_id = 0,
  $a_old_nr = 0 
)

Constructor public.

Parameters
scorm2004 page id

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

{
parent::__construct("sahs", $a_id, $a_old_nr);
$this->mobs_contained = array();
$this->files_contained = array();
}

Member Function Documentation

static ilSCORM2004Page::_getQuestionIdsForPage (   $a_parent_type,
  $a_page_id 
)
static

Get all questions of a page.

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

References $ilDB, and $res.

Referenced by ilSCORM2004Sco\exportHTMLPageObjects(), ilSCORM2004Sco\exportXMLPageObjects(), ilObjectivesAlignmentTableGUI\fillRow(), and ilSCORM2004ScoGUI\sahs_questions().

{
global $ilDB;
$res = $ilDB->queryF("SELECT * FROM page_question WHERE page_parent_type = %s ".
" AND page_id = %s",
array("text", "integer"),
array($a_parent_type, $a_page_id));
$q_ids = array();
while ($rec = $ilDB->fetchAssoc($res))
{
$q_ids[] = $rec["question_id"];
}
return $q_ids;
}

+ Here is the caller graph for this function:

ilSCORM2004Page::create ( )

Create new scorm 2004.

Reimplemented from ilPageObject.

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

References $ilDB.

Referenced by createWithLayoutId().

{
global $ilDB;
// maybe we need an additional table here?
// create page object
}

+ Here is the caller graph for this function:

ilSCORM2004Page::createWithLayoutId (   $a_layout_id)

Create new scorm 2004 with page-layout.

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

References create(), and ilPageObject\setXMLContent().

{
include_once("./Services/Style/classes/class.ilPageLayout.php");
//get XML Data for Layout
$layout_obj = new ilPageLayout($a_layout_id);
parent::setXMLContent($layout_obj->getXMLContent());
// create page object
}

+ Here is the call graph for this function:

ilSCORM2004Page::delete ( )

delete page and al related data

public

Reimplemented from ilPageObject.

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

References $ilDB.

{
global $ilDB;
// maybe we need an additional table here?
// delete co page
return true;
}
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 204 of file class.ilSCORM2004Page.php.

References $ilBench, exportXMLMetaData(), and exportXMLPageContent().

{
global $ilBench;
$attrs = array();
$a_xml_writer->xmlStartTag("PageObject", $attrs);
switch ($a_mode)
{
case "normal":
// MetaData
$ilBench->start("ContentObjectExport", "exportPageObject_XML_Meta");
$this->exportXMLMetaData($a_xml_writer);
$ilBench->stop("ContentObjectExport", "exportPageObject_XML_Meta");
// PageContent
$ilBench->start("ContentObjectExport", "exportPageObject_XML_PageContent");
$this->exportXMLPageContent($a_xml_writer, $a_inst);
$ilBench->stop("ContentObjectExport", "exportPageObject_XML_PageContent");
break;
case "alias":
$attrs = array();
$attrs["OriginId"] = "il_".$a_inst.
"_pg_".$this->getId();
$a_xml_writer->xmlElement("PageAlias", $attrs);
break;
}
$a_xml_writer->xmlEndTag("PageObject");
}

+ Here is the call graph for this function:

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 261 of file class.ilSCORM2004Page.php.

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

Referenced by exportXML().

{
include_once("Services/MetaData/classes/class.ilMD2XML.php");
$md2xml = new ilMD2XML($this->getParentId(), $this->getId(), gettype($this));
$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:

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 291 of file class.ilSCORM2004Page.php.

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

Referenced by exportXML().

{
$this->buildDom();
$this->insertInstIntoIDs($a_inst);
$cont_obj =& $this->getContentObject("pg");
$this->mobs_contained = $this->collectMediaObjects(false);
$this->files_contained = $this->collectFileItems();
$xml = $this->getXMLFromDom(false, false, false, "", true);
$xml = str_replace("&","&amp;", $xml);
$a_xml_writer->appendXML($xml);
$this->freeDom();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

{
return $this->files_contained;
}
ilSCORM2004Page::getMediaObjectIds ( )

get ids of all media objects within the page

note: this method must be called afer exportXMLPageContent

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

{
return $this->mobs_contained;
}
ilSCORM2004Page::getScormLmId ( )

Get Scorm LM ID.

Returns
int Scorm LM ID

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

{
return $this->scormlmid;
}
ilSCORM2004Page::read ( )

Read wiki data.

Reimplemented from ilPageObject.

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

References $ilDB.

{
global $ilDB;
// maybe we need an additional table here?
// get co page
}
ilSCORM2004Page::saveInternalLinks (   $a_xml)

save internal links of page.

this method overwrites the ilpageobject method and adds information on all questions to the db

Parameters
stringxml page code

Reimplemented from ilPageObject.

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

References $ilDB, $res, ilInternalLink\_extractInstOfTarget(), ilInternalLink\_extractObjIdOfTarget(), domxml_open_mem(), ilPageObject\getId(), ilPageObject\getParentType(), xpath_eval(), and xpath_new_context().

{
global $ilDB;
// *** STEP 1: Standard Processing ***
// *** STEP 2: Save question references of page ***
// delete all reference records
$ilDB->manipulateF("DELETE FROM page_question WHERE page_parent_type = %s ".
" AND page_id = %s", array("text", "integer"),
array($this->getParentType(), $this->getId()));
// save question references of page
$doc = domxml_open_mem($a_xml);
$xpc = xpath_new_context($doc);
$path = "//Question";
$res = xpath_eval($xpc, $path);
$q_ids = array();
for ($i=0; $i < count($res->nodeset); $i++)
{
$q_ref = $res->nodeset[$i]->get_attribute("QRef");
if (!($inst_id > 0))
{
if ($q_id > 0)
{
$q_ids[$q_id] = $q_id;
}
}
}
foreach($q_ids as $qid)
{
$ilDB->manipulateF("INSERT INTO page_question (page_parent_type, page_id, question_id)".
" VALUES (%s,%s,%s)",
array("text", "integer", "integer"),
array($this->getParentType(), $this->getId(), $qid));
}
}

+ Here is the call graph for this function:

ilSCORM2004Page::setScormLmId (   $a_scormlmid)

Set Scorm LM ID.

Parameters
int$a_scormlmidScorm LM ID

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

{
$this->scormlmid = $a_scormlmid;
}
ilSCORM2004Page::update (   $a_validate = true,
  $a_no_history = false 
)

update object data

public

Returns
boolean

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

References $ilDB.

{
global $ilDB;
// maybe we need an additional table here?
parent::update($a_validate, $a_no_history);
return true;
}

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