1 | <?php |
||
12 | class Configurator extends ConfiguratorBase |
||
13 | { |
||
14 | /** |
||
15 | * @var bool Whether to decode HTML entities in attribute values |
||
16 | */ |
||
17 | public $decodeHtmlEntities = false; |
||
18 | |||
19 | /** |
||
20 | * @var array Default tags |
||
21 | */ |
||
22 | protected $tags = [ |
||
23 | 'C' => '<code><xsl:apply-templates /></code>', |
||
24 | 'CODE' => [ |
||
25 | 'attributes' => [ |
||
26 | 'lang' => [ |
||
27 | 'filterChain' => ['#simpletext'], |
||
28 | 'required' => false |
||
29 | ] |
||
30 | ], |
||
31 | 'template' => |
||
32 | '<pre> |
||
33 | <code> |
||
34 | <xsl:if test="@lang"> |
||
35 | <xsl:attribute name="class"> |
||
36 | <xsl:text>language-</xsl:text> |
||
37 | <xsl:value-of select="@lang"/> |
||
38 | </xsl:attribute> |
||
39 | </xsl:if> |
||
40 | <xsl:apply-templates /> |
||
41 | </code> |
||
42 | </pre>' |
||
43 | ], |
||
44 | 'DEL' => '<del><xsl:apply-templates/></del>', |
||
45 | 'EM' => '<em><xsl:apply-templates/></em>', |
||
46 | 'H1' => '<h1><xsl:apply-templates/></h1>', |
||
47 | 'H2' => '<h2><xsl:apply-templates/></h2>', |
||
48 | 'H3' => '<h3><xsl:apply-templates/></h3>', |
||
49 | 'H4' => '<h4><xsl:apply-templates/></h4>', |
||
50 | 'H5' => '<h5><xsl:apply-templates/></h5>', |
||
51 | 'H6' => '<h6><xsl:apply-templates/></h6>', |
||
52 | 'HR' => '<hr/>', |
||
53 | 'IMG' => [ |
||
54 | 'attributes' => [ |
||
55 | 'alt' => ['required' => false], |
||
56 | 'src' => ['filterChain' => ['#url']], |
||
57 | 'title' => ['required' => false] |
||
58 | ], |
||
59 | 'template' => '<img src="{@src}"><xsl:copy-of select="@alt"/><xsl:copy-of select="@title"/></img>' |
||
60 | ], |
||
61 | 'LI' => '<li><xsl:apply-templates/></li>', |
||
62 | 'LIST' => [ |
||
63 | 'attributes' => [ |
||
64 | 'start' => [ |
||
65 | 'filterChain' => ['#uint'], |
||
66 | 'required' => false |
||
67 | ], |
||
68 | 'type' => [ |
||
69 | 'filterChain' => ['#simpletext'], |
||
70 | 'required' => false |
||
71 | ] |
||
72 | ], |
||
73 | 'template' => |
||
74 | '<xsl:choose> |
||
75 | <xsl:when test="not(@type)"> |
||
76 | <ul><xsl:apply-templates/></ul> |
||
77 | </xsl:when> |
||
78 | <xsl:otherwise> |
||
79 | <ol><xsl:copy-of select="@start"/><xsl:apply-templates/></ol> |
||
80 | </xsl:otherwise> |
||
81 | </xsl:choose>' |
||
82 | ], |
||
83 | 'QUOTE' => '<blockquote><xsl:apply-templates/></blockquote>', |
||
84 | 'STRONG' => '<strong><xsl:apply-templates/></strong>', |
||
85 | 'SUP' => '<sup><xsl:apply-templates/></sup>', |
||
86 | 'URL' => [ |
||
87 | 'attributes' => [ |
||
88 | 'title' => [ |
||
89 | 'required' => false |
||
90 | ], |
||
91 | 'url' => [ |
||
92 | 'filterChain' => ['#url'] |
||
93 | ] |
||
94 | ], |
||
95 | 'template' => '<a href="{@url}"><xsl:copy-of select="@title"/><xsl:apply-templates/></a>' |
||
96 | ] |
||
97 | ]; |
||
98 | |||
99 | /** |
||
100 | * {@inheritdoc} |
||
101 | */ |
||
102 | 270 | protected function setUp() |
|
144 | |||
145 | /** |
||
146 | * {@inheritdoc} |
||
147 | */ |
||
148 | 265 | public function asConfig() |
|
152 | |||
153 | /** |
||
154 | * {@inheritdoc} |
||
155 | */ |
||
156 | 2 | public function getJSHints() |
|
160 | |||
161 | /** |
||
162 | * {@inheritdoc} |
||
163 | */ |
||
164 | 263 | public function getJSParser() |
|
190 | } |