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 |
OptimizeConditionalAttributes.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 /**
13 * Optimize conditional attributes
14 *
15 * Will replace conditional attributes with a <xsl:copy-of/>, e.g.
16 * <xsl:if test="@foo">
17 * <xsl:attribute name="foo">
18 * <xsl:value-of select="@foo" />
19 * </xsl:attribute>
20 * </xsl:if>
21 * into
22 * <xsl:copy-of select="@foo"/>
23 */
24 class OptimizeConditionalAttributes extends AbstractNormalization
25 {
26 /**
27 * {@inheritdoc}
28 */
29 protected $queries = ['//xsl:if[starts-with(@test, "@")][count(descendant::node()) = 2][xsl:attribute[@name = substring(../@test, 2)][xsl:value-of[@select = ../../@test]]]'];
30
31 /**
32 * {@inheritdoc}
33 */
34 protected function normalizeElement(DOMElement $element)
35 {
36 $copyOf = $this->createElement('xsl:copy-of');
37 $copyOf->setAttribute('select', $element->getAttribute('test'));
38
39 $element->parentNode->replaceChild($copyOf, $element);
40 }
41 }