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

Class ilPCContentInclude. More...

+ Inheritance diagram for ilPCContentInclude:
+ Collaboration diagram for ilPCContentInclude:

Public Member Functions

 init ()
 Init page content component.
 setNode (&$a_node)
 Set node.
 create (&$a_pg_obj, $a_hier_id, $a_pc_id="")
 Create content include node in xml.
 setContentId ($a_id)
 Set content id.
 getContentId ()
 Get content id.
 setContentType ($a_type)
 Set content type.
 getContentType ()
 Get content type.
 setInstId ($a_id)
 Set installation id.
 getInstId ()
 Get installation id.
 getContentIncludeAttribute ($a_attr)
 Get content include tag attribute.
- Public Member Functions inherited from ilPageContent
 __construct ($a_pg_obj)
 Constructor.
 setPage ($a_val)
 Set page.
 getPage ()
 Get page.
 getType ()
 Get type of page content.
getNode ()
 Get xml node of page content.
 getJavascriptFiles ()
 Get Javascript files.
 getCssFiles ()
 Get css files.
 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 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.
static saveContentIncludeUsage ($a_page, $a_domdoc, $a_old_nr=0)
 save content include usages
static collectContentIncludes ($a_page, $a_domdoc)
 get all content includes that are used within the page
- Static Public Member Functions inherited from ilPageContent
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.

Data Fields

 $dom
 $incl_node
- Data Fields inherited from ilPageContent
 $hier_id
 $node
 $dom

Protected Member Functions

 setContentIncludeAttribute ($a_attr, $a_value)
 Set attribute of content include tag.
- Protected Member Functions inherited from ilPageContent
 setType ($a_type)
 Set Type.

Detailed Description

Class ilPCContentInclude.

Content include object (see ILIAS DTD). Inserts content snippets from other source (e.g. media pool)

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

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

Member Function Documentation

static ilPCContentInclude::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 from ilPageContent.

Definition at line 168 of file class.ilPCContentInclude.php.

References saveContentIncludeUsage().

{
self::saveContentIncludeUsage($a_page, $a_old_domdoc, $a_old_nr);
}

+ Here is the call graph for this function:

static ilPCContentInclude::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 from ilPageContent.

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

References saveContentIncludeUsage().

{
// pc content include
self::saveContentIncludeUsage($a_page, $a_domdoc);
}

+ Here is the call graph for this function:

static ilPCContentInclude::beforePageDelete (   $a_page)
static

Before page is being deleted.

Parameters
object$a_pagepage object

Reimplemented from ilPageContent.

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

References ilPageContentUsage\deleteAllUsages().

{
include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
ilPageContentUsage::deleteAllUsages("incl", $a_page->getParentType().":pg", $a_page->getId(), false, $a_page->getLanguage());
}

+ Here is the call graph for this function:

static ilPCContentInclude::collectContentIncludes (   $a_page,
  $a_domdoc 
)
static

get all content includes that are used within the page

Definition at line 194 of file class.ilPCContentInclude.php.

References ilPageContent\$node.

Referenced by saveContentIncludeUsage(), and ilPageObjectGUI\showPage().

{
$xpath = new DOMXPath($a_domdoc);
$nodes = $xpath->query('//ContentInclude');
$ci_ids = array();
foreach ($nodes as $node)
{
$type = $node->getAttribute("ContentType");
$id = $node->getAttribute("ContentId");
$inst_id = $node->getAttribute("InstId");
$ci_ids[$type.":".$id.":".$inst_id] = array(
"type" => $type, "id" => $id, "inst_id" => $inst_id);
}
return $ci_ids;
}

+ Here is the caller graph for this function:

ilPCContentInclude::create ( $a_pg_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Create content include node in xml.

Parameters
object$a_pg_objPage Object
string$a_hier_idHierarchical ID

Definition at line 45 of file class.ilPCContentInclude.php.

References ilPageContent\createPageContentNode(), and IL_INSERT_AFTER.

{
$this->node = $this->createPageContentNode();
$a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
$this->incl_node =& $this->dom->create_element("ContentInclude");
$this->incl_node =& $this->node->append_child($this->incl_node);
}

+ Here is the call graph for this function:

ilPCContentInclude::getContentId ( )

Get content id.

Definition at line 64 of file class.ilPCContentInclude.php.

References getContentIncludeAttribute().

{
return $this->getContentIncludeAttribute("ContentId");
}

+ Here is the call graph for this function:

ilPCContentInclude::getContentIncludeAttribute (   $a_attr)

Get content include tag attribute.

Returns
string attribute name

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

Referenced by getContentId(), getContentType(), and getInstId().

{
if (is_object($this->incl_node))
{
return $this->incl_node->get_attribute($a_attr);
}
}

+ Here is the caller graph for this function:

ilPCContentInclude::getContentType ( )

Get content type.

Definition at line 80 of file class.ilPCContentInclude.php.

References getContentIncludeAttribute().

{
return $this->getContentIncludeAttribute("ContentType");
}

+ Here is the call graph for this function:

ilPCContentInclude::getInstId ( )

Get installation id.

Definition at line 96 of file class.ilPCContentInclude.php.

References getContentIncludeAttribute().

{
return $this->getContentIncludeAttribute("InstId");
}

+ Here is the call graph for this function:

ilPCContentInclude::init ( )

Init page content component.

Reimplemented from ilPageContent.

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

References ilPageContent\setType().

{
$this->setType("incl");
}

+ Here is the call graph for this function:

static ilPCContentInclude::saveContentIncludeUsage (   $a_page,
  $a_domdoc,
  $a_old_nr = 0 
)
static

save content include usages

Definition at line 176 of file class.ilPCContentInclude.php.

References collectContentIncludes(), ilPageContentUsage\deleteAllUsages(), and ilPageContentUsage\saveUsage().

Referenced by afterPageHistoryEntry(), and afterPageUpdate().

{
include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
$ci_ids = self::collectContentIncludes($a_page, $a_domdoc);
ilPageContentUsage::deleteAllUsages("incl", $a_page->getParentType().":pg", $a_page->getId(), $a_old_nr, $a_page->getLanguage());
foreach($ci_ids as $ci_id)
{
if ((int) $ci_id["inst_id"] <= 0)
{
ilPageContentUsage::saveUsage("incl", $ci_id["id"], $a_page->getParentType().":pg", $a_page->getId(), $a_old_nr,
$a_page->getLanguage());
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPCContentInclude::setContentId (   $a_id)

Set content id.

Definition at line 56 of file class.ilPCContentInclude.php.

References setContentIncludeAttribute().

{
$this->setContentIncludeAttribute("ContentId", $a_id);
}

+ Here is the call graph for this function:

ilPCContentInclude::setContentIncludeAttribute (   $a_attr,
  $a_value 
)
protected

Set attribute of content include tag.

Parameters
stringattribute name
stringattribute value

Definition at line 107 of file class.ilPCContentInclude.php.

Referenced by setContentId(), setContentType(), and setInstId().

{
if (!empty($a_value))
{
$this->incl_node->set_attribute($a_attr, $a_value);
}
else
{
if ($this->incl_node->has_attribute($a_attr))
{
$this->incl_node->remove_attribute($a_attr);
}
}
}

+ Here is the caller graph for this function:

ilPCContentInclude::setContentType (   $a_type)

Set content type.

Definition at line 72 of file class.ilPCContentInclude.php.

References setContentIncludeAttribute().

{
$this->setContentIncludeAttribute("ContentType", $a_type);
}

+ Here is the call graph for this function:

ilPCContentInclude::setInstId (   $a_id)

Set installation id.

Definition at line 88 of file class.ilPCContentInclude.php.

References setContentIncludeAttribute().

{
$this->setContentIncludeAttribute("InstId", $a_id);
}

+ Here is the call graph for this function:

ilPCContentInclude::setNode ( $a_node)

Set node.

Reimplemented from ilPageContent.

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

{
parent::setNode($a_node); // this is the PageContent node
$this->incl_node =& $a_node->first_child(); // this is the snippet node
}

Field Documentation

ilPCContentInclude::$dom

Definition at line 19 of file class.ilPCContentInclude.php.

ilPCContentInclude::$incl_node

Definition at line 20 of file class.ilPCContentInclude.php.


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