Skip to content

Commit 4581d36

Browse files
committed
v 1.2.0
1 parent a3df801 commit 4581d36

File tree

3 files changed

+86
-15
lines changed

3 files changed

+86
-15
lines changed

elements/rfsubmit/element.json

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"margin": "default",
1616
"label": "Submit",
1717
"icon_align": "left",
18-
"button_style": "default"
18+
"button_style": "default",
19+
"js2": true
1920
},
2021
"fields": {
2122
"label": {
@@ -66,7 +67,26 @@
6667
"type": "checkbox",
6768
"text": "Full width button"
6869
},
69-
70+
"js0": {
71+
"type": "checkbox",
72+
"label": "Execute",
73+
"text": "Javascript #0"
74+
},
75+
"js1": {
76+
"type": "checkbox",
77+
"label": "Execute",
78+
"text": "Javascript #1"
79+
},
80+
"js2": {
81+
"type": "checkbox",
82+
"label": "Execute",
83+
"text": "Javascript #2 (Default)"
84+
},
85+
"js3": {
86+
"type": "checkbox",
87+
"label": "Execute",
88+
"text": "Javascript #3"
89+
},
7090
"margin": "${builder.margin}",
7191
"margin_remove_top": "${builder.margin_remove_top}",
7292
"margin_remove_bottom": "${builder.margin_remove_bottom}",
@@ -112,6 +132,25 @@
112132
"button_style",
113133
"button_size",
114134
"fullwidth"
135+
136+
]
137+
},
138+
{
139+
"label": "Before submit",
140+
"type": "group",
141+
"divider": true,
142+
"fields": [
143+
"js0"
144+
]
145+
},
146+
{
147+
"label": "After submit",
148+
"type": "group",
149+
"divider": true,
150+
"fields": [
151+
"js1",
152+
"js2",
153+
"js3"
115154
]
116155
},
117156
{

elements/rfsubmit/templates/template.php

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,52 @@
33
//Wrap
44
$wrap = $this->el('div');
55

6-
// Button
7-
$button = $this->el('button', [
86

9-
'class' => $this->expr([
10-
'el-content',
11-
'rf-button-send',
12-
'uk-width-1-1 {@fullwidth}',
13-
'uk-{button_style: link-\w+}' => ['button_style' => $props['button_style']],
14-
'uk-button uk-button-{!button_style: |link-\w+} [uk-button-{button_size}]' => ['button_style' => $props['button_style']],
15-
], $props),
7+
$rfCall="";
8+
if(!empty($props['js0']) && ($props['js0']))
9+
{
10+
$rfCall="0";
11+
}
12+
if(!empty($props['js1']) && ($props['js1']))
13+
{
14+
$rfCall.="1";
15+
}
16+
if(!empty($props['js2']) && ($props['js2']))
17+
{
18+
$rfCall.="2";
19+
}
20+
if(!empty($props['js3']) && ($props['js3']))
21+
{
22+
$rfCall.="3";
23+
}
24+
// Button
25+
if ($rfCall=="2")
26+
{
27+
$button = $this->el('button', [
1628

17-
'title' => ['{label}'],
29+
'class' => $this->expr([
30+
'el-content',
31+
'rf-button-send',
32+
'uk-width-1-1 {@fullwidth}',
33+
'uk-{button_style: link-\w+}' => ['button_style' => $props['button_style']],
34+
'uk-button uk-button-{!button_style: |link-\w+} [uk-button-{button_size}]' => ['button_style' => $props['button_style']],
35+
], $props)
36+
]);
37+
}
38+
else
39+
{
40+
$button = $this->el('button', [
1841

19-
]);
42+
'class' => $this->expr([
43+
'el-content',
44+
'rf-button-send',
45+
'uk-width-1-1 {@fullwidth}',
46+
'uk-{button_style: link-\w+}' => ['button_style' => $props['button_style']],
47+
'uk-button uk-button-{!button_style: |link-\w+} [uk-button-{button_size}]' => ['button_style' => $props['button_style']],
48+
], $props),
49+
'data-rf-call' => $rfCall
50+
]);
51+
}
2052

2153
?>
2254

radicalform_elements.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<extension version="3.8" type="plugin" method="upgrade" group="system">
33
<name>PLG_RFE_FORM</name>
44
<author>Tsymbal and Progreccor</author>
5-
<creationDate>27.07.2021</creationDate>
5+
<creationDate>29.07.2021</creationDate>
66
<copyright>Copyright (C) 2005 - 2021 Open Source Matters. All rights reserved.</copyright>
77
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
88
<authorEmail>boss@delo-design.ru</authorEmail>
99
<authorUrl>https://delo-design.ru</authorUrl>
10-
<version>1.1.2</version>
10+
<version>1.2.0</version>
1111
<description>PLG_RFE_FORM_XML_DESCRIPTION</description>
1212
<scriptfile>script.php</scriptfile>
1313

0 commit comments

Comments
 (0)