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 |
Configurator.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\Autolink;
09 use s9e\TextFormatter\Configurator\Helpers\RegexpBuilder;
10 use s9e\TextFormatter\Plugins\ConfiguratorBase;
11 class Configurator extends ConfiguratorBase
12 {
13 protected $attrName = 'url';
14 public $matchWww = \false;
15 protected $tagName = 'URL';
16 protected function setUp()
17 {
18 if (isset($this->configurator->tags[$this->tagName]))
19 return;
20 $tag = $this->configurator->tags->add($this->tagName);
21 $filter = $this->configurator->attributeFilters->get('#url');
22 $tag->attributes->add($this->attrName)->filterChain->append($filter);
23 $tag->template = '<a href="{@' . $this->attrName . '}"><xsl:apply-templates/></a>';
24 }
25 public function asConfig()
26 {
27 $config = array(
28 'attrName' => $this->attrName,
29 'regexp' => $this->getRegexp(),
30 'tagName' => $this->tagName
31 );
32 if (!$this->matchWww)
33 $config['quickMatch'] = '://';
34 return $config;
35 }
36 protected function getRegexp()
37 {
38 $anchor = RegexpBuilder::fromList($this->configurator->urlConfig->getAllowedSchemes()) . '://';
39 if ($this->matchWww)
40 $anchor = '(?:' . $anchor . '|www\\.)';
41 $regexp = '#\\b' . $anchor . '\\S(?>[^\\s\\[\\]\\x{FF01}-\\x{FF0F}\\x{FF1A}-\\x{FF20}\\x{FF3B}-\\x{FF40}\\x{FF5B}-\\x{FF65}]|\\[\\w*\\])++#Siu';
42 return $regexp;
43 }
44 }