ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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.

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 die("Error: ilPageContent::init() did not set type");
59 }
60 }
static getLogger($a_component_id)
Get component logger.
init()
Init object.
getType()
Get type of page content.
setPage($a_val)
Set page.

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

+ 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

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

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

494 {
495 }

◆ 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

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

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

473 {
474 }

◆ beforePageDelete()

static ilPageContent::beforePageDelete (   $a_page)
static

Before page is being deleted.

Parameters
object$a_pagepage object

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

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

482 {
483 }

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

318 {
319 $id = explode("_", $ed_id);
320 $id[count($id) - 1]--;
321
322 return implode($id, "_");
323 }
if(!array_key_exists('StateId', $_REQUEST)) $id

References $id.

◆ disable()

ilPageContent::disable ( )

Disable page content.

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

402 {
403 $this->setEnabled("False");
404 }
setEnabled($value)
Set Enabled value for page content component.

References setEnabled().

+ Here is the call graph for this function:

◆ enable()

ilPageContent::enable ( )

Enable page content.

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

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

References setEnabled().

+ Here is the call graph for this function:

◆ getCssFiles()

ilPageContent::getCssFiles (   $a_mode)

Get css files.

Reimplemented in ilPCGrid, ilPCPlugged, ilPCQuestion, and ilPCTabs.

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

141 {
142 return array();
143 }

◆ getFileDownloadLink()

ilPageContent::getFileDownloadLink ( )

Get file download link.

Returns
string

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

228 {
230 }

References $file_download_link.

Referenced by ilPCContentInclude\modifyPageContentPostXsl().

+ Here is the caller graph for this function:

◆ getFullscreenLink()

ilPageContent::getFullscreenLink ( )

Get fullscreen link.

Returns
string

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

248 {
250 }

References $fullscreen_link.

Referenced by ilPCContentInclude\modifyPageContentPostXsl().

+ Here is the caller graph for this function:

◆ getHierId()

ilPageContent::getHierId ( )

◆ getJavascriptFiles()

ilPageContent::getJavascriptFiles (   $a_mode)

Get Javascript files.

Reimplemented in ilPCGrid, ilPCParagraph, ilPCPlugged, ilPCQuestion, and ilPCTabs.

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

133 {
134 return array();
135 }

◆ getLangVars()

static ilPageContent::getLangVars ( )
static

Get lang vars needed for editing.

Returns
array array of lang var keys

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

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

439 {
440 return array();
441 }

◆ getNode()

◆ getOnloadCode()

ilPageContent::getOnloadCode (   $a_mode)

Get on load code.

Reimplemented in ilPCParagraph, and ilPCQuestion.

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

149 {
150 return array();
151 }

◆ getPage()

◆ getPCId()

ilPageContent::getPCId ( )

Get PC Id.

Returns
string PC Id

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

208 {
209 return $this->pcid;
210 }

◆ getSourcecodeDownloadScript()

ilPageContent::getSourcecodeDownloadScript ( )

Get sourcecode download script.

Returns
string

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

References $sourcecode_download_script.

Referenced by ilPCContentInclude\modifyPageContentPostXsl().

+ 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

Reimplemented in ilPCParagraph.

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

104 {
105 return $this->type;
106 }
$type

References $type.

Referenced by __construct().

+ 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

Reimplemented in ilPCAMDPageList, and ilPCTable.

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

450 {
451 }

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

334 {
335 $id1 = explode("_", $ed_id1);
336 $id2 = explode("_", $ed_id1);
337 if (count($id1) == count($id2)) {
338 array_pop($id1);
339 array_pop($id2);
340 foreach ($id1 as $key => $id) {
341 if ($id != $id2[$key]) {
342 return false;
343 }
344 }
345 return true;
346 }
347 return false;
348 }
$key
Definition: croninfo.php:18

References $id, and $key.

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

303 {
304 $id = explode("_", $ed_id);
305 $id[count($id) - 1]++;
306
307 return implode($id, "_");
308 }

References $id.

Referenced by ilPageObject\addHierIDs().

