ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilPCPlaceHolder 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 ilPCPlaceHolder:
+ Collaboration diagram for ilPCPlaceHolder:

Public Member Functions

 init ()
 Init object. More...
 
 create (ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id="")
 
 setContentClass (string $a_class)
 
 getContentClass ()
 
 setHeight (string $a_height)
 
 getHeight ()
 
 getClass ()
 
 modifyPageContentPostXsl (string $a_output, string $a_mode, bool $a_abstract_only=false)
 Modify page content after xsl. More...
 
 getModel ()
 @inheritDoc More...
 
 getCssFiles (string $a_mode)
 
- Public Member Functions inherited from ilPageContent
 __construct (ilPageObject $a_pg_obj, ?PageManagerInterface $page_manager=null, ?ObjectAdapterInterface $object_adapter=null)
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 init ()
 Init object. More...
 
 getType ()
 
 getDomNode ()
 
 getDomDoc ()
 
 setDomNode (DOMNode $node)
 
 getChildNode ()
 
 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...
 
 getNewPageContentNode ()
 
 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 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 Public Member Functions inherited from ilPageContent
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 $content_class
 
string $height
 
- Data Fields inherited from ilPageContent
string $hier_id = ""
 
DOMNode $dom_node = null
 
string $page_lang = ""
 

Protected Attributes

ilCtrl $ctrl
 
ilLanguage $lng
 
- Protected Attributes inherited from ilPageContent
DOMDocument $dom_doc
 
ILIAS COPage InternalDomainService $domain
 
string $pcid
 
string $type = ""
 
ilPageObject $pg_obj
 
string $file_download_link = ''
 
string $fullscreen_link = ''
 
string $sourcecode_download_script = ''
 
ilLogger $log
 
string $profile_back_url = ""
 
ILIAS COPage Dom DomUtil $dom_util
 
PageManagerInterface $page_manager = null
 
ObjectAdapterInterface $object = null
 

Additional Inherited Members

- Protected Member Functions inherited from ilPageContent
 getPageManager ()
 
 setType (string $a_type)
 Set Type. More...
 
 hasNode ()
 
 createInitialChildNode (string $hier_id, string $pc_id, string $child, array $child_attributes=[])
 

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 Class ilPlaceHolder

List content object (see ILIAS DTD)

Definition at line 24 of file class.ilPCPlaceHolder.php.

Member Function Documentation

◆ create()

ilPCPlaceHolder::create ( ilPageObject  $a_pg_obj,
string  $a_hier_id,
string  $a_pc_id = "" 
)

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

44 : void {
45 $this->createInitialChildNode($a_hier_id, $a_pc_id, "PlaceHolder");
46 }
createInitialChildNode(string $hier_id, string $pc_id, string $child, array $child_attributes=[])

◆ getClass()

ilPCPlaceHolder::getClass ( )

Definition at line 78 of file class.ilPCPlaceHolder.php.

78 : string
79 {
80 return "";
81 }

◆ getContentClass()

ilPCPlaceHolder::getContentClass ( )

Definition at line 55 of file class.ilPCPlaceHolder.php.

55 : string
56 {
57 if (is_object($this->getChildNode())) {
58 return $this->getChildNode()->getAttribute("ContentClass");
59 }
60 return "";
61 }

◆ getCssFiles()

ilPCPlaceHolder::getCssFiles ( string  $a_mode)

Reimplemented from ilPageContent.

Definition at line 155 of file class.ilPCPlaceHolder.php.

155 : array
156 {
157 return [];
158 }

◆ getHeight()

ilPCPlaceHolder::getHeight ( )

Definition at line 70 of file class.ilPCPlaceHolder.php.

70 : string
71 {
72 if (is_object($this->getChildNode())) {
73 return $this->getChildNode()->getAttribute("Height");
74 }
75 return "";
76 }

◆ getLangVars()

static ilPCPlaceHolder::getLangVars ( )
static

Get lang vars needed for editing.

Returns
string[] array of lang var keys

Reimplemented from ilPageContent.

Definition at line 83 of file class.ilPCPlaceHolder.php.

83 : array
84 {
85 return array("question_placeh","media_placeh","text_placeh",
86 "ed_insert_plach","question_placehl","media_placehl","text_placehl",
87 "verification_placeh", "verification_placehl");
88 }

