From a4a7e7cc146703830ae60f5b37bb5a27ec2b28bc Mon Sep 17 00:00:00 2001
From: Andrey Grachov
Date: Sat, 22 Mar 2014 23:03:13 +0200
Subject: [PATCH 001/324] Updated numbers generation for math captcha
---
core/components/formit/model/formit/firequest.class.php | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/core/components/formit/model/formit/firequest.class.php b/core/components/formit/model/formit/firequest.class.php
index 1e61d331..e27f3e3d 100644
--- a/core/components/formit/model/formit/firequest.class.php
+++ b/core/components/formit/model/formit/firequest.class.php
@@ -98,13 +98,11 @@ public function prepare() {
$mathMinRange = $this->modx->getOption('mathMinRange',$this->config,10);
$op1 = rand($mathMinRange,$mathMaxRange);
$op2 = rand($mathMinRange,$mathMaxRange);
- if ($op2 > $op1) { $t = $op2; $op2 = $op1; $op1 = $t; } /* swap so we always get positive #s */
/* prevent numbers from being equal */
- if ($op2 == $op1) {
- while ($op2 == $op1) {
- $op2 = rand($mathMinRange,$mathMaxRange);
- }
+ while ($op2 == $op1) {
+ $op2 = rand($mathMinRange,$mathMaxRange);
}
+ if ($op2 > $op1) { $t = $op2; $op2 = $op1; $op1 = $t; } /* swap so we always get positive #s */
$operators = array('+','-');
$operator = rand(0,1);
$this->modx->setPlaceholders(array(
From 7923dcf5a2d62aea397ae846156ac32ab79496a2 Mon Sep 17 00:00:00 2001
From: Jan-Christoph Ihrens
Date: Fri, 18 Apr 2014 05:11:44 +0200
Subject: [PATCH 002/324] Translated missing phrases to German
---
core/components/formit/lexicon/de/properties.inc.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/core/components/formit/lexicon/de/properties.inc.php b/core/components/formit/lexicon/de/properties.inc.php
index 0244c33d..233784d5 100644
--- a/core/components/formit/lexicon/de/properties.inc.php
+++ b/core/components/formit/lexicon/de/properties.inc.php
@@ -35,6 +35,7 @@
$_lang['prop_formit.validationerrormessage_desc'] = 'Eine generelle Fehlermeldung, die angezeigt wird, wenn eine Validierung nicht bestanden wurde. Kann die Variable [[+errors]] enthalten, wenn die genaue Liste von Fehlern mit angezeigt werden soll.';
$_lang['prop_formit.validationerrorbulktpl_desc'] = 'HTML-Template, das für die individuelle Fehlermeldungsanzeige benutzt wird, wenn eine Validierung nicht bestanden wurde.';
$_lang['prop_formit.customvalidators_desc'] = 'Eine kommaseparierte Liste von eigenen Validatoren (snippets), die auf das Formular angewendet werden sollen. Sie müssen hier explizit angegeben werden, um abzulaufen.';
+$_lang['prop_formit.trimvaluesdeforevalidation_desc'] = 'Gibt an, ob Leerzeichen vom Anfang und vom Ende von Werten entfernt werden, bevor versucht wird, sie zu validieren. Standardeinstellung ist "Ja".';
$_lang['prop_formit.clearfieldsonsuccess_desc'] = 'Falls gesetzt, werden die Formularinhalte nach dem Absenden gelöscht, wenn kein Redirect gesetzt wurde.';
$_lang['prop_formit.successmessage_desc'] = 'Falls gesetzt, wird ein Platzhalter mit dem Wert ausgegeben, der von &successMessagePlaceholder mitgegeben wird. Standardwert ist: `fi.successMessage`.';
$_lang['prop_formit.successmessageplaceholder_desc'] = 'Der Platzhalter mit der Erfolgsnachricht.';
@@ -104,8 +105,10 @@
$_lang['prop_fico.toplaceholder_desc'] = 'Optional. Verwenden Sie dies, um den Wert in einen Platzhalter auszugeben, statt ihn direkt auszugeben.';
$_lang['prop_fico.tpl_desc'] = 'Optional. Der zu nutzende Chunk für jede Option der Länderauswahl.';
$_lang['prop_fico.useisocode_desc'] = 'Falls diese Einstellung auf "Ja" steht, wird der ISO-Ländercode als Wert genutzt. Falls diese Einstellung auf "Nein" steht, wird der Ländername verwendet.';
+$_lang['prop_fico.country_desc'] = 'Optional. Verwenden Sie dieses Feld, um eine andere Länder-Datei zu verwenden, wenn eine Liste von Ländern geladen wird.';
/* FormItStateOptions properties */
+$_lang['prop_fiso.country_desc'] = 'Optional. Verwenden Sie dieses Feld, um eine andere Staaten-Datei zu verwenden, wenn eine Liste von Staaten geladen wird.';
$_lang['prop_fiso.selected_desc'] = 'Der auszuwählende Länderwert.';
$_lang['prop_fiso.selectedattribute_desc'] = 'Optional. Das HTML-Attribut, das einem ausgewählten Land hinzugefügt werden soll.';
$_lang['prop_fiso.toplaceholder_desc'] = 'Optional. Verwenden Sie dies, um den Wert in einen Platzhalter auszugeben, statt ihn direkt auszugeben.';
From 629389638718b657ae381174a264d876a034bc4a Mon Sep 17 00:00:00 2001
From: Bert Oost
Date: Fri, 2 May 2014 10:41:50 +0200
Subject: [PATCH 003/324] Update snippet.formitisselected.php
Same as FormItIsChecked.. Fix for non-array values
---
.../formit/elements/snippets/snippet.formitisselected.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/components/formit/elements/snippets/snippet.formitisselected.php b/core/components/formit/elements/snippets/snippet.formitisselected.php
index e23ed0a9..5712af6a 100644
--- a/core/components/formit/elements/snippets/snippet.formitisselected.php
+++ b/core/components/formit/elements/snippets/snippet.formitisselected.php
@@ -32,7 +32,7 @@
}
$input = $modx->fromJSON($input);
if(is_array($input)){
- if (in_array($options,$input)) {
+ if (!empty($input) && is_array($input) && in_array($options,$input)) {
$output = ' selected="selected"';
}
}
From 0e9b96857a65cd312d1ff629e8fedd6afff317c2 Mon Sep 17 00:00:00 2001
From: Mike Reid
Date: Fri, 16 May 2014 09:56:30 -0600
Subject: [PATCH 004/324] Added missing formit.not_regexp lexicon
---
core/components/formit/lexicon/en/default.inc.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/core/components/formit/lexicon/en/default.inc.php b/core/components/formit/lexicon/en/default.inc.php
index 45941bcd..9b7c05bd 100644
--- a/core/components/formit/lexicon/en/default.inc.php
+++ b/core/components/formit/lexicon/en/default.inc.php
@@ -52,4 +52,5 @@
$_lang['formit.recaptcha_err_load'] = 'Could not load FormItReCaptcha service class.';
$_lang['formit.spam_blocked'] = 'Your submission was blocked by a spam filter: ';
$_lang['formit.spam_marked'] = ' - marked as spam.';
-$_lang['formit.username_taken'] = 'Username already taken. Please choose another.';
\ No newline at end of file
+$_lang['formit.username_taken'] = 'Username already taken. Please choose another.';
+$_lang['formit.not_regexp'] = 'Your value did not match the expected format.';
From 4bf55ffda29caf0b6d87f21d4d9d205469afe444 Mon Sep 17 00:00:00 2001
From: jchirschy
Date: Tue, 5 Aug 2014 14:28:52 +0200
Subject: [PATCH 005/324] Specify explicitely a return-path
In order to pass SPF tests, ability to specify explicitely a return-path.
---
.../components/formit/model/formit/fihooks.class.php | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/core/components/formit/model/formit/fihooks.class.php b/core/components/formit/model/formit/fihooks.class.php
index b9a80342..75741bd5 100644
--- a/core/components/formit/model/formit/fihooks.class.php
+++ b/core/components/formit/model/formit/fihooks.class.php
@@ -342,6 +342,13 @@ public function email(array $fields = array()) {
$emailFromName = $this->modx->getOption('emailFromName',$this->formit->config,$emailFrom);
$emailFromName = $this->_process($emailFromName,$fields);
+ /* get returnPath */
+ $emailReturnPath = $this->modx->getOption('emailReturnPath',$this->formit->config,'');
+ if (empty($emailReturnPath)) {
+ $emailReturnPath = $emailFrom;
+ }
+ $emailReturnPath = $this->_process($emailReturnPath,$fields);
+
/* get subject */
$useEmailFieldForSubject = $this->modx->getOption('emailUseFieldForSubject',$this->formit->config,true);
if (!empty($fields['subject']) && $useEmailFieldForSubject) {
@@ -431,10 +438,9 @@ public function email(array $fields = array()) {
$this->modx->mail->set(modMail::MAIL_BODY,$emailHtml && $emailConvertNewlines ? nl2br($message) : $message);
$this->modx->mail->set(modMail::MAIL_FROM, $emailFrom);
$this->modx->mail->set(modMail::MAIL_FROM_NAME, $emailFromName);
- $this->modx->mail->set(modMail::MAIL_SENDER, $emailFrom);
+ $this->modx->mail->set(modMail::MAIL_SENDER, $emailReturnPath);
$this->modx->mail->set(modMail::MAIL_SUBJECT, $subject);
-
/* handle file fields */
foreach ($origFields as $k => $v) {
$attachmentIndex = 0;
@@ -688,4 +694,4 @@ public function gatherFields() {
return $this->getValues();
}
-}
\ No newline at end of file
+}
From c1834f1069ef86ce0f001c23d2c9507b9f2ab7f3 Mon Sep 17 00:00:00 2001
From: jchirschy
Date: Tue, 5 Aug 2014 14:40:23 +0200
Subject: [PATCH 006/324] Add property emailReturnPath
---
_build/docs/build/_fihooks.class.html | 1 +
1 file changed, 1 insertion(+)
diff --git a/_build/docs/build/_fihooks.class.html b/_build/docs/build/_fihooks.class.html
index 9ba69650..f07bc1b8 100644
--- a/_build/docs/build/_fihooks.class.html
+++ b/_build/docs/build/_fihooks.class.html
@@ -476,6 +476,7 @@
- emailToName - A comma separated list of names to pair with addresses.
- emailFrom - The From: email address. Defaults to either the email
field or the emailsender setting.
+- emailReturnPath - The Return-path email address. Defaults to emailFrom.
- emailFromName - The name of the From: user.
- emailSubject - The subject of the email.
- emailHtml - Boolean, if true, email will be in HTML mode.
From 2e88835962da47a0035252df678978ef9fab0102 Mon Sep 17 00:00:00 2001
From: jchirschy
Date: Tue, 5 Aug 2014 14:42:34 +0200
Subject: [PATCH 007/324] Add property emailReturnPath
---
_build/properties/properties.formit.php | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/_build/properties/properties.formit.php b/_build/properties/properties.formit.php
index 52046f1d..2d9f0047 100644
--- a/_build/properties/properties.formit.php
+++ b/_build/properties/properties.formit.php
@@ -309,6 +309,14 @@
'value' => '',
'lexicon' => 'formit:properties',
),
+ array(
+ 'name' => 'emailReturnPath',
+ 'desc' => 'prop_formit.emailreturnpath_desc',
+ 'type' => 'textfield',
+ 'options' => '',
+ 'value' => '',
+ 'lexicon' => 'formit:properties',
+ ),
array(
'name' => 'emailSubject',
'desc' => 'prop_formit.emailsubject_desc',
@@ -506,4 +514,4 @@
),
);
-return $properties;
\ No newline at end of file
+return $properties;
From 6f41a21c5fee0d71afe8ae17f7e55bcc63d9fe19 Mon Sep 17 00:00:00 2001
From: jchirschy
Date: Tue, 5 Aug 2014 14:45:40 +0200
Subject: [PATCH 008/324] Add property emailReturnPath
---
core/components/formit/lexicon/en/properties.inc.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/core/components/formit/lexicon/en/properties.inc.php b/core/components/formit/lexicon/en/properties.inc.php
index a2b1e9c5..a735b8f2 100644
--- a/core/components/formit/lexicon/en/properties.inc.php
+++ b/core/components/formit/lexicon/en/properties.inc.php
@@ -61,6 +61,7 @@
$_lang['prop_formit.emailfromname_desc'] = 'Optional. If `email` is set as a hook, and this is set, will specify the From: name for the email.';
$_lang['prop_formit.emailreplyto_desc'] = 'Optional. If `email` is set as a hook, and this is set, will specify the Reply-To: address for the email.';
$_lang['prop_formit.emailreplytoname_desc'] = 'Optional. If `email` is set as a hook, and this is set, will specify the Reply-To: name for the email.';
+$_lang['prop_formit.emailreturnpath_desc'] = 'Optional. If `email` is set as a hook, and this is set, will specify the Return-path: address for the email. If not set, will take the value of `emailFrom` property.';
$_lang['prop_formit.emailsubject_desc'] = 'If `email` is set as a hook, this is required as a subject line for the email.';
$_lang['prop_formit.emailusefieldforsubject_desc'] = 'If the field `subject` is passed into the form, if this is true, it will use the field content for the subject line of the email.';
$_lang['prop_formit.emailhtml_desc'] = 'Optional. If `email` is set as a hook, this toggles HTML emails or not. Defaults to true.';
@@ -119,4 +120,4 @@
$_lang['formit.opt_blackglass'] = 'Black Glass';
$_lang['formit.opt_clean'] = 'Clean';
$_lang['formit.opt_red'] = 'Red';
-$_lang['formit.opt_white'] = 'White';
\ No newline at end of file
+$_lang['formit.opt_white'] = 'White';
From 77b81eed349428d4563a21955715c631d24d0514 Mon Sep 17 00:00:00 2001
From: Bert Oost
Date: Wed, 6 Aug 2014 09:46:28 +0200
Subject: [PATCH 009/324] Update ficountryoptions.class.php
Make this load the lexicons.
For the prioritized option there are 2 lexicons requested, but after adding the entries they didn't appear. I use the country listing on forms where no FormIt is used for the handling, so that would be the issue I gues.
---
.../formit/model/formit/module/ficountryoptions.class.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/core/components/formit/model/formit/module/ficountryoptions.class.php b/core/components/formit/model/formit/module/ficountryoptions.class.php
index 889c3e53..3e08f5d2 100644
--- a/core/components/formit/model/formit/module/ficountryoptions.class.php
+++ b/core/components/formit/model/formit/module/ficountryoptions.class.php
@@ -54,6 +54,7 @@ public function initialize() {
'country' => $this->modx->getOption('cultureKey', array(), 'us', true),
));
$this->setOption('selectedKey',$this->getOption('useIsoCode',true,'isset') ? 'countryKey' : 'countryName');
+ $this->modx->lexicon->load('formit:default');
}
/**
From ffc18ae10024e04c621b4db8180bbf74cdc3f4f8 Mon Sep 17 00:00:00 2001
From: goldsky
Date: Tue, 12 Aug 2014 19:28:42 +0700
Subject: [PATCH 010/324] fix addAttachment() typo
---
core/components/formit/model/formit/fihooks.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/components/formit/model/formit/fihooks.class.php b/core/components/formit/model/formit/fihooks.class.php
index b9a80342..23b4660d 100644
--- a/core/components/formit/model/formit/fihooks.class.php
+++ b/core/components/formit/model/formit/fihooks.class.php
@@ -442,7 +442,7 @@ public function email(array $fields = array()) {
if (empty($v['name'])) {
$v['name'] = 'attachment'.$attachmentIndex;
}
- $this->modx->mail->mailer->AddAttachment($v['tmp_name'],$v['name'],'base64',!empty($v['type']) ? $v['type'] : 'application/octet-stream');
+ $this->modx->mail->mailer->addAttachment($v['tmp_name'],$v['name'],'base64',!empty($v['type']) ? $v['type'] : 'application/octet-stream');
$attachmentIndex++;
}
}
From ab5bc5cf66a70c9a7ca555c6d264566b408e2b7b Mon Sep 17 00:00:00 2001
From: Andrey Grachov
Date: Thu, 21 Aug 2014 09:46:06 +0300
Subject: [PATCH 011/324] Fixed typo in adding of the attachments
Each attachment without the name (not sure it's possible) will have same generated name `attachment0` without this fix.
---
core/components/formit/model/formit/fihooks.class.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/core/components/formit/model/formit/fihooks.class.php b/core/components/formit/model/formit/fihooks.class.php
index b9a80342..3e6d4ce3 100644
--- a/core/components/formit/model/formit/fihooks.class.php
+++ b/core/components/formit/model/formit/fihooks.class.php
@@ -436,8 +436,8 @@ public function email(array $fields = array()) {
/* handle file fields */
+ $attachmentIndex = 0;
foreach ($origFields as $k => $v) {
- $attachmentIndex = 0;
if (is_array($v) && !empty($v['tmp_name']) && isset($v['error']) && $v['error'] == UPLOAD_ERR_OK) {
if (empty($v['name'])) {
$v['name'] = 'attachment'.$attachmentIndex;
@@ -688,4 +688,4 @@ public function gatherFields() {
return $this->getValues();
}
-}
\ No newline at end of file
+}
From cd5277e978db5f1b72be894e42b78a848e1bd7cf Mon Sep 17 00:00:00 2001
From: Thomas Jakobi
Date: Mon, 24 Nov 2014 11:22:41 +0100
Subject: [PATCH 012/324] Add the possibility of redirectTo=`formfield`
Will redirect to the value of a form field if the form field value is numeric.
---
core/components/formit/model/formit/fihooks.class.php | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/core/components/formit/model/formit/fihooks.class.php b/core/components/formit/model/formit/fihooks.class.php
index b9a80342..11ba5df7 100644
--- a/core/components/formit/model/formit/fihooks.class.php
+++ b/core/components/formit/model/formit/fihooks.class.php
@@ -305,7 +305,14 @@ public function redirect(array $fields = array()) {
if ($resource) {
$contextKey = $resource->get('context_key');
}
- $url = $this->modx->makeUrl($this->formit->config['redirectTo'],$contextKey,$redirectParams,'full');
+ if (!is_numeric($this->formit->config['redirectTo']) &&
+ isset($fields[$this->formit->config['redirectTo']]) &&
+ is_numeric($fields[$this->formit->config['redirectTo']])
+ ) {
+ $url = $this->modx->makeUrl($fields[$this->formit->config['redirectTo']],$contextKey,$redirectParams,'full');
+ } else {
+ $url = $this->modx->makeUrl($this->formit->config['redirectTo'],$contextKey,$redirectParams,'full');
+ }
$this->setRedirectUrl($url);
return true;
}
@@ -688,4 +695,4 @@ public function gatherFields() {
return $this->getValues();
}
-}
\ No newline at end of file
+}
From 4849e4346a11f2a62d8d37ef0de7cc0ab5c8b7d7 Mon Sep 17 00:00:00 2001
From: Wieger Sloot
Date: Mon, 16 Feb 2015 10:28:42 +0100
Subject: [PATCH 013/324] Added attachments for auto-reply
Add coma-separated files (full path)
---
.../elements/snippets/snippet.formitautoresponder.php | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/core/components/formit/elements/snippets/snippet.formitautoresponder.php b/core/components/formit/elements/snippets/snippet.formitautoresponder.php
index decd29ee..7724d4cf 100644
--- a/core/components/formit/elements/snippets/snippet.formitautoresponder.php
+++ b/core/components/formit/elements/snippets/snippet.formitautoresponder.php
@@ -36,6 +36,7 @@
$mailSender = $modx->getOption('fiarSender',$scriptProperties,$modx->getOption('emailsender'));
$mailSubject = $modx->getOption('fiarSubject',$scriptProperties,'[[++site_name]] Auto-Responder');
$mailSubject = str_replace(array('[[++site_name]]','[[++emailsender]]'),array($modx->getOption('site_name'),$modx->getOption('emailsender')),$mailSubject);
+$fiarFiles = $modx->getOption('fiarFiles',$scriptProperties,false);
$isHtml = $modx->getOption('fiarHtml',$scriptProperties,true);
$toField = $modx->getOption('fiarToField',$scriptProperties,'email');
$multiSeparator = $modx->getOption('fiarMultiSeparator',$formit->config,"\n");
@@ -81,6 +82,14 @@
$modx->mail->address('to',$mailTo);
$modx->mail->setHTML($isHtml);
+/* add attachments */
+if($fiarFiles){
+ $fiarFiles = explode(',', $fiarFiles);
+ foreach($fiarFiles AS $file){
+ $modx->mail->mailer->AddAttachment($file);
+ }
+}
+
/* reply to */
$emailReplyTo = $modx->getOption('fiarReplyTo',$scriptProperties,$mailFrom);
$emailReplyTo = $hook->_process($emailReplyTo,$fields);
From 516f2f3b1f804f90a6b885e87bde53466f04f0fc Mon Sep 17 00:00:00 2001
From: Wieger Sloot
Date: Mon, 16 Feb 2015 11:14:52 +0100
Subject: [PATCH 014/324] Added ability to use @CODE as tpl
---
core/components/formit/model/formit/formit.class.php | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/core/components/formit/model/formit/formit.class.php b/core/components/formit/model/formit/formit.class.php
index ff255acd..5e95d3e3 100644
--- a/core/components/formit/model/formit/formit.class.php
+++ b/core/components/formit/model/formit/formit.class.php
@@ -218,7 +218,11 @@ public function getStoreKey() {
*/
public function getChunk($name,$properties = array()) {
$chunk = null;
- if (!isset($this->chunks[$name])) {
+ if(substr($name, 0, 6) == "@CODE:"){
+ $content = substr($name, 6);
+ $chunk = $this->modx->newObject('modChunk');
+ $chunk->setContent($content);
+ } elseif (!isset($this->chunks[$name])) {
if (!$this->config['debug']) {
$chunk = $this->modx->getObject('modChunk',array('name' => $name),true);
}
From 707ecae8ae5d05374a40483e5be5e7446821dd78 Mon Sep 17 00:00:00 2001
From: Wieger Sloot
Date: Tue, 24 Feb 2015 13:25:38 +0100
Subject: [PATCH 015/324] Canadian options for FormitStateOptions #4
---
core/components/formit/includes/ca.states.php | 41 +++++++++++++++++++
1 file changed, 41 insertions(+)
create mode 100755 core/components/formit/includes/ca.states.php
diff --git a/core/components/formit/includes/ca.states.php b/core/components/formit/includes/ca.states.php
new file mode 100755
index 00000000..48886f30
--- /dev/null
+++ b/core/components/formit/includes/ca.states.php
@@ -0,0 +1,41 @@
+
+ *
+ * FormIt is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option) any
+ * later version.
+ *
+ * FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package formit
+ */
+/**
+ * Array of Canadian states
+ * @package formit
+ * @author cyberwitz
+ */
+return array(
+ 'AB' => 'Alberta',
+ 'BC' => 'British Columbia',
+ 'MB' => 'Manitoba',
+ 'NB' => 'New Brunswick',
+ 'NL' => 'Newfoundland And Labrador',
+ 'NS' => 'Nova Scotia',
+ 'NT' => 'Northwest Territories',
+ 'NU' => 'Nunavut',
+ 'ON' => 'Ontario',
+ 'PE' => 'Prince Edward Island',
+ 'QC' => 'Quebec',
+ 'SK' => 'Saskatchewan',
+ 'YT' => 'Yukon'
+);
\ No newline at end of file
From 4f274008a5ba937b4e6921d4348cbf57bcf32ff2 Mon Sep 17 00:00:00 2001
From: Wieger Sloot
Date: Tue, 24 Feb 2015 13:29:28 +0100
Subject: [PATCH 016/324] Updating country reference for Taiwan #22
---
core/components/formit/includes/us.countries.inc.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/components/formit/includes/us.countries.inc.php b/core/components/formit/includes/us.countries.inc.php
index 23b7aa0f..399e57f1 100644
--- a/core/components/formit/includes/us.countries.inc.php
+++ b/core/components/formit/includes/us.countries.inc.php
@@ -231,7 +231,7 @@
'SE' => 'Sweden',
'CH' => 'Switzerland',
'SY' => 'Syrian Arab Republic',
- 'TW' => 'Taiwan, Province of China',
+ 'TW' => 'Taiwan',
'TJ' => 'Tajikistan',
'TZ' => 'Tanzania, United Republic of',
'TH' => 'Thailand',
From a0ee6efdf6692dcb0f3cd95641a2fc45c76a180d Mon Sep 17 00:00:00 2001
From: Wieger Sloot
Date: Tue, 24 Feb 2015 13:36:32 +0100
Subject: [PATCH 017/324] Update changelog.txt
---
core/components/formit/docs/changelog.txt | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/core/components/formit/docs/changelog.txt b/core/components/formit/docs/changelog.txt
index 2a0dbecf..9c5af18c 100755
--- a/core/components/formit/docs/changelog.txt
+++ b/core/components/formit/docs/changelog.txt
@@ -1,5 +1,18 @@
Changelog for FormIt.
+FormIt 2.2.1
+====================================
+- Updated numbers generation for math captcha #5
+- German translation #10
+- Added missing formit.not_regexp lexicon #15
+- Specify explicitely return-path fixes #19 #20
+- fix addAttachment() typo #23
+- Fixed typo in adding of the attachments #24
+- Add the possibility of redirectTo=`formfield` #26
+- Added attachments for auto-reply and Added ability to use @CODE as tpl #29
+- Update snippet.formitisselected.php #12
+- Canadian options for FormitStateOptions
+
FormIt 2.2.0
====================================
- [#8382] Prevent issue with checkboxes/radios causing text-parsing problems with required validator
@@ -215,4 +228,4 @@ FormIt 1.0
- Fixed bug with emailFrom in email hook
- Added emailUseFieldForSubject property to FormIt snippet
- Fixed bug on email hook where if subject was passed through form, it wouldn't set it as email subject
-- Added changelog
\ No newline at end of file
+- Added changelog
From 4ed39903a6bd0bd44d57c706ebb8b1f6d2f21868 Mon Sep 17 00:00:00 2001
From: Wieger Sloot
Date: Tue, 24 Feb 2015 13:37:00 +0100
Subject: [PATCH 018/324] Update build.transport.php
Upped version
---
_build/build.transport.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/_build/build.transport.php b/_build/build.transport.php
index dd819eff..99f923a4 100644
--- a/_build/build.transport.php
+++ b/_build/build.transport.php
@@ -34,7 +34,7 @@
/* set package defines */
define('PKG_ABBR','formit');
define('PKG_NAME','FormIt');
-define('PKG_VERSION','2.2.0');
+define('PKG_VERSION','2.2.1');
define('PKG_RELEASE','pl');
/* override with your own defines here (see build.config.sample.php) */
@@ -157,4 +157,4 @@
$modx->log(modX::LOG_LEVEL_INFO,"\n Package Built. \nExecution time: {$totalTime}\n");
-exit ();
\ No newline at end of file
+exit ();
From f61e03328bc525f758513a802f80b884861eda57 Mon Sep 17 00:00:00 2001
From: Mike Reid
Date: Wed, 25 Feb 2015 22:28:38 -0700
Subject: [PATCH 019/324] Corrects issue with new Canadian FormitStateOptions
not loading, also made case-insensitive.
Fixes #30
---
.../formit/includes/{ca.states.php => ca.states.inc.php} | 0
.../formit/model/formit/module/fistateoptions.class.php | 4 ++--
2 files changed, 2 insertions(+), 2 deletions(-)
rename core/components/formit/includes/{ca.states.php => ca.states.inc.php} (100%)
diff --git a/core/components/formit/includes/ca.states.php b/core/components/formit/includes/ca.states.inc.php
similarity index 100%
rename from core/components/formit/includes/ca.states.php
rename to core/components/formit/includes/ca.states.inc.php
diff --git a/core/components/formit/model/formit/module/fistateoptions.class.php b/core/components/formit/model/formit/module/fistateoptions.class.php
index 225bf6b2..d4ea46f5 100644
--- a/core/components/formit/model/formit/module/fistateoptions.class.php
+++ b/core/components/formit/model/formit/module/fistateoptions.class.php
@@ -53,7 +53,7 @@ public function initialize() {
* @return array
*/
public function getData() {
- $country = $this->getOption('country','us');
+ $country = strtolower( $this->getOption('country','us') );
$statesFile = $this->getOption('statesDirectory',$this->formit->config['includesPath']).$country.'.states.inc.php';
if (file_exists($statesFile)) {
$this->states = include $statesFile;
@@ -101,4 +101,4 @@ public function output() {
}
return $output;
}
-}
\ No newline at end of file
+}
From b7073f0d128a5c6c0b9b7cf38763277363c6ac6a Mon Sep 17 00:00:00 2001
From: Wieger Sloot
Date: Mon, 2 Mar 2015 11:16:08 +0100
Subject: [PATCH 020/324] RedirectTo with full url
Added ability to redirect to full url (http://www.example.com)
---
core/components/formit/model/formit/fihooks.class.php | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/core/components/formit/model/formit/fihooks.class.php b/core/components/formit/model/formit/fihooks.class.php
index 393de73c..905b0590 100644
--- a/core/components/formit/model/formit/fihooks.class.php
+++ b/core/components/formit/model/formit/fihooks.class.php
@@ -310,6 +310,10 @@ public function redirect(array $fields = array()) {
is_numeric($fields[$this->formit->config['redirectTo']])
) {
$url = $this->modx->makeUrl($fields[$this->formit->config['redirectTo']],$contextKey,$redirectParams,'full');
+ } elseif (!is_numeric($this->formit->config['redirectTo']) &&
+ substr($this->formit->config['redirectTo'], 0, 4 ) === "http"
+ ) {
+ $url = $this->formit->config['redirectTo'];
} else {
$url = $this->modx->makeUrl($this->formit->config['redirectTo'],$contextKey,$redirectParams,'full');
}
From 00a1d964a19862e25eb71a551a8be05af201a6a5 Mon Sep 17 00:00:00 2001
From: Wieger Sloot
Date: Mon, 2 Mar 2015 12:54:37 +0100
Subject: [PATCH 021/324] Don't allow whitespace on required
Will fix #11
---
core/components/formit/model/formit/fivalidator.class.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/core/components/formit/model/formit/fivalidator.class.php b/core/components/formit/model/formit/fivalidator.class.php
index 1c299545..42b333c3 100755
--- a/core/components/formit/model/formit/fivalidator.class.php
+++ b/core/components/formit/model/formit/fivalidator.class.php
@@ -351,7 +351,8 @@ public function required($key,$value) {
if (is_array($value) && isset($_FILES[$key])) { /* handling file uploads */
$success = !empty($value['tmp_name']) && isset($value['error']) && $value['error'] == UPLOAD_ERR_OK ? true : false;
} else {
- $success = (!empty($value) || is_numeric($value)) ? true : false;
+ $v = trim($value,' ');
+ $success = (!empty($v) || is_numeric($v)) ? true : false;
}
return $success ? true : $this->_getErrorMessage($key,'vTextRequired','formit.field_required',array(
'field' => $key,
From 8e69d3b24207328cf9964ddb4b149e98cc3cc72a Mon Sep 17 00:00:00 2001
From: Wieger Sloot
Date: Mon, 2 Mar 2015 13:19:38 +0100
Subject: [PATCH 022/324] Added HTML5 multiple file upload support
Fix issue #16
---
.../formit/model/formit/fihooks.class.php | 26 ++++++++++++++-----
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/core/components/formit/model/formit/fihooks.class.php b/core/components/formit/model/formit/fihooks.class.php
index 905b0590..dbf9d550 100644
--- a/core/components/formit/model/formit/fihooks.class.php
+++ b/core/components/formit/model/formit/fihooks.class.php
@@ -455,15 +455,29 @@ public function email(array $fields = array()) {
/* handle file fields */
$attachmentIndex = 0;
foreach ($origFields as $k => $v) {
- if (is_array($v) && !empty($v['tmp_name']) && isset($v['error']) && $v['error'] == UPLOAD_ERR_OK) {
- if (empty($v['name'])) {
- $v['name'] = 'attachment'.$attachmentIndex;
+ if (is_array($v) && !empty($v['tmp_name'])) {
+ if(count($v['name']) > 1){
+ for($i=0;$imodx->mail->mailer->addAttachment($v['tmp_name'][$i],$v['name'][$i],'base64',!empty($v['type'][$i]) ? $v['type'][$i] : 'application/octet-stream');
+ $attachmentIndex++;
+ }
+ }
+ }else{
+ if(isset($v['error']) && $v['error'] == UPLOAD_ERR_OK){
+ if (empty($v['name'])) {
+ $v['name'] = 'attachment'.$attachmentIndex;
+ }
+ $this->modx->mail->mailer->addAttachment($v['tmp_name'],$v['name'],'base64',!empty($v['type']) ? $v['type'] : 'application/octet-stream');
+ $attachmentIndex++;
+ }
}
- $this->modx->mail->mailer->addAttachment($v['tmp_name'],$v['name'],'base64',!empty($v['type']) ? $v['type'] : 'application/octet-stream');
- $attachmentIndex++;
}
}
-
+
/* add to: with support for multiple addresses */
$emailTo = explode(',',$emailTo);
$emailToName = explode(',',$emailToName);
From 4b7ac12372b163f1a8c0da08226627414e254a25 Mon Sep 17 00:00:00 2001
From: Wieger Sloot
Date: Mon, 2 Mar 2015 14:51:58 +0100
Subject: [PATCH 023/324] Validate seperator
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
If you’ve got comma delimited params inside an validator FormIt will
have a premature split.
This will fix # 14
---
core/components/formit/model/formit/firequest.class.php | 7 ++++---
core/components/formit/model/formit/fivalidator.class.php | 4 ++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/core/components/formit/model/formit/firequest.class.php b/core/components/formit/model/formit/firequest.class.php
index e27f3e3d..8bbea422 100644
--- a/core/components/formit/model/formit/firequest.class.php
+++ b/core/components/formit/model/formit/firequest.class.php
@@ -74,6 +74,7 @@ function __construct(FormIt &$formit,array $config = array()) {
'store' => false,
'submitVar' => '',
'validate' => '',
+ 'validateSeperator' => ',',
),$config);
}
@@ -196,7 +197,7 @@ public function handle(array $fields = array()) {
/* validate fields */
$this->loadValidator();
$this->validator->reset();
- $validated = $this->validate($this->config['validate']);
+ $validated = $this->validate($this->config['validate'], $this->config['validateSeperator']);
if ($validated) {
$this->postProcess();
@@ -257,9 +258,9 @@ public function loadDictionary() {
* @param string $validationString
* @return bool
*/
- public function validate($validationString) {
+ public function validate($validationString, $validationSeperator) {
$success = true;
- $this->validator->validateFields($this->dictionary,$validationString);
+ $this->validator->validateFields($this->dictionary,$validationString,$validationSeperator);
if ($this->validator->hasErrors()) {
$success = false;
diff --git a/core/components/formit/model/formit/fivalidator.class.php b/core/components/formit/model/formit/fivalidator.class.php
index 42b333c3..068552c7 100755
--- a/core/components/formit/model/formit/fivalidator.class.php
+++ b/core/components/formit/model/formit/fivalidator.class.php
@@ -117,12 +117,12 @@ public function getOption($key,$default = null,$method = '!empty') {
* @param string $validationFields
* @return array An array of field name => value pairs.
*/
- public function validateFields(fiDictionary $dictionary,$validationFields = '') {
+ public function validateFields(fiDictionary $dictionary,$validationFields = '', $validationSeperator = ',') {
$keys = $dictionary->toArray();
$this->fields = $keys;
/* process the list of fields that will be validated */
- $validationFields = explode(',',$validationFields);
+ $validationFields = explode($validationSeperator,$validationFields);
$fieldValidators = array();
foreach ($validationFields as $idx => $v) {
$v = trim(ltrim($v),' '); /* allow multi-line definitions */
From 478a6d5fab12faa0bb4436471c8ec402710a8cd8 Mon Sep 17 00:00:00 2001
From: Wieger Sloot
Date: Mon, 2 Mar 2015 16:29:30 +0100
Subject: [PATCH 024/324] typo
---
core/components/formit/model/formit/firequest.class.php | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/core/components/formit/model/formit/firequest.class.php b/core/components/formit/model/formit/firequest.class.php
index 8bbea422..794155e2 100644
--- a/core/components/formit/model/formit/firequest.class.php
+++ b/core/components/formit/model/formit/firequest.class.php
@@ -74,7 +74,7 @@ function __construct(FormIt &$formit,array $config = array()) {
'store' => false,
'submitVar' => '',
'validate' => '',
- 'validateSeperator' => ',',
+ 'validateSeparator' => ',',
),$config);
}
@@ -197,7 +197,7 @@ public function handle(array $fields = array()) {
/* validate fields */
$this->loadValidator();
$this->validator->reset();
- $validated = $this->validate($this->config['validate'], $this->config['validateSeperator']);
+ $validated = $this->validate($this->config['validate'], $this->config['validateSeparator']);
if ($validated) {
$this->postProcess();
@@ -258,9 +258,9 @@ public function loadDictionary() {
* @param string $validationString
* @return bool
*/
- public function validate($validationString, $validationSeperator) {
+ public function validate($validationString, $validationSeparator) {
$success = true;
- $this->validator->validateFields($this->dictionary,$validationString,$validationSeperator);
+ $this->validator->validateFields($this->dictionary,$validationString,$validationSeparator);
if ($this->validator->hasErrors()) {
$success = false;
From faf470eccfa30272803a68192535dbc5f2d726ef Mon Sep 17 00:00:00 2001
From: Wieger Sloot
Date: Mon, 2 Mar 2015 16:30:26 +0100
Subject: [PATCH 025/324] typo
---
core/components/formit/model/formit/fivalidator.class.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/core/components/formit/model/formit/fivalidator.class.php b/core/components/formit/model/formit/fivalidator.class.php
index 068552c7..3f270d03 100755
--- a/core/components/formit/model/formit/fivalidator.class.php
+++ b/core/components/formit/model/formit/fivalidator.class.php
@@ -117,12 +117,12 @@ public function getOption($key,$default = null,$method = '!empty') {
* @param string $validationFields
* @return array An array of field name => value pairs.
*/
- public function validateFields(fiDictionary $dictionary,$validationFields = '', $validationSeperator = ',') {
+ public function validateFields(fiDictionary $dictionary,$validationFields = '', $validationSeparator = ',') {
$keys = $dictionary->toArray();
$this->fields = $keys;
/* process the list of fields that will be validated */
- $validationFields = explode($validationSeperator,$validationFields);
+ $validationFields = explode($validationSeparator,$validationFields);
$fieldValidators = array();
foreach ($validationFields as $idx => $v) {
$v = trim(ltrim($v),' '); /* allow multi-line definitions */
From 700cc885ba60fa9493fe49947c427a1768d511cd Mon Sep 17 00:00:00 2001
From: Wieger Sloot
Date: Thu, 19 Mar 2015 14:37:44 +0100
Subject: [PATCH 026/324] Added CMP for the saved forms
---
_build/build.transport.php | 36 ++++-
_build/data/transport.menu.php | 33 ++++
_build/data/transport.settings.php | 9 ++
_build/data/transport.snippets.php | 9 ++
_build/resolvers/resolve.paths.php | 38 +++++
_build/resolvers/resolve.tables.php | 23 +++
assets/components/formit/connector.php | 22 +++
assets/components/formit/css/mgr.css | 11 ++
assets/components/formit/js/mgr/formit.js | 46 ++++++
.../components/formit/js/mgr/sections/home.js | 16 ++
.../formit/js/mgr/widgets/forms.grid.js | 117 ++++++++++++++
.../formit/js/mgr/widgets/home.panel.js | 149 ++++++++++++++++++
.../formit/controllers/home.class.php | 19 +++
.../snippets/snippet.formitsaveform.php | 86 ++++++++++
core/components/formit/index.class.php | 30 ++++
.../formit/lexicon/en/default.inc.php | 3 +
core/components/formit/lexicon/en/mgr.inc.php | 53 +++++++
.../formit/model/formit/formit.class.php | 4 +
.../formit/model/formit/formitform.class.php | 6 +
.../formit/model/formit/metadata.mysql.php | 8 +
.../model/formit/mysql/formitform.class.php | 7 +
.../model/formit/mysql/formitform.map.inc.php | 60 +++++++
.../model/schema/formit.mysql.schema.xml | 10 ++
.../formit/processors/mgr/form/download.php | 7 +
.../processors/mgr/form/export.class.php | 91 +++++++++++
.../processors/mgr/form/getlist.class.php | 38 +++++
.../processors/mgr/form/getnames.class.php | 20 +++
.../processors/mgr/form/remove.class.php | 12 ++
core/components/formit/templates/home.tpl | 1 +
29 files changed, 963 insertions(+), 1 deletion(-)
create mode 100644 _build/data/transport.menu.php
create mode 100644 _build/resolvers/resolve.paths.php
create mode 100644 _build/resolvers/resolve.tables.php
create mode 100644 assets/components/formit/connector.php
create mode 100644 assets/components/formit/css/mgr.css
create mode 100755 assets/components/formit/js/mgr/formit.js
create mode 100755 assets/components/formit/js/mgr/sections/home.js
create mode 100755 assets/components/formit/js/mgr/widgets/forms.grid.js
create mode 100755 assets/components/formit/js/mgr/widgets/home.panel.js
create mode 100644 core/components/formit/controllers/home.class.php
create mode 100644 core/components/formit/elements/snippets/snippet.formitsaveform.php
create mode 100644 core/components/formit/index.class.php
create mode 100644 core/components/formit/lexicon/en/mgr.inc.php
create mode 100644 core/components/formit/model/formit/formitform.class.php
create mode 100644 core/components/formit/model/formit/metadata.mysql.php
create mode 100644 core/components/formit/model/formit/mysql/formitform.class.php
create mode 100644 core/components/formit/model/formit/mysql/formitform.map.inc.php
create mode 100644 core/components/formit/model/schema/formit.mysql.schema.xml
create mode 100644 core/components/formit/processors/mgr/form/download.php
create mode 100644 core/components/formit/processors/mgr/form/export.class.php
create mode 100644 core/components/formit/processors/mgr/form/getlist.class.php
create mode 100644 core/components/formit/processors/mgr/form/getnames.class.php
create mode 100644 core/components/formit/processors/mgr/form/remove.class.php
create mode 100755 core/components/formit/templates/home.tpl
diff --git a/_build/build.transport.php b/_build/build.transport.php
index 99f923a4..72c9eeea 100644
--- a/_build/build.transport.php
+++ b/_build/build.transport.php
@@ -34,7 +34,7 @@
/* set package defines */
define('PKG_ABBR','formit');
define('PKG_NAME','FormIt');
-define('PKG_VERSION','2.2.1');
+define('PKG_VERSION','2.2.2');
define('PKG_RELEASE','pl');
/* override with your own defines here (see build.config.sample.php) */
@@ -122,6 +122,10 @@
'source' => $sources['source_core'],
'target' => "return MODX_CORE_PATH . 'components/';",
));
+$vehicle->resolve('file',array(
+ 'source' => $sources['source_assets'],
+ 'target' => "return MODX_ASSETS_PATH . 'components/';",
+));
$builder->putVehicle($vehicle);
/* load system settings */
@@ -139,6 +143,36 @@
$modx->log(modX::LOG_LEVEL_INFO,'Packaged in '.count($settings).' system settings.'); flush();
unset($settings,$setting,$attributes);
+/* load menu */
+$menu = include $sources['data'].'transport.menu.php';
+if (empty($menu)) {
+ $modx->log(modX::LOG_LEVEL_ERROR,'Could not package in menu.');
+} else {
+ $vehicle= $builder->createVehicle($menu,array (
+ xPDOTransport::PRESERVE_KEYS => true,
+ xPDOTransport::UPDATE_OBJECT => true,
+ xPDOTransport::UNIQUE_KEY => 'text',
+ xPDOTransport::RELATED_OBJECTS => true,
+ xPDOTransport::RELATED_OBJECT_ATTRIBUTES => array (
+ 'Action' => array (
+ xPDOTransport::PRESERVE_KEYS => false,
+ xPDOTransport::UPDATE_OBJECT => true,
+ xPDOTransport::UNIQUE_KEY => array ('namespace','controller'),
+ ),
+ ),
+ ));
+ $modx->log(modX::LOG_LEVEL_INFO,'Adding in PHP resolvers...');
+ $vehicle->resolve('php',array(
+ 'source' => $sources['resolvers'] . 'resolve.tables.php',
+ ));
+ // $vehicle->resolve('php',array(
+ // 'source' => $sources['resolvers'] . 'resolve.paths.php',
+ // ));
+ $builder->putVehicle($vehicle);
+ $modx->log(modX::LOG_LEVEL_INFO,'Packaged in menu.');
+}
+unset($vehicle,$menu);
+
/* now pack in the license file, readme and setup options */
$builder->setPackageAttributes(array(
'license' => file_get_contents($sources['docs'] . 'license.txt'),
diff --git a/_build/data/transport.menu.php b/_build/data/transport.menu.php
new file mode 100644
index 00000000..cce8e75f
--- /dev/null
+++ b/_build/data/transport.menu.php
@@ -0,0 +1,33 @@
+newObject('modAction');
+$action->fromArray(array(
+ 'id' => 1,
+ 'namespace' => 'formit',
+ 'parent' => 0,
+ 'controller' => 'index',
+ 'haslayout' => 1,
+ 'lang_topics' => 'formit:mgr',
+ 'assets' => '',
+),'',true,true);
+
+/* load action into menu */
+$menu= $modx->newObject('modMenu');
+$menu->fromArray(array(
+ 'text' => 'formit',
+ 'parent' => 'components',
+ 'description' => 'formit.menu_desc',
+ 'icon' => 'images/icons/plugin.gif',
+ 'menuindex' => 0,
+ 'params' => '',
+ 'handler' => '',
+),'',true,true);
+$menu->addOne($action);
+unset($action);
+
+return $menu;
\ No newline at end of file
diff --git a/_build/data/transport.settings.php b/_build/data/transport.settings.php
index 6f67fdfb..d5f658b9 100644
--- a/_build/data/transport.settings.php
+++ b/_build/data/transport.settings.php
@@ -54,4 +54,13 @@
'area' => 'reCaptcha',
),'',true,true);
+$settings['formit.exclude_contexts']= $modx->newObject('modSystemSetting');
+$settings['formit.exclude_contexts']->fromArray(array(
+ 'key' => 'formit.exclude_contexts',
+ 'value' => 'mgr',
+ 'xtype' => 'textfield',
+ 'namespace' => 'formit',
+ 'area' => '',
+),'',true,true);
+
return $settings;
\ No newline at end of file
diff --git a/_build/data/transport.snippets.php b/_build/data/transport.snippets.php
index 19f383f0..9e97fc01 100644
--- a/_build/data/transport.snippets.php
+++ b/_build/data/transport.snippets.php
@@ -94,6 +94,15 @@
$snippets[6]->setProperties($properties);
unset($properties);
+$snippets[7]= $modx->newObject('modSnippet');
+$snippets[7]->fromArray(array(
+ 'id' => 7,
+ 'name' => 'FormItSaveForm',
+ 'description' => 'Save any form and export them to csv.',
+ 'snippet' => getSnippetContent($sources['source_core'].'/elements/snippets/snippet.formitsaveform.php'),
+),'',true,true);
+unset($properties);
+
/*
$snippets[0]= $modx->newObject('modSnippet');
$snippets[0]->fromArray(array(
diff --git a/_build/resolvers/resolve.paths.php b/_build/resolvers/resolve.paths.php
new file mode 100644
index 00000000..8b5ea627
--- /dev/null
+++ b/_build/resolvers/resolve.paths.php
@@ -0,0 +1,38 @@
+getCount('modSystemSetting',array(
+ 'key' => 'formit.'.$key,
+ ));
+ if (empty($ct)) {
+ $setting = $modx->newObject('modSystemSetting');
+ $setting->set('key','formit.'.$key);
+ $setting->set('value',$value);
+ $setting->set('namespace','formit');
+ $setting->set('area','Paths');
+ $setting->save();
+ }
+}
+if ($object->xpdo) {
+ switch ($options[xPDOTransport::PACKAGE_ACTION]) {
+ case xPDOTransport::ACTION_INSTALL:
+ case xPDOTransport::ACTION_UPGRADE:
+ $modx =& $object->xpdo;
+
+ /* setup paths */
+ createSetting($modx,'core_path',$modx->getOption('core_path').'components/formit/');
+ createSetting($modx,'assets_path',$modx->getOption('assets_path').'components/formit/');
+
+ /* setup urls */
+ createSetting($modx,'assets_url',$modx->getOption('assets_url').'components/formit/');
+ break;
+ }
+}
+return true;
\ No newline at end of file
diff --git a/_build/resolvers/resolve.tables.php b/_build/resolvers/resolve.tables.php
new file mode 100644
index 00000000..c97bb430
--- /dev/null
+++ b/_build/resolvers/resolve.tables.php
@@ -0,0 +1,23 @@
+xpdo) {
+ switch ($options[xPDOTransport::PACKAGE_ACTION]) {
+ case xPDOTransport::ACTION_INSTALL:
+ case xPDOTransport::ACTION_UPGRADE:
+ $modx =& $object->xpdo;
+ $modelPath = $modx->getOption('formit.core_path',null,$modx->getOption('core_path').'components/formit/').'model/';
+ $modx->addPackage('formit',$modelPath);
+
+ $manager = $modx->getManager();
+
+ $manager->createObjectContainer('FormItForm');
+
+ break;
+ }
+}
+return true;
\ No newline at end of file
diff --git a/assets/components/formit/connector.php b/assets/components/formit/connector.php
new file mode 100644
index 00000000..1d51f3c9
--- /dev/null
+++ b/assets/components/formit/connector.php
@@ -0,0 +1,22 @@
+getOption('formit.core_path',null,$modx->getOption('core_path').'components/formit/');
+require_once $corePath.'model/formit/formit.class.php';
+$modx->formit = new FormIt($modx);
+
+$modx->lexicon->load('formit:default');
+
+/* handle request */
+$path = $modx->getOption('processorsPath',$modx->formit->config,$corePath.'processors/');
+$modx->request->handleRequest(array(
+ 'processors_path' => $path,
+ 'location' => '',
+));
\ No newline at end of file
diff --git a/assets/components/formit/css/mgr.css b/assets/components/formit/css/mgr.css
new file mode 100644
index 00000000..97fa5603
--- /dev/null
+++ b/assets/components/formit/css/mgr.css
@@ -0,0 +1,11 @@
+.required:before {
+ content: "* ";
+ color: red;
+}
+
+.button-holder {
+ padding: 15px 0 0 156px;
+}
+.button-holder span{
+ margin-right: 15px;
+}
\ No newline at end of file
diff --git a/assets/components/formit/js/mgr/formit.js b/assets/components/formit/js/mgr/formit.js
new file mode 100755
index 00000000..63cead18
--- /dev/null
+++ b/assets/components/formit/js/mgr/formit.js
@@ -0,0 +1,46 @@
+var FormIt = function(config) {
+ config = config || {};
+ FormIt.superclass.constructor.call(this,config);
+};
+Ext.extend(FormIt,Ext.Component,{
+ page:{},window:{},grid:{},tree:{},panel:{},combo:{},config: {}
+});
+Ext.reg('formit',FormIt);
+FormIt = new FormIt();
+
+
+
+
+Ext.onReady(function() {
+
+ Ext.apply(Ext.form.VTypes, {
+ daterange: function(val, field) {
+ var date = field.parseDate(val);
+
+ if (!date) {
+ return false;
+ }
+ if (field.startDateField && (!this.dateRangeMax || (date.getTime() != this.dateRangeMax.getTime()))) {
+ var start = Ext.getCmp(field.startDateField);
+ start.setMaxValue(date);
+ start.validate();
+ this.dateRangeMax = date;
+ }
+ else if (field.endDateField && (!this.dateRangeMin || (date.getTime() != this.dateRangeMin.getTime()))) {
+ console.log(field)
+ var end = Ext.getCmp(field.endDateField);
+ end.setMinValue(date);
+ end.validate();
+ this.dateRangeMin = date;
+ }
+ /*
+ * Always return true since we're only using this vtype to set the
+ * min/max allowed values (these are tested for after the vtype test)
+ */
+ return true;
+ },
+
+ daterangeText: 'Start date must be less than end date',
+
+ });
+});
\ No newline at end of file
diff --git a/assets/components/formit/js/mgr/sections/home.js b/assets/components/formit/js/mgr/sections/home.js
new file mode 100755
index 00000000..16c74a2a
--- /dev/null
+++ b/assets/components/formit/js/mgr/sections/home.js
@@ -0,0 +1,16 @@
+Ext.onReady(function() {
+ MODx.load({ xtype: 'formit-page-home'});
+});
+
+FormIt.page.Home = function(config) {
+ config = config || {};
+ Ext.applyIf(config,{
+ components: [{
+ xtype: 'formit-panel-home'
+ ,renderTo: 'formit-panel-home-div'
+ }]
+ });
+ FormIt.page.Home.superclass.constructor.call(this,config);
+};
+Ext.extend(FormIt.page.Home,MODx.Component);
+Ext.reg('formit-page-home',FormIt.page.Home);
\ No newline at end of file
diff --git a/assets/components/formit/js/mgr/widgets/forms.grid.js b/assets/components/formit/js/mgr/widgets/forms.grid.js
new file mode 100755
index 00000000..63fc5a87
--- /dev/null
+++ b/assets/components/formit/js/mgr/widgets/forms.grid.js
@@ -0,0 +1,117 @@
+
+FormIt.grid.Forms = function(config) {
+ config = config || {};
+ Ext.applyIf(config,{
+ id: 'formit-grid-forms'
+ ,url: FormIt.config.connectorUrl
+ ,baseParams: {
+ action: 'mgr/form/getlist'
+ }
+ ,fields: ['id','form','values', 'ip', 'date']
+ ,autoHeight: true
+ ,paging: true
+ ,remoteSort: true
+ ,columns: [{
+ header: _('id')
+ ,dataIndex: 'id'
+ },{
+ header: _('formit.values')
+ ,dataIndex: 'values'
+ ,width: 250
+ ,renderer: function(value){
+ var output = '';
+ for(var k in value){
+ output += ''+k+': '+value[k]+'\n';
+ }
+ return output;
+ }
+ },{
+ header: _('formit.date')
+ ,dataIndex: 'date'
+ ,width: 250
+ ,renderer: function(value) {
+ var formDate = Date.parseDate(value, 'U');
+ return formDate.format('Y/m/d H:i');
+ }
+ }]
+ });
+ FormIt.grid.Forms.superclass.constructor.call(this,config);
+};
+Ext.extend(FormIt.grid.Forms,MODx.grid.Grid,{
+ windows: {}
+ ,getMenu: function() {
+ var m = [];
+ m.push({
+ text: _('formit.form_view')
+ ,handler: this.viewItem
+ });
+ m.push('-');
+ m.push({
+ text: _('formit.form_remove')
+ ,handler: this.remove
+ });
+ this.addContextMenuItem(m);
+ }
+ ,viewItem: function(btn,e) {
+ if (!this.menu.record) return false;
+ var fieldsOutput = '';
+ for(var k in this.menu.record.values){
+ fieldsOutput += ''+k+': '+this.menu.record.values[k]+' ';
+ }
+
+ var formDate = Date.parseDate(this.menu.record.date, 'U');
+
+ var win = new Ext.Window({
+ title: _('formit.values'),
+ modal: true,
+ width: 640,
+ height: 400,
+ preventBodyReset: true,
+ html: '