ILIAS  release_8 Revision v8.24
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.

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 }
static getLogger(string $a_component_id)
Get component logger.
init()
Init object.
setPage(ilPageObject $a_val)
getDom()
@depracated

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

+ 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.

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

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)

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

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.

358 : void
359 {
360 }

◆ beforePageDelete()

static ilPageContent::beforePageDelete ( ilPageObject  $a_page)
static

Before page is being deleted.

Parameters
ilPageObject$a_pagepage object

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

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

352 : void {
353 }

◆ createPageContentNode()

ilPageContent::createPageContentNode ( bool  $a_set_this_node = true)

Create page content node (always use this method first when adding a new element)

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

289 {
290 $node = $this->dom->create_element("PageContent");
291 if ($a_set_this_node) {
292 $this->node = $node;
293 }
294 return $node;
295 }
php4DOMElement $node

References $node.

Referenced by ilPCInteractiveImage\create(), ilPCMediaObject\create(), ilPCLearningHistory\create(), ilPCParagraph\createAfter(), ilPCParagraph\createAtNode(), and ilPCParagraph\createBeforeNode().

+ Here is the caller graph for this function:

◆ 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.

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

References $id.

◆ 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.

Reimplemented in ilPCContentInclude, ilPCFileList, ilPCMediaObject, and ilPCSkills.

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

389 : void {
390 }

◆ disable()

ilPageContent::disable ( )

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

269 : void
270 {
271 $this->setEnabled("False");
272 }
setEnabled(string $value)
Set Enabled value for page content component.

References setEnabled().

Referenced by ilPageContentGUI\deactivate().

+ 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.

264 : void
265 {
266 $this->setEnabled("True");
267 }

References setEnabled().

+ Here is the call graph for this function:

◆ getCssFiles()

ilPageContent::getCssFiles ( string  $a_mode)

Reimplemented in ilPCGrid, ilPCMediaObject, ilPCPlaceHolder, ilPCPlugged, ilPCQuestion, and ilPCTabs.

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.

153 : string
154 {
156 }

References $file_download_link.

◆ getFullscreenLink()

ilPageContent::getFullscreenLink ( )

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

173 : string
174 {
176 }

References $fullscreen_link.

◆ getHierId()

ilPageContent::getHierId ( )

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

119 : string
120 {
121 return $this->hier_id;
122 }

References $hier_id.

◆ getJavascriptFiles()

ilPageContent::getJavascriptFiles ( string  $a_mode)

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

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

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

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.

Reimplemented in ilPCParagraph, ilPCPlaceHolder, ilPCSection, and ilPCTable.

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

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

◆ getNode()

◆ getOnloadCode()

ilPageContent::getOnloadCode ( string  $a_mode)

Reimplemented in ilPCMediaObject, ilPCParagraph, and ilPCQuestion.

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

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

◆ getPage()

ilPageContent::getPage ( )

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

60 {
61 return $this->pg_obj;
62 }
ilPageObject $pg_obj
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)

References $pg_obj.

Referenced by ilPCContentTemplate\create(), and ilPCAMDForm\isTemplate().

+ Here is the caller graph for this function:

◆ getPCId()

ilPageContent::getPCId ( )

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

143 : string
144 {
145 return $this->pcid;
146 }

References $pcid.

◆ getProfileBackUrl()

ilPageContent::getProfileBackUrl ( )

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

163 : string
164 {
166 }

References $profile_back_url.

◆ getSourcecodeDownloadScript()

ilPageContent::getSourcecodeDownloadScript ( )

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

183 : string
184 {
186 }
string $sourcecode_download_script

References $sourcecode_download_script.

◆ getType()

ilPageContent::getType ( )

Reimplemented in ilPCParagraph.

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

79 : string
80 {
81 return $this->type;
82 }

References $type.

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

+ 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

Reimplemented in ilPCAMDForm, ilPCAMDPageList, ilPCPlaceHolder, and ilPCTable.

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.

208 : string
209 {
210 $id = explode("_", $ed_id);
211 $id[count($id) - 1]++;
212 return implode("_", $id);
213 }

References $id.

Referenced by ilPageObject\addHierIDs().

+ Here is the caller graph for this function:

◆ init()

◆ 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.

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 }
$i
Definition: metadata.php:41
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples

References Vendor\Package\$a, Vendor\Package\$b, $i, and ILIAS\Repository\int().

+ 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.

Reimplemented in ilPCCurriculum, ilPCLauncher, ilPCAMDForm, ilPCAMDPageList, ilPCContentInclude, ilPCMap, ilPCMediaObject, ilPCPlaceHolder, ilPCPlugged, ilPCQuestion, ilPCSection, ilPCTab, ilPCLearningHistory, and ilPCSourceCode.

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.

130 : string
131 {
132 if (is_object($this->node)) {
133 return $this->node->get_attribute("HierId");
134 }
135 return "";
136 }

Referenced by ilPCInteractiveImage\setNode().

+ Here is the caller graph for this function:

◆ readPCId()

ilPageContent::readPCId ( )

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

188 : string
189 {
190 if (is_object($this->node)) {
191 return $this->node->get_attribute("PCID");
192 }
193 return "";
194 }

Referenced by ilPCInteractiveImage\setNode().

+ 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.

257 : void
258 {
259 if (is_object($this->node)) {
260 $this->node->set_attribute("Enabled", $value);
261 }
262 }

Referenced by disable(), and enable().

+ 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)

Reimplemented in ilPCMediaObject.

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

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

◆ setNode()

◆ setPage()

ilPageContent::setPage ( ilPageObject  $a_val)

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

54 : void
55 {
56 $this->pg_obj = $a_val;
57 }

Referenced by __construct().

+ 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.

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

References $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.

230 : array
231 {
232 uasort($a_array, array("ilPageContent", "isGreaterHierId"));
233 return $a_array;
234 }

Referenced by ilPageObject\copyContents().

+ 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

php4DOMDocument ilPageContent::$dom = null

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

◆ $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

string ilPageContent::$hier_id = ""

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

Referenced by ilPCContentTemplate\create(), and getHierId().

◆ $log

ilLogger ilPageContent::$log
protected

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

◆ $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 getType().


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