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_m5_update_bbcodes extends bbcodes_migration_base |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* {@inheritdoc} |
17
|
|
|
*/ |
18
|
|
|
public function effectively_installed() |
19
|
|
|
{ |
20
|
|
|
return !isset($this->config['abbc3_version']); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* {@inheritdoc} |
25
|
|
|
*/ |
26
|
|
|
public static function depends_on() |
27
|
|
|
{ |
28
|
|
|
return array('\vse\abbc3\migrations\v310_m4_install_data'); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* {@inheritdoc} |
33
|
|
|
*/ |
34
|
|
|
public function update_data() |
35
|
|
|
{ |
36
|
|
|
return array( |
37
|
|
|
// Stop tracking the version number in the db |
38
|
|
|
array('config.remove', array('abbc3_version')), |
39
|
|
|
array('custom', array(array($this, 'install_abbc3_bbcodes'))), |
40
|
|
|
); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* {@inheritdoc} |
45
|
|
|
*/ |
46
|
|
|
protected static $bbcode_data = array( |
47
|
|
|
'pre' => array( |
48
|
|
|
'bbcode_helpline' => 'ABBC3_PREFORMAT_HELPLINE', |
49
|
|
|
'bbcode_match' => '[pre]{TEXT}[/pre]', |
50
|
|
|
'bbcode_tpl' => '<pre class="abbc3_pre" style="display: block; font-family: monospace; white-space: pre;">{TEXT}</pre>', |
51
|
|
|
), |
52
|
|
|
's' => array( |
53
|
|
|
'bbcode_helpline' => 'ABBC3_STRIKE_HELPLINE', |
54
|
|
|
'bbcode_match' => '[s]{TEXT}[/s]', |
55
|
|
|
'bbcode_tpl' => '<span class="abbc3_strike" style="text-decoration: line-through">{TEXT}</span>', |
56
|
|
|
), |
57
|
|
|
'sup' => array( |
58
|
|
|
'bbcode_helpline' => 'ABBC3_SUP_HELPLINE', |
59
|
|
|
'bbcode_match' => '[sup]{TEXT}[/sup]', |
60
|
|
|
'bbcode_tpl' => '<sup style="vertical-align: super; font-size: smaller;">{TEXT}</sup>', |
61
|
|
|
), |
62
|
|
|
'sub' => array( |
63
|
|
|
'bbcode_helpline' => 'ABBC3_SUB_HELPLINE', |
64
|
|
|
'bbcode_match' => '[sub]{TEXT}[/sub]', |
65
|
|
|
'bbcode_tpl' => '<sub style="vertical-align: sub; font-size: smaller;">{TEXT}</sub>', |
66
|
|
|
), |
67
|
|
|
'marq=' => array( |
68
|
|
|
'bbcode_helpline' => 'ABBC3_MARQUEE_HELPLINE', |
69
|
|
|
'bbcode_match' => '[marq={IDENTIFIER}]{TEXT}[/marq]', |
70
|
|
|
'bbcode_tpl' => '<marquee class="abbc3_marquee" direction="{IDENTIFIER}" scrolldelay="100" onmouseover="this.scrollDelay=10000000;" onmouseout="this.scrollDelay=100;" style="margin: 10px 0; padding: 5px; display: inline-block;">{TEXT}</marquee>', |
71
|
|
|
), |
72
|
|
|
'spoil' => array( |
73
|
|
|
'bbcode_helpline' => 'ABBC3_SPOILER_HELPLINE', |
74
|
|
|
'bbcode_match' => '[spoil]{TEXT}[/spoil]', |
75
|
|
|
'bbcode_tpl' => '<div class="spoilwrapper" style="margin:5px 0;font-weight:normal;padding:4px 10px;background-color:#fff;border:1px solid #dbdbdb;border-radius:4px;color:#333333;"><div class="spoiltitle" style="margin:0;padding:0;width:100%;"><span class="spoilbtn" style="margin:2px 5px;text-transform:uppercase;font-family:\'Helvetica Neue\', Helvetica, Arial, sans-serif;font-size:11px;font-weight:bold;display:block;cursor:pointer;color:#333;" data-show="{L_ABBC3_SPOILER_SHOW}" data-hide="{L_ABBC3_SPOILER_HIDE}">{L_ABBC3_SPOILER_SHOW}</span></div><div class="spoilcontent" style="color:#333333;display:none;padding:5px;border-top:1px solid #ccc;">{TEXT}</div></div>', |
76
|
|
|
), |
77
|
|
|
'offtopic' => array( |
78
|
|
|
'bbcode_helpline' => 'ABBC3_OFFTOPIC_HELPLINE', |
79
|
|
|
'bbcode_match' => '[offtopic]{TEXT}[/offtopic]', |
80
|
|
|
'bbcode_tpl' => '<div class="offtopic" style="position:relative;margin:5px 0;padding:39px 19px 14px;background:#fff;border:1px solid #ddd;border-radius:4px;"><div class="offtopic_title" style="position:absolute;top:-1px;left:-1px;font-family:\'Helvetica Neue\', Helvetica, Arial, sans-serif;font-weight:bold;font-size:12px;color:#9da0a4;background:#f5f5f5;padding:5px 12px;border:1px solid #ddd;border-radius:4px 0 4px 0;">{L_ABBC3_OFFTOPIC}</div><div class="offtopic_text" style="padding:5px 10px;color:#333333;">{TEXT}</div></div>', |
81
|
|
|
), |
82
|
|
|
'mod=' => array( |
83
|
|
|
'bbcode_helpline' => 'ABBC3_MOD_HELPLINE', |
84
|
|
|
'bbcode_match' => '[mod={TEXT1}]{TEXT2}[/mod]', |
85
|
|
|
'bbcode_tpl' => '<table class="ModTable" style="background-color:#FFFFFF;border:1px solid #000000;border-collapse:separate;border-spacing:5px;padding:0;width:100%;color:#333333;overflow:hidden;"><tr><td class="exclamation" rowspan="2" style="background-color:#ff6060;font-weight:bold;font-family:\'Times New Roman\',Verdana,sans-serif;font-size:4em;color:#ffffff;vertical-align:middle;text-align:center;width:1%;"> ! </td><td class="rowuser" style="border-bottom:1px solid #000000;font-weight:bold;">{L_MESSAGE} {L_FROM}{L_COLON} {TEXT1}</td></tr><tr><td class="rowtext">{TEXT2}</td></tr></table>', |
86
|
|
|
), |
87
|
|
|
'nfo' => array( |
88
|
|
|
'bbcode_helpline' => 'ABBC3_NFO_HELPLINE', |
89
|
|
|
'bbcode_match' => '[nfo]{TEXT}[/nfo]', |
90
|
|
|
'bbcode_tpl' => '<pre class="nfo" style="color: #000000; font-weight: normal; line-height: normal; font-size: 10pt; font-family: Terminal, monospace; background-color: #ffffff; white-space: pre; padding: 5px;">{TEXT}</pre>', |
91
|
|
|
), |
92
|
|
|
); |
93
|
|
|
} |
94
|
|
|
|