-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.options.php
72 lines (64 loc) · 2.54 KB
/
setup.options.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/** @var array $options */
$exists = $chunks = false;
$output = null;
switch ($options[xPDOTransport::PACKAGE_ACTION]) {
case xPDOTransport::ACTION_INSTALL:
//$exists = $modx->getObject('transport.modTransportPackage', array('package_name' => 'pdoTools'));
break;
case xPDOTransport::ACTION_UPGRADE:
//$exists = $modx->getObject('transport.modTransportPackage', array('package_name' => 'pdoTools'));
if (!empty($options['attributes']['chunks'])) {
$chunks = '<ul id="formCheckboxes" style="height:200px;overflow:auto;">';
foreach ($options['attributes']['chunks'] as $k => $v) {
$chunks .= '
<li>
<label>
<input type="checkbox" name="update_chunks[]" value="' . $k . '"> ' . $k . '
</label>
</li>';
}
$chunks .= '</ul>';
}
break;
case xPDOTransport::ACTION_UNINSTALL:
break;
}
$output = '';
/*
if (!$exists) {
switch ($modx->getOption('manager_language')) {
case 'ru':
$output = 'Этот компонент требует <b>pdoTools</b> для быстрой работы сниппетов.<br/>Он будет автоматически скачан и установлен.';
break;
default:
$output = 'This component requires <b>pdoTools</b> for fast work of snippets.<br/><br/>It will be downloaded and installed automatically.';
}
}
*/
if ($chunks) {
/*
if (!$exists) {
$output .= '<br/><br/>';
}
*/
switch ($modx->getOption('manager_language')) {
case 'ru':
$output .= 'Выберите чанки, которые нужно <b>перезаписать</b>:<br/>
<small>
<a href="#" onclick="Ext.get(\'formCheckboxes\').select(\'input\').each(function(v) {v.dom.checked = true;});">отметить все</a> |
<a href="#" onclick="Ext.get(\'formCheckboxes\').select(\'input\').each(function(v) {v.dom.checked = false;});">cнять отметки</a>
</small>
';
break;
default:
$output .= 'Select chunks, which need to <b>overwrite</b>:<br/>
<small>
<a href="#" onclick="Ext.get(\'formCheckboxes\').select(\'input\').each(function(v) {v.dom.checked = true;});">select all</a> |
<a href="#" onclick="Ext.get(\'formCheckboxes\').select(\'input\').each(function(v) {v.dom.checked = false;});">deselect all</a>
</small>
';
}
$output .= $chunks;
}
return $output;