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 |
InlineAttributes.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 use DOMText;
12
13 /**
14 * Inline the xsl:attribute declarations of a template
15 *
16 * Will replace
17 * <a><xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>...</a>
18 * with
19 * <a href="{@url}">...</a>
20 */
21 class InlineAttributes extends AbstractNormalization
22 {
23 /**
24 * {@inheritdoc}
25 */
26 protected $queries = ['//*[namespace-uri() != $XSL]/xsl:attribute'];
27
28 /**
29 * {@inheritdoc}
30 */
31 protected function normalizeElement(DOMElement $element)
32 {
33 $value = '';
34 foreach ($element->childNodes as $node)
35 {
36 if ($node instanceof DOMText || $this->isXsl($node, 'text'))
37 {
38 $value .= preg_replace('([{}])', '$0$0', $node->textContent);
39 }
40 elseif ($this->isXsl($node, 'value-of'))
41 {
42 $value .= '{' . $node->getAttribute('select') . '}';
43 }
44 else
45 {
46 // Can't inline this attribute
47 return;
48 }
49 }
50 $element->parentNode->setAttribute($element->getAttribute('name'), $value);
51 $element->parentNode->removeChild($element);
52 }
53 }