ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ($a_mode)
 Get Javascript files. More...
 
 getCssFiles ($a_mode)
 Get css files. More...
 
 getOnloadCode ($a_mode)
 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...
 
 setFileDownloadLink ($a_download_link)
 Set file download link. More...
 
 getFileDownloadLink ()
 Get file download link. More...
 
 setFullscreenLink ($a_fullscreen_link)
 Set fullscreen link. More...
 
 getFullscreenLink ()
 Get fullscreen link. More...
 
 setSourcecodeDownloadScript ($script_name)
 Set sourcecode download script. More...
 
 getSourcecodeDownloadScript ()
 Get sourcecode download script. More...
 
 readPCId ()
 Read PC Id. More...
 
 writePCId ($a_pc_id)
 Write pc id. 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 isGreaterHierId ($a, $b)
 Check whether Hier ID $a is greater than Hier ID $b. 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
 
 $page_lang
 

Protected Member Functions

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

Protected Attributes

 $file_download_link
 
 $fullscreen_link
 
 $sourcecode_download_script
 
 $log
 

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

References ilLoggerFactory\getLogger(), getType(), init(), and setPage().

52  {
53  $this->log = ilLoggerFactory::getLogger('copg');
54  $this->setPage($a_pg_obj);
55  $this->dom = $a_pg_obj->getDom();
56  $this->init();
57  if ($this->getType() == "")
58  {
59  die ("Error: ilPageContent::init() did not set type");
60  }
61  }
init()
Init object.
getType()
Get type of page content.
setPage($a_val)
Set page.
static getLogger($a_component_id)
Get component logger.
+ 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 509 of file class.ilPageContent.php.

510  {
511  }

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

489  {
490  }

◆ beforePageDelete()

static ilPageContent::beforePageDelete (   $a_page)
static

Before page is being deleted.

Parameters
object$a_pagepage object

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

498  {
499  }

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

322  {
323  $id = explode("_", $ed_id);
324  $id[count($id) - 1]--;
325 
326  return implode($id, "_");
327  }

◆ disable()

ilPageContent::disable ( )

Disable page content.

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

References setEnabled().

414  {
415  $this->setEnabled("False");
416  }
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 405 of file class.ilPageContent.php.

References setEnabled().

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

◆ getCssFiles()

ilPageContent::getCssFiles (   $a_mode)

Get css files.

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

References array.

142  {
143  return array();
144  }
Create styles array
The data for the language used.

◆ getFileDownloadLink()

ilPageContent::getFileDownloadLink ( )

Get file download link.

Returns
string

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

References $file_download_link.

Referenced by ilPCContentInclude\modifyPageContentPostXsl().

230  {
232  }
+ Here is the caller graph for this function:

◆ getFullscreenLink()

ilPageContent::getFullscreenLink ( )

Get fullscreen link.

Returns
string

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

References $fullscreen_link.

Referenced by ilPCContentInclude\modifyPageContentPostXsl().

250  {
251  return $this->fullscreen_link;
252  }
+ Here is the caller graph for this function:

◆ getHierId()

ilPageContent::getHierId ( )

Get hierarchical id.

Definition at line 167 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().

168  {
169  return $this->hier_id;
170  }
+ Here is the caller graph for this function:

◆ getJavascriptFiles()

ilPageContent::getJavascriptFiles (   $a_mode)

Get Javascript files.

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

References array.

134  {
135  return array();
136  }
Create styles array
The data for the language used.

◆ getLangVars()

static ilPageContent::getLangVars ( )
static

Get lang vars needed for editing.

Returns
array array of lang var keys

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

References array.

455  {
456  return array();
457  }
Create styles array
The data for the language used.

◆ getNode()

◆ getOnloadCode()

ilPageContent::getOnloadCode (   $a_mode)

Get on load code.

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

References array.

150  {
151  return array();
152  }
Create styles array
The data for the language used.

◆ getPage()

◆ getPCId()

ilPageContent::getPCId ( )

Get PC Id.

Returns
string PC Id

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

210  {
211  return $this->pcid;
212  }

◆ getSourcecodeDownloadScript()

ilPageContent::getSourcecodeDownloadScript ( )

Get sourcecode download script.

Returns
string

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

References $sourcecode_download_script.

Referenced by ilPCContentInclude\modifyPageContentPostXsl().

270  {
272  }
+ Here is the caller graph for this function:

◆ getType()

ilPageContent::getType ( )

Get type of page content.

Returns
string Type as defined by the page content component

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

Referenced by __construct().

105  {
106  return $this->type;
107  }
+ 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 465 of file class.ilPageContent.php.

466  {
467  }

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

338  {
339  $id1 = explode("_", $ed_id1);
340  $id2 = explode("_", $ed_id1);
341  if(count($id1) == count($id2))
342  {
343  array_pop($id1);
344  array_pop($id2);
345  foreach ($id1 as $key => $id)
346  {
347  if($id != $id2[$key])
348  {
349  return false;
350  }
351  }
352  return true;
353  }
354  return false;
355  }

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

Referenced by ilPageObject\addHierIDs().

