ILIAS  release_7 Revision v7.30-3-g800a261c036
ilPCPlaceHolder Class Reference

Class ilPlaceHolder. More...

+ Inheritance diagram for ilPCPlaceHolder:
+ Collaboration diagram for ilPCPlaceHolder:

Public Member Functions

 init ()
 Init page content component. More...
 
 setNode ($a_node)
 Set node. More...
 
 create (&$a_pg_obj, $a_hier_id, $a_pc_id="")
 Create PlaceHolder Element. More...
 
 setContentClass ($a_class)
 Set Content Class. More...
 
 getContentClass ()
 Get Content Class. More...
 
 setHeight ($a_height)
 Set Height. More...
 
 getHeight ()
 Get Height. More...
 
 getClass ()
 Get characteristic of PlaceHolder. More...
 
 modifyPageContentPostXsl ($a_html, $a_mode, $a_abstract_only=false)
 
 getModel ()
 
 getCssFiles ($a_mode)
 Get css files. More...
 
- Public Member Functions inherited from ilPageContent
 __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...
 
 setProfileBackUrl ($url)
 
 getProfileBackUrl ()
 
 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, $a_abstract_only=false)
 Modify page content after xsl. More...
 
 getModel ()
 Get model. More...
 

Static Public Member Functions

static getLangVars ()
 Get lang vars needed for editing. More...
 
- Static Public Member Functions inherited from ilPageContent
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

 $q_node
 
 $content_class
 
 $height
 
- Data Fields inherited from ilPageContent
 $hier_id
 
 $node
 
 $dom
 
 $page_lang
 

Protected Attributes

 $ctrl
 
 $lng
 
- Protected Attributes inherited from ilPageContent
 $profile_back_url
 
 $file_download_link
 
 $fullscreen_link
 
 $sourcecode_download_script
 
 $log
 

Additional Inherited Members

- Protected Member Functions inherited from ilPageContent
 setType ($a_type)
 Set Type. More...
 

Detailed Description

Class ilPlaceHolder.

List content object (see ILIAS DTD)

Version
$Id$

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

Member Function Documentation

◆ create()

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

Create PlaceHolder Element.

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

References ilPageContent\createPageContentNode(), and IL_INSERT_AFTER.

60  {
61  $this->createPageContentNode();
62  $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
63  $this->q_node = $this->dom->create_element("PlaceHolder");
64  $this->q_node = $this->node->append_child($this->q_node);
65  }
const IL_INSERT_AFTER
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element) ...
+ Here is the call graph for this function:

◆ getClass()

ilPCPlaceHolder::getClass ( )

Get characteristic of PlaceHolder.

Returns
string characteristic

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

124  {
125  return "";
126  }

◆ getContentClass()

ilPCPlaceHolder::getContentClass ( )

Get Content Class.

Returns
string Content Class

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

Referenced by getModel().

85  {
86  if (is_object($this->q_node)) {
87  return $this->q_node->get_attribute("ContentClass", $a_class);
88  }
89  return false;
90  }
+ Here is the caller graph for this function:

◆ getCssFiles()

ilPCPlaceHolder::getCssFiles (   $a_mode)

Get css files.

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

References ilObjStyleSheet\getPlaceHolderStylePath().

210  {
212  }
static getPlaceHolderStylePath()
get placeholder style path (for Page Layouts)
+ Here is the call graph for this function:

◆ getHeight()

ilPCPlaceHolder::getHeight ( )

Get Height.

Returns
string Content Class

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

111  {
112  if (is_object($this->q_node)) {
113  return $this->q_node->get_attribute("Height", $a_class);
114  }
115  return false;
116  }

◆ getLangVars()

static ilPCPlaceHolder::getLangVars ( )
static

Get lang vars needed for editing.

Returns
array array of lang var keys

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

133  {
134  return array("question_placeh","media_placeh","text_placeh",
135  "ed_insert_plach","question_placehl","media_placehl","text_placehl",
136  "verification_placeh", "verification_placehl");
137  }

◆ getModel()

ilPCPlaceHolder::getModel ( )

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

References getContentClass().

200  {
201  $model = new \stdClass();
202  $model->contentClass = $this->getContentClass();;
203  return $model;
204  }
getContentClass()
Get Content Class.
+ Here is the call graph for this function:

◆ init()

ilPCPlaceHolder::init ( )

Init page content component.

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

References $DIC, and ilPageContent\setType().

38  {
39  global $DIC;
40 
41  $this->ctrl = $DIC->ctrl();
42  $this->lng = $DIC->language();
43  $this->setType("plach");
44  }
setType($a_type)
Set Type.
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

◆ modifyPageContentPostXsl()

ilPCPlaceHolder::modifyPageContentPostXsl (   $a_html,
  $a_mode,
  $a_abstract_only = false 
)

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

References $ctrl, $i, $lng, and $param.

144  {
145  $ilCtrl = $this->ctrl;
146  $lng = $this->lng;
147 
148  //
149  // Note: this standard output is "overwritten", e.g. by ilPortfolioPageGUI::postOutputProcessing
150  //
151 
152  $c_pos = 0;
153  $start = strpos($a_html, "{{{{{PlaceHolder#");
154  if (is_int($start)) {
155  $end = strpos($a_html, "}}}}}", $start);
156  }
157  $i = 1;
158  while ($end > 0) {
159  $param = substr($a_html, $start + 17, $end - $start - 17);
160  $param = explode("#", $param);
161 
162  $html = $param[2];
163  switch ($param[2]) {
164  case "Text":
165  $html = $lng->txt("cont_text_placeh");
166  break;
167 
168  case "Media":
169  $html = $lng->txt("cont_media_placeh");
170  break;
171 
172  case "Question":
173  $html = $lng->txt("cont_question_placeh");
174  break;
175 
176  case "Verification":
177  $html = $lng->txt("cont_verification_placeh");
178  break;
179  }
180 
181  $h2 = substr($a_html, 0, $start) .
182  $html .
183  substr($a_html, $end + 5);
184  $a_html = $h2;
185  $i++;
186 
187  $start = strpos($a_html, "{{{{{PlaceHolder#", $start + 5);
188  $end = 0;
189  if (is_int($start)) {
190  $end = strpos($a_html, "}}}}}", $start);
191  }
192  }
193  return $a_html;
194  }
$param
Definition: xapitoken.php:29
$i
Definition: metadata.php:24

◆ setContentClass()

ilPCPlaceHolder::setContentClass (   $a_class)

Set Content Class.

Parameters
string$a_classContent Class

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

73  {
74  if (is_object($this->q_node)) {
75  $this->q_node->set_attribute("ContentClass", $a_class);
76  }
77  }

◆ setHeight()

ilPCPlaceHolder::setHeight (   $a_height)

Set Height.

Parameters
string$a_heightHeight

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

98  {
99  if (is_object($this->q_node)) {
100  $this->q_node->set_attribute("Height", $a_height);
101  }
102  }

◆ setNode()

ilPCPlaceHolder::setNode (   $a_node)

Set node.

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

51  {
52  parent::setNode($a_node); // this is the PageContent node
53  $this->q_node = $a_node->first_child(); //... and this the PlaceHolder
54  }

Field Documentation

◆ $content_class

ilPCPlaceHolder::$content_class

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

◆ $ctrl

ilPCPlaceHolder::$ctrl
protected

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

Referenced by modifyPageContentPostXsl().

◆ $height

ilPCPlaceHolder::$height

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

◆ $lng

ilPCPlaceHolder::$lng
protected

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

Referenced by modifyPageContentPostXsl().

◆ $q_node

ilPCPlaceHolder::$q_node

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


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