ILIAS  release_8 Revision v8.23
ilPageContent Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct (ilPageObject $a_pg_obj)
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 init ()
 Init object. More...
 
 getType ()
 
 setNode (php4DOMElement $a_node)
 Set xml node of page content. More...
 
 getNode ()
 
 getJavascriptFiles (string $a_mode)
 
 getCssFiles (string $a_mode)
 
 getOnloadCode (string $a_mode)
 
 setHierId (string $a_hier_id)
 
 getHierId ()
 
 lookupHierId ()
 
 readHierId ()
 
 setPcId (string $a_pcid)
 
 getPCId ()
 
 setFileDownloadLink (string $a_download_link)
 
 getFileDownloadLink ()
 
 setProfileBackUrl (string $url)
 
 getProfileBackUrl ()
 
 setFullscreenLink (string $a_fullscreen_link)
 
 getFullscreenLink ()
 
 setSourcecodeDownloadScript (string $script_name)
 
 getSourcecodeDownloadScript ()
 
 readPCId ()
 
 writePCId (string $a_pc_id)
 
 setEnabled (string $value)
 Set Enabled value for page content component. More...
 
 enable ()
 
 disable ()
 
 isEnabled ()
 
 createPageContentNode (bool $a_set_this_node=true)
 Create page content node (always use this method first when adding a new element) More...
 
 modifyPageContentPostXsl (string $a_output, string $a_mode, bool $a_abstract_only=false)
 Modify page content after xsl. More...
 
 getModel ()
 Get model as needed for the front-end editor. More...
 

Static Public Member Functions

static incEdId (string $ed_id)
 Increases an hierarchical editing id at lowest level (last number) More...
 
static decEdId (string $ed_id)
 Decreases an hierarchical editing id at lowest level (last number) More...
 
static sortHierIds (array $a_array)
 Sort an array of Hier IDS in ascending order. More...
 
static isGreaterHierId (string $a, string $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, bool $a_self_ass=true, bool $a_clone_mobs=false, int $new_parent_id=0, int $obj_copy_id=0)
 Handle copied content. More...
 
static afterPageUpdate (ilPageObject $a_page, DOMDocument $a_domdoc, string $a_xml, bool $a_creation)
 After page has been updated (or created) More...
 
static beforePageDelete (ilPageObject $a_page)
 Before page is being deleted. More...
 
static afterRepositoryCopy (ilPageObject $page, array $mapping, int $source_ref_id)
 After repository (container) copy action. More...
 
static afterPageHistoryEntry (ilPageObject $a_page, DOMDocument $a_old_domdoc, string $a_old_xml, int $a_old_nr)
 After page history entry has been created. More...
 
static deleteHistoryLowerEqualThan (string $parent_type, int $page_id, string $lang, int $delete_lower_than_nr)
 Overwrite in derived classes, if old history entries are being deleted. More...
 

Data Fields

string $hier_id = ""
 
php4DOMElement $node = null
 
php4DOMDocument $dom = null
 
string $page_lang = ""
 

Protected Member Functions

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

Protected Attributes

string $pcid
 
string $type = ""
 
ilPageObject $pg_obj
 
string $file_download_link
 
string $fullscreen_link
 
string $sourcecode_download_script
 
ilLogger $log
 
string $profile_back_url = ""
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ilPageContent::__construct ( ilPageObject  $a_pg_obj)
final

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

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

44  {
45  $this->log = ilLoggerFactory::getLogger('copg');
46  $this->setPage($a_pg_obj);
47  $this->dom = $a_pg_obj->getDom();
48  $this->init();
49  if ($this->getType() == "") {
50  die("Error: ilPageContent::init() did not set type");
51  }
52  }
init()
Init object.
static getLogger(string $a_component_id)
Get component logger.
setPage(ilPageObject $a_val)
+ Here is the call graph for this function:

Member Function Documentation

◆ afterPageHistoryEntry()

static ilPageContent::afterPageHistoryEntry ( ilPageObject  $a_page,
DOMDocument  $a_old_domdoc,
string  $a_old_xml,
int  $a_old_nr 
)
static

After page history entry has been created.

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

370  : void {
371  }

◆ afterPageUpdate()

static ilPageContent::afterPageUpdate ( ilPageObject  $a_page,
DOMDocument  $a_domdoc,
string  $a_xml,
bool  $a_creation 
)
static

After page has been updated (or created)

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

343  : void {
344  }

◆ afterRepositoryCopy()

static ilPageContent::afterRepositoryCopy ( ilPageObject  $page,
array  $mapping,
int  $source_ref_id 
)
static

After repository (container) copy action.

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

Referenced by ilPCPlugged\getPluginName().

358  : void
359  {
360  }
+ Here is the caller graph for this function:

◆ beforePageDelete()

static ilPageContent::beforePageDelete ( ilPageObject  $a_page)
static

Before page is being deleted.

Parameters
ilPageObject$a_pagepage object

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

352  : void {
353  }

◆ createPageContentNode()

◆ decEdId()

static ilPageContent::decEdId ( string  $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 220 of file class.ilPageContent.php.

References $id.

220  : string
221  {
222  $id = explode("_", $ed_id);
223  $id[count($id) - 1]--;
224  return implode("_", $id);
225  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

◆ deleteHistoryLowerEqualThan()

static ilPageContent::deleteHistoryLowerEqualThan ( string  $parent_type,
int  $page_id,
string  $lang,
int  $delete_lower_than_nr 
)
static

Overwrite in derived classes, if old history entries are being deleted.

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

389  : void {
390  }

◆ disable()

ilPageContent::disable ( )

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

References setEnabled().

Referenced by ilPageContentGUI\deactivate().

269  : void
270  {
271  $this->setEnabled("False");
272  }
setEnabled(string $value)
Set Enabled value for page content component.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enable()

ilPageContent::enable ( )

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

References setEnabled().

264  : void
265  {
266  $this->setEnabled("True");
267  }
setEnabled(string $value)
Set Enabled value for page content component.
+ Here is the call graph for this function:

◆ getCssFiles()

ilPageContent::getCssFiles ( string  $a_mode)

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

104  : array
105  {
106  return [];
107  }

◆ getFileDownloadLink()

ilPageContent::getFileDownloadLink ( )

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

References $file_download_link.

Referenced by ilPCContentInclude\modifyPageContentPostXsl().

153  : string
154  {
156  }
+ Here is the caller graph for this function:

◆ getFullscreenLink()

ilPageContent::getFullscreenLink ( )

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

References $fullscreen_link.

Referenced by ilPCContentInclude\modifyPageContentPostXsl().

173  : string
174  {
175  return $this->fullscreen_link;
176  }
+ Here is the caller graph for this function:

◆ getHierId()

◆ getJavascriptFiles()

ilPageContent::getJavascriptFiles ( string  $a_mode)

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

99  : array
100  {
101  return array();
102  }

◆ getLangVars()

static ilPageContent::getLangVars ( )
static

Get lang vars needed for editing.

Returns
string[] array of lang var keys

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

301  : array
302  {
303  return array();
304  }

◆ getModel()

ilPageContent::getModel ( )

Get model as needed for the front-end editor.

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

376  : ?stdClass
377  {
378  return null;
379  }

◆ getNode()

◆ getOnloadCode()

ilPageContent::getOnloadCode ( string  $a_mode)

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

109  : array
110  {
111  return array();
112  }

◆ getPage()

◆ getPCId()

◆ getProfileBackUrl()

ilPageContent::getProfileBackUrl ( )

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

References $profile_back_url.

Referenced by ilPCContentInclude\modifyPageContentPostXsl().

163  : string
164  {
166  }
+ Here is the caller graph for this function:

◆ getSourcecodeDownloadScript()

ilPageContent::getSourcecodeDownloadScript ( )

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

References $sourcecode_download_script.

Referenced by ilPCContentInclude\modifyPageContentPostXsl().

183  : string
184  {
186  }
string $sourcecode_download_script
+ Here is the caller graph for this function:

◆ getType()

ilPageContent::getType ( )

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

References $type.

Referenced by __construct(), ilGlossaryDefPage\beforePageContentUpdate(), ilLMPage\beforePageContentUpdate(), ilPageEditorGUI\characteristic(), and ilPageEditorGUI\executeCommand().

79  : string
80  {
81  return $this->type;
82  }
+ Here is the caller graph for this function:

◆ handleCopiedContent()

static ilPageContent::handleCopiedContent ( DOMDocument  $a_domdoc,
bool  $a_self_ass = true,
bool  $a_clone_mobs = false,
int  $new_parent_id = 0,
int  $obj_copy_id = 0 
)
static

Handle copied content.

This function must, e.g. create copies of objects referenced within the content (e.g. question objects)

Parameters
DOMDocument$a_domdoc
bool$a_self_ass
bool$a_clone_mobs
int$new_parent_id
int$obj_copy_id

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

321  : void {
322  }

◆ incEdId()

static ilPageContent::incEdId ( string  $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 208 of file class.ilPageContent.php.

References $id.

Referenced by ilPageObject\addHierIDs().

208  : string
209  {
210  $id = explode("_", $ed_id);
211  $id[count($id) - 1]++;
212  return implode("_", $id);
213  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ 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

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

274  : bool
275  {
276  if (is_object($this->node) && $this->node->has_attribute("Enabled")) {
277  $compare = $this->node->get_attribute("Enabled");
278  } else {
279  $compare = "True";
280  }
281 
282  return strcasecmp($compare, "true") == 0;
283  }

◆ isGreaterHierId()

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

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

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

References $i, and ILIAS\Repository\int().

239  : int
240  {
241  $a_arr = explode("_", $a);
242  $b_arr = explode("_", $b);
243  for ($i = 0; $i < count($a_arr); $i++) {
244  if ((int) $a_arr[$i] > (int) $b_arr[$i]) {
245  return +1;
246  } elseif ((int) $a_arr[$i] < (int) $b_arr[$i]) {
247  return -1;
248  }
249  }
250  return 0;
251  }
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

◆ lookupHierId()

ilPageContent::lookupHierId ( )

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

125  : string
126  {
127  return $this->node->get_attribute("HierId");
128  }

◆ modifyPageContentPostXsl()

ilPageContent::modifyPageContentPostXsl ( string  $a_output,
string  $a_mode,
bool  $a_abstract_only = false 
)

Modify page content after xsl.

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

331  : string {
332  return $a_output;
333  }

◆ readHierId()

ilPageContent::readHierId ( )

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

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

130  : string
131  {
132  if (is_object($this->node)) {
133  return $this->node->get_attribute("HierId");
134  }
135  return "";
136  }
+ Here is the caller graph for this function:

◆ readPCId()

ilPageContent::readPCId ( )

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

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

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

◆ setEnabled()

ilPageContent::setEnabled ( string  $value)

Set Enabled value for page content component.

Parameters
string$value"True" | "False"

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

Referenced by disable(), and enable().

257  : void
258  {
259  if (is_object($this->node)) {
260  $this->node->set_attribute("Enabled", $value);
261  }
262  }
+ Here is the caller graph for this function:

◆ setFileDownloadLink()

ilPageContent::setFileDownloadLink ( string  $a_download_link)

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

148  : void
149  {
150  $this->file_download_link = $a_download_link;
151  }

◆ setFullscreenLink()

ilPageContent::setFullscreenLink ( string  $a_fullscreen_link)

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

168  : void
169  {
170  $this->fullscreen_link = $a_fullscreen_link;
171  }

◆ setHierId()

ilPageContent::setHierId ( string  $a_hier_id)

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

114  : void
115  {
116  $this->hier_id = $a_hier_id;
117  }

◆ setNode()

ilPageContent::setNode ( php4DOMElement  $a_node)

Set xml node of page content.

Parameters
php4DOMElement$a_nodenode object

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

Referenced by ilPageObject\insertContent().

88  : void
89  {
90  $this->node = $a_node;
91  }
+ Here is the caller graph for this function:

◆ setPage()

ilPageContent::setPage ( ilPageObject  $a_val)

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

Referenced by __construct().

54  : void
55  {
56  $this->pg_obj = $a_val;
57  }
+ Here is the caller graph for this function:

◆ setPcId()

ilPageContent::setPcId ( string  $a_pcid)

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

138  : void
139  {
140  $this->pcid = $a_pcid;
141  }

◆ setProfileBackUrl()

ilPageContent::setProfileBackUrl ( string  $url)

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

References $url.

158  : void
159  {
160  $this->profile_back_url = $url;
161  }
$url

◆ setSourcecodeDownloadScript()

ilPageContent::setSourcecodeDownloadScript ( string  $script_name)

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

178  : void
179  {
180  $this->sourcecode_download_script = $script_name;
181  }

◆ setType()

◆ sortHierIds()

static ilPageContent::sortHierIds ( array  $a_array)
static

Sort an array of Hier IDS in ascending order.

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

Referenced by ilPageObject\copyContents().

230  : array
231  {
232  uasort($a_array, array("ilPageContent", "isGreaterHierId"));
233  return $a_array;
234  }
+ Here is the caller graph for this function:

◆ writePCId()

ilPageContent::writePCId ( string  $a_pc_id)

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

196  : void
197  {
198  if (is_object($this->node)) {
199  $this->node->set_attribute("PCID", $a_pc_id);
200  }
201  }

Field Documentation

◆ $dom

◆ $file_download_link

string ilPageContent::$file_download_link
protected

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

Referenced by getFileDownloadLink().

◆ $fullscreen_link

string ilPageContent::$fullscreen_link
protected

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

Referenced by getFullscreenLink().

◆ $hier_id

◆ $log

◆ $node

◆ $page_lang

string ilPageContent::$page_lang = ""

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

◆ $pcid

string ilPageContent::$pcid
protected

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

Referenced by getPCId().

◆ $pg_obj

ilPageObject ilPageContent::$pg_obj
protected

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

Referenced by getPage().

◆ $profile_back_url

string ilPageContent::$profile_back_url = ""
protected

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

Referenced by getProfileBackUrl().

◆ $sourcecode_download_script

string ilPageContent::$sourcecode_download_script
protected

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

Referenced by getSourcecodeDownloadScript().

◆ $type

string ilPageContent::$type = ""
protected

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

Referenced by ilPCContentInclude\collectContentIncludes(), and getType().


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