ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilPageContent Class Reference

Class ilPageContent. More...

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

Public Member Functions

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

Static Public Member Functions

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

Data Fields

 $hier_id
 
 $node
 
 $dom
 

Protected Member Functions

 setType ($a_type)
 Set Type. More...
 

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$

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

Constructor & Destructor Documentation

◆ __construct()

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().

31  {
32  $this->setPage($a_pg_obj);
33  $this->dom = $a_pg_obj->getDom();
34  $this->init();
35  if ($this->getType() == "")
36  {
37  die ("Error: ilPageContent::init() did not set type");
38  }
39  }
init()
Init object.
getType()
Get type of page content.
setPage($a_val)
Set page.
+ Here is the call graph for this function:

Member Function Documentation

◆ afterPageHistoryEntry()

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

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

428  {
429  }

◆ afterPageUpdate()

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

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

407  {
408  }

◆ beforePageDelete()

static ilPageContent::beforePageDelete (   $a_page)
static

Before page is being deleted.

Parameters
object$a_pagepage object

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

416  {
417  }

◆ createPageContentNode()

◆ decEdId()

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.

240  {
241  $id = explode("_", $ed_id);
242  $id[count($id) - 1]--;
243 
244  return implode($id, "_");
245  }

◆ disable()

ilPageContent::disable ( )

Disable page content.

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

References setEnabled().

332  {
333  $this->setEnabled("False");
334  }
setEnabled($value)
Set Enabled value for page content component.
+ Here is the call graph for this function:

◆ enable()

ilPageContent::enable ( )

Enable page content.

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

References setEnabled().

324  {
325  $this->setEnabled("True");
326  }
setEnabled($value)
Set Enabled value for page content component.
+ Here is the call graph for this function:

◆ getCssFiles()

ilPageContent::getCssFiles ( )

Get css files.

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

120  {
121  return array();
122  }

◆ getHierId()

ilPageContent::getHierId ( )

Get hierarchical id.

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

References $hier_id.

Referenced by ilPCTableData\deleteCol(), ilPCTable\getCaption(), ilPCTable\getCaptionAlign(), ilPCTableData\moveColLeft(), ilPCTableData\moveColRight(), ilPCTableData\newColAfter(), and ilPCTableData\newColBefore().

146  {
147  return $this->hier_id;
148  }
+ Here is the caller graph for this function:

◆ getJavascriptFiles()

ilPageContent::getJavascriptFiles ( )

Get Javascript files.

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

112  {
113  return array();
114  }

◆ getLangVars()

static ilPageContent::getLangVars ( )
static

Get lang vars needed for editing.

Returns
array array of lang var keys

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

373  {
374  return array();
375  }

◆ getNode()

◆ getOnloadCode()

ilPageContent::getOnloadCode ( )

Get on load code.

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

128  {
129  return array();
130  }

◆ getPage()

ilPageContent::getPage ( )

◆ getPCId()

ilPageContent::getPCId ( )

Get PC Id.

Returns
string PC Id

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

188  {
189  return $this->pcid;
190  }

◆ getType()

ilPageContent::getType ( )

Get type of page content.

Returns
string Type as defined by the page content component

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

Referenced by __construct().

83  {
84  return $this->type;
85  }
+ Here is the caller graph for this function:

◆ handleCopiedContent()

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

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

384  {
385  }

◆ haveSameContainer()

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.

256  {
257  $id1 = explode("_", $ed_id1);
258  $id2 = explode("_", $ed_id1);
259  if(count($id1) == count($id2))
260  {
261  array_pop($id1);
262  array_pop($id2);
263  foreach ($id1 as $key => $id)
264  {
265  if($id != $id2[$key])
266  {
267  return false;
268  }
269  }
270  return true;
271  }
272  return false;
273  }

◆ incEdId()

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().

225  {
226  $id = explode("_", $ed_id);
227  $id[count($id) - 1]++;
228 
229  return implode($id, "_");
230  }
+ Here is the caller graph for this function:

◆ init()

ilPageContent::init ( )
abstract

Init object.

This function must be overwritten and at least set the content type.

Referenced by __construct(), and getPage().

+ Here is the caller graph for this function:

◆ isEnabled()

ilPageContent::isEnabled ( )
final

Check whether page content is enabled.

Returns
boolean true/false

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

342  {
343  if (is_object($this->node) && $this->node->has_attribute("Enabled"))
344  {
345  $compare = $this->node->get_attribute("Enabled");
346  }
347  else
348  {
349  $compare = "True";
350  }
351 
352  return strcasecmp($compare,"true") == 0;
353  }

◆ isGreaterHierId()

ilPageContent::isGreaterHierId (   $a,
  $b 
)

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

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

289  {
290  $a_arr = explode("_", $a);
291  $b_arr = explode("_", $b);
292  for ($i = 0; $i < count($a_arr); $i++)
293  {
294  if ((int) $a_arr[$i] > (int) $b_arr[$i])
295  {
296  return true;
297  }
298  else if ((int) $a_arr[$i] < (int) $b_arr[$i])
299  {
300  return false;
301  }
302  }
303  return false;
304  }

◆ lookupHierId()

ilPageContent::lookupHierId ( )

Get hierarchical id from dom.

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

155  {
156  return $this->node->get_attribute("HierId");
157  }

◆ modifyPageContentPostXsl()

ilPageContent::modifyPageContentPostXsl (   $a_output,
  $a_mode 
)

Modify page content after xsl.

Parameters
string$a_output
Returns
string

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

394  {
395  return $a_output;
396  }

◆ readHierId()

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().

165  {
166  if (is_object($this->node))
167  {
168  return $this->node->get_attribute("HierId");
169  }
170  }
+ Here is the caller graph for this function:

◆ readPCId()

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().

199  {
200  if (is_object($this->node))
201  {
202  return $this->node->get_attribute("PCID");
203  }
204  }
+ Here is the caller graph for this function:

◆ setEnabled()

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().

313  {
314  if (is_object($this->node))
315  {
316  $this->node->set_attribute("Enabled", $value);
317  }
318  }
+ Here is the caller graph for this function:

◆ setHierId()

ilPageContent::setHierId (   $a_hier_id)

Set hierarchical ID in xml structure.

Parameters
string$a_hier_idHierarchical ID.

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

138  {
139  $this->hier_id = $a_hier_id;
140  }

◆ setNode()

ilPageContent::setNode ( $a_node)

Set xml node of page content.

Parameters
object$a_nodenode object

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

93  {
94  $this->node =& $a_node;
95  }

◆ setPage()

ilPageContent::setPage (   $a_val)

Set page.

Parameters
object$a_valpage object

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

Referenced by __construct().

47  {
48  $this->pg_obj = $a_val;
49  }
+ Here is the caller graph for this function:

◆ setPcId()

ilPageContent::setPcId (   $a_pcid)

Set PC Id.

Parameters
string$a_pcidPC Id

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

178  {
179  $this->pcid = $a_pcid;
180  }

◆ setType()

◆ sortHierIds()

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().

279  {
280  uasort($a_array, array("ilPageContent", "isGreaterHierId"));
281 
282  return $a_array;
283  }
+ Here is the caller graph for this function:

◆ writePCId()

ilPageContent::writePCId (   $a_pc_id)

Write pc id.

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

210  {
211  if (is_object($this->node))
212  {
213  $this->node->set_attribute("PCID", $a_pc_id);
214  }
215  }

Field Documentation

◆ $dom

ilPageContent::$dom

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

◆ $hier_id

◆ $node


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