ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPageContent Class Reference

Class ilPageContent. More...

+ Inheritance diagram for ilPageContent:
+ Collaboration diagram for ilPageContent:

Public Member Functions

 __construct ($a_pg_obj)
 Constructor.
 setPage ($a_val)
 Set page.
 getPage ()
 Get page.
 init ()
 Init object.
 getType ()
 Get type of page content.
 setNode (&$a_node)
 Set xml node of page content.
getNode ()
 Get xml node of page content.
 getJavascriptFiles ()
 Get Javascript files.
 getCssFiles ()
 Get css files.
 getOnloadCode ()
 Get on load code.
 setHierId ($a_hier_id)
 Set hierarchical ID in xml structure.
 getHierId ()
 Get hierarchical id.
 lookupHierId ()
 Get hierarchical id from dom.
 readHierId ()
 Read PC Id.
 setPcId ($a_pcid)
 Set PC Id.
 getPCId ()
 Get PC Id.
 readPCId ()
 Read PC Id.
 writePCId ($a_pc_id)
 Write pc id.
 isGreaterHierId ($a, $b)
 Check whether Hier ID $a is greater than Hier ID $b.
 setEnabled ($value)
 Set Enabled value for page content component.
 enable ()
 Enable page content.
 disable ()
 Disable page content.
 isEnabled ()
 Check whether page content is enabled.
 createPageContentNode ($a_set_this_node=true)
 Create page content node (always use this method first when adding a new element)
 modifyPageContentPostXsl ($a_output, $a_mode)
 Modify page content after xsl.

Static Public Member Functions

static incEdId ($ed_id)
 Increases an hierarchical editing id at lowest level (last number)
static decEdId ($ed_id)
 Decreases an hierarchical editing id at lowest level (last number)
static haveSameContainer ($ed_id1, $ed_id2)
 Check, if two ids are in same container.
static sortHierIds ($a_array)
 Sort an array of Hier IDS in ascending order.
static getLangVars ()
 Get lang vars needed for editing.
static handleCopiedContent (DOMDocument $a_domdoc, $a_self_ass=true, $a_clone_mobs=false)
 Handle copied content.
static afterPageUpdate ($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)
 After page has been updated (or created)
static beforePageDelete ($a_page)
 Before page is being deleted.
static afterPageHistoryEntry ($a_page, DOMDocument $a_old_domdoc, $a_old_xml, $a_old_nr)
 After page history entry has been created.

Data Fields

 $hier_id
 $node
 $dom

Protected Member Functions

 setType ($a_type)
 Set Type.

Detailed Description

Class ilPageContent.

Content object of ilPageObject (see ILIAS DTD). Every concrete object should be an instance of a class derived from ilPageContent (e.g. ilParagraph, ilMediaObject, ...)

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilPageContent.php 52445 2014-08-20 13:45:24Z akill

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

Constructor & Destructor Documentation

ilPageContent::__construct (   $a_pg_obj)
final

Constructor.

All initialisation in derived classes should go to the init() function

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

References getType(), init(), and setPage().

{
$this->setPage($a_pg_obj);
$this->dom = $a_pg_obj->getDom();
$this->init();
if ($this->getType() == "")
{
die ("Error: ilPageContent::init() did not set type");
}
}

+ Here is the call graph for this function:

Member Function Documentation

static ilPageContent::afterPageHistoryEntry (   $a_page,
DOMDocument  $a_old_domdoc,
  $a_old_xml,
  $a_old_nr 
)
static

After page history entry has been created.

Parameters
object$a_pagepage object
DOMDocument$a_old_domdocold dom document
string$a_old_xmlold xml
integer$a_old_nrhistory number

Reimplemented in ilPCParagraph, ilPCMediaObject, ilPCFileList, ilPCContentInclude, and ilPCSkills.

Definition at line 427 of file class.ilPageContent.php.

{
}
static ilPageContent::afterPageUpdate (   $a_page,
DOMDocument  $a_domdoc,
  $a_xml,
  $a_creation 
)
static

After page has been updated (or created)