+ Here is the caller graph for this function:

◆ init()

◆ isEnabled()

ilPageContent::isEnabled ( )
final

Check whether page content is enabled.

Returns
boolean true/false

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

412 {
413 if (is_object($this->node) && $this->node->has_attribute("Enabled")) {
414 $compare = $this->node->get_attribute("Enabled");
415 } else {
416 $compare = "True";
417 }
418
419 return strcasecmp($compare, "true") == 0;
420 }

◆ isGreaterHierId()

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

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

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

364 {
365 $a_arr = explode("_", $a);
366 $b_arr = explode("_", $b);
367 for ($i = 0; $i < count($a_arr); $i++) {
368 if ((int) $a_arr[$i] > (int) $b_arr[$i]) {
369 return true;
370 } elseif ((int) $a_arr[$i] < (int) $b_arr[$i]) {
371 return false;
372 }
373 }
374 return false;
375 }
$i
Definition: disco.tpl.php:19

References $i.

◆ lookupHierId()

ilPageContent::lookupHierId ( )

Get hierarchical id from dom.

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

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

◆ modifyPageContentPostXsl()

ilPageContent::modifyPageContentPostXsl (   $a_output,
  $a_mode 
)

Modify page content after xsl.

Parameters
string$a_output
Returns
string

Reimplemented in ilPCAMDPageList, ilPCContentInclude, ilPCMap, ilPCMediaObject, ilPCPlaceHolder, ilPCPlugged, ilPCQuestion, ilPCSection, and ilPCSourceCode.

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

460 {
461 return $a_output;
462 }

◆ readHierId()

ilPageContent::readHierId ( )

Read PC Id.

Returns
string PC Id

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

186 {
187 if (is_object($this->node)) {
188 return $this->node->get_attribute("HierId");
189 }
190 }

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

+ Here is the caller graph for this function:

◆ readPCId()

ilPageContent::readPCId ( )

Read PC Id.

Returns
string PC Id

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

279 {
280 if (is_object($this->node)) {
281 return $this->node->get_attribute("PCID");
282 }
283 }

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

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

384 {
385 if (is_object($this->node)) {
386 $this->node->set_attribute("Enabled", $value);
387 }
388 }

Referenced by disable(), and enable().

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

218 {
219 $this->file_download_link = $a_download_link;
220 }

◆ setFullscreenLink()

ilPageContent::setFullscreenLink (   $a_fullscreen_link)

Set fullscreen link.

Parameters
string$a_download_linkdownload link

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

238 {
239 $this->fullscreen_link = $a_fullscreen_link;
240 }

◆ setHierId()

ilPageContent::setHierId (   $a_hier_id)

Set hierarchical ID in xml structure.

Parameters
string$a_hier_idHierarchical ID.

Reimplemented in ilPCMediaObject.

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

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

◆ setNode()

◆ setPage()

ilPageContent::setPage (   $a_val)

Set page.

Parameters
object$a_valpage object

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

68 {
69 $this->pg_obj = $a_val;
70 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setPcId()

ilPageContent::setPcId (   $a_pcid)

Set PC Id.

Parameters
string$a_pcidPC Id

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

198 {
199 $this->pcid = $a_pcid;
200 }

◆ setSourcecodeDownloadScript()

ilPageContent::setSourcecodeDownloadScript (   $script_name)

Set sourcecode download script.

Parameters
string$script_name

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

258 {
259 $this->sourcecode_download_script = $script_name;
260 }

◆ setType()

◆ sortHierIds()

static ilPageContent::sortHierIds (   $a_array)
static

Sort an array of Hier IDS in ascending order.

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

354 {
355 uasort($a_array, array("ilPageContent", "isGreaterHierId"));
356
357 return $a_array;
358 }

Referenced by ilPageObject\copyContents().

+ Here is the caller graph for this function:

◆ writePCId()

ilPageContent::writePCId (   $a_pc_id)

Write pc id.

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

289 {
290 if (is_object($this->node)) {
291 $this->node->set_attribute("PCID", $a_pc_id);
292 }
293 }

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: