ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ILIAS\Data\Meta\Html\TransformUtil Class Reference
+ Collaboration diagram for ILIAS\Data\Meta\Html\TransformUtil:

Public Member Functions

 getPosOfPlaceholder (string $html, string $tag, int $offset=0)
 
 getEndPosOfPlaceholder (string $html, int $offset=0)
 
 getPlaceholderParamString (string $html, string $tag)
 
 getPlaceholderParams (string $html, string $tag)
 
 getInnerContentOfPlaceholders (string $html, string $start_tag, string $end_tag)
 parameters of start and end tag must match {{{{{StartTag;a;b;c}}}}}...inner content...{{{{{EndTag;a;b;c}}}}} More...
 
 replaceInnerContentAndPlaceholders (string $html, string $start_tag, string $end_tag, string $replacement)
 parameters of start and end tag must match {{{{{StartTag;a;b;c}}}}}...inner content...{{{{{EndTag;a;b;c}}}}} ...replacement... More...
 

Protected Attributes

const PH_START = "{{{{{"
 
const PH_END = "}}}}}"
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 26 of file TransformUtil.php.

Member Function Documentation

◆ getEndPosOfPlaceholder()

ILIAS\Data\Meta\Html\TransformUtil::getEndPosOfPlaceholder ( string  $html,
int  $offset = 0 
)

Definition at line 37 of file TransformUtil.php.

References null.

Referenced by ILIAS\Data\Meta\Html\TransformUtil\getInnerContentOfPlaceholders(), ILIAS\Data\Meta\Html\TransformUtil\getPlaceholderParamString(), and ILIAS\Data\Meta\Html\TransformUtil\replaceInnerContentAndPlaceholders().

37  : ?int
38  {
39  $p = strpos($html, self::PH_END, $offset);
40  return is_int($p) ? ($p + strlen(self::PH_END)) : null;
41  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ getInnerContentOfPlaceholders()

ILIAS\Data\Meta\Html\TransformUtil::getInnerContentOfPlaceholders ( string  $html,
string  $start_tag,
string  $end_tag 
)

parameters of start and end tag must match {{{{{StartTag;a;b;c}}}}}...inner content...{{{{{EndTag;a;b;c}}}}}

Definition at line 67 of file TransformUtil.php.

References ILIAS\Data\Meta\Html\TransformUtil\getEndPosOfPlaceholder(), ILIAS\Data\Meta\Html\TransformUtil\getPlaceholderParamString(), ILIAS\Data\Meta\Html\TransformUtil\getPosOfPlaceholder(), and null.

67  : ?string
68  {
69  $start1 = $this->getPosOfPlaceholder($html, $start_tag);
70  if (is_int($start1)) {
71  $end1 = $this->getEndPosOfPlaceholder($html, $start1);
72  $param_str = $this->getPlaceholderParamString($html, $start_tag);
73  $end_tag_with_params = str_replace($start_tag . ";", $end_tag . ";", $param_str);
74  $start2 = $this->getPosOfPlaceholder($html, $end_tag_with_params);
75  if (is_int($end1) && is_int($start2)) {
76  $end2 = $this->getEndPosOfPlaceholder($html, $start2);
77  if (is_int($end2)) {
78  return substr($html, $end1, $start2 - $end1);
79  }
80  }
81  }
82  return null;
83  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getPlaceholderParamString(string $html, string $tag)
getPosOfPlaceholder(string $html, string $tag, int $offset=0)
getEndPosOfPlaceholder(string $html, int $offset=0)
+ Here is the call graph for this function:

◆ getPlaceholderParams()

ILIAS\Data\Meta\Html\TransformUtil::getPlaceholderParams ( string  $html,
string  $tag 
)

Definition at line 54 of file TransformUtil.php.

References ILIAS\Data\Meta\Html\TransformUtil\getPlaceholderParamString(), and null.

54  : ?array
55  {
56  $tag_string = $this->getPlaceholderParamString($html, $tag);
57  if (is_string($tag_string)) {
58  return explode(";", $tag_string);
59  }
60  return null;
61  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getPlaceholderParamString(string $html, string $tag)
+ Here is the call graph for this function:

◆ getPlaceholderParamString()

ILIAS\Data\Meta\Html\TransformUtil::getPlaceholderParamString ( string  $html,
string  $tag 
)

Definition at line 43 of file TransformUtil.php.

References ILIAS\Data\Meta\Html\TransformUtil\getEndPosOfPlaceholder(), ILIAS\Data\Meta\Html\TransformUtil\getPosOfPlaceholder(), and null.

Referenced by ILIAS\Data\Meta\Html\TransformUtil\getInnerContentOfPlaceholders(), ILIAS\Data\Meta\Html\TransformUtil\getPlaceholderParams(), and ILIAS\Data\Meta\Html\TransformUtil\replaceInnerContentAndPlaceholders().

43  : ?string
44  {
45  $start = $this->getPosOfPlaceholder($html, $tag);
46  if (is_int($start)) {
47  $end = $this->getEndPosOfPlaceholder($html, $start);
48  $tag_string = substr($html, $start + strlen(self::PH_START), $end - $start - strlen(self::PH_START) - strlen(self::PH_END));
49  return $tag_string;
50  }
51  return null;
52  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getPosOfPlaceholder(string $html, string $tag, int $offset=0)
getEndPosOfPlaceholder(string $html, int $offset=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPosOfPlaceholder()

ILIAS\Data\Meta\Html\TransformUtil::getPosOfPlaceholder ( string  $html,
string  $tag,
int  $offset = 0 
)

Definition at line 31 of file TransformUtil.php.

References null.

Referenced by ILIAS\Data\Meta\Html\TransformUtil\getInnerContentOfPlaceholders(), ILIAS\Data\Meta\Html\TransformUtil\getPlaceholderParamString(), and ILIAS\Data\Meta\Html\TransformUtil\replaceInnerContentAndPlaceholders().

31  : ?int
32  {
33  $p = strpos($html, self::PH_START . $tag, $offset);
34  return is_int($p) ? $p : null;
35  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ replaceInnerContentAndPlaceholders()

ILIAS\Data\Meta\Html\TransformUtil::replaceInnerContentAndPlaceholders ( string  $html,
string  $start_tag,
string  $end_tag,
string  $replacement 
)

parameters of start and end tag must match {{{{{StartTag;a;b;c}}}}}...inner content...{{{{{EndTag;a;b;c}}}}} ...replacement...

Definition at line 90 of file TransformUtil.php.

References ILIAS\Data\Meta\Html\TransformUtil\getEndPosOfPlaceholder(), ILIAS\Data\Meta\Html\TransformUtil\getPlaceholderParamString(), ILIAS\Data\Meta\Html\TransformUtil\getPosOfPlaceholder(), and null.

90  : ?string
91  {
92  $start1 = $this->getPosOfPlaceholder($html, $start_tag);
93  if (is_int($start1)) {
94  $end1 = $this->getEndPosOfPlaceholder($html, $start1);
95  $param_str = $this->getPlaceholderParamString($html, $start_tag);
96  $end_tag_with_params = str_replace($start_tag . ";", $end_tag . ";", $param_str);
97  $start2 = $this->getPosOfPlaceholder($html, $end_tag_with_params);
98  if (is_int($end1) && is_int($start2)) {
99  $end2 = $this->getEndPosOfPlaceholder($html, $start2);
100  if (is_int($end2)) {
101  return substr($html, 0, $start1) .
102  $replacement .
103  substr($html, $end2);
104  }
105  }
106  }
107  return null;
108  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getPlaceholderParamString(string $html, string $tag)
getPosOfPlaceholder(string $html, string $tag, int $offset=0)
getEndPosOfPlaceholder(string $html, int $offset=0)
+ Here is the call graph for this function:

Field Documentation

◆ PH_END

const ILIAS\Data\Meta\Html\TransformUtil::PH_END = "}}}}}"
protected

Definition at line 29 of file TransformUtil.php.

◆ PH_START

const ILIAS\Data\Meta\Html\TransformUtil::PH_START = "{{{{{"
protected

Definition at line 28 of file TransformUtil.php.


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