1<?php
2// p = function name (either "p" or "p_open" and p_close)
3// replacement = The pattern to replace bzw. to split the template
4// template = template with replacement
5// alias = other common names for the tag
6// subpattern = when there are additional parts in the template which have to be replaced (ex. h1 and footnotes)
7$m = array(
8
9    'p' => array(
10        'replacement'   => 'NORMAL_TEXT',
11        'alias'         => array('section'),
12        'subpattern'    => array(),
13
14        // Normal text with paragraph
15        'template'      => '<p style="ps-0" dir="ltr">NORMAL_TEXT</p>',
16    ),
17
18    // Normal text
19    'cdata' => array(
20        'replacement'   => 'CDATA',
21        'alias'         => array(),
22        'subpattern'    => array(),
23        'template'      => '<c style="cs-0">CDATA</c>',
24    ),
25
26
27    'header' => array(
28        'replacement'   => 'HEADLINE',
29        'alias'         => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'),
30        'subpattern'    => array('{{LEVEL}}'),
31        'template'      => '<p style="ps-6" dir="ltr">
32                              <c style="cs-7" lang="tl-0">
33                                <autotitle level="{{LEVEL}}" index="0" model-string-length="{{LENGTH}}">
34                                  <c style="cs-7" lang="tl-0">HEADLINE</c>
35                                </autotitle>
36                              </c>
37                            </p>',
38        'template_level_0' => '<p style="ps-1" dir="ltr">
39                                  <c style="cs-1" lang="tl-0">
40                                      <autotitle level="0" index="0" model-string-length="{{LENGTH}}">
41                                          <c style="cs-1" lang="tl-0">HEADLINE</c>
42                                      </autotitle>
43                                  </c>
44                                </p>',
45    ),
46
47    'footnote' => array(
48        'replacement'   => 'FOOTNOTE',
49        'alias'         => array(),
50        'subpattern'    => array('{{NOTE}}'),
51        'template'      => '<c style="cs-0" lang="tl-0">{{NOTE}}<note stream="nsm-0">
52                                <p style="ps-5" dir="ltr">
53                                    <c style="cs-6" lang="tl-0">FOOTNOTE</c>
54                                </p>
55                            </note></c>',
56//        'template_p_open' => '</p><c style="cs-0" lang="tl-0">{{NOTE}}<note stream="nsm-0">
57//                                <p style="ps-5" dir="ltr">
58//                                    <c style="cs-6" lang="tl-0">FOOTNOTE</c>
59//                                </p>
60//                            </note></c><p style="ps-0" dir="ltr">',
61    ),
62
63    'externallink' => array(
64        'replacement'   => 'EXTERNALLINK',
65        'alias'         => array('internallink', 'internalmedia', 'emaillink'),
66        'subpattern'    => array('{{TITLE}}'),
67        "template"      => '<c style="cs-0"><hyperlink display-as-link="yes"><display-text><c style="cs-0">{{TITLE}}</c><c style="cs-0"/></display-text><url-string>EXTERNALLINK</url-string></hyperlink></c>',
68    ),
69
70    // http://mountaindragon.com/html/iso.htm
71    'doublequoteopening' => array(
72        'replacement'   => 'DOUBLEQUOTEOPENING',
73        'alias'         => array(),
74        'subpattern'    => array(),
75        #'template'      => '&qout;',
76        'template'      => '<c style="cs-0">"</c>',
77    ),
78
79    'doublequoteclosing' => array(
80        'replacement'   => 'DOUBLEQUOTECLOSING',
81        'alias'         => array(),
82        'subpattern'    => array(),
83        #'template'      => '&qout;',
84        'template'      => '<c style="cs-0">"</c>',
85    ),
86
87    'singlequoteopening' => array(
88        'replacement'   => 'SINGLEQUOTEOPENING',
89        'alias'         => array(),
90        'subpattern'    => array(),
91        'template'      => '<c style="cs-0">\'</c>',
92    ),
93
94    'singlequoteclosing' => array(
95        'replacement'   => 'SINGLEQUOTECLOSING',
96        'alias'         => array(),
97        'subpattern'    => array(),
98        'template'        => '<c style="cs-0">\'</c>',
99    ),
100
101    'plain' => array(
102        'replacement'   => 'PLAIN',
103        'alias'         => array('entity', 'acronym', 'preformatted'),
104        'subpattern'    => array(),
105        'template'      => '<c style="cs-0">PLAIN</c>', // same template as "p"?
106    ),
107
108    'list' => array(
109        'replacement'   => 'LIST',
110        'alias'         => array('listu', 'listo'),
111        'subpattern'    => array(),
112        'template'      => '<list style="ls-0">LIST</list>',
113        #'template_p_open' => '<list style="ls-0">LIST</list>',
114    ),
115
116    'listcontent' => array(
117        'replacement'   => 'LISTCONTENT',
118        'alias'         => array(),
119        'subpattern'    => array(),
120        'template'      => 'LISTCONTENT',
121    ),
122
123    'listitem' => array(
124        'replacement'   => 'LISTITEM',
125        'alias'         => array(),
126        'subpattern'    => array('{{LEVEL}}'),
127        'template'      => '<p style="ps-0" dir="ltr" list-level="{{LEVEL}}">LISTITEM</p>',
128    ),
129
130    'strong' => array(
131        'replacement'   => 'BOLD',
132        'alias'         => array(),
133        'subpattern'    => array(),
134        'template'      => '<c style="cs-0" lang="tl-0" over="co-6">BOLD</c>',
135    ),
136
137    'emphasis' => array(
138        'replacement'   => 'EMPHASIS',
139        'alias'         => array('italic'),
140        'subpattern'    => array(),
141        'template'      => '<c style="cs-0" lang="tl-0" over="co-3">EMPHASIS</c>',
142    ),
143
144    'underline' => array(
145        'replacement'   => 'UNDERLINE',
146        'alias'         => array(),
147        'subpattern'    => array(),
148        'template'      => '<c style="cs-0" over="co-15">UNDERLINE</c>',
149    ),
150
151    'deleted' => array(
152        'replacement'   => 'DELETED',
153        'alias'         => array(),
154        'subpattern'    => array(),
155        'template'      => '<c style="cs-0" over="co-16">DELETED</c>',
156    ),
157
158    'monospace' => array(
159        'replacement'   => 'MONOSPACE',
160        'alias'         => array(),
161        'subpattern'    => array(),
162        'template'      => '<c style="cs-0" over="co-5">MONOSPACE</c>',
163    ),
164
165    'code' => array(
166        'replacement'   => 'CODE',
167        'alias'         => array(),
168        'subpattern'    => array(),
169        'template'      => '<p  style="ps-0" dir="ltr"><c style="cs-0" lang="tl-0" over="co-5">CODE</c></p>',
170    ),
171
172    'smiley' => array(
173        'replacement'   => 'SMILEY',
174        'alias'         => array(),
175        'subpattern'    => array(),
176        'template'      => 'SMILEY',
177    ),
178
179    'table' => array(
180        'replacement'   => 'TABLE',
181        'alias'         => array(),
182        'subpattern'    => array(),
183        'template'      => 'TABLE',
184    ),
185
186    'tablerow' => array(
187        'replacement'   => 'TABLEROW',
188        'alias'         => array(),
189        'subpattern'    => array(),
190        'template'      => '<p style="ps-0" dir="ltr">TABLEROW</p>',
191    ),
192
193    'tablecell' => array(
194        'replacement'   => 'TABLECELL',
195        'alias'         => array(),
196        'subpattern'    => array(),
197        'template'      => '<c style="cs-0"> | </c>TABLECELL<c style="cs-0"> | </c>',
198    ),
199
200    'hr' => array(
201        'replacement'   => 'HR',
202        'alias'         => array(),
203        'subpattern'    => array(),
204        'template'      => '<p style="ps-0" dir="ltr">----</p>',
205    ),
206);