Parameters
object$a_pagepage object
DOMDocument$a_domdocdom document
string$a_xmlxml
bool$a_creationtrue on creation, otherwise false

Reimplemented in ilPCParagraph, ilPCMediaObject, ilPCFileList, ilPCQuestion, ilPCContentInclude, and ilPCSkills.

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

{
}
static ilPageContent::beforePageDelete (   $a_page)
static

Before page is being deleted.

Parameters
object$a_pagepage object

Reimplemented in ilPCParagraph, ilPCMediaObject, ilPCFileList, ilPCQuestion, ilPCContentInclude, and ilPCSkills.

Definition at line 415 of file class.ilPageContent.php.

{
}
static ilPageContent::decEdId (   $ed_id)
staticfinal

Decreases an hierarchical editing id at lowest level (last number)

Parameters
string$ed_idhierarchical ID
Returns
string hierarchical ID (decreased)

Definition at line 239 of file class.ilPageContent.php.

{
$id = explode("_", $ed_id);
$id[count($id) - 1]--;
return implode($id, "_");
}
ilPageContent::disable ( )

Disable page content.

Definition at line 331 of file class.ilPageContent.php.

References setEnabled().

{
$this->setEnabled("False");
}

+ Here is the call graph for this function:

ilPageContent::enable ( )

Enable page content.

Definition at line 323 of file class.ilPageContent.php.

References setEnabled().

{
$this->setEnabled("True");
}

+ Here is the call graph for this function:

ilPageContent::getCssFiles ( )

Get css files.

Reimplemented in ilPCPlugged.

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

{
return array();
}
ilPageContent::getHierId ( )
ilPageContent::getJavascriptFiles ( )

Get Javascript files.

Reimplemented in ilPCPlugged.

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

{
return array();
}
static ilPageContent::getLangVars ( )
static

Get lang vars needed for editing.

Returns
array array of lang var keys

Reimplemented in ilPCTable, ilPCTabs, ilPCMediaObject, ilPCFileList, ilPCResources, ilPCQuestion, ilPCProfile, ilPCPlaceHolder, ilPCLoginPageElement, ilPCSection, ilPCVerification, ilPCConsultationHours, ilPCMyCourses, ilPCAMDPageList, and ilPCSourceCode.

Definition at line 372 of file class.ilPageContent.php.

{
return array();
}
ilPageContent::getOnloadCode ( )

Get on load code.

Definition at line 127 of file class.ilPageContent.php.

{
return array();
}
ilPageContent::getPCId ( )

Get PC Id.

Returns
string PC Id

Definition at line 187 of file class.ilPageContent.php.

{
return $this->pcid;
}
ilPageContent::getType ( )

Get type of page content.

Returns
string Type as defined by the page content component

Reimplemented in ilPCParagraph.

Definition at line 82 of file class.ilPageContent.php.

Referenced by __construct().

{
return $this->type;
}

+ Here is the caller graph for this function:

static ilPageContent::handleCopiedContent ( DOMDocument  $a_domdoc,
  $a_self_ass = true,
  $a_clone_mobs = false 
)
static

Handle copied content.

This function must, e.g. create copies of objects referenced within the content (e.g. question objects)

Parameters
DOMDocument$a_domdocdom document

Reimplemented in ilPCTable, and ilPCAMDPageList.

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

{
}
static ilPageContent::haveSameContainer (   $ed_id1,
  $ed_id2 
)
staticfinal

Check, if two ids are in same container.

Parameters
string$ed_id1hierachical ID 1
string$ed_id2hierachical ID 2
Returns
boolean true/false

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

{
$id1 = explode("_", $ed_id1);
$id2 = explode("_", $ed_id1);
if(count($id1) == count($id2))
{
array_pop($id1);
array_pop($id2);
foreach ($id1 as $key => $id)
{
if($id != $id2[$key])
{
return false;
}
}
return true;
}
return false;
}
static ilPageContent::incEdId (   $ed_id)
staticfinal

Increases an hierarchical editing id at lowest level (last number)

Parameters
string$ed_idhierarchical ID
Returns
string hierarchical ID (increased)

