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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

Configurator.php

Zuletzt modifiziert: 02.04.2025, 15:04 - Dateigröße: 1.96 KiB


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\FancyPants;
09   
10  use s9e\TextFormatter\Plugins\ConfiguratorBase;
11   
12  /**
13  * This plugin combines some of the functionalities found in SmartyPants and Textile
14  *
15  * @link http://daringfireball.net/projects/smartypants/
16  * @link http://textile.thresholdstate.com/
17  */
18  class Configurator extends ConfiguratorBase
19  {
20      /**
21      * @var string Name of attribute used to for the replacement
22      */
23      protected $attrName = 'char';
24   
25      /**
26      * @var string[] List of passes that have been explicitly disabled
27      */
28      protected $disabledPasses = [];
29   
30      /**
31      * @var string Name of the tag used to mark the text to replace
32      */
33      protected $tagName = 'FP';
34   
35      /**
36      * Plugin's setup
37      *
38      * Will initialize create the plugin's tag if it does not exist
39      */
40      protected function setUp()
41      {
42          if (isset($this->configurator->tags[$this->tagName]))
43          {
44              return;
45          }
46   
47          // Create tag
48          $tag = $this->configurator->tags->add($this->tagName);
49   
50          // Create attribute
51          $tag->attributes->add($this->attrName);
52   
53          // Create a template that replaces its content with the replacement char
54          $tag->template
55              = '<xsl:value-of select="@' . htmlspecialchars($this->attrName) . '"/>';
56      }
57   
58      /**
59      * Disable a given pass
60      *
61      * @param  string $passName
62      * @return void
63      */
64      public function disablePass($passName)
65      {
66          $this->disabledPasses[] = $passName;
67      }
68   
69      /**
70      * Enable a given pass
71      *
72      * @param  string $passName
73      * @return void
74      */
75      public function enablePass($passName)
76      {
77          foreach (array_keys($this->disabledPasses, $passName, true) as $k)
78          {
79              unset($this->disabledPasses[$k]);
80          }
81      }
82   
83      /**
84      * {@inheritdoc}
85      */
86      public function asConfig()
87      {
88          $config = [
89              'attrName' => $this->attrName,
90              'tagName'  => $this->tagName
91          ];
92          foreach ($this->disabledPasses as $passName)
93          {
94              $config['disable' . $passName] = true;
95          }
96   
97          return $config;
98      }
99  }