Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
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-2016 The s9e Authors
06 * @license http://www.opensource.org/licenses/mit-license.php The MIT License
07 */
08 namespace s9e\TextFormatter\Configurator\TemplateNormalizations;
09 use DOMElement;
10 use DOMXPath;
11 use s9e\TextFormatter\Configurator\TemplateNormalization;
12 class MergeConsecutiveCopyOf extends TemplateNormalization
13 {
14 public function normalize(DOMElement $template)
15 {
16 $xpath = new DOMXPath($template->ownerDocument);
17 foreach ($xpath->query('//xsl:copy-of') as $node)
18 $this->mergeCopyOfSiblings($node);
19 }
20 protected function mergeCopyOfSiblings(DOMElement $node)
21 {
22 while ($this->nextSiblingIsCopyOf($node))
23 {
24 $node->setAttribute('select', $node->getAttribute('select') . '|' . $node->nextSibling->getAttribute('select'));
25 $node->parentNode->removeChild($node->nextSibling);
26 }
27 }
28 protected function nextSiblingIsCopyOf(DOMElement $node)
29 {
30 return ($node->nextSibling && $node->nextSibling->localName === 'copy-of' && $node->nextSibling->namespaceURI === self::XMLNS_XSL);
31 }
32 }