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 |
Parser.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\Plugins\Preg;
09 use s9e\TextFormatter\Plugins\ParserBase;
10 class Parser extends ParserBase
11 {
12 public function parse($text, array $matches)
13 {
14 foreach ($this->config['generics'] as $_8d36e519)
15 {
16 list($tagName, $regexp, $passthroughIdx, $map) = $_8d36e519;
17 \preg_match_all($regexp, $text, $matches, \PREG_SET_ORDER | \PREG_OFFSET_CAPTURE);
18 foreach ($matches as $m)
19 {
20 $startTagPos = $m[0][1];
21 $matchLen = \strlen($m[0][0]);
22 if ($passthroughIdx && isset($m[$passthroughIdx]) && $m[$passthroughIdx][0] !== '')
23 {
24 $contentPos = $m[$passthroughIdx][1];
25 $contentLen = \strlen($m[$passthroughIdx][0]);
26 $startTagLen = $contentPos - $startTagPos;
27 $endTagPos = $contentPos + $contentLen;
28 $endTagLen = $matchLen - ($startTagLen + $contentLen);
29 $tag = $this->parser->addTagPair($tagName, $startTagPos, $startTagLen, $endTagPos, $endTagLen, -100);
30 }
31 else
32 $tag = $this->parser->addSelfClosingTag($tagName, $startTagPos, $matchLen, -100);
33 foreach ($map as $i => $attrName)
34 if ($attrName && isset($m[$i]) && $m[$i][0] !== '')
35 $tag->setAttribute($attrName, $m[$i][0]);
36 }
37 }
38 }
39 }