-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbanner_tpl.ocmod.xml
156 lines (144 loc) · 5.44 KB
/
banner_tpl.ocmod.xml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Banner edit</name>
<code>BE</code>
<version>1.0.0</version>
<author>Babaiev Ihor</author>
<link>https://github.com/bald-cat</link>
<file path="admin/controller/extension/module/banner.php">
<operation>
<search><![CDATA[$data['entry_status'] = $this->language->get('entry_status'); ]]></search>
<add position="after"><![CDATA[
/* Banner Edit - start! */
$data['entry_tpl'] = $this->language->get('entry_tpl');
$data['entry_size_check'] = $this->language->get('entry_size_check');
/* Banner Edit - end! */
]]></add>
</operation>
<operation>
<search><![CDATA[$data['header'] = $this->load->controller('common/header'); ]]></search>
<add position="before"><![CDATA[
/* Banner Edit - start! */
if (isset($this->request->post['tpl'])) {
$data['tpl'] = $this->request->post['tpl'];
} elseif (!empty($module_info)) {
$data['tpl'] = $module_info['tpl'];
} else {
$data['tpl'] = '';
}
if (isset($this->request->post['size_check'])) {
$data['size_check'] = $this->request->post['size_check'];
} elseif (!empty($module_info)) {
$data['size_check'] = $module_info['size_check'];
} else {
$data['size_check'] = '';
}
/* Banner Edit - end! */
]]></add>
</operation>
</file>
<file path="catalog/controller/extension/module/banner.php">
<operation>
<search><![CDATA[$data['module'] = $module++;]]></search>
<add position="after"><![CDATA[
/* Banner Edit - start! */
if(isset($setting['tpl'])){
$tpl='extension/module/'.$setting['tpl'];
}else{
$tpl='extension/module/banner';
}
/* Banner Edit - end! */
]]></add>
</operation>
<operation>
<search><![CDATA[return $this->load->view('extension/module/banner', $data);]]></search>
<add position="replace"><![CDATA[
/* Banner Edit - start! */
return $this->load->view($tpl, $data);
/* Banner Edit - end! */
]]></add>
</operation>
<operation>
<search><![CDATA['image' => $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height'])]]></search>
<add position="replace"><![CDATA[
/* Banner Edit - start! */
'image' => $image
/* Banner Edit - end! */
]]></add>
</operation>
<operation>
<search><![CDATA[ foreach ($results as $result) {]]></search>
<add position="after"><![CDATA[
/* Banner Edit - start! */
$image = $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height']);
if($setting['size_check'] == 1){
$image = 'image/' . $result['image'];
}
/* Banner Edit - end! */
]]></add>
</operation>
</file>
<file path="admin/language/uk-ua/extension/module/banner.php">
<operation>
<search><![CDATA[$_['entry_status'] = 'Статус';]]></search>
<add position="after"><![CDATA[
/* Banner Edit - start! */
$_['entry_tpl'] = 'Шаблон';
$_['entry_size_check'] = 'Источник размеров';
/* Banner Edit - end! */
]]></add>
</operation>
</file>
<file path="admin/language/ru-ru/extension/module/banner.php">
<operation>
<search><![CDATA[$_['entry_status'] = 'Статус';]]></search>
<add position="after"><![CDATA[
/* Banner Edit - start! */
$_['entry_tpl'] = 'Шаблон';
$_['entry_size_check'] = 'Источник размеров';
/* Banner Edit - end! */
]]></add>
</operation>
</file>
<file path="admin/language/en-gb/extension/module/banner.php">
<operation>
<search><![CDATA[$_['entry_status'] = 'Status';]]></search>
<add position="after"><![CDATA[
/* Banner Edit - start! */
$_['entry_tpl'] = 'Template';
$_['entry_size_check'] = 'Size source';
/* Banner Edit - end! */
]]></add>
</operation>
</file>
<file path="admin/view/template/extension/module/banner.tpl">
<operation>
<search><![CDATA[ </form>]]></search>
<add position="before"><![CDATA[
<!-- Banner Edit - start! -->
<div class="form-group">
<label class="col-sm-2 control-label" for="input-check_size"><?php echo $entry_size_check; ?></label>
<div class="col-sm-10">
<select name="size_check" id="input-check_size" class="form-control">
<?php if ($size_check) { ?>
<option value="1" selected="selected">Указывать размеры в шаблоне</option>
<option value="0">Использовать размеры из настроек выше</option>
<?php } else { ?>
<option value="1">Указывать размеры в шаблоне</option>
<option value="0" selected="selected">Использовать размеры из настроек выше</option>
<?php } ?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="input-tpl"><?php echo $entry_tpl; ?></label>
<div class="col-sm-10">
<input type="text" name="tpl" value="<?php echo $tpl; ?>" placeholder="<?php echo $entry_tpl; ?>" id="input-tpl" class="form-control" />
<small>* добавьте макет в папку catalog/view/*/template/extension/module, в это поле запишите только название файла</small>
</div>
</div>
<!-- Banner Edit - end! -->
]]></add>
</operation>
</file>
</modification>