Definition at line 224 of file class.ilPageContent.php.

Referenced by ilPageObject\addHierIDs().

{
$id = explode("_", $ed_id);
$id[count($id) - 1]++;
return implode($id, "_");
}

+ Here is the caller graph for this function:

ilPageContent::isEnabled ( )
final

Check whether page content is enabled.

Returns
boolean true/false

Definition at line 341 of file class.ilPageContent.php.

{
if (is_object($this->node) && $this->node->has_attribute("Enabled"))
{
$compare = $this->node->get_attribute("Enabled");
}
else
{
$compare = "True";
}
return strcasecmp($compare,"true") == 0;
}
ilPageContent::isGreaterHierId (   $a,
  $b 
)

Check whether Hier ID $a is greater than Hier ID $b.

Definition at line 288 of file class.ilPageContent.php.

{
$a_arr = explode("_", $a);
$b_arr = explode("_", $b);
for ($i = 0; $i < count($a_arr); $i++)
{
if ((int) $a_arr[$i] > (int) $b_arr[$i])
{
return true;
}
else if ((int) $a_arr[$i] < (int) $b_arr[$i])
{
return false;
}
}
return false;
}
ilPageContent::lookupHierId ( )

Get hierarchical id from dom.

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

{
return $this->node->get_attribute("HierId");
}
ilPageContent::modifyPageContentPostXsl (   $a_output,
  $a_mode 
)

Modify page content after xsl.

Parameters
string$a_output
Returns
string

Reimplemented in ilPCMap, ilPCQuestion, ilPCAMDPageList, ilPCPlugged, and ilPCSourceCode.

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

{
return $a_output;
}
ilPageContent::readHierId ( )

Read PC Id.

Returns
string PC Id

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

Referenced by ilPCParagraph\getParagraphSequenceContent(), and ilPCInteractiveImage\setNode().

{
if (is_object($this->node))
{
return $this->node->get_attribute("HierId");
}
}

+ Here is the caller graph for this function:

ilPageContent::readPCId ( )

Read PC Id.

Returns
string PC Id

Definition at line 198 of file class.ilPageContent.php.

Referenced by ilPCParagraph\getParagraphSequenceContent(), and ilPCInteractiveImage\setNode().

{
if (is_object($this->node))
{
return $this->node->get_attribute("PCID");
}
}

+ Here is the caller graph for this function:

ilPageContent::setEnabled (   $value)

Set Enabled value for page content component.

Parameters
string$value"True" | "False"

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

Referenced by disable(), and enable().

{
if (is_object($this->node))
{
$this->node->set_attribute("Enabled", $value);
}
}

+ Here is the caller graph for this function:

ilPageContent::setHierId (   $a_hier_id)

Set hierarchical ID in xml structure.

Parameters
string$a_hier_idHierarchical ID.

Reimplemented in ilPCMediaObject.

Definition at line 137 of file class.ilPageContent.php.

{
$this->hier_id = $a_hier_id;
}
ilPageContent::setNode ( $a_node)
ilPageContent::setPage (   $a_val)

Set page.

Parameters
object$a_valpage object

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

Referenced by __construct().

{
$this->pg_obj = $a_val;
}

+ Here is the caller graph for this function:

ilPageContent::setPcId (   $a_pcid)

Set PC Id.

Parameters
string$a_pcidPC Id

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

{
$this->pcid = $a_pcid;
}
static ilPageContent::sortHierIds (   $a_array)
static

Sort an array of Hier IDS in ascending order.

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

Referenced by ilPageObject\copyContents().

{
uasort($a_array, array("ilPageContent", "isGreaterHierId"));
return $a_array;
}

+ Here is the caller graph for this function:

ilPageContent::writePCId (   $a_pc_id)

Write pc id.

Definition at line 209 of file class.ilPageContent.php.

{
if (is_object($this->node))
{
$this->node->set_attribute("PCID", $a_pc_id);
}
}

Field Documentation

ilPageContent::$dom

Definition at line 22 of file class.ilPageContent.php.


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