◆ getModel()

ilPCPlaceHolder::getModel ( )

@inheritDoc

Reimplemented from ilPageContent.

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

148 : ?stdClass
149 {
150 $model = new \stdClass();
151 $model->contentClass = $this->getContentClass();
152 return $model;
153 }

◆ handleCopiedContent()

static ilPCPlaceHolder::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 from ilPageContent.

Definition at line 160 of file class.ilPCPlaceHolder.php.

166 : void {
167 // remove question placholders
168 if (!$a_self_ass) {
169 // Get question IDs
170 $path = "//PlaceHolder[@ContentClass = 'Question']";
171 $xpath = new DOMXPath($a_domdoc);
172 $nodes = $xpath->query($path);
173
174 foreach ($nodes as $node) {
175 $parent = $node->parentNode;
176 $parent->parentNode->removeChild($parent);
177 }
178 }
179 }
$path
Definition: ltiservices.php:30

References $path.

◆ init()

ilPCPlaceHolder::init ( )

Init object.

This function must be overwritten and at least set the content type.

Reimplemented from ilPageContent.

Definition at line 31 of file class.ilPCPlaceHolder.php.

31 : void
32 {
33 global $DIC;
34
35 $this->ctrl = $DIC->ctrl();
36 $this->lng = $DIC->language();
37 $this->setType("plach");
38 }
setType(string $a_type)
Set Type.
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilPageContent\setType().

+ Here is the call graph for this function:

◆ modifyPageContentPostXsl()

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

Modify page content after xsl.

Reimplemented from ilPageContent.

Definition at line 90 of file class.ilPCPlaceHolder.php.

94 : string {
96
97 //
98 // Note: this standard output is "overwritten", e.g. by ilPortfolioPageGUI::postOutputProcessing
99 //
100
101 $end = 0;
102 $start = strpos($a_output, "{{{{{PlaceHolder#");
103 if (is_int($start)) {
104 $end = strpos($a_output, "}}}}}", $start);
105 }
106 $i = 1;
107 while ($end > 0) {
108 $param = substr($a_output, $start + 17, $end - $start - 17);
109 $param = explode("#", $param);
110
111 $html = $param[2];
112 switch ($param[2]) {
113 case "Text":
114 $html = $lng->txt("cont_text_placeh");
115 break;
116
117 case "Media":
118 $html = $lng->txt("cont_media_placeh");
119 break;
120
121 case "Question":
122 $html = $lng->txt("cont_question_placeh");
123 break;
124
125 case "Verification":
126 $html = $lng->txt("cont_verification_placeh");
127 break;
128 }
129
130 $h2 = substr($a_output, 0, $start) .
131 $html .
132 substr($a_output, $end + 5);
133 $a_output = $h2;
134 $i++;
135
136 $start = strpos($a_output, "{{{{{PlaceHolder#", $start + 5);
137 $end = 0;
138 if (is_int($start)) {
139 $end = strpos($a_output, "}}}}}", $start);
140 }
141 }
142 return $a_output;
143 }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
$param
Definition: xapitoken.php:46

◆ setContentClass()

ilPCPlaceHolder::setContentClass ( string  $a_class)

Definition at line 48 of file class.ilPCPlaceHolder.php.

48 : void
49 {
50 if (is_object($this->getChildNode())) {
51 $this->getChildNode()->setAttribute("ContentClass", $a_class);
52 }
53 }

◆ setHeight()

ilPCPlaceHolder::setHeight ( string  $a_height)

Definition at line 63 of file class.ilPCPlaceHolder.php.

63 : void
64 {
65 if (is_object($this->getChildNode())) {
66 $this->getChildNode()->setAttribute("Height", $a_height);
67 }
68 }

Field Documentation

◆ $content_class

string ilPCPlaceHolder::$content_class

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

◆ $ctrl

ilCtrl ilPCPlaceHolder::$ctrl
protected

Definition at line 26 of file class.ilPCPlaceHolder.php.

◆ $height

string ilPCPlaceHolder::$height

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

◆ $lng

ilLanguage ilPCPlaceHolder::$lng
protected

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


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