Skip to content

Commit 478146e

Browse files
committed
Added Source URL Parameter 🔗
1 parent 5056d8f commit 478146e

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

‎helper.php‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,16 @@ public static function submitForm($ajax = false) {
213213
);
214214
}
215215

216+
// Fetches Source URL of Submission Page
217+
if ( $params->get('source_url' ) ) {
218+
$link = urldecode( $jinput->get('returnurl', '', 'RAW') );
219+
$contents[] = array(
220+
"value" => "<a href='$link'>$link</a>",
221+
"label" => "Source URL",
222+
"name" => "sourceURL"
223+
);
224+
}
225+
216226
if ($params->get('email_template', '') == 'custom') {
217227
$html = $params->get('email_custom', '');
218228
if ( empty( $html ) ) {

‎language/en-GB/en-GB.mod_jdsimplecontactform.ini‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ MOD_JDSCF_CSS_DESC=""
9494
MOD_JDSCF_IPADDR_LBL="Include IP Address"
9595
MOD_JDSCF_IPADDR_DESC="Collects IP address of the user and include it in the email received by the admin."
9696

97+
MOD_JDSCF_SRC_URL_LBL="Include Source URL"
98+
MOD_JDSCF_SRC_URL_DESC="Collects the URL of the page where the form is submitted."
99+
97100
MOD_JDSCF_REQUIRED_ERROR="%s is required."
98101
MOD_JDSCF_NUMBER_MIN_LENGTH_ERROR="%s should have %s characters or more."
99102
MOD_JDSCF_NUMBER_MAX_LENGTH_ERROR="%s should have %s characters or fewer."

‎mod_jdsimplecontactform.xml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,16 @@
136136
<option value="1">JYES</option>
137137
<option value="0">JNO</option>
138138
</field>
139+
<field
140+
name="source_url"
141+
type="radio"
142+
label="MOD_JDSCF_SRC_URL_LBL"
143+
description="MOD_JDSCF_SRC_URL_DESC"
144+
class="btn-group btn-group-yesno"
145+
default="0">
146+
<option value="1">JYES</option>
147+
<option value="0">JNO</option>
148+
</field>
139149
</fieldset>
140150
<fieldset name="fields" label="MOD_JDSCF_FORM_FIELDS_OPTIONS_LBL">
141151
<field name="fields" type="subform" formsource="modules/mod_jdsimplecontactform/forms/fielditem.xml" multiple="true" label="MOD_JDSCF_FIELDS_LBL" />

0 commit comments

Comments
 (0)