1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @package Board3 Portal v2.2 |
5
|
|
|
* @copyright 2015 Board3 Group ( www.board3.de ) |
6
|
|
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace board3\portal\migrations; |
10
|
|
|
|
11
|
|
|
use phpbb\db\migration\migration; |
12
|
|
|
|
13
|
|
|
class v220_fa extends migration |
14
|
|
|
{ |
15
|
|
|
static public function depends_on() |
16
|
|
|
{ |
17
|
|
|
return array('\board3\portal\migrations\v210_rc3'); |
18
|
|
|
} |
19
|
|
|
|
20
|
|
|
public function update_schema() |
21
|
|
|
{ |
22
|
|
|
return array( |
23
|
|
|
'add_columns' => array( |
24
|
|
|
$this->table_prefix . 'portal_modules' => array( |
25
|
|
|
'module_fa_icon' => array('VCHAR', ''), |
26
|
|
|
'module_fa_size' => array('INT:1', 16), |
27
|
|
|
), |
28
|
|
|
), |
29
|
|
|
); |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
public function update_data() |
33
|
|
|
{ |
34
|
|
|
return array( |
35
|
|
|
array('config.add', array('board3_portal_fa_styles', '')), |
36
|
|
|
array('custom', array(array(&$this, 'insert_defaults'))), |
37
|
|
|
); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
public function insert_defaults() |
41
|
|
|
{ |
42
|
|
|
$fa_icons = array( |
43
|
|
|
'\board3\portal\modules\main_menu' => 'fa-bars', |
44
|
|
|
'\board3\portal\modules\stylechanger' => 'fa-paint-brush', |
45
|
|
|
'\board3\portal\modules\birthday_list' => 'fa-birthday-cake', |
46
|
|
|
'\board3\portal\modules\clock' => 'fa-clock-o', |
47
|
|
|
'\board3\portal\modules\search' => 'fa-search', |
48
|
|
|
'\board3\portal\modules\attachments' => 'fa-paperclip', |
49
|
|
|
'\board3\portal\modules\topposters' => 'fa-pencil-square-o', |
50
|
|
|
'\board3\portal\modules\latest_members' => 'fa-users', |
51
|
|
|
'\board3\portal\modules\link_us' => 'fa-external-link', |
52
|
|
|
'\board3\portal\modules\user_menu' => 'fa-user', |
53
|
|
|
'\board3\portal\modules\statistics' => 'fa-bar-chart', |
54
|
|
|
'\board3\portal\modules\calendar' => 'fa-calendar', |
55
|
|
|
'\board3\portal\modules\leaders' => 'fa-users', |
56
|
|
|
'\board3\portal\modules\latest_bots' => 'fa-android', |
57
|
|
|
'\board3\portal\modules\links' => 'fa-link', |
58
|
|
|
); |
59
|
|
|
foreach ($fa_icons as $key => $value) |
60
|
|
|
{ |
61
|
|
|
$query = 'UPDATE ' . $this->table_prefix . "portal_modules SET module_fa_icon = '" . $value . "' WHERE module_classname = '" . $this->db->sql_escape($key) . "'"; |
62
|
|
|
$this->db->sql_query($query); |
63
|
|
|
} |
64
|
|
|
} |
65
|
|
|
} |
66
|
|
|
|