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 |
LinkAttributesSetter.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\Plugins\Litedown\Parser;
09
10 use s9e\TextFormatter\Parser\Tag;
11
12 trait LinkAttributesSetter
13 {
14 /**
15 * Set a URL or IMG tag's attributes
16 *
17 * @param Tag $tag URL or IMG tag
18 * @param string $linkInfo Link's info: an URL optionally followed by spaces and a title
19 * @param string $attrName Name of the URL attribute
20 * @return void
21 */
22 protected function setLinkAttributes(Tag $tag, $linkInfo, $attrName)
23 {
24 $url = trim($linkInfo);
25 $title = '';
26 $pos = strpos($url, ' ');
27 if ($pos !== false)
28 {
29 $title = substr(trim(substr($url, $pos)), 1, -1);
30 $url = substr($url, 0, $pos);
31 }
32 if (preg_match('/^<.+>$/', $url))
33 {
34 $url = str_replace('\\>', '>', substr($url, 1, -1));
35 }
36
37 $tag->setAttribute($attrName, $this->text->decode($url));
38 if ($title > '')
39 {
40 $tag->setAttribute('title', $this->text->decode($title));
41 }
42 }
43 }