Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
MergeConsecutiveCopyOf.php
01 <?php
02
03 /**
04 * @package s9e\TextFormatter
05 * @copyright Copyright (c) 2010-2022 The s9e authors
06 * @license http://www.opensource.org/licenses/mit-license.php The MIT License
07 */
08 namespace s9e\TextFormatter\Configurator\TemplateNormalizations;
09
10 use DOMElement;
11
12 class MergeConsecutiveCopyOf extends AbstractNormalization
13 {
14 /**
15 * {@inheritdoc}
16 */
17 protected $queries = ['//xsl:copy-of'];
18
19 /**
20 * {@inheritdoc}
21 */
22 protected function normalizeElement(DOMElement $element)
23 {
24 while ($this->nextSiblingIsCopyOf($element))
25 {
26 $element->setAttribute('select', $element->getAttribute('select') . '|' . $element->nextSibling->getAttribute('select'));
27 $element->parentNode->removeChild($element->nextSibling);
28 }
29 }
30
31 /**
32 * Test whether the next sibling to given element is an xsl:copy-of element
33 *
34 * @param DOMElement $element Context node
35 * @return bool
36 */
37 protected function nextSiblingIsCopyOf(DOMElement $element)
38 {
39 return ($element->nextSibling && $this->isXsl($element->nextSibling, 'copy-of'));
40 }
41 }