|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* |
|
4
|
|
|
* @package sitemaker |
|
5
|
|
|
* @copyright (c) 2016 Daniel A. (blitze) |
|
6
|
|
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 |
|
7
|
|
|
* |
|
8
|
|
|
*/ |
|
9
|
|
|
|
|
10
|
|
|
namespace blitze\sitemaker\migrations\v30x; |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* Initial schema changes needed for Extension installation |
|
14
|
|
|
*/ |
|
15
|
|
|
class m17_add_settings_module extends \phpbb\db\migration\container_aware_migration |
|
16
|
|
|
{ |
|
17
|
|
|
/** |
|
18
|
|
|
* @inheritdoc |
|
19
|
|
|
*/ |
|
20
|
|
|
public static function depends_on() |
|
21
|
|
|
{ |
|
22
|
|
|
return array( |
|
23
|
|
|
'\blitze\sitemaker\migrations\v20x\m10_remove_dashboard', |
|
24
|
|
|
'\blitze\sitemaker\migrations\v30x\m16_add_block_view_field', |
|
25
|
|
|
); |
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @inheritdoc |
|
30
|
|
|
*/ |
|
31
|
|
|
public function update_data() |
|
32
|
|
|
{ |
|
33
|
|
|
return array( |
|
34
|
|
|
array('config.add', array('sm_hide_login', 1)), |
|
35
|
|
|
array('config.add', array('sm_hide_online', 1)), |
|
36
|
|
|
array('config.add', array('sm_hide_birthday', 1)), |
|
37
|
|
|
array('config.add', array('sm_show_forum_nav', 1)), |
|
38
|
|
|
array('config.add', array('sm_forum_icon', 'fa fa-comments-o')), |
|
39
|
|
|
|
|
40
|
|
|
array('custom', array(array($this, 'set_layout_prefs'))), |
|
41
|
|
|
|
|
42
|
|
|
array('permission.add', array('a_sm_settings', true)), |
|
43
|
|
|
array('permission.permission_set', array('ROLE_ADMIN_STANDARD', 'a_sm_settings')), |
|
44
|
|
|
|
|
45
|
|
|
array('module.add', array( |
|
46
|
|
|
'acp', 'ACP_SITEMAKER', array( |
|
47
|
|
|
'module_basename' => '\blitze\sitemaker\acp\settings_module', |
|
48
|
|
|
'modes' => array('settings'), |
|
49
|
|
|
), |
|
50
|
|
|
)), |
|
51
|
|
|
); |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
public function set_layout_prefs() |
|
55
|
|
|
{ |
|
56
|
|
|
$style_id = $this->config['default_style']; |
|
57
|
|
|
$layout_prefs = array($style_id => array( |
|
58
|
|
|
'layout' => './../ext/blitze/sitemaker/styles/all/template/layouts/portal/', |
|
59
|
|
|
'view' => '', |
|
60
|
|
|
)); |
|
61
|
|
|
|
|
62
|
|
|
$config_text = $this->container->get('config_text'); |
|
63
|
|
|
$config_text->set('sm_layout_prefs', json_encode($layout_prefs)); |
|
64
|
|
|
} |
|
65
|
|
|
} |
|
66
|
|
|
|