307  {
308  $id = explode("_", $ed_id);
309  $id[count($id) - 1]++;
310 
311  return implode($id, "_");
312  }
+ 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 423 of file class.ilPageContent.php.

424  {
425  if (is_object($this->node) && $this->node->has_attribute("Enabled"))
426  {
427  $compare = $this->node->get_attribute("Enabled");
428  }
429  else
430  {
431  $compare = "True";
432  }
433 
434  return strcasecmp($compare,"true") == 0;
435  }

◆ isGreaterHierId()

static ilPageContent::isGreaterHierId (   $a,
  $b 
)
static

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

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

371  {
372  $a_arr = explode("_", $a);
373  $b_arr = explode("_", $b);
374  for ($i = 0; $i < count($a_arr); $i++)
375  {
376  if ((int) $a_arr[$i] > (int) $b_arr[$i])
377  {
378  return true;
379  }
380  else if ((int) $a_arr[$i] < (int) $b_arr[$i])
381  {
382  return false;
383  }
384  }
385  return false;
386  }

◆ lookupHierId()

ilPageContent::lookupHierId ( )

Get hierarchical id from dom.

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

177  {
178  return $this->node->get_attribute("HierId");
179  }

◆ modifyPageContentPostXsl()

ilPageContent::modifyPageContentPostXsl (   $a_output,
  $a_mode 
)

Modify page content after xsl.

Parameters
string$a_output
Returns
string

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

476  {
477  return $a_output;
478  }

◆ readHierId()

ilPageContent::readHierId ( )

Read PC Id.

Returns
string PC Id

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

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

187  {
188  if (is_object($this->node))
189  {
190  return $this->node->get_attribute("HierId");
191  }
192  }
+ Here is the caller graph for this function:

◆ readPCId()

ilPageContent::readPCId ( )

Read PC Id.

Returns
string PC Id

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

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

281  {
282  if (is_object($this->node))
283  {
284  return $this->node->get_attribute("PCID");
285  }
286  }
+ 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 394 of file class.ilPageContent.php.

Referenced by disable(), and enable().

395  {
396  if (is_object($this->node))
397  {
398  $this->node->set_attribute("Enabled", $value);
399  }
400  }
+ Here is the caller graph for this function:

◆ setFileDownloadLink()

ilPageContent::setFileDownloadLink (   $a_download_link)

Set file download link.

Parameters
string$a_download_linkdownload link

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

220  {
221  $this->file_download_link = $a_download_link;
222  }

◆ setFullscreenLink()

ilPageContent::setFullscreenLink (   $a_fullscreen_link)

Set fullscreen link.

Parameters
string$a_download_linkdownload link

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

240  {
241  $this->fullscreen_link = $a_fullscreen_link;
242  }

◆ setHierId()

ilPageContent::setHierId (   $a_hier_id)

Set hierarchical ID in xml structure.

Parameters
string$a_hier_idHierarchical ID.

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

160  {
161  $this->hier_id = $a_hier_id;
162  }

◆ setNode()

ilPageContent::setNode (   $a_node)

Set xml node of page content.

Parameters
object$a_nodenode object

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

115  {
116  $this->node = $a_node;
117  }

◆ setPage()

ilPageContent::setPage (   $a_val)

Set page.

Parameters
object$a_valpage object

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

Referenced by __construct().

69  {
70  $this->pg_obj = $a_val;
71  }
+ Here is the caller graph for this function:

◆ setPcId()

ilPageContent::setPcId (   $a_pcid)

Set PC Id.

Parameters
string$a_pcidPC Id

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

200  {
201  $this->pcid = $a_pcid;
202  }

◆ setSourcecodeDownloadScript()

ilPageContent::setSourcecodeDownloadScript (   $script_name)

Set sourcecode download script.

Parameters
string$script_name

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

260  {
261  $this->sourcecode_download_script = $script_name;
262  }

◆ setType()

◆ sortHierIds()

static ilPageContent::sortHierIds (   $a_array)
static

Sort an array of Hier IDS in ascending order.

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

References array.

Referenced by ilPageObject\copyContents().

361  {
362  uasort($a_array, array("ilPageContent", "isGreaterHierId"));
363 
364  return $a_array;
365  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ writePCId()

ilPageContent::writePCId (   $a_pc_id)

Write pc id.

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

292  {
293  if (is_object($this->node))
294  {
295  $this->node->set_attribute("PCID", $a_pc_id);
296  }
297  }

Field Documentation

◆ $dom

ilPageContent::$dom

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

◆ $file_download_link

ilPageContent::$file_download_link
protected

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

Referenced by getFileDownloadLink().

◆ $fullscreen_link

ilPageContent::$fullscreen_link
protected

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

Referenced by getFullscreenLink().

◆ $hier_id

◆ $log

ilPageContent::$log
protected

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

◆ $node

◆ $page_lang

ilPageContent::$page_lang

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

◆ $sourcecode_download_script

ilPageContent::$sourcecode_download_script
protected

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

Referenced by getSourcecodeDownloadScript().


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