ILIAS  release_4-4 Revision
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...
 
 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 419 of file class.ilPageContent.php.

420  {
421  }

◆ 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 398 of file class.ilPageContent.php.

399  {
400  }

◆ beforePageDelete()

static ilPageContent::beforePageDelete (   $a_page)
static

Before page is being deleted.

Parameters
object$a_pagepage object

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

408  {
409  }

◆ 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 231 of file class.ilPageContent.php.

232  {
233  $id = explode("_", $ed_id);
234  $id[count($id) - 1]--;
235 
236  return implode($id, "_");
237  }

◆ disable()

ilPageContent::disable ( )

Disable page content.

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

References setEnabled().

324  {
325  $this->setEnabled("False");
326  }
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 315 of file class.ilPageContent.php.

References setEnabled().

316  {
317  $this->setEnabled("True");
318  }
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 137 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().

138  {
139  return $this->hier_id;
140  }
+ 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 364 of file class.ilPageContent.php.

365  {
366  return array();
367  }

◆ getNode()

◆ getPage()

ilPageContent::getPage ( )

Get page.

Returns
object page object

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

References init().

Referenced by ilPCTableData\fixHideAndSpans(), ilPCTable\importCell(), ilPCParagraph\saveJS(), and ilPCParagraph\setText().

57  {
58  return $this->pg_obj;
59  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPCId()

ilPageContent::getPCId ( )

Get PC Id.

Returns
string PC Id

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

180  {
181  return $this->pcid;
182  }

◆ 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 375 of file class.ilPageContent.php.

376  {
377  }

◆ 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 247 of file class.ilPageContent.php.

248  {
249  $id1 = explode("_", $ed_id1);
250  $id2 = explode("_", $ed_id1);
251  if(count($id1) == count($id2))
252  {
253  array_pop($id1);
254  array_pop($id2);
255  foreach ($id1 as $key => $id)
256  {
257  if($id != $id2[$key])
258  {
259  return false;
260  }
261  }
262  return true;
263  }
264  return false;
265  }

◆ 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 216 of file class.ilPageContent.php.

Referenced by ilPageObject\addHierIDs().

217  {
218  $id = explode("_", $ed_id);
219  $id[count($id) - 1]++;
220 
221  return implode($id, "_");
222  }
+ 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 333 of file class.ilPageContent.php.

334  {
335  if (is_object($this->node) && $this->node->has_attribute("Enabled"))
336  {
337  $compare = $this->node->get_attribute("Enabled");
338  }
339  else
340  {
341  $compare = "True";
342  }
343 
344  return strcasecmp($compare,"true") == 0;
345  }

◆ isGreaterHierId()

ilPageContent::isGreaterHierId (   $a,
  $b 
)

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

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

281  {
282  $a_arr = explode("_", $a);
283  $b_arr = explode("_", $b);
284  for ($i = 0; $i < count($a_arr); $i++)
285  {
286  if ((int) $a_arr[$i] > (int) $b_arr[$i])
287  {
288  return true;
289  }
290  else if ((int) $a_arr[$i] < (int) $b_arr[$i])
291  {
292  return false;
293  }
294  }
295  return false;
296  }

◆ lookupHierId()

ilPageContent::lookupHierId ( )

Get hierarchical id from dom.

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

147  {
148  return $this->node->get_attribute("HierId");
149  }

◆ modifyPageContentPostXsl()

ilPageContent::modifyPageContentPostXsl (   $a_output,
  $a_mode 
)

Modify page content after xsl.

Parameters
string$a_output
Returns
string

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

386  {
387  return $a_output;
388  }

◆ readHierId()

ilPageContent::readHierId ( )

Read PC Id.

Returns
string PC Id

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

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

157  {
158  if (is_object($this->node))
159  {
160  return $this->node->get_attribute("HierId");
161  }
162  }
+ Here is the caller graph for this function:

◆ readPCId()

ilPageContent::readPCId ( )

Read PC Id.

Returns
string PC Id

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

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

191  {
192  if (is_object($this->node))
193  {
194  return $this->node->get_attribute("PCID");
195  }
196  }
+ 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 304 of file class.ilPageContent.php.

Referenced by disable(), and enable().

305  {
306  if (is_object($this->node))
307  {
308  $this->node->set_attribute("Enabled", $value);
309  }
310  }
+ 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 129 of file class.ilPageContent.php.

130  {
131  $this->hier_id = $a_hier_id;
132  }

◆ 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 169 of file class.ilPageContent.php.

170  {
171  $this->pcid = $a_pcid;
172  }

◆ setType()

◆ sortHierIds()

static ilPageContent::sortHierIds (   $a_array)
static

Sort an array of Hier IDS in ascending order.

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

Referenced by ilPageObject\copyContents().

271  {
272  uasort($a_array, array("ilPageContent", "isGreaterHierId"));
273 
274  return $a_array;
275  }
+ Here is the caller graph for this function:

◆ writePCId()

ilPageContent::writePCId (   $a_pc_id)

Write pc id.

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

202  {
203  if (is_object($this->node))
204  {
205  $this->node->set_attribute("PCID", $a_pc_id);
206  }
207  }

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: