1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* |
4
|
|
|
* Advanced BBCode Box |
5
|
|
|
* |
6
|
|
|
* @copyright (c) 2013 Matt Friedman |
7
|
|
|
* @license GNU General Public License, version 2 (GPL-2.0) |
8
|
|
|
* |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace vse\abbc3\migrations; |
12
|
|
|
|
13
|
|
|
class v310_m4_install_data extends \vse\abbc3\core\bbcodes_migration_base |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* {@inheritdoc} |
17
|
|
|
*/ |
18
|
|
|
public function effectively_installed() |
19
|
|
|
{ |
20
|
|
|
return isset($this->config['abbc3_version']) && version_compare($this->config['abbc3_version'], '3.1.0', '>='); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* {@inheritdoc} |
25
|
|
|
*/ |
26
|
|
|
static public function depends_on() |
27
|
|
|
{ |
28
|
|
|
return array('\vse\abbc3\migrations\v310_m3_install_schema'); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* {@inheritdoc} |
33
|
|
|
*/ |
34
|
|
View Code Duplication |
public function update_data() |
35
|
|
|
{ |
36
|
|
|
return array( |
37
|
|
|
array('config.add', array('abbc3_version', '3.1.0')), |
38
|
|
|
array('custom', array(array($this, 'install_abbc3_bbcodes'))), |
39
|
|
|
); |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var array An array of bbcodes data to install |
44
|
|
|
*/ |
45
|
|
|
protected $bbcode_data = array( |
46
|
|
|
'font=' => array( |
47
|
|
|
'bbcode_helpline' => 'ABBC3_FONT_HELPLINE', |
48
|
|
|
'bbcode_match' => '[font={INTTEXT}]{TEXT}[/font]', |
49
|
|
|
'bbcode_tpl' => '<span style="font-family: {INTTEXT};">{TEXT}</span>', |
50
|
|
|
), |
51
|
|
|
'highlight=' => array( |
52
|
|
|
'bbcode_helpline' => 'ABBC3_HIGHLIGHT_HELPLINE', |
53
|
|
|
'bbcode_match' => '[highlight={COLOR}]{TEXT}[/highlight]', |
54
|
|
|
'bbcode_tpl' => '<span style="background-color: {COLOR};">{TEXT}</span>', |
55
|
|
|
), |
56
|
|
|
'align=center' => array( |
57
|
|
|
'bbcode_helpline' => 'ABBC3_ALIGN_HELPLINE', |
58
|
|
|
'bbcode_match' => '[align={IDENTIFIER}]{TEXT}[/align]', |
59
|
|
|
'bbcode_tpl' => '<span style="text-align:{IDENTIFIER}; display:block;">{TEXT}</span>', |
60
|
|
|
), |
61
|
|
|
'float=' => array( |
62
|
|
|
'bbcode_helpline' => 'ABBC3_FLOAT_HELPLINE', |
63
|
|
|
'bbcode_match' => '[float={IDENTIFIER}]{TEXT}[/float]', |
64
|
|
|
'bbcode_tpl' => '<div style="float:{IDENTIFIER}; padding:0 10px;">{TEXT}</div>', |
65
|
|
|
), |
66
|
|
|
'pre' => array( |
67
|
|
|
'bbcode_helpline' => 'ABBC3_PREFORMAT_HELPLINE', |
68
|
|
|
'bbcode_match' => '[pre]{TEXT}[/pre]', |
69
|
|
|
'bbcode_tpl' => '<pre class="abbc3_pre">{TEXT}</pre>', |
70
|
|
|
), |
71
|
|
|
's' => array( |
72
|
|
|
'bbcode_helpline' => 'ABBC3_STRIKE_HELPLINE', |
73
|
|
|
'bbcode_match' => '[s]{TEXT}[/s]', |
74
|
|
|
'bbcode_tpl' => '<span class="abbc3_strike">{TEXT}</span>', |
75
|
|
|
), |
76
|
|
|
'sup' => array( |
77
|
|
|
'bbcode_helpline' => 'ABBC3_SUP_HELPLINE', |
78
|
|
|
'bbcode_match' => '[sup]{TEXT}[/sup]', |
79
|
|
|
'bbcode_tpl' => '<sup>{TEXT}</sup>', |
80
|
|
|
), |
81
|
|
|
'sub' => array( |
82
|
|
|
'bbcode_helpline' => 'ABBC3_SUB_HELPLINE', |
83
|
|
|
'bbcode_match' => '[sub]{TEXT}[/sub]', |
84
|
|
|
'bbcode_tpl' => '<sub>{TEXT}</sub>', |
85
|
|
|
), |
86
|
|
|
'glow=' => array( |
87
|
|
|
'bbcode_helpline' => 'ABBC3_GLOW_HELPLINE', |
88
|
|
|
'bbcode_match' => '[glow={COLOR}]{TEXT}[/glow]', |
89
|
|
|
'bbcode_tpl' => '<span class="glow" style="display: inline; padding: 0 6px; color: #ffffff; text-shadow: 0 0 1em {COLOR}, 0 0 1em {COLOR}, 0 0 1.2em {COLOR};">{TEXT}</span>', |
90
|
|
|
), |
91
|
|
|
'shadow=' => array( |
92
|
|
|
'bbcode_helpline' => 'ABBC3_SHADOW_HELPLINE', |
93
|
|
|
'bbcode_match' => '[shadow={COLOR}]{TEXT}[/shadow]', |
94
|
|
|
'bbcode_tpl' => '<span class="shadow" style="display: inline; padding: 0 6px; color: {COLOR}; text-shadow: -2px 2px 2px #999;">{TEXT}</span>', |
95
|
|
|
), |
96
|
|
|
'dropshadow=' => array( |
97
|
|
|
'bbcode_helpline' => 'ABBC3_DROPSHADOW_HELPLINE', |
98
|
|
|
'bbcode_match' => '[dropshadow={COLOR}]{TEXT}[/dropshadow]', |
99
|
|
|
'bbcode_tpl' => '<span class="dropshadow" style="display: inline; padding: 0 6px; color: {COLOR}; text-shadow: -1px 1px 0 #999;">{TEXT}</span>', |
100
|
|
|
), |
101
|
|
|
'blur=' => array( |
102
|
|
|
'bbcode_helpline' => 'ABBC3_BLUR_HELPLINE', |
103
|
|
|
'bbcode_match' => '[blur={COLOR}]{TEXT}[/blur]', |
104
|
|
|
'bbcode_tpl' => '<span class="blur" style="display: inline; padding: 0 6px; color: transparent; text-shadow: 0 0 0.2em {COLOR};">{TEXT}</span>', |
105
|
|
|
), |
106
|
|
|
'fade' => array( |
107
|
|
|
'bbcode_helpline' => 'ABBC3_FADE_HELPLINE', |
108
|
|
|
'bbcode_match' => '[fade]{TEXT}[/fade]', |
109
|
|
|
'bbcode_tpl' => '<span class="fadeEffect">{TEXT}</span>', |
110
|
|
|
), |
111
|
|
|
'dir=ltr' => array( |
112
|
|
|
'bbcode_helpline' => 'ABBC3_DIR_HELPLINE', |
113
|
|
|
'bbcode_match' => '[dir={IDENTIFIER}]{TEXT}[/dir]', |
114
|
|
|
'bbcode_tpl' => '<bdo dir="{IDENTIFIER}">{TEXT}</bdo>', |
115
|
|
|
), |
116
|
|
|
'marq=up' => array( |
117
|
|
|
'bbcode_helpline' => 'ABBC3_MARQUEE_HELPLINE', |
118
|
|
|
'bbcode_match' => '[marq={IDENTIFIER}]{TEXT}[/marq]', |
119
|
|
|
'bbcode_tpl' => '<marquee class="abbc3_marquee" direction="{IDENTIFIER}" scrolldelay="100" onmouseover="this.scrollDelay=10000000;" onmouseout="this.scrollDelay=100;">{TEXT}</marquee>', |
120
|
|
|
), |
121
|
|
|
'spoil' => array( |
122
|
|
|
'bbcode_helpline' => 'ABBC3_SPOILER_HELPLINE', |
123
|
|
|
'bbcode_match' => '[spoil]{TEXT}[/spoil]', |
124
|
|
|
'bbcode_tpl' => '<div class="spoilwrapper"><div class="spoiltitle"><span class="spoilbtn" data-show="{L_ABBC3_SPOILER_SHOW}" data-hide="{L_ABBC3_SPOILER_HIDE}">{L_ABBC3_SPOILER_SHOW}</span></div><div style="display: none;" class="spoilcontent">{TEXT}</div></div>', |
125
|
|
|
), |
126
|
|
|
'hidden' => array( |
127
|
|
|
'bbcode_helpline' => 'ABBC3_HIDDEN_HELPLINE', |
128
|
|
|
'bbcode_match' => '[hidden]{TEXT}[/hidden]', |
129
|
|
|
'bbcode_tpl' => '<!-- ABBC3_BBCODE_HIDDEN -->{TEXT}<!-- ABBC3_BBCODE_HIDDEN -->', |
130
|
|
|
), |
131
|
|
|
'offtopic' => array( |
132
|
|
|
'bbcode_helpline' => 'ABBC3_OFFTOPIC_HELPLINE', |
133
|
|
|
'bbcode_match' => '[offtopic]{TEXT}[/offtopic]', |
134
|
|
|
'bbcode_tpl' => '<div class="offtopic"><div class="offtopic_title">{L_ABBC3_OFFTOPIC}</div><div class="offtopic_text">{TEXT}</div></div>', |
135
|
|
|
), |
136
|
|
|
'mod=' => array( |
137
|
|
|
'bbcode_helpline' => 'ABBC3_MOD_HELPLINE', |
138
|
|
|
'bbcode_match' => '[mod={TEXT1}]{TEXT2}[/mod]', |
139
|
|
|
'bbcode_tpl' => '<table class="ModTable"><tr><td class="exclamation" rowspan="2"> ! </td><td class="rowuser">{L_MESSAGE} {L_FROM}{L_COLON} {TEXT1}</td></tr><tr><td class="rowtext">{TEXT2}</td></tr></table>', |
140
|
|
|
), |
141
|
|
|
'nfo' => array( |
142
|
|
|
'bbcode_helpline' => 'ABBC3_NFO_HELPLINE', |
143
|
|
|
'bbcode_match' => '[nfo]{TEXT}[/nfo]', |
144
|
|
|
'bbcode_tpl' => '<pre class="nfo">{TEXT}</pre>', |
145
|
|
|
), |
146
|
|
|
'soundcloud' => array( |
147
|
|
|
'bbcode_helpline' => 'ABBC3_SOUNDCLOUD_HELPLINE', |
148
|
|
|
'bbcode_match' => '[soundcloud]{URL}[/soundcloud]', |
149
|
|
|
'bbcode_tpl' => '<object height="81" width="100%"><param name="movie" value="http://player.soundcloud.com/player.swf?url={URL}&g=bb"><param name="allowscriptaccess" value="always"><embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url={URL}&g=bb" type="application/x-shockwave-flash" width="100%"></embed></object>', |
150
|
|
|
), |
151
|
|
|
'BBvideo' => array( |
152
|
|
|
'bbcode_helpline' => 'ABBC3_BBVIDEO_HELPLINE', |
153
|
|
|
'bbcode_match' => '[BBvideo={NUMBER1},{NUMBER2}]{URL}[/BBvideo]', |
154
|
|
|
'bbcode_tpl' => '<a href="{URL}" class="bbvideo" data-bbvideo="{NUMBER1},{NUMBER2}" target="_blank">{URL}</a>', |
155
|
|
|
), |
156
|
|
|
'youtube' => array( |
157
|
|
|
'bbcode_helpline' => 'ABBC3_YOUTUBE_HELPLINE', |
158
|
|
|
'bbcode_match' => '[youtube]{URL}[/youtube]', |
159
|
|
|
'bbcode_tpl' => '<a href="{URL}" class="bbvideo" data-bbvideo="560,315">{URL}</a>', |
160
|
|
|
'display_on_posting'=> 0, |
161
|
|
|
), |
162
|
|
|
); |
163
|
|
|
} |
164
|
|
|
|