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 |
SortAttributesByName.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 * Sort attributes by name in lexical order
14 *
15 * Only applies to inline attributes, not attributes created with xsl:attribute
16 */
17 class SortAttributesByName extends AbstractNormalization
18 {
19 /**
20 * {@inheritdoc}
21 */
22 protected $queries = ['//*[@*]'];
23
24 /**
25 * {@inheritdoc}
26 */
27 protected function normalizeElement(DOMElement $element)
28 {
29 $attributes = [];
30 foreach ($element->attributes as $name => $attribute)
31 {
32 $attributes[$name] = $element->removeAttributeNode($attribute);
33 }
34
35 ksort($attributes);
36 foreach ($attributes as $attribute)
37 {
38 $element->setAttributeNode($attribute);
39 }
40 }
41 }