diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..978516d0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,26 @@ +--- +name: Bug report +about: Create a report to help us improve FormIt +--- + +## Bug report + +### Summary + +Quick summary what's this issue about. + +### Step to reproduce + +How to reproduce the issue, including custom code if needed. + +### Observed behavior + +How it behaved after following steps above. + +### Expected behavior + +How it should behave after following steps above. + +### Environment + +Apache/NGINX and version, MySQL version, browser, etc. Any relevant information. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..8a003f1e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,22 @@ +--- +name: Feature request +about: Suggest an idea that makes FormIt +--- + +## Feature request + +### Summary + +Quick summary what's this feature request about. + +### Why is it needed? + +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +### Suggested solution(s) + +A clear and concise description of what you want to happen. + +### Related issue(s)/PR(s) + +Let us know if this is related to any issue/pull request. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..c2afb3a5 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +### What does it do? +Describe the technical changes you did. + +### Why is it needed? +Describe the issue you are solving. + +### Related issue(s)/PR(s) +Let us know if this is related to any issue/pull request (see https://github.com/blog/1506-closing-issues-via-pull-requests) diff --git a/.gitignore b/.gitignore index 92a00843..555837a8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,14 @@ _build/build.config.php config.core.php .idea +.DS_Store + core/components/formit/test/properties.inc.php core/components/formit/test/config.inc.php + +assets/components/formit/*.log +assets/components/formit/tmp + +_packages/*.* +!_packages/.gitignore +!_packages/*.zip diff --git a/_build/build.config.sample.php b/_build/_archive/build.config.sample.php similarity index 100% rename from _build/build.config.sample.php rename to _build/_archive/build.config.sample.php diff --git a/_build/build.schema.php b/_build/_archive/build.schema.php similarity index 100% rename from _build/build.schema.php rename to _build/_archive/build.schema.php diff --git a/_build/build.transport.php b/_build/_archive/build.transport.php similarity index 80% rename from _build/build.transport.php rename to _build/_archive/build.transport.php index dd819eff..a56b151a 100644 --- a/_build/build.transport.php +++ b/_build/_archive/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','4.0.0'); define('PKG_RELEASE','pl'); /* override with your own defines here (see build.config.sample.php) */ @@ -66,7 +66,7 @@ $modx->loadClass('transport.modPackageBuilder','',false, true); $builder = new modPackageBuilder($modx); $builder->createPackage(PKG_ABBR,PKG_VERSION,PKG_RELEASE); -$builder->registerNamespace(PKG_ABBR,false,true,'{core_path}components/'.PKG_ABBR.'/'); +$builder->registerNamespace(PKG_ABBR,false,true,'{core_path}components/'.PKG_ABBR.'/','{assets_path}components/'.PKG_ABBR.'/'); /* create category */ $category= $modx->newObject('modCategory'); @@ -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'), @@ -157,4 +191,4 @@ $modx->log(modX::LOG_LEVEL_INFO,"\n
Package Built.
\nExecution time: {$totalTime}\n"); -exit (); \ No newline at end of file +exit (); diff --git a/_build/_archive/config.json b/_build/_archive/config.json new file mode 100644 index 00000000..b0f1f065 --- /dev/null +++ b/_build/_archive/config.json @@ -0,0 +1,526 @@ +{ + "name": "FormIt", + "lowCaseName": "formit", + "description": "FormIt is a dynamic form processing Snippet for MODx Revolution. It handles a form after submission, performing validation and followup actions like sending an email. It does not generate the form, but it can repopulate it if it fails validation.", + "author": "Sterc", + "version": "4.1.0", + "package": { + "actions": [{ + "id": 1, + "controller": "index", + "hasLayout": 1, + "langTopics": "formit:mgr", + "assets": "" + }], + "menus": [{ + "text": "formit", + "description": "formit.menu_desc", + "action": 1, + "parent": "components", + "icon": "", + "menuIndex": 0, + "params": "", + "handler": "" + }], + "elements": { + "chunks": [{ + "name": "fiDefaultEmailTpl", + "file": "email.chunk.tpl", + "description": "The default chunk used for the email. Please do not edit this chunk, as this will be overwritten when updating FormIt." + },{ + "name": "fiDefaultFiarTpl", + "file": "fiartpl.chunk.tpl", + "description": "The default chunk used for the autoresponder email. Please do not edit this chunk, as this will be overwritten when updating FormIt." + },{ + "name": "fiDefaultOptGroupTpl", + "file": "optgroup.chunk.tpl", + "description": "The default chunk used by the FormItCountryOptions snippet for the select optgroup. Please do not edit this chunk, as this will be overwritten when updating FormIt." + },{ + "name": "fiDefaultOptionTpl", + "file": "option.chunk.tpl", + "description": "The default chunk used by the FormItCountryOptions snippet for the select option. Please do not edit this chunk, as this will be overwritten when updating FormIt." + }], + "plugins": [{ + "name": "FormIt", + "file": "formit.plugin.php", + "events": [ + "OnManagerPageBeforeRender" + ] + }], + "snippets": [{ + "name": "FormIt", + "description": "A dynamic form processing snippet.", + "file": "snippet.formit.php", + "properties": [{ + "name": "hooks", + "description": "prop_formit.hooks_desc", + "value": "" + },{ + "name": "preHooks", + "description": "prop_formit.prehooks_desc", + "value": "" + },{ + "name": "submitVar", + "description": "prop_formit.submitvar_desc", + "value": "" + },{ + "name": "validate", + "description": "prop_formit.validate_desc", + "value": "" + },{ + "name": "errTpl", + "description": "prop_formit.errtpl_desc", + "value": "[[+error]]" + },{ + "name": "validationErrorMessage", + "description": "prop_formit.validationerrormessage_desc", + "value": "

A form validation error occurred. Please check the values you have entered.

" + },{ + "name": "validationErrorBulkTpl", + "description": "prop_formit.validationerrorbulktpl_desc", + "value": "
  • [[+error]]
  • " + },{ + "name": "trimValuesBeforeValidation", + "description": "prop_formit.trimvaluesdeforevalidation_desc", + "type": "combo-boolean", + "value": "1" + },{ + "name": "customValidators", + "description": "prop_formit.customvalidators_desc", + "value": "" + },{ + "name": "clearFieldsOnSuccess", + "description": "prop_formit.clearfieldsonsuccess_desc", + "type": "combo-boolean", + "value": "1" + },{ + "name": "successMessage", + "description": "prop_formit.successmessage_desc", + "value": "" + },{ + "name": "successMessagePlaceholder", + "description": "prop_formit.successmessageplaceholder_desc", + "value": "fi.successMessage" + },{ + "name": "store", + "description": "prop_formit.store_desc", + "type": "combo-boolean", + "value": "0" + },{ + "name": "placeholderPrefix", + "description": "prop_formit.placeholderprefix_desc", + "value": "fi." + },{ + "name": "storeTime", + "description": "prop_formit.storetime_desc", + "value": "300" + },{ + "name": "storeLocation", + "description": "prop_formit.storelocation_desc", + "type": "list", + "options": [{ + "name": "formit.opt_cache", + "value": "cache" + },{ + "name": "formit.opt_session", + "value": "session" + }], + "value": "cache" + },{ + "name": "allowFiles", + "description": "prop_formit.allowfiles_desc", + "type": "combo-boolean", + "value": "1" + },{ + "name": "spamEmailFields", + "description": "prop_formit.spamemailfields_desc", + "value": "email" + },{ + "name": "spamCheckIp", + "description": "prop_formit.spamcheckip_desc", + "type": "combo-boolean", + "value": "0" + },{ + "name": "recaptchaJs", + "description": "prop_formit.recaptchajs_desc", + "value": "{}" + },{ + "name": "recaptchaTheme", + "description": "prop_formit.recaptchatheme_desc", + "type": "list", + "options": [{ + "name": "formit.opt_red", + "value": "red" + },{ + "name": "formit.opt_white", + "value": "white" + },{ + "name": "formit.opt_clean", + "value": "clean" + },{ + "name": "formit.opt_blackglass", + "value": "blackglass" + }], + "value": "clean" + },{ + "name": "redirectTo", + "description": "prop_formit.redirectto_desc", + "value": "" + },{ + "name": "redirectParams", + "description": "prop_formit.redirectparams_desc", + "value": "" + },{ + "name": "emailTo", + "description": "prop_formit.emailto_desc", + "value": "" + },{ + "name": "emailToName", + "description": "prop_formit.emailtoname_desc", + "value": "" + },{ + "name": "emailFrom", + "description": "prop_formit.emailfrom_desc", + "value": "" + },{ + "name": "emailFromName", + "description": "prop_formit.emailfromname_desc", + "value": "" + },{ + "name": "emailReplyTo", + "description": "prop_formit.emailreplyto_desc", + "value": "" + },{ + "name": "emailReplyToName", + "description": "prop_formit.emailreplytoname_desc", + "value": "" + },{ + "name": "emailCC", + "description": "prop_formit.emailcc_desc", + "value": "" + },{ + "name": "emailCCName", + "description": "prop_formit.emailccname_desc", + "value": "" + },{ + "name": "emailBCC", + "description": "prop_formit.emailbcc_desc", + "value": "" + },{ + "name": "emailBCCName", + "description": "prop_formit.emailbccname_desc", + "value": "" + },{ + "name": "emailReturnPath", + "description": "prop_formit.emailreturnpath_desc", + "value": "" + },{ + "name": "emailSubject", + "description": "prop_formit.emailsubject_desc", + "value": "" + },{ + "name": "emailUseFieldForSubject", + "description": "prop_formit.emailusefieldforsubject_desc", + "value": "" + },{ + "name": "emailHtml", + "description": "prop_formit.emailhtml_desc", + "type": "combo-boolean", + "value": "1" + },{ + "name": "emailConvertNewlines", + "description": "prop_formit.emailconvertnewlines_desc", + "type": "combo-boolean", + "value": "0" + },{ + "name": "emailMultiWrapper", + "description": "prop_formit.emailmultiwrapper_desc", + "value": "[[+value]]" + },{ + "name": "emailMultiSeparator", + "description": "prop_formit.emailmultiseparator_desc", + "value": "" + },{ + "name": "fiarTpl", + "description": "prop_formit.fiartpl_desc", + "value": "" + },{ + "name": "fiarToField", + "description": "prop_formit.fiartofield_desc", + "value": "email" + },{ + "name": "fiarSubject", + "description": "prop_formit.fiarsubject_desc", + "value": "[[++site_name]] Auto-Responder" + },{ + "name": "fiarFrom", + "description": "prop_formit.fiarfrom_desc", + "value": "" + },{ + "name": "fiarFromName", + "description": "prop_formit.fiarfromname_desc", + "value": "" + },{ + "name": "fiarReplyTo", + "description": "prop_formit.fiarreplyto_desc", + "value": "" + },{ + "name": "fiarReplyToName", + "description": "prop_formit.fiarreplytoname_desc", + "value": "" + },{ + "name": "fiarCC", + "description": "prop_formit.fiarcc_desc", + "value": "" + },{ + "name": "fiarCCName", + "description": "prop_fiar.fiarccname_desc", + "value": "" + },{ + "name": "fiarBCC", + "description": "prop_formit.fiarbcc_desc", + "value": "" + },{ + "name": "fiarBCCName", + "description": "prop_formit.fiarbccname_desc", + "value": "" + },{ + "name": "fiarHtml", + "description": "prop_formit.fiarhtml_desc", + "type": "combo-boolean", + "value": "1" + },{ + "name": "mathMinRange", + "description": "prop_formit.mathminrange_desc", + "value": "10" + },{ + "name": "mathMaxRange", + "description": "prop_formit.mathmaxrange_desc", + "value": "100" + },{ + "name": "mathField", + "description": "prop_formit.mathfield_desc", + "value": "math" + },{ + "name": "mathOp1Field", + "description": "prop_formit.mathop1field_desc", + "value": "op1" + },{ + "name": "mathOp2Field", + "description": "prop_formit.mathop2field_desc", + "value": "op2" + },{ + "name": "mathOperatorField", + "description": "prop_formit.mathoperatorfield_desc", + "value": "operator" + },{ + "name": "saveTmpFiles", + "description": "prop_formit.savetmpfiles_desc", + "type": "combo-boolean", + "value": "0" + },{ + "name": "attachFilesToEmail", + "description": "prop_formit.attachfiles_desc", + "type": "combo-boolean", + "value": "1" + },{ + "name": "storeAttachments", + "description": "prop_formit.store_attachments_desc", + "type": "combo-boolean", + "value": "0" + }] + },{ + "name": "FormItRetriever", + "description": "Fetches a form submission for a user for displaying on a thank you page.", + "file": "snippet.formitretriever.php", + "properties": [{ + "name": "placeholderPrefix", + "description": "prop_fir.placeholderprefix_desc", + "value": "fi." + },{ + "name": "redirectToOnNotFound", + "description": "prop_fir.redirecttoonnotfound_desc", + "value": "" + },{ + "name": "eraseOnLoad", + "description": "prop_fir.eraseonload_desc", + "type": "combo-boolean", + "value": "0" + },{ + "name": "storeLocation", + "description": "prop_fir.storelocation_desc", + "type": "list", + "options": [{ + "name": "formit.opt_cache", + "value": "cache" + },{ + "name": "formit.opt_session", + "value": "session" + }], + "value": "cache" + }] + },{ + "name": "FormItIsChecked", + "description": "A custom output filter used with checkboxes/radios for checking checked status.", + "file": "snippet.formitischecked.php", + "properties": [] + },{ + "name": "FormItIsSelected", + "description": "A custom output filter used with dropdowns for checking selected status.", + "file": "snippet.formitisselected.php", + "properties": [] + },{ + "name": "FormItCountryOptions", + "description": "A utility snippet for generating a dropdown list of countries.", + "file": "snippet.formitcountryoptions.php", + "properties": [{ + "name": "selected", + "description": "prop_fico.selected_desc", + "value": "" + },{ + "name": "tpl", + "description": "prop_fico.tpl_desc", + "value": "fiDefaultOptionTpl" + },{ + "name": "useIsoCode", + "description": "prop_fico.useisocode_desc", + "type": "combo-boolean", + "value": "1" + },{ + "name": "prioritized", + "description": "prop_fico.prioritized_desc", + "value": "" + },{ + "name": "optGroupTpl", + "description": "prop_fico.optgrouptpl_desc", + "value": "fiDefaultOptGroupTpl" + },{ + "name": "prioritizedGroupText", + "description": "prop_fico.prioritizedgrouptext_desc", + "value": "" + },{ + "name": "allGroupText", + "description": "prop_fico.allgrouptext_desc", + "value": "" + },{ + "name": "selectedAttribute", + "description": "prop_fico.selectedattribute_desc", + "value": " selected=\"selected\"" + },{ + "name": "toPlaceholder", + "description": "prop_fico.toplaceholder_desc", + "value": "" + },{ + "name": "country", + "description": "prop_fico.country_desc", + "value": "[[++cultureKey]]" + },{ + "name": "limited", + "description": "prop_fico.limited_desc", + "value": "" + }] + },{ + "name": "FormItStateOptions", + "description": "A utility snippet for generating a dropdown list of U.S. states.", + "file": "snippet.formitstateoptions.php", + "properties": [{ + "name": "selected", + "description": "prop_fiso.selected_desc", + "value": "" + },{ + "name": "tpl", + "description": "prop_fiso.tpl_desc", + "value": "fiDefaultOptionTpl" + },{ + "name": "useAbbr", + "description": "prop_fiso.useabbr_desc", + "type": "combo-boolean", + "value": "1" + },{ + "name": "selectedAttribute", + "description": "prop_fiso.selectedattribute_desc", + "value": " selected=\"selected\"" + },{ + "name": "toPlaceholder", + "description": "prop_fiso.toplaceholder_desc", + "value": "" + },{ + "name": "country", + "description": "prop_fiso.country_desc", + "value": "[[++cultureKey]]" + }] + },{ + "name": "FormItLoadSavedForm", + "description": "Prehook to load previously saved form.", + "file": "snippet.formitloadsavedform.php" + }] + }, + "systemSettings": [{ + "key": "recaptcha_public_key", + "type": "textfield", + "area": "recaptcha", + "value": "" + },{ + "key": "recaptcha_private_key", + "type": "textfield", + "area": "recaptcha", + "value": "" + },{ + "key": "recaptcha_use_ssl", + "type": "combo-boolean", + "area": "recaptcha", + "value": "0" + },{ + "key": "exclude_contexts", + "type": "combo-boolean", + "area": "system", + "value": "mgr" + },{ + "key": "form_encryptkey", + "type": "textfield", + "area": "system", + "value": "" + },{ + "key": "attachment.mediasource", + "type": "modx-combo-source", + "area": "system", + "value": 1 + },{ + "key": "attachment.path", + "type": "textfield", + "area": "system", + "value": "" + },{ + "key": "export_csv_delimiter", + "type": "textfield", + "area": "system", + "value": ";" + },{ + "key": "cleanform.days", + "type": "numberfield", + "area": "system", + "value": "30" + }] + }, + "database": { + "tables": [ + "FormItForm" + ] + }, + "build": { + "readme": "docs/readme.txt", + "license": "docs/license.txt", + "changelog": "docs/changelog.txt", + "resolver": { + "after": [ + "resolve.tables.php", + "setupoptions.resolver.php", + "stercextra.resolver.php", + "resolve.cron.php" + ] + }, + "setupOptions":{ + "source": "setup.options.php" + } + } +} diff --git a/_build/_archive/data/transport.menu.php b/_build/_archive/data/transport.menu.php new file mode 100644 index 00000000..cce8e75f --- /dev/null +++ b/_build/_archive/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/_archive/data/transport.settings.php similarity index 58% rename from _build/data/transport.settings.php rename to _build/_archive/data/transport.settings.php index 6f67fdfb..f708ec2f 100644 --- a/_build/data/transport.settings.php +++ b/_build/_archive/data/transport.settings.php @@ -33,7 +33,7 @@ 'value' => '', 'xtype' => 'textfield', 'namespace' => 'formit', - 'area' => 'reCaptcha', + 'area' => 'recaptcha', ),'',true,true); $settings['formit.recaptcha_private_key']= $modx->newObject('modSystemSetting'); @@ -42,7 +42,7 @@ 'value' => '', 'xtype' => 'textfield', 'namespace' => 'formit', - 'area' => 'reCaptcha', + 'area' => 'recaptcha', ),'',true,true); $settings['formit.recaptcha_use_ssl']= $modx->newObject('modSystemSetting'); @@ -51,7 +51,43 @@ 'value' => false, 'xtype' => 'combo-boolean', 'namespace' => 'formit', - 'area' => 'reCaptcha', + '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); + +$settings['formit.attachment.mediasource']= $modx->newObject('modSystemSetting'); +$settings['formit.attachment.mediasource']->fromArray(array( + 'key' => 'formit.attachment.mediasource', + 'value' => '1', + 'xtype' => 'modx-combo-source', + 'namespace' => 'formit', + 'area' => '', +),'',true,true); + +$settings['formit.attachment.path']= $modx->newObject('modSystemSetting'); +$settings['formit.attachment.path']->fromArray(array( + 'key' => 'formit.attachment.path', + 'value' => '', + 'xtype' => 'textfield', + 'namespace' => 'formit', + 'area' => '', +),'',true,true); + +$settings['formit.cleanform.days']= $modx->newObject('modSystemSetting'); +$settings['formit.cleanform.days']->fromArray(array( + 'key' => 'formit.cleanform.days', + 'value' => '90', + 'xtype' => 'numberfield', + 'namespace' => 'formit', + 'area' => '', ),'',true,true); return $settings; \ No newline at end of file diff --git a/_build/data/transport.snippets.php b/_build/_archive/data/transport.snippets.php similarity index 86% rename from _build/data/transport.snippets.php rename to _build/_archive/data/transport.snippets.php index 19f383f0..65289ab5 100644 --- a/_build/data/transport.snippets.php +++ b/_build/_archive/data/transport.snippets.php @@ -43,7 +43,6 @@ 'description' => 'Custom hook for FormIt to handle Auto-Response emails.', 'snippet' => getSnippetContent($sources['source_core'].'/elements/snippets/snippet.formitautoresponder.php'), ),'',true,true); -unset($properties); $snippets[2]= $modx->newObject('modSnippet'); $snippets[2]->fromArray(array( @@ -94,6 +93,24 @@ $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); + +$snippets[8]= $modx->newObject('modSnippet'); +$snippets[8]->fromArray(array( + 'id' => 8, + 'name' => 'FormItLoadSavedForm', + 'description' => 'Prehook to load previously saved form.', + 'snippet' => getSnippetContent($sources['source_core'].'/elements/snippets/snippet.formitloadsavedform.php'), +),'',true,true); +unset($properties); + + /* $snippets[0]= $modx->newObject('modSnippet'); $snippets[0]->fromArray(array( @@ -107,4 +124,4 @@ unset($properties); */ -return $snippets; \ No newline at end of file +return $snippets; diff --git a/_build/docblox.xml b/_build/_archive/docblox.xml similarity index 100% rename from _build/docblox.xml rename to _build/_archive/docblox.xml diff --git a/_build/_archive/gpm_resolvers/gpm.resolve.tables.php b/_build/_archive/gpm_resolvers/gpm.resolve.tables.php new file mode 100644 index 00000000..77aee544 --- /dev/null +++ b/_build/_archive/gpm_resolvers/gpm.resolve.tables.php @@ -0,0 +1,35 @@ +xpdo) { + $modx =& $object->xpdo; + switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + case xPDOTransport::ACTION_UPGRADE: + $modelPath = $modx->getOption('formit.core_path', null, $modx->getOption('core_path') . 'components/formit/') . 'model/'; + + $modx->addPackage('formit', $modelPath, null); + + + + $manager = $modx->getManager(); + + $manager->createObjectContainer('FormItForm'); + + + break; + } +} + +return true; \ No newline at end of file diff --git a/_build/includes/functions.php b/_build/_archive/includes/functions.php similarity index 100% rename from _build/includes/functions.php rename to _build/_archive/includes/functions.php diff --git a/_build/properties/properties.formit.php b/_build/_archive/properties/properties.formit.php similarity index 95% rename from _build/properties/properties.formit.php rename to _build/_archive/properties/properties.formit.php index 52046f1d..2e2a5410 100644 --- a/_build/properties/properties.formit.php +++ b/_build/_archive/properties/properties.formit.php @@ -146,6 +146,17 @@ 'value' => 300, 'lexicon' => 'formit:properties', ), + array( + 'name' => 'storeLocation', + 'desc' => 'prop_formit.storelocation_desc', + 'type' => 'list', + 'options' => array( + array('text' => 'formit.opt_cache','value' => 'cache'), + array('text' => 'formit.opt_session','value' => 'session') + ), + 'value' => 'cache', + 'lexicon' => 'formit:properties', + ), array( 'name' => 'allowFiles', 'desc' => 'prop_formit.allowfiles_desc', @@ -309,6 +320,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', @@ -352,7 +371,7 @@ array( 'name' => 'emailMultiSeparator', 'desc' => 'prop_formit.emailmultiseparator_desc', - 'type' => 'combo-boolean', + 'type' => 'textfield', 'options' => '', 'value' => '', 'lexicon' => 'formit:properties', @@ -506,4 +525,4 @@ ), ); -return $properties; \ No newline at end of file +return $properties; diff --git a/_build/properties/properties.formitcountryoptions.php b/_build/_archive/properties/properties.formitcountryoptions.php similarity index 91% rename from _build/properties/properties.formitcountryoptions.php rename to _build/_archive/properties/properties.formitcountryoptions.php index 713831fd..29907bc2 100644 --- a/_build/properties/properties.formitcountryoptions.php +++ b/_build/_archive/properties/properties.formitcountryoptions.php @@ -39,7 +39,7 @@ 'desc' => 'prop_fico.tpl_desc', 'type' => 'textfield', 'options' => '', - 'value' => 'option', + 'value' => 'fiDefaultOptionTpl', 'lexicon' => 'formit:properties', ), array( @@ -50,6 +50,14 @@ 'value' => true, 'lexicon' => 'formit:properties', ), + array( + 'name' => 'limited', + 'desc' => 'prop_fico.limited_desc', + 'type' => 'textfield', + 'options' => '', + 'value' => '', + 'lexicon' => 'formit:properties', + ), array( 'name' => 'prioritized', 'desc' => 'prop_fico.prioritized_desc', @@ -63,7 +71,7 @@ 'desc' => 'prop_fico.optgrouptpl_desc', 'type' => 'textfield', 'options' => '', - 'value' => 'optgroup', + 'value' => 'fiDefaultOptGroupTpl', 'lexicon' => 'formit:properties', ), array( diff --git a/_build/properties/properties.formitretriever.php b/_build/_archive/properties/properties.formitretriever.php similarity index 100% rename from _build/properties/properties.formitretriever.php rename to _build/_archive/properties/properties.formitretriever.php diff --git a/_build/properties/properties.formitstateoptions.php b/_build/_archive/properties/properties.formitstateoptions.php similarity index 98% rename from _build/properties/properties.formitstateoptions.php rename to _build/_archive/properties/properties.formitstateoptions.php index cabf11ce..a5a6e072 100644 --- a/_build/properties/properties.formitstateoptions.php +++ b/_build/_archive/properties/properties.formitstateoptions.php @@ -39,7 +39,7 @@ 'desc' => 'prop_fiso.tpl_desc', 'type' => 'textfield', 'options' => '', - 'value' => 'option', + 'value' => 'fiDefaultOptionTpl', 'lexicon' => 'formit:properties', ), array( @@ -59,19 +59,19 @@ 'lexicon' => 'formit:properties', ), array( - 'name' => 'country', - 'desc' => 'prop_fiso.country_desc', + 'name' => 'toPlaceholder', + 'desc' => 'prop_fiso.toplaceholder_desc', 'type' => 'textfield', 'options' => '', - 'value' => '[[++cultureKey]]', + 'value' => '', 'lexicon' => 'formit:properties', ), array( - 'name' => 'toPlaceholder', - 'desc' => 'prop_fiso.toplaceholder_desc', + 'name' => 'country', + 'desc' => 'prop_fiso.country_desc', 'type' => 'textfield', 'options' => '', - 'value' => '', + 'value' => '[[++cultureKey]]', 'lexicon' => 'formit:properties', ), ); diff --git a/_build/_archive/resolvers/resolve.cron.php b/_build/_archive/resolvers/resolve.cron.php new file mode 100644 index 00000000..233dd220 --- /dev/null +++ b/_build/_archive/resolvers/resolve.cron.php @@ -0,0 +1,24 @@ +xpdo) { + switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + case xPDOTransport::ACTION_UPGRADE: + $modx =& $object->xpdo; + + $formitPath = $modx->getOption('formit.assets_path', null, MODX_ASSETS_PATH . 'components/formit/'); + $cronjobPath = $formitPath . 'cronjob/cron.php'; + + $modx->log(modX::LOG_LEVEL_INFO, + 'You can setup a cronjob for automatically cleaning up of old forms, please use the following path: ' + . $cronjobPath + ); + break; + } +} +return true; \ No newline at end of file diff --git a/_build/_archive/resolvers/resolve.paths.php b/_build/_archive/resolvers/resolve.paths.php new file mode 100644 index 00000000..8b5ea627 --- /dev/null +++ b/_build/_archive/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/_archive/resolvers/resolve.tables.php b/_build/_archive/resolvers/resolve.tables.php new file mode 100644 index 00000000..0818fe13 --- /dev/null +++ b/_build/_archive/resolvers/resolve.tables.php @@ -0,0 +1,122 @@ +getTableName($table); + $tableName = str_replace('`', '', $tableName); + $dbname = $modx->getOption('dbname'); + + $c = $modx->prepare("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = :dbName AND table_name = :tableName"); + $c->bindParam(':dbName', $dbname); + $c->bindParam(':tableName', $tableName); + $c->execute(); + + $unusedColumns = $c->fetchAll(PDO::FETCH_COLUMN, 0); + $unusedColumns = array_flip($unusedColumns); + + $meta = $modx->getFieldMeta($table); + $columns = array_keys($meta); + + $m = $modx->getManager(); + + foreach ($columns as $column) { + if (isset($unusedColumns[$column])) { + $m->alterField($table, $column); + $modx->log(modX::LOG_LEVEL_INFO, ' -- altered column: ' . $column); + unset($unusedColumns[$column]); + } else { + $m->addField($table, $column); + $modx->log(modX::LOG_LEVEL_INFO, ' -- added column: ' . $column); + } + } + + foreach ($unusedColumns as $column => $v) { + $m->removeField($table, $column); + $modx->log(modX::LOG_LEVEL_INFO, ' -- removed column: ' . $column); + } + } +} + +if (!function_exists('updateTableIndexes')) { + /** + * @param modX $modx + * @param string $table + */ + function updateTableIndexes($modx, $table) + { + $tableName = $modx->getTableName($table); + $tableName = str_replace('`', '', $tableName); + $dbname = $modx->getOption('dbname'); + + $c = $modx->prepare("SELECT DISTINCT INDEX_NAME FROM INFORMATION_SCHEMA.STATISTICS WHERE table_schema = :dbName AND table_name = :tableName AND INDEX_NAME != 'PRIMARY'"); + $c->bindParam(':dbName', $dbname); + $c->bindParam(':tableName', $tableName); + $c->execute(); + + $oldIndexes = $c->fetchAll(PDO::FETCH_COLUMN, 0); + + $m = $modx->getManager(); + + foreach ($oldIndexes as $oldIndex) { + $m->removeIndex($table, $oldIndex); + $modx->log(modX::LOG_LEVEL_INFO, ' -- removed index: ' . $oldIndex); + } + + $meta = $modx->getIndexMeta($table); + $indexes = array_keys($meta); + + foreach ($indexes as $index) { + if ($index == 'PRIMARY') continue; + $m->addIndex($table, $index); + $modx->log(modX::LOG_LEVEL_INFO, ' -- added index: ' . $index); + } + } +} + +if (!function_exists('alterTable')) { + /** + * @param modX $modx + * @param string $table + */ + function alterTable($modx, $table) + { + $modx->log(modX::LOG_LEVEL_INFO, ' - Updating columns'); + updateTableColumns($modx, $table); + + $modx->log(modX::LOG_LEVEL_INFO, ' - Updating indexes'); + updateTableIndexes($modx, $table); + } +} + +if ($object->xpdo) { + switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_UPGRADE: + /** @var modX $modx */ + $modx =& $object->xpdo; + + $tables = array( + 'FormItForm' + ); + $modelPath = $modx->getOption('formit.core_path', null, $modx->getOption('core_path').'components/formit/').'model/'; + $modx->addPackage('formit', $modelPath); + foreach ($tables as $table) { + $modx->log(modX::LOG_LEVEL_INFO, 'Altering table: ' . $table); + alterTable($modx, $table); + } + + break; + } +} +return true; \ No newline at end of file diff --git a/_build/_archive/resolvers/setupoptions.resolver.php b/_build/_archive/resolvers/setupoptions.resolver.php new file mode 100644 index 00000000..a92c1dac --- /dev/null +++ b/_build/_archive/resolvers/setupoptions.resolver.php @@ -0,0 +1,40 @@ +xpdo->getObject( + 'modSystemSetting', + array('key' => strtolower($package) . '.' . $key) + ); + if (!$settingObject) { + $settingObject = $object->xpdo->newObject('modSystemSetting'); + $settingObject->set('key', strtolower($package) . '.' . $key); + } + $settingObject->set('value', $options[$key]); + $settingObject->save(); + } + } + + $success = true; + break; + case xPDOTransport::ACTION_UNINSTALL: + $success = true; + break; +} + +return $success; diff --git a/_build/_archive/resolvers/stercextra.resolver.php b/_build/_archive/resolvers/stercextra.resolver.php new file mode 100644 index 00000000..acd88e42 --- /dev/null +++ b/_build/_archive/resolvers/stercextra.resolver.php @@ -0,0 +1,118 @@ +xpdo; +$c = $modx->newQuery('transport.modTransportPackage'); +$c->where( + array( + 'workspace' => 1, + "(SELECT + `signature` + FROM {$modx->getTableName('modTransportPackage')} AS `latestPackage` + WHERE `latestPackage`.`package_name` = `modTransportPackage`.`package_name` + ORDER BY + `latestPackage`.`version_major` DESC, + `latestPackage`.`version_minor` DESC, + `latestPackage`.`version_patch` DESC, + IF(`release` = '' OR `release` = 'ga' OR `release` = 'pl','z',`release`) DESC, + `latestPackage`.`release_index` DESC + LIMIT 1,1) = `modTransportPackage`.`signature`", + ) +); +$c->where( + array( + array( + 'modTransportPackage.package_name' => strtolower($package) + ), + 'installed:IS NOT' => null + ) +); +$c->limit(1); + +/** @var modTransportPackage $oldPackage */ +$oldPackage = $modx->getObject('transport.modTransportPackage', $c); + +$oldVersion = ''; +if ($oldPackage) { + $oldVersion = $oldPackage->get('version_major') . '.' . $oldPackage->get('version_minor'); + $oldVersion .= '.' . $oldPackage->get('version_patch'); + $oldVersion .= '-' . $oldPackage->get('release'); +} + +$version = ''; +if ($options['topic']) { + $topic = trim($options['topic'], '/'); + $topic = explode('/', $topic); + $signature = end($topic); + $version = str_replace(strtolower($package) . '-', '', $signature); +} + +$userNameObj = $modx->getObject( + 'modSystemSetting', + array('key' => strtolower($package) . '.user_name') +); +$userName = ($userNameObj) ? $userNameObj->get('value') : ''; + +$userEmailObj = $modx->getObject( + 'modSystemSetting', + array('key' => strtolower($package) . '.user_email') +); +$userEmail = ($userEmailObj) ? $userEmailObj->get('value') : ''; + +$modxVersionObj = $modx->getObject('modSystemSetting', array('key' => 'settings_version')); +$modxVersion = ($modxVersionObj) ? $modxVersionObj->get('value') : ''; +$managerLang = $modx->getOption('manager_language'); + +$action = ''; +switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + $action = 'install'; + break; + case xPDOTransport::ACTION_UPGRADE: + $action = 'upgrade'; + break; + case xPDOTransport::ACTION_UNINSTALL: + $action = 'uninstall'; + + $version = $oldVersion; + $setupOptionsPath = explode('/', $options['setup-options']); + $signature = $setupOptionsPath[0]; + $oldVersion = str_replace(strtolower($package) . '-', '', $signature); + + break; +} + +$params = array( + 'name' => $options['namespace'], + 'url' => $_SERVER['SERVER_NAME'], + 'user_name' => $userName, + 'user_email' => $userEmail, + 'php_version' => phpversion(), + 'modx_version' => $modxVersion, + 'manager_lang' => $managerLang, + 'installation_type' => $action, + 'package_version_from' => $oldVersion, + 'package_version' => $version, + 'date' => time() +); + +/** + * Curl POST. + */ +$curl = curl_init(); +curl_setopt($curl, CURLOPT_URL, $url); +curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: STERC-A64XHC7PNY8G61L79E')); +curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); +curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 120); +curl_setopt($curl, CURLOPT_POST, true); +curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($params)); +curl_setopt($curl, CURLOPT_TIMEOUT, 120); + +$response = curl_exec($curl); +$responseInfo = curl_getinfo($curl); +$curlError = curl_error($curl); +curl_close($curl); + +return true; diff --git a/_build/schema/formit.mysql.schema.xml b/_build/_archive/schema/formit.mysql.schema.xml similarity index 100% rename from _build/schema/formit.mysql.schema.xml rename to _build/_archive/schema/formit.mysql.schema.xml diff --git a/_build/_archive/setup.options.php b/_build/_archive/setup.options.php new file mode 100644 index 00000000..fc1a3168 --- /dev/null +++ b/_build/_archive/setup.options.php @@ -0,0 +1,65 @@ + 'user_name', + 'value' => '', + 'name' => 'Name' + ), + array( + 'key' => 'user_email', + 'value' => '', + 'name' => 'Email' + ), +); +switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + case xPDOTransport::ACTION_UPGRADE: + foreach ($settings as $key => $setting) { + $settingObject = $modx->getObject( + 'modSystemSetting', + array('key' => strtolower($package) . '.' . $setting['key']) + ); + if ($settingObject) { + $settings[$key]['value'] = $settingObject->get('value'); + } + } + break; + case xPDOTransport::ACTION_UNINSTALL: + break; +} + +$output = array(); + +/* Hide default setuptoptions text */ +$output[] = ' + + + + +

    Get free priority updates

    +

    Enter your name and email address below to receive priority updates about our extras. +Be the first to know about Extra updates and new features. +It is not required to enter your name and email to use this extra.

    '; + +foreach ($settings as $setting) { + $str = ''; + $str .= ''; + + $output[] = $str; +} + +return implode('

    ', $output); diff --git a/core/components/formit/test/Data/Chunks/emailhook.chunk.tpl b/_build/_archive/test/Data/Chunks/emailhook.chunk.tpl similarity index 100% rename from core/components/formit/test/Data/Chunks/emailhook.chunk.tpl rename to _build/_archive/test/Data/Chunks/emailhook.chunk.tpl diff --git a/core/components/formit/test/FiTestCase.php b/_build/_archive/test/FiTestCase.php similarity index 100% rename from core/components/formit/test/FiTestCase.php rename to _build/_archive/test/FiTestCase.php diff --git a/core/components/formit/test/FiTestHarness.php b/_build/_archive/test/FiTestHarness.php similarity index 100% rename from core/components/formit/test/FiTestHarness.php rename to _build/_archive/test/FiTestHarness.php diff --git a/core/components/formit/test/Tests/Cases/AutoResponder/AutoResponderBasicTest.php b/_build/_archive/test/Tests/Cases/AutoResponder/AutoResponderBasicTest.php similarity index 100% rename from core/components/formit/test/Tests/Cases/AutoResponder/AutoResponderBasicTest.php rename to _build/_archive/test/Tests/Cases/AutoResponder/AutoResponderBasicTest.php diff --git a/core/components/formit/test/Tests/Cases/Basic/EmailHookTest.php b/_build/_archive/test/Tests/Cases/Basic/EmailHookTest.php similarity index 100% rename from core/components/formit/test/Tests/Cases/Basic/EmailHookTest.php rename to _build/_archive/test/Tests/Cases/Basic/EmailHookTest.php diff --git a/core/components/formit/test/Tests/Cases/Basic/InlineValidatorTest.php b/_build/_archive/test/Tests/Cases/Basic/InlineValidatorTest.php similarity index 100% rename from core/components/formit/test/Tests/Cases/Basic/InlineValidatorTest.php rename to _build/_archive/test/Tests/Cases/Basic/InlineValidatorTest.php diff --git a/core/components/formit/test/Tests/Cases/Basic/MathHookTest.php b/_build/_archive/test/Tests/Cases/Basic/MathHookTest.php similarity index 100% rename from core/components/formit/test/Tests/Cases/Basic/MathHookTest.php rename to _build/_archive/test/Tests/Cases/Basic/MathHookTest.php diff --git a/core/components/formit/test/Tests/Cases/Basic/PostHookTest.php b/_build/_archive/test/Tests/Cases/Basic/PostHookTest.php similarity index 100% rename from core/components/formit/test/Tests/Cases/Basic/PostHookTest.php rename to _build/_archive/test/Tests/Cases/Basic/PostHookTest.php diff --git a/core/components/formit/test/Tests/Cases/Basic/PreHookTest.php b/_build/_archive/test/Tests/Cases/Basic/PreHookTest.php similarity index 100% rename from core/components/formit/test/Tests/Cases/Basic/PreHookTest.php rename to _build/_archive/test/Tests/Cases/Basic/PreHookTest.php diff --git a/core/components/formit/test/Tests/Cases/Basic/SingleFieldTest.php b/_build/_archive/test/Tests/Cases/Basic/SingleFieldTest.php similarity index 100% rename from core/components/formit/test/Tests/Cases/Basic/SingleFieldTest.php rename to _build/_archive/test/Tests/Cases/Basic/SingleFieldTest.php diff --git a/core/components/formit/test/Tests/Cases/Basic/SpamHookTest.php b/_build/_archive/test/Tests/Cases/Basic/SpamHookTest.php similarity index 100% rename from core/components/formit/test/Tests/Cases/Basic/SpamHookTest.php rename to _build/_archive/test/Tests/Cases/Basic/SpamHookTest.php diff --git a/core/components/formit/test/Tests/Cases/Basic/ValidationTest.php b/_build/_archive/test/Tests/Cases/Basic/ValidationTest.php similarity index 100% rename from core/components/formit/test/Tests/Cases/Basic/ValidationTest.php rename to _build/_archive/test/Tests/Cases/Basic/ValidationTest.php diff --git a/core/components/formit/test/Tests/Core/FiDictionaryTest.php b/_build/_archive/test/Tests/Core/FiDictionaryTest.php similarity index 100% rename from core/components/formit/test/Tests/Core/FiDictionaryTest.php rename to _build/_archive/test/Tests/Core/FiDictionaryTest.php diff --git a/core/components/formit/test/Tests/Core/FiRequestTest.php b/_build/_archive/test/Tests/Core/FiRequestTest.php similarity index 100% rename from core/components/formit/test/Tests/Core/FiRequestTest.php rename to _build/_archive/test/Tests/Core/FiRequestTest.php diff --git a/core/components/formit/test/Tests/Core/FormItClassTest.php b/_build/_archive/test/Tests/Core/FormItClassTest.php similarity index 100% rename from core/components/formit/test/Tests/Core/FormItClassTest.php rename to _build/_archive/test/Tests/Core/FormItClassTest.php diff --git a/core/components/formit/test/Tests/Modules/FiCountryOptionsTest.php b/_build/_archive/test/Tests/Modules/FiCountryOptionsTest.php similarity index 100% rename from core/components/formit/test/Tests/Modules/FiCountryOptionsTest.php rename to _build/_archive/test/Tests/Modules/FiCountryOptionsTest.php diff --git a/core/components/formit/test/Tests/Modules/FiStateOptionsTest.php b/_build/_archive/test/Tests/Modules/FiStateOptionsTest.php similarity index 100% rename from core/components/formit/test/Tests/Modules/FiStateOptionsTest.php rename to _build/_archive/test/Tests/Modules/FiStateOptionsTest.php diff --git a/core/components/formit/test/config.sample.inc.php b/_build/_archive/test/config.sample.inc.php similarity index 100% rename from core/components/formit/test/config.sample.inc.php rename to _build/_archive/test/config.sample.inc.php diff --git a/core/components/formit/test/hooks/post/posthooktest.adderror.php b/_build/_archive/test/hooks/post/posthooktest.adderror.php similarity index 100% rename from core/components/formit/test/hooks/post/posthooktest.adderror.php rename to _build/_archive/test/hooks/post/posthooktest.adderror.php diff --git a/core/components/formit/test/hooks/post/posthooktest.fail.php b/_build/_archive/test/hooks/post/posthooktest.fail.php similarity index 100% rename from core/components/formit/test/hooks/post/posthooktest.fail.php rename to _build/_archive/test/hooks/post/posthooktest.fail.php diff --git a/core/components/formit/test/hooks/post/posthooktest.redirecturl.php b/_build/_archive/test/hooks/post/posthooktest.redirecturl.php similarity index 100% rename from core/components/formit/test/hooks/post/posthooktest.redirecturl.php rename to _build/_archive/test/hooks/post/posthooktest.redirecturl.php diff --git a/core/components/formit/test/hooks/post/posthooktest.setvalues.php b/_build/_archive/test/hooks/post/posthooktest.setvalues.php similarity index 100% rename from core/components/formit/test/hooks/post/posthooktest.setvalues.php rename to _build/_archive/test/hooks/post/posthooktest.setvalues.php diff --git a/core/components/formit/test/hooks/pre/prehooktest.setvalue.php b/_build/_archive/test/hooks/pre/prehooktest.setvalue.php similarity index 100% rename from core/components/formit/test/hooks/pre/prehooktest.setvalue.php rename to _build/_archive/test/hooks/pre/prehooktest.setvalue.php diff --git a/core/components/formit/test/phpunit.xml b/_build/_archive/test/phpunit.xml similarity index 100% rename from core/components/formit/test/phpunit.xml rename to _build/_archive/test/phpunit.xml diff --git a/core/components/formit/test/properties.sample.inc.php b/_build/_archive/test/properties.sample.inc.php similarity index 100% rename from core/components/formit/test/properties.sample.inc.php rename to _build/_archive/test/properties.sample.inc.php diff --git a/_build/config.json b/_build/config.json new file mode 100644 index 00000000..8994e67e --- /dev/null +++ b/_build/config.json @@ -0,0 +1,509 @@ +{ + "name": "FormIt", + "lowCaseName": "formit", + "description": "FormIt is a dynamic form processing Snippet for MODx Revolution. It handles a form after submission, performing validation and followup actions like sending an email. It does not generate the form, but it can repopulate it if it fails validation.", + "author": "Sterc", + "version": "4.2.7", + "package": { + "menus": [{ + "text": "formit", + "description": "formit.desc", + "parent": "components", + "action": "home", + "permissions": "formit" + }], + "elements": { + "chunks": [{ + "name": "fiDefaultEmailTpl", + "file": "email.chunk.tpl", + "description": "The default chunk used for the email. Please do not edit this chunk, as this will be overwritten when updating FormIt." + },{ + "name": "fiDefaultFiarTpl", + "file": "fiartpl.chunk.tpl", + "description": "The default chunk used for the autoresponder email. Please do not edit this chunk, as this will be overwritten when updating FormIt." + },{ + "name": "fiDefaultOptGroupTpl", + "file": "optgroup.chunk.tpl", + "description": "The default chunk used by the FormItCountryOptions snippet for the select optgroup. Please do not edit this chunk, as this will be overwritten when updating FormIt." + },{ + "name": "fiDefaultOptionTpl", + "file": "option.chunk.tpl", + "description": "The default chunk used by the FormItCountryOptions snippet for the select option. Please do not edit this chunk, as this will be overwritten when updating FormIt." + }], + "plugins": [{ + "name": "FormIt", + "file": "formit.plugin.php", + "events": [ + "OnManagerPageBeforeRender" + ] + }], + "snippets": [{ + "name": "FormIt", + "description": "A dynamic form processing snippet.", + "file": "snippet.formit.php", + "properties": [{ + "name": "hooks", + "description": "prop_formit.hooks_desc", + "value": "" + },{ + "name": "preHooks", + "description": "prop_formit.prehooks_desc", + "value": "" + },{ + "name": "submitVar", + "description": "prop_formit.submitvar_desc", + "value": "" + },{ + "name": "validate", + "description": "prop_formit.validate_desc", + "value": "" + },{ + "name": "errTpl", + "description": "prop_formit.errtpl_desc", + "value": "[[+error]]" + },{ + "name": "validationErrorMessage", + "description": "prop_formit.validationerrormessage_desc", + "value": "

    A form validation error occurred. Please check the values you have entered.

    " + },{ + "name": "validationErrorBulkTpl", + "description": "prop_formit.validationerrorbulktpl_desc", + "value": "
  • [[+error]]
  • " + },{ + "name": "trimValuesBeforeValidation", + "description": "prop_formit.trimvaluesdeforevalidation_desc", + "type": "combo-boolean", + "value": "1" + },{ + "name": "customValidators", + "description": "prop_formit.customvalidators_desc", + "value": "" + },{ + "name": "clearFieldsOnSuccess", + "description": "prop_formit.clearfieldsonsuccess_desc", + "type": "combo-boolean", + "value": "1" + },{ + "name": "successMessage", + "description": "prop_formit.successmessage_desc", + "value": "" + },{ + "name": "successMessagePlaceholder", + "description": "prop_formit.successmessageplaceholder_desc", + "value": "fi.successMessage" + },{ + "name": "store", + "description": "prop_formit.store_desc", + "type": "combo-boolean", + "value": "0" + },{ + "name": "placeholderPrefix", + "description": "prop_formit.placeholderprefix_desc", + "value": "fi." + },{ + "name": "storeTime", + "description": "prop_formit.storetime_desc", + "value": "300" + },{ + "name": "storeLocation", + "description": "prop_formit.storelocation_desc", + "type": "list", + "options": [{ + "name": "formit.opt_cache", + "value": "cache" + },{ + "name": "formit.opt_session", + "value": "session" + }], + "value": "cache" + },{ + "name": "allowFiles", + "description": "prop_formit.allowfiles_desc", + "type": "combo-boolean", + "value": "0" + },{ + "name": "spamEmailFields", + "description": "prop_formit.spamemailfields_desc", + "value": "email" + },{ + "name": "spamCheckIp", + "description": "prop_formit.spamcheckip_desc", + "type": "combo-boolean", + "value": "0" + },{ + "name": "recaptchaJs", + "description": "prop_formit.recaptchajs_desc", + "value": "{}" + },{ + "name": "recaptchaTheme", + "description": "prop_formit.recaptchatheme_desc", + "type": "list", + "options": [{ + "name": "formit.opt_red", + "value": "red" + },{ + "name": "formit.opt_white", + "value": "white" + },{ + "name": "formit.opt_clean", + "value": "clean" + },{ + "name": "formit.opt_blackglass", + "value": "blackglass" + }], + "value": "clean" + },{ + "name": "redirectTo", + "description": "prop_formit.redirectto_desc", + "value": "" + },{ + "name": "redirectParams", + "description": "prop_formit.redirectparams_desc", + "value": "" + },{ + "name": "emailTo", + "description": "prop_formit.emailto_desc", + "value": "" + },{ + "name": "emailToName", + "description": "prop_formit.emailtoname_desc", + "value": "" + },{ + "name": "emailFrom", + "description": "prop_formit.emailfrom_desc", + "value": "" + },{ + "name": "emailFromName", + "description": "prop_formit.emailfromname_desc", + "value": "" + },{ + "name": "emailReplyTo", + "description": "prop_formit.emailreplyto_desc", + "value": "" + },{ + "name": "emailReplyToName", + "description": "prop_formit.emailreplytoname_desc", + "value": "" + },{ + "name": "emailCC", + "description": "prop_formit.emailcc_desc", + "value": "" + },{ + "name": "emailCCName", + "description": "prop_formit.emailccname_desc", + "value": "" + },{ + "name": "emailBCC", + "description": "prop_formit.emailbcc_desc", + "value": "" + },{ + "name": "emailBCCName", + "description": "prop_formit.emailbccname_desc", + "value": "" + },{ + "name": "emailReturnPath", + "description": "prop_formit.emailreturnpath_desc", + "value": "" + },{ + "name": "emailSubject", + "description": "prop_formit.emailsubject_desc", + "value": "" + },{ + "name": "emailUseFieldForSubject", + "description": "prop_formit.emailusefieldforsubject_desc", + "value": "" + },{ + "name": "emailHtml", + "description": "prop_formit.emailhtml_desc", + "type": "combo-boolean", + "value": "1" + },{ + "name": "emailConvertNewlines", + "description": "prop_formit.emailconvertnewlines_desc", + "type": "combo-boolean", + "value": "0" + },{ + "name": "emailMultiWrapper", + "description": "prop_formit.emailmultiwrapper_desc", + "value": "[[+value]]" + },{ + "name": "emailMultiSeparator", + "description": "prop_formit.emailmultiseparator_desc", + "value": "" + },{ + "name": "fiarTpl", + "description": "prop_formit.fiartpl_desc", + "value": "" + },{ + "name": "fiarToField", + "description": "prop_formit.fiartofield_desc", + "value": "email" + },{ + "name": "fiarSubject", + "description": "prop_formit.fiarsubject_desc", + "value": "[[++site_name]] Auto-Responder" + },{ + "name": "fiarFrom", + "description": "prop_formit.fiarfrom_desc", + "value": "" + },{ + "name": "fiarFromName", + "description": "prop_formit.fiarfromname_desc", + "value": "" + },{ + "name": "fiarReplyTo", + "description": "prop_formit.fiarreplyto_desc", + "value": "" + },{ + "name": "fiarReplyToName", + "description": "prop_formit.fiarreplytoname_desc", + "value": "" + },{ + "name": "fiarCC", + "description": "prop_formit.fiarcc_desc", + "value": "" + },{ + "name": "fiarCCName", + "description": "prop_fiar.fiarccname_desc", + "value": "" + },{ + "name": "fiarBCC", + "description": "prop_formit.fiarbcc_desc", + "value": "" + },{ + "name": "fiarBCCName", + "description": "prop_formit.fiarbccname_desc", + "value": "" + },{ + "name": "fiarHtml", + "description": "prop_formit.fiarhtml_desc", + "type": "combo-boolean", + "value": "1" + },{ + "name": "mathMinRange", + "description": "prop_formit.mathminrange_desc", + "value": "10" + },{ + "name": "mathMaxRange", + "description": "prop_formit.mathmaxrange_desc", + "value": "100" + },{ + "name": "mathField", + "description": "prop_formit.mathfield_desc", + "value": "math" + },{ + "name": "mathOp1Field", + "description": "prop_formit.mathop1field_desc", + "value": "op1" + },{ + "name": "mathOp2Field", + "description": "prop_formit.mathop2field_desc", + "value": "op2" + },{ + "name": "mathOperatorField", + "description": "prop_formit.mathoperatorfield_desc", + "value": "operator" + },{ + "name": "saveTmpFiles", + "description": "prop_formit.savetmpfiles_desc", + "type": "combo-boolean", + "value": "0" + },{ + "name": "attachFilesToEmail", + "description": "prop_formit.attachfiles_desc", + "type": "combo-boolean", + "value": "0" + },{ + "name": "storeAttachments", + "description": "prop_formit.store_attachments_desc", + "type": "combo-boolean", + "value": "0" + }] + },{ + "name": "FormItRetriever", + "description": "Fetches a form submission for a user for displaying on a thank you page.", + "file": "snippet.formitretriever.php", + "properties": [{ + "name": "placeholderPrefix", + "description": "prop_fir.placeholderprefix_desc", + "value": "fi." + },{ + "name": "redirectToOnNotFound", + "description": "prop_fir.redirecttoonnotfound_desc", + "value": "" + },{ + "name": "eraseOnLoad", + "description": "prop_fir.eraseonload_desc", + "type": "combo-boolean", + "value": "0" + },{ + "name": "storeLocation", + "description": "prop_fir.storelocation_desc", + "type": "list", + "options": [{ + "name": "formit.opt_cache", + "value": "cache" + },{ + "name": "formit.opt_session", + "value": "session" + }], + "value": "cache" + }] + },{ + "name": "FormItIsChecked", + "description": "A custom output filter used with checkboxes/radios for checking checked status.", + "file": "snippet.formitischecked.php", + "properties": [] + },{ + "name": "FormItIsSelected", + "description": "A custom output filter used with dropdowns for checking selected status.", + "file": "snippet.formitisselected.php", + "properties": [] + },{ + "name": "FormItCountryOptions", + "description": "A utility snippet for generating a dropdown list of countries.", + "file": "snippet.formitcountryoptions.php", + "properties": [{ + "name": "selected", + "description": "prop_fico.selected_desc", + "value": "" + },{ + "name": "tpl", + "description": "prop_fico.tpl_desc", + "value": "fiDefaultOptionTpl" + },{ + "name": "useIsoCode", + "description": "prop_fico.useisocode_desc", + "type": "combo-boolean", + "value": "1" + },{ + "name": "prioritized", + "description": "prop_fico.prioritized_desc", + "value": "" + },{ + "name": "optGroupTpl", + "description": "prop_fico.optgrouptpl_desc", + "value": "fiDefaultOptGroupTpl" + },{ + "name": "prioritizedGroupText", + "description": "prop_fico.prioritizedgrouptext_desc", + "value": "" + },{ + "name": "allGroupText", + "description": "prop_fico.allgrouptext_desc", + "value": "" + },{ + "name": "selectedAttribute", + "description": "prop_fico.selectedattribute_desc", + "value": " selected=\"selected\"" + },{ + "name": "toPlaceholder", + "description": "prop_fico.toplaceholder_desc", + "value": "" + },{ + "name": "country", + "description": "prop_fico.country_desc", + "value": "[[++cultureKey]]" + },{ + "name": "limited", + "description": "prop_fico.limited_desc", + "value": "" + }] + },{ + "name": "FormItStateOptions", + "description": "A utility snippet for generating a dropdown list of U.S. states.", + "file": "snippet.formitstateoptions.php", + "properties": [{ + "name": "selected", + "description": "prop_fiso.selected_desc", + "value": "" + },{ + "name": "tpl", + "description": "prop_fiso.tpl_desc", + "value": "fiDefaultOptionTpl" + },{ + "name": "useAbbr", + "description": "prop_fiso.useabbr_desc", + "type": "combo-boolean", + "value": "1" + },{ + "name": "selectedAttribute", + "description": "prop_fiso.selectedattribute_desc", + "value": " selected=\"selected\"" + },{ + "name": "toPlaceholder", + "description": "prop_fiso.toplaceholder_desc", + "value": "" + },{ + "name": "country", + "description": "prop_fiso.country_desc", + "value": "[[++cultureKey]]" + }] + },{ + "name": "FormItLoadSavedForm", + "description": "Prehook to load previously saved form.", + "file": "snippet.formitloadsavedform.php" + }] + }, + "systemSettings": [{ + "key": "recaptcha_public_key", + "area": "formit_recaptcha" + },{ + "key": "recaptcha_private_key", + "area": "formit_recaptcha" + },{ + "type": "combo-boolean", + "key": "recaptcha_use_ssl", + "value": 0, + "area": "formit_recaptcha" + },{ + "key": "exclude_contexts", + "value": "mgr", + "area": "formit" + },{ + "key": "form_encryptkey", + "area": "formit" + },{ + "type": "modx-combo-source", + "key": "attachment.mediasource", + "value": 1, + "area": "formit" + },{ + "key": "attachment.path", + "area": "formit" + },{ + "key": "attachment.lifeline", + "area": "formit" + },{ + "key": "cleanform.days", + "value": 30, + "area": "formit" + },{ + "key": "max_chars_textfield", + "value": 125, + "area": "formit" + }] + }, + "database": { + "tables": [ + "FormItForm" + ] + }, + "build": { + "readme": "docs/readme.txt", + "license": "docs/license.txt", + "changelog": "docs/changelog.txt", + "resolver": { + "after": [ + "tables.resolver.php", + "permissions.resolver.php", + "setupoptions.resolver.php", + "stercextra.resolver.php", + "cron.resolver.php" + ] + }, + "setupOptions":{ + "source": "setup.options.php" + } + } +} 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.

    diff --git a/_build/gpm_resolvers/gpm.resolve.tables.php b/_build/gpm_resolvers/gpm.resolve.tables.php new file mode 100644 index 00000000..b3705467 --- /dev/null +++ b/_build/gpm_resolvers/gpm.resolve.tables.php @@ -0,0 +1,33 @@ +xpdo) { + $modx =& $object->xpdo; + switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + case xPDOTransport::ACTION_UPGRADE: + $modelPath = $modx->getOption('formit.core_path', null, $modx->getOption('core_path') . 'components/formit/') . 'model/'; + + $modx->addPackage('formit', $modelPath, null); + + + $manager = $modx->getManager(); + + $manager->createObjectContainer('FormItForm'); + + break; + } +} + +return true; \ No newline at end of file diff --git a/_build/resolvers/cron.resolver.php b/_build/resolvers/cron.resolver.php new file mode 100644 index 00000000..cdf4b6fe --- /dev/null +++ b/_build/resolvers/cron.resolver.php @@ -0,0 +1,23 @@ + + */ + +if ($object->xpdo) { + switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + case xPDOTransport::ACTION_UPGRADE: + $modx =& $object->xpdo; + + $path = $modx->getOption('formit.assets_path', null, MODX_ASSETS_PATH . 'components/formit/') . 'cronjob/cron.php'; + + $modx->log(modX::LOG_LEVEL_INFO, 'You can setup a cronjob for automatically cleaning up of old forms, please use the following path: ' . $path); + + break; + } +} + +return true; diff --git a/_build/resolvers/permissions.resolver.php b/_build/resolvers/permissions.resolver.php new file mode 100644 index 00000000..36af4b8f --- /dev/null +++ b/_build/resolvers/permissions.resolver.php @@ -0,0 +1,84 @@ + + */ + +$package = 'FormIt'; + +$permissions = [[ + 'name' => 'formit', + 'description' => 'To view the formit package.', + 'templates' => ['AdministratorTemplate'] +], [ + 'name' => 'formit_encryptions', + 'description' => 'To view the formit package, encriptions part.', + 'templates' => ['AdministratorTemplate'], + 'policies' => ['Administrator'] +]]; + +$success = false; + +if ($object->xpdo) { + switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + case xPDOTransport::ACTION_UPGRADE: + $modx =& $object->xpdo; + + foreach ($modx->getCollection('modAccessPolicyTemplate') as $accessTemplate) { + foreach ($permissions as $permission) { + if (!isset($permission['templates']) || in_array($accessTemplate->get('name'), $permission['templates'])) { + $accessPermission = $modx->getObject('modAccessPermission', [ + 'name' => $permission['name'], + 'template' => $accessTemplate->get('id') + ]); + + if (!$accessPermission) { + $accessPermission = $modx->newObject('modAccessPermission'); + + if ($accessPermission) { + $accessPermission->fromArray(array_merge($permission, [ + 'template' => $accessTemplate->get('id'), + 'value' => 1 + ])); + + $accessPermission->save(); + } + } + } + } + } + + foreach ($modx->getCollection('modAccessPolicy') as $accessPolicy) { + $data = $accessPolicy->get('data'); + + foreach ($permissions as $permission) { + if (isset($permission['policies'])) { + if (in_array($accessPolicy->get('name'), $permission['policies'], true)) { + $data[$permission['name']] = true; + } else { + $data[$permission['name']] = false; + } + } else { + $data[$permission['name']] = true; + } + } + + $accessPolicy->set('data', $data); + + $accessPolicy->save(); + } + + $success = true; + + break; + case xPDOTransport::ACTION_UNINSTALL: + $success = true; + + break; + } +} + +return $success; diff --git a/_build/resolvers/setupoptions.resolver.php b/_build/resolvers/setupoptions.resolver.php new file mode 100644 index 00000000..4633b450 --- /dev/null +++ b/_build/resolvers/setupoptions.resolver.php @@ -0,0 +1,40 @@ + + */ + +$package = 'FormIt'; + +$settings = ['user_name', 'user_email']; + +$success = false; + +switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + case xPDOTransport::ACTION_UPGRADE: + foreach ($settings as $key) { + if (isset($options[$key])) { + $setting = $modx->getObject('modSystemSetting', [ + 'key' => strtolower($package) . '.' . $key + ]); + + if ($setting) { + $setting->set('value', $options[$key]); + $setting->save(); + } + } + } + + $success = true; + + break; + case xPDOTransport::ACTION_UNINSTALL: + $success = true; + + break; +} + +return $success; diff --git a/_build/resolvers/stercextra.resolver.php b/_build/resolvers/stercextra.resolver.php new file mode 100644 index 00000000..7eccca9d --- /dev/null +++ b/_build/resolvers/stercextra.resolver.php @@ -0,0 +1,125 @@ + + */ + +$package = 'FormIt'; +$url = 'https://extras.sterc.nl/api/v1/packagedata'; +$params = array(); + +$modx =& $object->xpdo; +$c = $modx->newQuery('transport.modTransportPackage'); +$c->where( + array( + 'workspace' => 1, + "(SELECT + `signature` + FROM {$modx->getTableName('transport.modTransportPackage')} AS `latestPackage` + WHERE `latestPackage`.`package_name` = `modTransportPackage`.`package_name` + ORDER BY + `latestPackage`.`version_major` DESC, + `latestPackage`.`version_minor` DESC, + `latestPackage`.`version_patch` DESC, + IF(`release` = '' OR `release` = 'ga' OR `release` = 'pl','z',`release`) DESC, + `latestPackage`.`release_index` DESC + LIMIT 1,1) = `modTransportPackage`.`signature`", + ) +); +$c->where( + array( + array( + 'modTransportPackage.package_name' => strtolower($package) + ), + 'installed:IS NOT' => null + ) +); +$c->limit(1); + +/** @var modTransportPackage $oldPackage */ +$oldPackage = $modx->getObject('transport.modTransportPackage', $c); + +$oldVersion = ''; +if ($oldPackage) { + $oldVersion = $oldPackage->get('version_major') . '.' . $oldPackage->get('version_minor'); + $oldVersion .= '.' . $oldPackage->get('version_patch'); + $oldVersion .= '-' . $oldPackage->get('release'); +} + +$version = ''; +if ($options['topic']) { + $topic = trim($options['topic'], '/'); + $topic = explode('/', $topic); + $signature = end($topic); + $version = str_replace(strtolower($package) . '-', '', $signature); +} + +$userNameObj = $modx->getObject( + 'modSystemSetting', + array('key' => strtolower($package) . '.user_name') +); +$userName = ($userNameObj) ? $userNameObj->get('value') : ''; + +$userEmailObj = $modx->getObject( + 'modSystemSetting', + array('key' => strtolower($package) . '.user_email') +); +$userEmail = ($userEmailObj) ? $userEmailObj->get('value') : ''; + +$modxVersionObj = $modx->getObject('modSystemSetting', array('key' => 'settings_version')); +$modxVersion = ($modxVersionObj) ? $modxVersionObj->get('value') : ''; +$managerLang = $modx->getOption('manager_language'); + +$action = ''; +switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + $action = 'install'; + break; + case xPDOTransport::ACTION_UPGRADE: + $action = 'upgrade'; + break; + case xPDOTransport::ACTION_UNINSTALL: + $action = 'uninstall'; + + $version = $oldVersion; + $setupOptionsPath = explode('/', $options['setup-options']); + $signature = $setupOptionsPath[0]; + $oldVersion = str_replace(strtolower($package) . '-', '', $signature); + + break; +} + +$params = array( + 'name' => $options['namespace'], + 'url' => $_SERVER['SERVER_NAME'], + 'user_name' => $userName, + 'user_email' => $userEmail, + 'php_version' => phpversion(), + 'modx_version' => $modxVersion, + 'manager_lang' => $managerLang, + 'installation_type' => $action, + 'package_version_from' => $oldVersion, + 'package_version' => $version, + 'date' => time() +); + +/** + * Curl POST. + */ +$curl = curl_init(); +curl_setopt($curl, CURLOPT_URL, $url); +curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: STERC-A64XHC7PNY8G61L79E')); +curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); +curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 120); +curl_setopt($curl, CURLOPT_POST, true); +curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($params)); +curl_setopt($curl, CURLOPT_TIMEOUT, 120); + +$response = curl_exec($curl); +$responseInfo = curl_getinfo($curl); +$curlError = curl_error($curl); +curl_close($curl); + +return true; diff --git a/_build/resolvers/tables.resolver.php b/_build/resolvers/tables.resolver.php new file mode 100644 index 00000000..c0e7ece6 --- /dev/null +++ b/_build/resolvers/tables.resolver.php @@ -0,0 +1,133 @@ + + */ + +set_time_limit(0); + +if (!function_exists('updateTableColumns')) { + /** + * @param modX $modx + * @param string $table + */ + function updateTableColumns($modx, $table) + { + $tableName = $modx->getTableName($table); + $tableName = str_replace('`', '', $tableName); + $dbname = $modx->getOption('dbname'); + + $c = $modx->prepare("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = :dbName AND table_name = :tableName"); + $c->bindParam(':dbName', $dbname); + $c->bindParam(':tableName', $tableName); + $c->execute(); + + $unusedColumns = $c->fetchAll(PDO::FETCH_COLUMN, 0); + $unusedColumns = array_flip($unusedColumns); + + $meta = $modx->getFieldMeta($table); + $columns = array_keys($meta); + + $m = $modx->getManager(); + + foreach ($columns as $column) { + if (isset($unusedColumns[$column])) { + $m->alterField($table, $column); + $modx->log(modX::LOG_LEVEL_INFO, ' -- altered column: ' . $column); + unset($unusedColumns[$column]); + } else { + $m->addField($table, $column); + $modx->log(modX::LOG_LEVEL_INFO, ' -- added column: ' . $column); + } + } + + foreach ($unusedColumns as $column => $v) { + $m->removeField($table, $column); + $modx->log(modX::LOG_LEVEL_INFO, ' -- removed column: ' . $column); + } + } +} + +if (!function_exists('updateTableIndexes')) { + /** + * @param modX $modx + * @param string $table + */ + function updateTableIndexes($modx, $table) + { + $tableName = $modx->getTableName($table); + $tableName = str_replace('`', '', $tableName); + $dbname = $modx->getOption('dbname'); + + $c = $modx->prepare("SELECT DISTINCT INDEX_NAME FROM INFORMATION_SCHEMA.STATISTICS WHERE table_schema = :dbName AND table_name = :tableName AND INDEX_NAME != 'PRIMARY'"); + $c->bindParam(':dbName', $dbname); + $c->bindParam(':tableName', $tableName); + $c->execute(); + + $oldIndexes = $c->fetchAll(PDO::FETCH_COLUMN, 0); + + $m = $modx->getManager(); + + foreach ($oldIndexes as $oldIndex) { + $m->removeIndex($table, $oldIndex); + $modx->log(modX::LOG_LEVEL_INFO, ' -- removed index: ' . $oldIndex); + } + + $meta = $modx->getIndexMeta($table); + $indexes = array_keys($meta); + + foreach ($indexes as $index) { + if ($index == 'PRIMARY') continue; + $m->addIndex($table, $index); + $modx->log(modX::LOG_LEVEL_INFO, ' -- added index: ' . $index); + } + } +} + +if (!function_exists('alterTable')) { + /** + * @param modX $modx + * @param string $table + */ + function alterTable($modx, $table) + { + $modx->log(modX::LOG_LEVEL_INFO, ' - Updating columns'); + updateTableColumns($modx, $table); + + $modx->log(modX::LOG_LEVEL_INFO, ' - Updating indexes'); + updateTableIndexes($modx, $table); + } +} + +if ($object->xpdo) { + switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + $modx =& $object->xpdo; + $modx->addPackage('formit', $modx->getOption('formit.core_path', null, $modx->getOption('core_path') . 'components/formit/') . 'model/'); + + $manager = $modx->getManager(); + + $manager->createObjectContainer('FormItForm'); + + break; + case xPDOTransport::ACTION_UPGRADE: + /** @var modX $modx */ + $modx =& $object->xpdo; + + $tables = array( + 'FormItForm' + ); + $modelPath = $modx->getOption('formit.core_path', null, $modx->getOption('core_path').'components/formit/').'model/'; + $modx->addPackage('formit', $modelPath); + foreach ($tables as $table) { + $modx->log(modX::LOG_LEVEL_INFO, 'Altering table: ' . $table); + alterTable($modx, $table); + } + + break; + } +} + +return true; diff --git a/_build/setup.options.php b/_build/setup.options.php new file mode 100644 index 00000000..5d6ca17f --- /dev/null +++ b/_build/setup.options.php @@ -0,0 +1,61 @@ + + */ + +$package = 'FormIt'; + +$settings = [[ + 'key' => 'user_name', + 'value' => '', + 'name' => 'Name' +], [ + 'key' => 'user_email', + 'value' => '', + 'name' => 'Email address' +]]; + +switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + case xPDOTransport::ACTION_UPGRADE: + foreach ($settings as $key => $value) { + $setting = $modx->getObject('modSystemSetting', [ + 'key' => strtolower($package) . '.' . $value['key'] + ]); + + if ($setting) { + $settings[$key]['value'] = $setting->get('value'); + } + } + break; + case xPDOTransport::ACTION_UNINSTALL: + break; +} + +/* Hide default setuptoptions text */ +$output[] = ' + + + +

    Get free priority updates

    +

    Enter your name and email address below to receive priority updates about our extras. +Be the first to know about updates and new features. +It is NOT required to enter your name and email to use this extra.

    '; + +foreach ($settings as $setting) { + $str = ''; + $str .= ''; + + $output[] = $str; +} + +return implode('

    ', $output); diff --git a/_packages/formit-2.2.10-pl.transport.zip b/_packages/formit-2.2.10-pl.transport.zip new file mode 100755 index 00000000..1e1b2bfa Binary files /dev/null and b/_packages/formit-2.2.10-pl.transport.zip differ diff --git a/_packages/formit-2.2.11-beta.transport.zip b/_packages/formit-2.2.11-beta.transport.zip new file mode 100755 index 00000000..1b1f80dc Binary files /dev/null and b/_packages/formit-2.2.11-beta.transport.zip differ diff --git a/_packages/formit-2.2.11-pl.transport.zip b/_packages/formit-2.2.11-pl.transport.zip new file mode 100755 index 00000000..8dd8dfbd Binary files /dev/null and b/_packages/formit-2.2.11-pl.transport.zip differ diff --git a/_packages/formit-2.2.9-pl.transport.zip b/_packages/formit-2.2.9-pl.transport.zip new file mode 100755 index 00000000..d441d2a2 Binary files /dev/null and b/_packages/formit-2.2.9-pl.transport.zip differ diff --git a/_packages/formit-3.0-alpha.transport.zip b/_packages/formit-3.0-alpha.transport.zip new file mode 100755 index 00000000..8fe02785 Binary files /dev/null and b/_packages/formit-3.0-alpha.transport.zip differ diff --git a/_packages/formit-3.0.0-pl.transport.zip b/_packages/formit-3.0.0-pl.transport.zip new file mode 100755 index 00000000..7e0b434a Binary files /dev/null and b/_packages/formit-3.0.0-pl.transport.zip differ diff --git a/_packages/formit-3.0.1-pl.transport.zip b/_packages/formit-3.0.1-pl.transport.zip new file mode 100755 index 00000000..c939dff3 Binary files /dev/null and b/_packages/formit-3.0.1-pl.transport.zip differ diff --git a/_packages/formit-3.0.2-pl.transport.zip b/_packages/formit-3.0.2-pl.transport.zip new file mode 100755 index 00000000..8ff4f13b Binary files /dev/null and b/_packages/formit-3.0.2-pl.transport.zip differ diff --git a/_packages/formit-3.0.3-pl.transport.zip b/_packages/formit-3.0.3-pl.transport.zip new file mode 100755 index 00000000..4517b133 Binary files /dev/null and b/_packages/formit-3.0.3-pl.transport.zip differ diff --git a/_packages/formit-3.0.4-pl.transport.zip b/_packages/formit-3.0.4-pl.transport.zip new file mode 100755 index 00000000..fdeaf9eb Binary files /dev/null and b/_packages/formit-3.0.4-pl.transport.zip differ diff --git a/_packages/formit-4.0-beta.transport.zip b/_packages/formit-4.0-beta.transport.zip new file mode 100755 index 00000000..acb845b3 Binary files /dev/null and b/_packages/formit-4.0-beta.transport.zip differ diff --git a/_packages/formit-4.0-beta2.transport.zip b/_packages/formit-4.0-beta2.transport.zip new file mode 100755 index 00000000..5326741d Binary files /dev/null and b/_packages/formit-4.0-beta2.transport.zip differ diff --git a/_packages/formit-4.0-beta3.transport.zip b/_packages/formit-4.0-beta3.transport.zip new file mode 100755 index 00000000..08c0744a Binary files /dev/null and b/_packages/formit-4.0-beta3.transport.zip differ diff --git a/_packages/formit-4.0.0-pl.transport.zip b/_packages/formit-4.0.0-pl.transport.zip new file mode 100755 index 00000000..7e351591 Binary files /dev/null and b/_packages/formit-4.0.0-pl.transport.zip differ diff --git a/_packages/formit-4.0.1-pl.transport.zip b/_packages/formit-4.0.1-pl.transport.zip new file mode 100755 index 00000000..62f72f69 Binary files /dev/null and b/_packages/formit-4.0.1-pl.transport.zip differ diff --git a/_packages/formit-4.1.0-pl.transport.zip b/_packages/formit-4.1.0-pl.transport.zip new file mode 100644 index 00000000..35246def Binary files /dev/null and b/_packages/formit-4.1.0-pl.transport.zip differ diff --git a/_packages/formit-4.1.1-pl.transport.zip b/_packages/formit-4.1.1-pl.transport.zip new file mode 100644 index 00000000..c236df76 Binary files /dev/null and b/_packages/formit-4.1.1-pl.transport.zip differ diff --git a/_packages/formit-4.1.2-pl.transport.zip b/_packages/formit-4.1.2-pl.transport.zip new file mode 100644 index 00000000..6233955d Binary files /dev/null and b/_packages/formit-4.1.2-pl.transport.zip differ diff --git a/_packages/formit-4.2.0-pl.transport.zip b/_packages/formit-4.2.0-pl.transport.zip new file mode 100644 index 00000000..4129f312 Binary files /dev/null and b/_packages/formit-4.2.0-pl.transport.zip differ diff --git a/_packages/formit-4.2.1-pl.transport.zip b/_packages/formit-4.2.1-pl.transport.zip new file mode 100644 index 00000000..04c08d79 Binary files /dev/null and b/_packages/formit-4.2.1-pl.transport.zip differ diff --git a/_packages/formit-4.2.2-pl.transport.zip b/_packages/formit-4.2.2-pl.transport.zip new file mode 100644 index 00000000..29568ffd Binary files /dev/null and b/_packages/formit-4.2.2-pl.transport.zip differ diff --git a/_packages/formit-4.2.3-pl.transport.zip b/_packages/formit-4.2.3-pl.transport.zip new file mode 100644 index 00000000..f56f5844 Binary files /dev/null and b/_packages/formit-4.2.3-pl.transport.zip differ diff --git a/_packages/formit-4.2.4-pl.transport.zip b/_packages/formit-4.2.4-pl.transport.zip new file mode 100644 index 00000000..4f43f4a9 Binary files /dev/null and b/_packages/formit-4.2.4-pl.transport.zip differ diff --git a/_packages/formit-4.2.5-pl.transport.zip b/_packages/formit-4.2.5-pl.transport.zip new file mode 100644 index 00000000..29f9d078 Binary files /dev/null and b/_packages/formit-4.2.5-pl.transport.zip differ diff --git a/_packages/formit-4.2.6-pl.transport.zip b/_packages/formit-4.2.6-pl.transport.zip new file mode 100644 index 00000000..c9cc5fb9 Binary files /dev/null and b/_packages/formit-4.2.6-pl.transport.zip differ diff --git a/_packages/formit-4.2.7-pl.transport.zip b/_packages/formit-4.2.7-pl.transport.zip new file mode 100644 index 00000000..2902b3d4 Binary files /dev/null and b/_packages/formit-4.2.7-pl.transport.zip differ 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/cronjob/cron.php b/assets/components/formit/cronjob/cron.php new file mode 100644 index 00000000..2ea380c4 --- /dev/null +++ b/assets/components/formit/cronjob/cron.php @@ -0,0 +1,32 @@ +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/'); +$response = $modx->runProcessor('mgr/forms/clean', [], [ + 'processors_path' => $path +]); + +if(!empty($response)){ + if ($response->isError()) { + print $response->getMessage(); + } +} diff --git a/assets/components/formit/css/mgr/formit.css b/assets/components/formit/css/mgr/formit.css new file mode 100644 index 00000000..defd8080 --- /dev/null +++ b/assets/components/formit/css/mgr/formit.css @@ -0,0 +1,31 @@ +/* Should be moved to default theme. */ +.x-menu-item-icon { + left: 7px !important; + font-size: 14px !important; + line-height: 16px !important; + text-align: center !important; +} + +/* Should be moved to default theme. */ +.x-btn-text .icon { + margin-right: 8px; +} + +#modx-action-buttons .x-btn-branding { + background: none !important; + box-shadow: none !important; + border: none !important; + color: #555555 !important; +} + +.panel-alert-desc { + padding: 10px !important; + margin: 10px 10px 0; + color: #a94442; + background: #f2dede; + border: 1px solid #ebccd1; +} + +.x-window-formit .x-window-body { + padding-top: 15px !important; +} diff --git a/assets/components/formit/css/migrate.css b/assets/components/formit/css/migrate.css new file mode 100644 index 00000000..ed6885a7 --- /dev/null +++ b/assets/components/formit/css/migrate.css @@ -0,0 +1,31 @@ +#modx-container { + margin-top: 37px; +} +#modx-leftbar { + top: 92px !important; +} +#modx-content { + top: 92px !important; +} +.formit-alert-migrate { + position: absolute; + top: 0; + left: 0; + width: 100%; + z-index: 20; + background: #c0272b; + color: #fff; + height: 36px; + line-height: 36px; + text-align: center; + border-bottom: 1px solid rgba(255,255,255,0.3); +} +.formit-alert-migrate a { + color: #fff; + text-decoration: none; + display: block; +} +.formit-alert-migrate a:hover { + color: #fff; + text-decoration: underline; +} \ 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 100644 index 00000000..56f9d21a --- /dev/null +++ b/assets/components/formit/js/mgr/formit.js @@ -0,0 +1,19 @@ +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(); \ 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 100644 index 00000000..2069e675 --- /dev/null +++ b/assets/components/formit/js/mgr/sections/home.js @@ -0,0 +1,44 @@ +Ext.onReady(function() { + MODx.load({ + xtype : 'formit-page-home' + }); +}); + +FormIt.page.Home = function(config) { + config = config || {}; + + config.buttons = []; + + if (FormIt.config.branding_url) { + config.buttons.push({ + text : 'FormIt ' + FormIt.config.version, + cls : 'x-btn-branding', + handler : this.loadBranding + }); + } + + if (FormIt.config.branding_url_help) { + config.buttons.push({ + text : _('help_ex'), + handler : MODx.loadHelpPane, + scope : this + }); + } + + 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, { + loadBranding: function(btn) { + window.open(FormIt.config.branding_url); + } +}); + +Ext.reg('formit-page-home', FormIt.page.Home); \ No newline at end of file diff --git a/assets/components/formit/js/mgr/sections/migrate.js b/assets/components/formit/js/mgr/sections/migrate.js new file mode 100644 index 00000000..2410d676 --- /dev/null +++ b/assets/components/formit/js/mgr/sections/migrate.js @@ -0,0 +1,16 @@ +Ext.onReady(function() { + MODx.load({ xtype: 'formit-page-migrate'}); +}); + +FormIt.page.Migrate = function(config) { + config = config || {}; + Ext.applyIf(config,{ + components: [{ + xtype: 'formit-panel-migrate' + ,renderTo: 'formit-panel-migrate-div' + }] + }); + FormIt.page.Migrate.superclass.constructor.call(this,config); +}; +Ext.extend(FormIt.page.Migrate,MODx.Component); +Ext.reg('formit-page-migrate',FormIt.page.Migrate); \ No newline at end of file diff --git a/assets/components/formit/js/mgr/widgets/encryption.grid.js b/assets/components/formit/js/mgr/widgets/encryption.grid.js new file mode 100644 index 00000000..d237c30e --- /dev/null +++ b/assets/components/formit/js/mgr/widgets/encryption.grid.js @@ -0,0 +1,174 @@ +FormIt.grid.Encryptions = function(config) { + config = config || {}; + + config.tbar = ['->', { + xtype : 'textfield', + name : 'formit-filter-encryptions-search', + id : 'formit-filter-encryptions-search', + emptyText : _('search') + '...', + listeners : { + 'change' : { + fn : this.filterSearch, + scope : this + }, + 'render' : { + fn : function(cmp) { + new Ext.KeyMap(cmp.getEl(), { + key : Ext.EventObject.ENTER, + fn : this.blur, + scope : cmp + }); + }, + scope : this + } + } + }, { + xtype : 'button', + cls : 'x-form-filter-clear', + id : 'formit-filter-encryptions-clear', + text : _('filter_clear'), + listeners : { + 'click' : { + fn : this.clearFilter, + scope : this + } + } + }]; + + var columns = [{ + header : _('formit.label_form_name'), + dataIndex : 'form', + sortable : true, + editable : false, + width : 250 + }, { + header : _('formit.label_form_encrypted'), + dataIndex : 'encrypted', + sortable : true, + editable : false, + width : 150, + fixed : true + }, { + header : _('formit.label_form_decrypted'), + dataIndex : 'decrypted', + sortable : true, + editable : false, + width : 150, + fixed : true + }, { + header : _('formit.label_form_total'), + dataIndex : 'total', + sortable : true, + editable : false, + width : 150, + fixed : true, + renderer : this.renderTotal + }]; + + Ext.applyIf(config,{ + columns : columns, + url : FormIt.config.connector_url, + baseParams : { + action : 'mgr/encryption/getlist' + }, + fields : ['form', 'encrypted', 'decrypted'], + paging : true, + pageSize : MODx.config.default_per_page > 30 ? MODx.config.default_per_page : 30, + remoteSort : true, + refreshGrid : [], + }); + + FormIt.grid.Encryptions.superclass.constructor.call(this, config); +}; + +Ext.extend(FormIt.grid.Encryptions, MODx.grid.Grid, { + filterSearch: function(tf, nv, ov) { + this.getStore().baseParams.query = tf.getValue(); + + this.getBottomToolbar().changePage(1); + }, + clearFilter: function() { + this.getStore().baseParams.query = ''; + + Ext.getCmp('formit-filter-encryptions-search').reset(); + + this.getBottomToolbar().changePage(1); + }, + getMenu: function() { + var menu = []; + + if (FormIt.config.openssl) { + if (this.menu.record.decrypted > 0) { + menu.push({ + text : '' + _('formit.form_encrypt'), + handler : this.encryptAll + }); + } + + if (this.menu.record.encrypted > 0) { + menu.push({ + text : '' + _('formit.form_decrypt'), + handler : this.decryptAll + }); + } + } + + return menu; + }, + refreshGrids: function() { + var grids = this.config.refreshGrid; + + if (typeof this.config.refreshGrid === 'string') { + if (Ext.getCmp(this.config.refreshGrid)) { + Ext.getCmp(this.config.refreshGrid).refresh(); + } + } else { + this.config.refreshGrid.forEach(function(grid) { + if (Ext.getCmp(grid)) { + Ext.getCmp(grid).refresh(); + } + }); + } + + this.refresh(); + }, + encryptAll: function(btn, e) { + MODx.msg.confirm({ + title : _('formit.form_encrypt'), + text : _('formit.form_encrypt_confirm'), + url : FormIt.config.connector_url, + params : { + action : 'mgr/encryption/encrypt', + form : this.menu.record.form + }, + listeners : { + 'success' : { + fn : this.refreshGrids, + scope : this + } + } + }); + }, + decryptAll: function(btn, e) { + MODx.msg.confirm({ + title : _('formit.form_decrypt'), + text : _('formit.form_decrypt_confirm'), + url : FormIt.config.connector_url, + params : { + action : 'mgr/encryption/decrypt', + form : this.menu.record.form + }, + listeners : { + 'success' : { + fn : this.refreshGrids, + scope : this + } + } + }); + }, + renderTotal: function(d, c, e) { + return e.json.encrypted + e.json.decrypted; + } +}); + +Ext.reg('formit-grid-encryptions', FormIt.grid.Encryptions); \ 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 100644 index 00000000..6abd5063 --- /dev/null +++ b/assets/components/formit/js/mgr/widgets/forms.grid.js @@ -0,0 +1,553 @@ +FormIt.grid.Forms = function(config) { + config = config || {}; + + config.tbar = [{ + text : _('bulk_actions'), + menu : [{ + text : '' + _('formit.forms_clean'), + handler : this.cleanForms, + scope : this + }, { + text : '' + _('formit.forms_export'), + handler : this.exportForms, + scope : this + },'-', { + text : '' + _('formit.forms_remove'), + handler : this.removeSelectedForms, + scope : this + }] + }, '->', { + xtype : 'datefield', + name : 'formit-filter-forms-start-date', + id : 'formit-filter-forms-start-date', + dateFormat : MODx.config.manager_date_format, + startDay : parseInt(MODx.config.manager_week_start), + width : 200, + emptyText : _('formit.filter_start_date'), + listeners : { + 'change' : { + fn : this.filterStartDate, + scope : this + } + } + }, { + xtype : 'datefield', + name : 'formit-filter-forms-end-date', + id : 'formit-filter-forms-end-date', + dateFormat : MODx.config.manager_date_format, + startDay : parseInt(MODx.config.manager_week_start), + width : 200, + emptyText : _('formit.filter_end_date'), + listeners : { + 'change' : { + fn : this.filterEndDate, + scope : this + } + } + }, { + xtype : 'formit-combo-forms', + name : 'formit-filter-forms-form', + id : 'formit-filter-forms-form', + width : 200, + emptyText : _('formit.filter_form'), + listeners : { + 'change' : { + fn : this.filterForm, + scope : this + } + } + }, { + xtype : 'textfield', + name : 'formit-filter-forms-search', + id : 'formit-filter-forms-search', + emptyText : _('search') + '...', + value : decodeURIComponent(MODx.request.form || ''), + listeners : { + 'change' : { + fn : this.filterSearch, + scope : this + }, + 'render' : { + fn : function(cmp) { + new Ext.KeyMap(cmp.getEl(), { + key : Ext.EventObject.ENTER, + fn : this.blur, + scope : cmp + }); + }, + scope : this + } + } + }, { + xtype : 'button', + cls : 'x-form-filter-clear', + id : 'formit-filter-forms-clear', + text : _('filter_clear'), + listeners : { + 'click' : { + fn : this.clearFilter, + scope : this + } + } + }]; + + var selection = new Ext.grid.CheckboxSelectionModel(); + + var columns = [selection, { + header : _('formit.label_form_name'), + dataIndex : 'form', + sortable : true, + editable : false, + width : 200, + fixed : true + }, { + header : _('formit.label_form_values'), + dataIndex : 'values', + sortable : true, + editable : false, + width : 125, + renderer : this.renderValues + }, { + header : _('formit.label_form_ip'), + dataIndex : 'ip', + sortable : true, + editable : true, + width : 125, + fixed : true + }, { + header : _('formit.label_form_encrypted'), + dataIndex : 'encrypted', + sortable : true, + editable : true, + width : 125, + fixed : true, + renderer : this.renderBoolean + }, { + header : _('formit.label_form_date'), + dataIndex : 'date', + sortable : true, + editable : false, + fixed : true, + width : 200, + renderer : this.renderDate + }]; + + Ext.applyIf(config, { + sm : selection, + columns : columns, + id : 'formit-grid-forms', + url : FormIt.config.connector_url, + baseParams : { + action : 'mgr/forms/getlist', + query : decodeURIComponent(MODx.request.form || '') + }, + fields :['id','form','values', 'ip', 'date', 'encrypted'], + paging : true, + pageSize : MODx.config.default_per_page > 30 ? MODx.config.default_per_page : 30, + remoteSort : true + }); + + FormIt.grid.Forms.superclass.constructor.call(this, config); +}; + +Ext.extend(FormIt.grid.Forms, MODx.grid.Grid, { + filterSearch: function(tf, nv, ov) { + this.getStore().baseParams.query = tf.getValue(); + + this.getBottomToolbar().changePage(1); + }, + filterForm: function(tf, nv, ov) { + this.getStore().baseParams.form = tf.getValue(); + + this.getBottomToolbar().changePage(1); + }, + filterStartDate: function(tf, nv, ov) { + this.getStore().baseParams.start_date = tf.getValue(); + + this.getBottomToolbar().changePage(1); + }, + filterEndDate: function(tf, nv, ov) { + this.getStore().baseParams.end_date = tf.getValue(); + + this.getBottomToolbar().changePage(1); + }, + clearFilter: function() { + this.getStore().baseParams.query = ''; + this.getStore().baseParams.form = ''; + this.getStore().baseParams.start_date = ''; + this.getStore().baseParams.end_date = ''; + + Ext.getCmp('formit-filter-forms-search').reset(); + Ext.getCmp('formit-filter-forms-form').reset(); + Ext.getCmp('formit-filter-forms-start-date').reset(); + Ext.getCmp('formit-filter-forms-end-date').reset(); + + this.getBottomToolbar().changePage(1); + }, + getMenu: function() { + return [{ + text : '' + _('formit.form_view'), + handler : this.viewForm + }, { + text : '' + _('formit.view_ip'), + handler : this.viewFormIP + }, '-', { + text : '' + _('formit.form_remove'), + handler : this.removeForm + }]; + }, + viewForm: function(btn, e) { + if (this.viewFormWindow) { + this.viewFormWindow.destroy(); + } + + this.viewFormWindow = MODx.load({ + xtype : 'formit-window-form-view', + record : this.menu.record, + closeAction : 'close', + buttons : [{ + text : _('ok'), + cls : 'primary-button', + handler : function() { + this.viewFormWindow.close(); + }, + scope : this + }] + }); + + this.viewFormWindow.show(e.target); + }, + removeForm: function(btn, e) { + MODx.msg.confirm({ + title : _('formit.form_remove'), + text : _('formit.form_remove_confirm'), + url : this.config.url, + params : { + action : 'mgr/forms/remove', + id : this.menu.record.id + }, + listeners : { + 'success' : { + fn : this.refresh, + scope : this + } + } + }); + }, + viewFormIP: function(btn, e) { + this.getStore().baseParams.query = this.menu.record.ip; + this.getStore().baseParams.form = ''; + + Ext.getCmp('formit-filter-forms-search').setValue(this.menu.record.ip); + Ext.getCmp('formit-filter-forms-form').reset(); + + this.getBottomToolbar().changePage(1); + }, + removeSelectedForms: function(btn, e) { + MODx.msg.confirm({ + title : _('formit.forms_remove'), + text : _('formit.forms_remove_confirm'), + url : this.config.url, + params : { + action : 'mgr/forms/removeselected', + ids : this.getSelectedAsList() + }, + listeners : { + 'success' : { + fn : this.refresh, + scope : this + } + } + }); + }, + cleanForms: function(btn, e) { + if (this.cleanFormsWindow) { + this.cleanFormsWindow.destroy(); + } + + this.cleanFormsWindow = MODx.load({ + xtype : 'formit-window-forms-clean', + closeAction : 'close', + listeners : { + 'success' : { + fn : function(record) { + MODx.msg.status({ + title : _('success'), + message : record.a.result.message, + delay : 4 + }); + + this.refresh(); + }, + scope : this + } + } + }); + + this.cleanFormsWindow.show(e.target); + }, + exportForms: function(btn, e) { + if (this.exportFormsWindow) { + this.exportFormsWindow.destroy(); + } + + this.exportFormsWindow = MODx.load({ + xtype : 'formit-window-forms-export', + record : { + form : this.getStore().baseParams.form || '', + start_date : this.getStore().baseParams.start_date || '', + end_date : this.getStore().baseParams.end_date || '' + }, + closeAction :'close', + listeners : { + 'success' : { + fn : function() { + location.href = FormIt.config.connector_url + '?action=' + this.exportFormsWindow.baseParams.action + '&download=1&HTTP_MODAUTH=' + MODx.siteId; + }, + scope : this + }, + 'failure' : { + fn : function(response) { + MODx.msg.alert(_('failure'), response.message); + }, + scope : this + } + } + }); + + this.exportFormsWindow.setValues({ + form : this.getStore().baseParams.form || '', + start_date : this.getStore().baseParams.start_date || '', + end_date : this.getStore().baseParams.end_date || '' + }); + this.exportFormsWindow.show(e.target); + }, + renderBoolean: function(d, c) { + c.css = parseInt(d) === 1|| d ? 'green' : 'red'; + + return parseInt(d) === 1 || d ? _('yes') : _('no'); + }, + renderValues: function(d) { + var output = []; + + for (var key in d) { + output.push(String.format('{0}: {1}', key, d[key])); + } + + return output.join(', '); + }, + renderDate: function(a) { + if (Ext.isEmpty(a)) { + return '—'; + } + + return a; + } +}); + +Ext.reg('formit-grid-forms', FormIt.grid.Forms); + +FormIt.window.ViewForm = function(config) { + config = config || {}; + + Ext.applyIf(config, { + height : 500, + width : 600, + title : _('formit.form_view'), + labelAlign : 'left', + labelWidth : 150, + cls : 'x-window-formit', + fields : [{ + xtype : 'statictextfield', + fieldLabel : _('formit.label_form_name'), + name : 'form', + anchor : '100%' + }, { + xtype : 'statictextfield', + fieldLabel : _('formit.label_form_ip'), + name : 'ip', + anchor : '100%' + }, { + xtype : 'statictextfield', + fieldLabel : _('formit.label_form_date'), + name : 'date', + anchor : '100%' + }, { + html : '
    ' + }, this.getValues(config.record.values)] + }); + + FormIt.window.ViewForm.superclass.constructor.call(this, config); +}; + +Ext.extend(FormIt.window.ViewForm, MODx.Window, { + getValues: function(values) { + var output = []; + + for (var key in values) { + if (values[key].length >= FormIt.config['max_chars']) { + output.push({ + xtype : 'textarea', + fieldLabel : key, + name : 'date', + anchor : '100%', + value : values[key], + height : 125, + readOnly : true + }); + } else { + output.push({ + xtype : 'textfield', + fieldLabel : key, + name : 'date', + anchor : '100%', + value : values[key], + readOnly : true + }); + } + } + + return output; + } +}); + +Ext.reg('formit-window-form-view', FormIt.window.ViewForm); + +FormIt.window.CleanForms = function(config) { + config = config || {}; + + Ext.applyIf(config, { + autoHeight : true, + width : 500, + title : _('formit.forms_clean'), + cls : 'x-window-formit', + url : FormIt.config.connector_url, + baseParams : { + action : 'mgr/forms/clean' + }, + items : [{ + html : '

    ' + _('formit.forms_clean_desc') + '

    ', + cls : 'panel-desc', + }, { + xtype : 'modx-panel', + items : [{ + xtype : 'label', + html : _('formit.label_clean_label') + }, { + xtype : 'numberfield', + name : 'days', + minValue : 1, + maxValue : 9999999999, + value : MODx.config['formit.cleanform.days'], + width : 75, + allowBlank : false, + style : 'margin: 0 10px;' + }, { + xtype : 'label', + html : _('formit.label_clean_desc'), + }] + }], + keys : [], + saveBtnText : _('formit.forms_clean'), + waitMsg : _('formit.forms_clean_executing') + }); + + FormIt.window.CleanForms.superclass.constructor.call(this, config); +}; + +Ext.extend(FormIt.window.CleanForms, MODx.Window); + +Ext.reg('formit-window-forms-clean', FormIt.window.CleanForms); + +FormIt.window.ExportForms = function(config) { + config = config || {}; + + Ext.applyIf(config, { + autoHeight : true, + title : _('formit.forms_export'), + url : FormIt.config.connector_url, + baseParams : { + action : 'mgr/forms/export' + }, + fields : [{ + xtype : 'formit-combo-forms', + fieldLabel : _('formit.label_export_form'), + description : MODx.expandHelp ? '' : _('formit.label_export_form_desc'), + name : 'form', + anchor : '100%', + width : '100%', + emptyText : _('formit.filter_form'), + allowBlank : true + }, { + xtype : MODx.expandHelp ? 'label' : 'hidden', + html : _('formit.label_export_form_desc'), + cls : 'desc-under' + }, { + xtype : 'datefield', + fieldLabel : _('formit.label_export_start_date'), + description : MODx.expandHelp ? '' : _('formit.label_export_start_date_desc'), + name : 'start_date', + dateFormat : MODx.config.manager_date_format, + startDay : parseInt(MODx.config.manager_week_start), + anchor : '100%' + }, { + xtype : MODx.expandHelp ? 'label' : 'hidden', + html : _('formit.label_export_start_date_desc'), + cls : 'desc-under' + }, { + xtype : 'datefield', + fieldLabel : _('formit.label_export_end_date'), + description : MODx.expandHelp ? '' : _('formit.label_export_end_date_desc'), + name : 'end_date', + dateFormat : MODx.config.manager_date_format, + startDay : parseInt(MODx.config.manager_week_start), + anchor : '100%' + }, { + xtype : MODx.expandHelp ? 'label' : 'hidden', + html : _('formit.label_export_end_date_desc'), + cls : 'desc-under' + }, { + xtype : 'textfield', + fieldLabel : _('formit.label_export_delimiter'), + description : MODx.expandHelp ? '' : _('formit.label_export_delimiter_desc'), + name : 'delimiter', + anchor : '100%', + allowBlank : false, + value : ';' + }, { + xtype : MODx.expandHelp ? 'label' : 'hidden', + html : _('formit.label_export_delimiter_desc'), + cls : 'desc-under' + }], + saveBtnText : _('export') + }); + + FormIt.window.ExportForms.superclass.constructor.call(this, config); +}; + +Ext.extend(FormIt.window.ExportForms, MODx.Window); + +Ext.reg('formit-window-forms-export', FormIt.window.ExportForms); + +FormIt.combo.Forms = function(config) { + config = config || {}; + + Ext.applyIf(config, { + url : FormIt.config.connector_url, + baseParams : { + action : 'mgr/forms/getforms' + }, + fields : ['form'], + hiddenName : 'form', + valueField : 'form', + displayField : 'form', + paging : true, + pageSize : MODx.config.default_per_page > 30 ? MODx.config.default_per_page : 30 + }); + + FormIt.combo.Forms.superclass.constructor.call(this, config); +}; + +Ext.extend(FormIt.combo.Forms, MODx.combo.ComboBox); + +Ext.reg('formit-combo-forms', FormIt.combo.Forms); diff --git a/assets/components/formit/js/mgr/widgets/home.panel.js b/assets/components/formit/js/mgr/widgets/home.panel.js new file mode 100644 index 00000000..649080c2 --- /dev/null +++ b/assets/components/formit/js/mgr/widgets/home.panel.js @@ -0,0 +1,52 @@ +FormIt.panel.Home = function(config) { + config = config || {}; + + var tabs = [{ + title : _('formit.forms'), + items : [{ + html : '

    ' + _('formit.forms_desc') + '

    ', + bodyCssClass : 'panel-desc' + }, { + xtype : 'formit-grid-forms', + cls : 'main-wrapper', + preventRender : true + }] + }]; + + if (FormIt.config.permissions.encryptions) { + tabs.push({ + title : _('formit.encryptions'), + items : [{ + html : '

    ' + _('formit.encryptions_desc') + '

    ', + bodyCssClass : 'panel-desc' + }, { + hidden : FormIt.config.openssl, + html : '

    ' + _('formit.encryption_unavailable_warning') + '

    ', + bodyCssClass : 'panel-alert-desc' + }, { + xtype : 'formit-grid-encryptions', + cls : 'main-wrapper', + preventRender : true, + refreshGrid : 'formit-grid-forms' + }] + }); + } + + Ext.apply(config, { + id : 'formit-panel-home', + cls : 'container', + items : [{ + html : '

    ' + _('formit') + '

    ', + cls : 'modx-page-header' + }, { + xtype : 'modx-tabs', + items : tabs + }] + }); + + FormIt.panel.Home.superclass.constructor.call(this, config); +}; + +Ext.extend(FormIt.panel.Home, MODx.FormPanel); + +Ext.reg('formit-panel-home', FormIt.panel.Home); diff --git a/assets/components/formit/js/mgr/widgets/migrate.panel.js b/assets/components/formit/js/mgr/widgets/migrate.panel.js new file mode 100644 index 00000000..c58fe5b7 --- /dev/null +++ b/assets/components/formit/js/mgr/widgets/migrate.panel.js @@ -0,0 +1,77 @@ +FormIt.panel.Migrate = function(config) { + config = config || {}; + Ext.apply(config,{ + border: false + ,baseCls: 'modx-formpanel' + ,id: 'formit-migrate-panel' + ,cls: 'container' + ,items: [{ + html: '

    '+_('formit')+' - '+_('formit.migrate')+'

    ' + ,border: false + ,cls: 'modx-page-header' + },{ + xtype: 'modx-panel' + ,defaults: { border: false ,autoHeight: true } + ,border: true + ,activeItem: 0 + ,hideMode: 'offsets' + ,cls: 'x-tab-panel-bwrap main-wrapper' + ,items: [{ + html: '

    '+_('formit.migrate_desc')+'

    ' + ,border: false + }] + },{ + xtype: 'modx-panel' + ,defaults: { border: false ,autoHeight: true } + ,border: true + ,activeItem: 0 + ,hideMode: 'offsets' + ,cls: 'x-tab-panel-bwrap main-wrapper' + ,items: [{ + html: '

    '+_('formit.migrate_status')+'

    ' + ,border: false + },{ + id: 'formit-migrate-panel-status' + ,html: '' + ,border: false + }] + }] + ,listeners: { + 'render': {fn: this.migrateRedirects, scope:this } + } + }); + FormIt.panel.Migrate.superclass.constructor.call(this,config); +}; +Ext.extend(FormIt.panel.Migrate,MODx.Panel,{ + migrateRedirects: function(){ + MODx.Ajax.request({ + url: FormIt.config.connector_url + ,params: { + action: 'mgr/forms/migrate' + } + ,listeners: { + 'success':{fn:function(r) { + if(r.total) { + var message; + if(r.total == 0) { + // No redirects found in resource properties, success! + message = '

    '+_('formit.migrate_success_msg')+'

    '; + MODx.msg.alert(_('formit.migrate_success'), _('formit.migrate_success_msg'), function() { + location.href = MODx.config.manager_url + '?a=home&namespace=' + MODx.request.namespace; + }); + } else { + // Processing redirects + message = '

    '+_('formit.migrate_running')+'

    '; + Ext.getCmp('formit-migrate-panel').fireEvent('render'); + } + Ext.getCmp('formit-migrate-panel-status').update(message); + } + },scope:this} + ,'failure':{fn:function(r) { + // MODx.msg.alert('error'); + }, scope:this} + } + }); + } +}); +Ext.reg('formit-panel-migrate',FormIt.panel.Migrate); diff --git a/core/components/formit/composer.json b/core/components/formit/composer.json new file mode 100644 index 00000000..d1839ce2 --- /dev/null +++ b/core/components/formit/composer.json @@ -0,0 +1,16 @@ +{ + "name": "sterc/formit", + "description": "FormIt is a dynamic form processing snippet for MODX Revolution developers.", + "keywords": [ + "modx", + "formit" + ], + "require": { + "php": ">=5.6" + }, + "autoload": { + "psr-4": { + "Sterc\\": "src/" + } + } +} diff --git a/core/components/formit/composer.lock b/core/components/formit/composer.lock new file mode 100644 index 00000000..06d607e5 --- /dev/null +++ b/core/components/formit/composer.lock @@ -0,0 +1,19 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "732eb44a5f99b2bd1b3ea7e9ad96cb1a", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.6" + }, + "platform-dev": [] +} diff --git a/core/components/formit/controllers/home.class.php b/core/components/formit/controllers/home.class.php new file mode 100644 index 00000000..e428eb40 --- /dev/null +++ b/core/components/formit/controllers/home.class.php @@ -0,0 +1,43 @@ + + */ + +require_once dirname(__DIR__) . '/index.class.php'; + +class FormItHomeManagerController extends FormItBaseManagerController +{ + /** + * @access public. + */ + public function loadCustomCssJs() + { + $this->addJavascript($this->modx->formit->config['js_url'] . 'mgr/widgets/home.panel.js'); + + $this->addJavascript($this->modx->formit->config['js_url'] . 'mgr/widgets/forms.grid.js'); + $this->addJavascript($this->modx->formit->config['js_url'] . 'mgr/widgets/encryption.grid.js'); + + $this->addLastJavascript($this->modx->formit->config['js_url'] . 'mgr/sections/home.js'); + } + + /** + * @access public. + * @return String. + */ + public function getPageTitle() + { + return $this->modx->lexicon('formit'); + } + + /** + * @access public. + * @return String. + */ + public function getTemplateFile() + { + return $this->modx->formit->config['templates_path'] . 'home.tpl'; + } +} \ No newline at end of file diff --git a/core/components/formit/controllers/migrate.class.php b/core/components/formit/controllers/migrate.class.php new file mode 100644 index 00000000..0f65ad77 --- /dev/null +++ b/core/components/formit/controllers/migrate.class.php @@ -0,0 +1,29 @@ +modx->lexicon('formit.migrate'); + } + public function loadCustomCssJs() + { + $this->addJavascript($this->modx->formit->config['js_url'] . 'mgr/widgets/migrate.panel.js'); + $this->addLastJavascript($this->modx->formit->config['js_url'] . 'mgr/sections/migrate.js'); + } + + public function getTemplateFile() + { + return $this->formit->config['templatesPath'].'migrate.tpl'; + } +} diff --git a/core/components/formit/docs/changelog.txt b/core/components/formit/docs/changelog.txt old mode 100755 new mode 100644 index 2a0dbecf..450f31ca --- a/core/components/formit/docs/changelog.txt +++ b/core/components/formit/docs/changelog.txt @@ -1,5 +1,223 @@ Changelog for FormIt. +FormIt 4.3 +- Add setting to post external without going external. + +FormIt 4.2.7 +==================================== +- Use server_offset_time for grid in manager (PR#219) +- Fix fatal error when empty responce in cronjob (PR#230) +- Add RU (PR#245) and IT (PR#257) translation of country list +- Change stopforumspam API URL (PR#248) +- Fix property for getTableName in resolver (PR#247) + +FormIt 4.2.6 +==================================== +- Add support for UTF-8 when exporting (PR#221) +- Move limit from foreach to query in migration class (PR#236) +- Remove unnecessary mail->reset from autoresponder hook (PR#240) +- Add Ukrainian lexicon + some changes to RU and EN lexicons (PR#242) +- Update Composer autoloader for newer Composer versions (PR#243) + +FormIt 4.2.5 +==================================== +- Added new properties to email hook (#229, thanks to @jako) +- emailSelectTo, emailSelectToName, emailSelectField + +FormIt 4.2.4 +==================================== +- Fix export form select width (#218) +- Fix limit of form filter (#206) +- Fix path to clean processor for cronjob (#215, thanks to @bennyb) +- Fix ability to export all forms (#210, thanks to @JoshuaLuckers) +- Fix PHP notice 'Only variables should be assigned by reference' in Hook.php (#212, thanks to @intersel) +- Updated Russian translation (#208, thanks to @webinmd) + +FormIt 4.2.3 +==================================== +- FormIt 4.2.0 release bug - Fix migration of forms with encryption + +FormIt 4.2.2 +==================================== +- FormIt 4.2.0 release bug - Altering tables on update (#203) + +FormIt 4.2.1 +==================================== +- FormIt 4.2.0 release bug (#202) + +FormIt 4.2.0 +==================================== +- Bug on hasHook() fixed (#182, #181, #170, #193) +- ExtJS refactored for faster and better UI/UX +- IP number added to the grid (#194) +- Better form view with textfields and textareas (#136) +- Remove multiple forms (#143) +- Search by IP (and context menu option to view all forms from 1 IP) +- New permissions added +- formit_encryptions to encrypt/decrypt forms +- Context awereness, an user can only see the forms with the contexts that the user has access to. +- Swedish translation updated +- All other language files checked and filled with English strings +- Formit deprecation notice in 2.7.0dev bug fixed (#190) + +FormIt 4.1.2 +==================================== +- Fix spam hook for better spam prevention thanks to Kristoffer Karlström +- Fix FormItLoadSavedForm for encrypted forms + +FormIt 4.1.1 +==================================== +- Added new hook "renderHooks", which triggers just before rendering the form + +FormIt 4.1.0 +==================================== +- This release is made possible thanks to Bert Kooij / Census.nl. Thanks! +- Added new button in Manager page for manually removing forms. +- Added new system setting for the default amount of days. +- Added cronjob task for automatically deletion of old forms. + +FormIt 4.0.1 +==================================== +- Add option to specify csv delimiter for form export +- Add GDPR compliant attachment handling (#154) - Thanks to @wax100 +- Allow empty isDate validator (PR#164) - Thanks to JoshuaLuckers +- Fix bug with multiple forms on one page (#160) +- Fix modx->log calls in various classes (#161) +- Fix setting redirectParams variable (#165) + +FormIt 4.0.0 +==================================== +- Move formit base classes to /src/ folder and add namespace +- Update existing classes to extend new classes +- Update all snippets to use modx getService +- Move FormItAutoResponder and FormItSaveForm logic to classes +- Add helper functions for all FormIt properties +- Set defaultEngine to InnoDB in mysql schema +- Fix PHP7 error in default email output (PR#156) +- Updated German lexicons (PR#150) +- Add 'Form' column to form export (PR#149) + +FormIt 3.0.4 +==================================== +- Fix checkbox values not showing in email + +FormIt 3.0.3 +==================================== +- Fix FormItSaveForm to allow multiple fields with same fieldName +- Add 'saveTmpFiles' FormIt snippet property to enable/disable saving files to tmp directory +- Remove list() function from formitsaveform snippet for better PHP version compatibility (#98) +- Fix PHP7 by-reference errors (#98) +- Replace ereg() functions with preg_match() for PHP compatibility (#98) +- Increase precision for FormItForm 'ip' field to allow for IPV6 addresses (#135) +- Fix issue where in some cases fields are not correctly saved in FormItForm (#92) +- Optimize FormItForm export class for better performance (#120) +- Add 'attachFilesToEmail' property to control if files are added as attachment to email (#122) + +FormIt 3.0.2 +==================================== +- Fix encryption in formitsaveform snippet to save correct encryption_type +- Fix bug in forms grid when decrypting encrypted forms fail +- Fix migration to check if decrypted data is correct + +FormIt 3.0.1 +==================================== +- Store file uploads in tmp folder to prevent file uploads getting lost in multistep forms +- Add checks for OpenSSL in classes and encryption CMP tab +- Add method_exists check to plugin to prevent errors when method not exists +- Update context-menu in forms-encryption grid to show only encrypt or decrypt +- Set placeholders for file upload $_FILES array +- Add option to FormItCountryOptions snippet to limit country list to selected countries only (PR#123) - thanks to gadgetto + +FormIt 3.0.0 +==================================== +- PLEASE NOTE: THIS UPDATE CONTAINS A MIGRATION SCRIPT FOR ENCRYPTED FORMS - Read more about it at https://github.com/Sterc/FormIt +- Mcrypt encryption/decryption methods replaced with openssl due to mcrypt being deprecated in PHP 7.1 +- Add default file-based chunks as objects +- Add support for pdoTools getChunk method, thanks to soulcreate and bezumkin (PR#89) +- Add French countries for FormItCountryOptions, thanks to beau-gosse (PR#109) +- Add Dutch countries for FormItCountryOptions, thanks to visvoer (PR#110) +- Add extjs stateful parameters to CMP tabs + +FormIt 2.2.11 +==================================== +- Added storeLocation property to FormIt and FormItRetriever. (issue #95, PR #105#106#107) +- Changed default behaviour of emailReplyTo parameter to fallback to email field in form (issue #101) +- Changed math hook to store values in session, preventing easy bypass of math hook (issue #64) +- Add GPM config +- Fix bug with multiple file upload (PR #104) +- Add 'hash' field to FormItSaveForm to allow updating of previously saved forms (PR #94) +- Add FormItLoadSavedForm snippet to retrieve saved forms (PR #94) +- Fix for export with datefilter (issue #96, PR #97) +- Add fiarRequired property (PR#83) +- Update resolver to check for current version to prevent errors on upgrade +- Add system setting for form_encryptkey, to not rely on site_id (issue #68) +- Fix saved forms export when using encrypted forms (issue #48) + +FormIt 2.2.10 +==================================== +- Merged PR#58: Added BOM for Excel to understand UTF-8 non-latin symbols properly. (thanks to govza) +- Merged PR#73: JSON output options for errors and hooks +- Merged PR#79: Create German lexicon for FormIt-CMP (thanks to sebastian-marinescu) + +FormIt 2.2.9 +==================================== +- Merging PR#74 from Jako which solves multiple issues. +- Fix XSS vulnerabilities +- Javascript code cleanup +- Fix empty math operator after form submission #d782c29 + +FormIt 2.2.8 +==================================== +- Fixed export limit and added form dropdown paging #60 +- Fixed typo property lexicons #57 +- Added templates path to config #63 +- Added loading lexicons in ficountryoptions class #21 +- Added ability to dynamically set formName by setting placeholder inside formName equal to an existing form field key #45 + +FormIt 2.2.7 +==================================== +- Optimised export + +FormIt 2.2.6 +==================================== +- Fixed empty placeholder for file field in autoresponder + +FormIt 2.2.5 +==================================== +- Fixed creating table on update +- Added new tab inside CMP for managing encryption +- Added missing br on auto emailTpl + +FormIt 2.2.4 +==================================== +- Fixed bug inside FormItSaveForm and PR #43 + +FormIt 2.2.3 +==================================== +- Added encryption to saved forms +- Added formname to grid +- Saved form is now returned from the hook +- Export unlimited items +- Add RU translation + +FormIt 2.2.2 +==================================== +- Added CMP for the saved forms +- Fixed whitespace PR on required checkboxes + +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 @@ -203,9 +421,9 @@ FormIt 1.0 ==================================== - Fixed bug with emailFrom property getting overwritten - [#ADDON-122] Fixed incorrect message in spam lexicon item -- Added 'spam' hook that utilizes StopForumSpam spam filter. Will filter the fields in the property &spamEmailFields +- Added 'spam' hook that utilizes StopForumSpam spam filter. Will filter the fields in the property &spamEmailFields - Ensure hooks errors are set as placeholders -- Aded fi.success placeholder to be set on a successful form submission if no redirect hook is specified +- Aded fi.success placeholder to be set on a successful form submission if no redirect hook is specified - Added default to emailTpl property so that it is now no longer required. Will send out email with just field names and values. - Added Dutch translation - Added missing formit.contains lexicon entry @@ -215,4 +433,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 diff --git a/core/components/formit/docs/readme.txt b/core/components/formit/docs/readme.txt index d343f56b..03f0ee6d 100644 --- a/core/components/formit/docs/readme.txt +++ b/core/components/formit/docs/readme.txt @@ -1,9 +1,9 @@ -------------------- Snippet: FormIt -------------------- -Author: Shaun McCormick +Author: Sterc A form processing Snippet for MODx Revolution. Official Documentation: -http://rtfm.modx.com/display/ADDON/FormIt \ No newline at end of file +https://docs.modx.com/extras/revo/formit \ No newline at end of file diff --git a/core/components/formit/elements/chunks/migrate/alert.chunk.tpl b/core/components/formit/elements/chunks/migrate/alert.chunk.tpl new file mode 100644 index 00000000..1b88526c --- /dev/null +++ b/core/components/formit/elements/chunks/migrate/alert.chunk.tpl @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/core/components/formit/elements/plugins/formit.plugin.php b/core/components/formit/elements/plugins/formit.plugin.php new file mode 100644 index 00000000..3428a5e3 --- /dev/null +++ b/core/components/formit/elements/plugins/formit.plugin.php @@ -0,0 +1,53 @@ + + * + * 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 + */ +/** + * FormIt plugin + * + * @package formit + */ + +$formit = $modx->getService( + 'formit', + 'FormIt', + $modx->getOption('formit.core_path', null, $modx->getOption('core_path').'components/formit/') .'model/formit/', + array() +); + +if (!($formit instanceof FormIt)) { + return; +} + +switch ($modx->event->name) { + case 'OnManagerPageBeforeRender': + // If migration status is false, show migrate alert message bar in manager + if (method_exists('FormIt','encryptionMigrationStatus')) { + if (!$formit->encryptionMigrationStatus()) { + $modx->lexicon->load('formit:mgr'); + $properties = array('message' => $modx->lexicon('formit.migrate_alert')); + $chunk = $formit->_getTplChunk('migrate/alert'); + if ($chunk) { + $modx->regClientStartupHTMLBlock($chunk->process($properties)); + $modx->regClientCSS($formit->config['cssUrl'] . 'migrate.css'); + } + } + } +} \ No newline at end of file diff --git a/core/components/formit/elements/snippets/snippet.formit.php b/core/components/formit/elements/snippets/snippet.formit.php index 450f202f..b7910ccf 100644 --- a/core/components/formit/elements/snippets/snippet.formit.php +++ b/core/components/formit/elements/snippets/snippet.formit.php @@ -24,10 +24,20 @@ * * A dynamic form processing Snippet for MODx Revolution. * + * @var modX $modx + * @var array $scriptProperties + * * @package formit */ -require_once $modx->getOption('formit.core_path',null,$modx->getOption('core_path',null,MODX_CORE_PATH).'components/formit/').'model/formit/formit.class.php'; -$fi = new FormIt($modx,$scriptProperties); + +$modelPath = $modx->getOption( + 'formit.core_path', + null, + $modx->getOption('core_path', null, MODX_CORE_PATH) . 'components/formit/' +) . 'model/formit/'; +$modx->loadClass('FormIt', $modelPath, true, true); +$fi = new FormIt($modx, $scriptProperties); + $fi->initialize($modx->context->get('key')); $fi->loadRequest(); diff --git a/core/components/formit/elements/snippets/snippet.formitautoresponder.php b/core/components/formit/elements/snippets/snippet.formitautoresponder.php deleted file mode 100644 index decd29ee..00000000 --- a/core/components/formit/elements/snippets/snippet.formitautoresponder.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * 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 - */ -/** - * A custom FormIt hook for auto-responders. - * - * @var modX $modx - * @var array $scriptProperties - * @var FormIt $formit - * @var fiHooks $hook - * - * @package formit - */ -/* setup default properties */ -$tpl = $modx->getOption('fiarTpl',$scriptProperties,'fiarTpl'); -$mailFrom = $modx->getOption('fiarFrom',$scriptProperties,$modx->getOption('emailsender')); -$mailFromName = $modx->getOption('fiarFromName',$scriptProperties,$modx->getOption('site_name')); -$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); -$isHtml = $modx->getOption('fiarHtml',$scriptProperties,true); -$toField = $modx->getOption('fiarToField',$scriptProperties,'email'); -$multiSeparator = $modx->getOption('fiarMultiSeparator',$formit->config,"\n"); -$multiWrapper = $modx->getOption('fiarMultiWrapper',$formit->config,"[[+value]]"); -if (empty($fields[$toField])) { - $modx->log(modX::LOG_LEVEL_ERROR,'[FormIt] Auto-responder could not find field `'.$toField.'` in form submission.'); - return false; -} - -/* handle checkbox and array fields */ -foreach ($fields as $k => &$v) { - if (is_array($v)) { - $vOpts = array(); - foreach ($v as $vKey => $vValue) { - if (is_string($vKey) && !empty($vKey)) { - $vKey = $k.'.'.$vKey; - $fields[$vKey] = $vValue; - } else { - $vOpts[] = str_replace('[[+value]]',$vValue,$multiWrapper); - } - } - $newValue = implode($multiSeparator,$vOpts); - if (!empty($vOpts)) { - $fields[$k] = $newValue; - } - } -} - -/* setup placeholders */ -$placeholders = $fields; -$mailTo= $fields[$toField]; - -$message = $formit->getChunk($tpl,$placeholders); -$modx->parser->processElementTags('',$message,true,false); - -$modx->getService('mail', 'mail.modPHPMailer'); -$modx->mail->reset(); -$modx->mail->set(modMail::MAIL_BODY,$message); -$modx->mail->set(modMail::MAIL_FROM,$hook->_process($mailFrom,$placeholders)); -$modx->mail->set(modMail::MAIL_FROM_NAME,$hook->_process($mailFromName,$placeholders)); -$modx->mail->set(modMail::MAIL_SENDER,$hook->_process($mailSender,$placeholders)); -$modx->mail->set(modMail::MAIL_SUBJECT,$hook->_process($mailSubject,$placeholders)); -$modx->mail->address('to',$mailTo); -$modx->mail->setHTML($isHtml); - -/* reply to */ -$emailReplyTo = $modx->getOption('fiarReplyTo',$scriptProperties,$mailFrom); -$emailReplyTo = $hook->_process($emailReplyTo,$fields); -$emailReplyToName = $modx->getOption('fiarReplyToName',$scriptProperties,$mailFromName); -$emailReplyToName = $hook->_process($emailReplyToName,$fields); -if (!empty($emailReplyTo)) { - $modx->mail->address('reply-to',$emailReplyTo,$emailReplyToName); -} - -/* cc */ -$emailCC = $modx->getOption('fiarCC',$scriptProperties,''); -if (!empty($emailCC)) { - $emailCCName = $modx->getOption('fiarCCName',$scriptProperties,''); - $emailCC = explode(',',$emailCC); - $emailCCName = explode(',',$emailCCName); - $numAddresses = count($emailCC); - for ($i=0;$i<$numAddresses;$i++) { - $etn = !empty($emailCCName[$i]) ? $emailCCName[$i] : ''; - if (!empty($etn)) $etn = $hook->_process($etn,$fields); - $emailCC[$i] = $hook->_process($emailCC[$i],$fields); - if (!empty($emailCC[$i])) { - $modx->mail->address('cc',$emailCC[$i],$etn); - } - } -} - -/* bcc */ -$emailBCC = $modx->getOption('fiarBCC',$scriptProperties,''); -if (!empty($emailBCC)) { - $emailBCCName = $modx->getOption('fiarBCCName',$scriptProperties,''); - $emailBCC = explode(',',$emailBCC); - $emailBCCName = explode(',',$emailBCCName); - $numAddresses = count($emailBCC); - for ($i=0;$i<$numAddresses;$i++) { - $etn = !empty($emailBCCName[$i]) ? $emailBCCName[$i] : ''; - if (!empty($etn)) $etn = $hook->_process($etn,$fields); - $emailBCC[$i] = $hook->_process($emailBCC[$i],$fields); - if (!empty($emailBCC[$i])) { - $modx->mail->address('bcc',$emailBCC[$i],$etn); - } - } -} - -if (!$formit->inTestMode) { - if (!$modx->mail->send()) { - $modx->log(modX::LOG_LEVEL_ERROR,'[FormIt] An error occurred while trying to send the auto-responder email: '.$modx->mail->mailer->ErrorInfo); - return false; - } -} -$modx->mail->reset(); -return true; \ No newline at end of file diff --git a/core/components/formit/elements/snippets/snippet.formitcountryoptions.php b/core/components/formit/elements/snippets/snippet.formitcountryoptions.php index e718efc5..293a89ba 100644 --- a/core/components/formit/elements/snippets/snippet.formitcountryoptions.php +++ b/core/components/formit/elements/snippets/snippet.formitcountryoptions.php @@ -20,17 +20,25 @@ * @package formit */ /** + * FormItCountryOptions + * * Automatically generates and outputs a country list for usage in forms * * @var modX $modx * @var array $scriptProperties + * * @package formit */ -require_once $modx->getOption('formit.core_path',null,$modx->getOption('core_path').'components/formit/').'model/formit/formit.class.php'; -$fi = new FormIt($modx,$scriptProperties); + +$modelPath = $modx->getOption( + 'formit.core_path', + null, + $modx->getOption('core_path', null, MODX_CORE_PATH) . 'components/formit/' +) . 'model/formit/'; +$fi = $modx->getService('formit', 'FormIt', $modelPath, $scriptProperties); /** @var fiCountryOptions $co */ -$co = $fi->loadModule('fiCountryOptions','countryOptions',$scriptProperties); +$co = $fi->loadModule('fiCountryOptions', 'countryOptions', $scriptProperties); $co->initialize(); $co->getData(); $co->loadPrioritized(); diff --git a/core/components/formit/elements/snippets/snippet.formitischecked.php b/core/components/formit/elements/snippets/snippet.formitischecked.php index 7e0097f2..edb30ecc 100644 --- a/core/components/formit/elements/snippets/snippet.formitischecked.php +++ b/core/components/formit/elements/snippets/snippet.formitischecked.php @@ -20,18 +20,22 @@ * @package formit */ /** + * FormItIsChecked + * * Custom output filter that returns checked="checked" if the value is set * * @var string $input * @var string $options + * @var modX $modx + * * @package formit */ $output = ' '; if ($input == $options) { $output = ' checked="checked"'; } -$input = $modx->fromJSON($input); +$input = strpos($input, '"') ? $modx->fromJSON($input) : explode(',', $input); if (!empty($input) && is_array($input) && in_array($options,$input)) { $output = ' checked="checked"'; } -return $output; +return $output; \ No newline at end of file diff --git a/core/components/formit/elements/snippets/snippet.formitisselected.php b/core/components/formit/elements/snippets/snippet.formitisselected.php index e23ed0a9..b88c5577 100644 --- a/core/components/formit/elements/snippets/snippet.formitisselected.php +++ b/core/components/formit/elements/snippets/snippet.formitisselected.php @@ -20,20 +20,22 @@ * @package formit */ /** + * FormItIsChecked + * * Custom output filter that returns checked="checked" if the value is set * * @var string $input * @var string $options + * @var modX $modx + * * @package formit */ $output = ' '; if ($input == $options) { $output = ' selected="selected"'; } -$input = $modx->fromJSON($input); -if(is_array($input)){ - if (in_array($options,$input)) { - $output = ' selected="selected"'; - } +$input = strpos($input, '"') ? $modx->fromJSON($input) : explode(',', $input); +if (!empty($input) && is_array($input) && in_array($options,$input)) { + $output = ' selected="selected"'; } -return $output; +return $output; \ No newline at end of file diff --git a/core/components/formit/elements/snippets/snippet.formitloadsavedform.php b/core/components/formit/elements/snippets/snippet.formitloadsavedform.php new file mode 100644 index 00000000..2e62cd8c --- /dev/null +++ b/core/components/formit/elements/snippets/snippet.formitloadsavedform.php @@ -0,0 +1,98 @@ + + * Copyright 2015 by Wieger Sloot + * Copyright 2016 by YJ Tso + * + * 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 + */ +/** + * A custom FormIt prehook for fetching saved form data. - Based on FormItSaveForm + * + * @var modX $modx + * @var array $scriptProperties + * @var FormIt $formit + * @var fiHooks $hook + * + * @package formit + */ +/* setup default properties */ +// If prehook fails do we continue? +$return = $modx->getOption('returnValueOnFail', $formit->config, true); +$formEncrypt = $modx->getOption('formEncrypt', $formit->config, false); +$formFields = $modx->getOption('formFields', $formit->config, false); +$fieldNames = $modx->getOption('fieldNames', $formit->config, false); +$updateSavedForm = $modx->getOption('updateSavedForm', $formit->config, false); // true, false, '1', '0', or 'values' +// If FormIt config says don't update, don't do it +if (!$updateSavedForm) return $return; +// In order to load form values, the user must provide the hash key somehow +// Usually with a $_GET parameter, but a property in $formit->config will override. +$formHashKeyField = $modx->getOption('savedFormHashKeyField', $formit->config, 'savedFormHashKey'); +$formHashKey = ''; +if (isset($_GET[$formHashKeyField])) $formHashKey = (string) $_GET[$formHashKeyField]; +if ($hook->getValue($formHashKeyField)) $formHashKey = (string) $hook->getValue($formHashKeyField); +if (isset($formit->config[$formHashKeyField])) $formHashKey = $formit->config[$formHashKeyField]; +// our hashing methods return 32 chars. if no valid hash key we're done here. +if (strlen($formHashKey) !== 32) return $return; + +// Try to fetch the saved form +$savedForm = $modx->getObject('FormItForm', array('hash' => $formHashKey)); +if (!$savedForm) return $return; + +if ($formFields) { + $formFields = explode(',', $formFields); + foreach($formFields as $k => $v) { + $formFields[$k] = trim($v); + } +} + +// Initialize the data array +// Handle encryption +if ($formEncrypt) { + $encrypted_data = $savedForm->get('values'); + $data = $savedForm->decrypt($encrypted_data); +} else { + $data = $savedForm->get('values'); +} +if (is_string($data)) $data = $modx->fromJSON($data); +if (!is_array($data)) return $return; + +//Change the fieldnames +if ($fieldNames) { + $newDataArray = array(); + $fieldLabels = array(); + $formFieldNames = explode(',', $fieldNames); + foreach($formFieldNames as $formFieldName){ + list($name, $label) = explode('==', $formFieldName); + // reverse order from FormItSaveForm snippet + $fieldLabels[trim($label)] = trim($name); + } + foreach ($data as $key => $value) { + if ($fieldLabels[$key]) { + $newDataArray[$fieldLabels[$key]] = $value; + }else{ + $newDataArray[$key] = $value; + } + } + $data = $newDataArray; +} + +// Always pass back in the provided hash key +$data[$formHashKeyField] = $formHashKey; +$hook->setValues($data); +return true; \ No newline at end of file diff --git a/core/components/formit/elements/snippets/snippet.formitretriever.php b/core/components/formit/elements/snippets/snippet.formitretriever.php index c4c28f79..1051c08c 100644 --- a/core/components/formit/elements/snippets/snippet.formitretriever.php +++ b/core/components/formit/elements/snippets/snippet.formitretriever.php @@ -20,21 +20,28 @@ * @package formit */ /** + * FormItRetriever + * * Retrieves a prior form submission that was stored with the &store property * in a FormIt call. * * @var modX $modx * @var array $scriptProperties - * + * * @package formit */ -require_once $modx->getOption('formit.core_path',null,$modx->getOption('core_path').'components/formit/').'model/formit/formit.class.php'; -$fi = new FormIt($modx,$scriptProperties); + +$modelPath = $modx->getOption( + 'formit.core_path', + null, + $modx->getOption('core_path', null, MODX_CORE_PATH) . 'components/formit/' +) . 'model/formit/'; +$fi = $modx->getService('formit', 'FormIt', $modelPath, $scriptProperties); /* setup properties */ -$placeholderPrefix = $modx->getOption('placeholderPrefix',$scriptProperties,'fi.'); -$eraseOnLoad = $modx->getOption('eraseOnLoad',$scriptProperties,false); -$redirectToOnNotFound = $modx->getOption('redirectToOnNotFound',$scriptProperties,false); +$placeholderPrefix = $modx->getOption('placeholderPrefix', $scriptProperties, 'fi.'); +$eraseOnLoad = $modx->getOption('eraseOnLoad', $scriptProperties, false); +$redirectToOnNotFound = $modx->getOption('redirectToOnNotFound', $scriptProperties, false); /* fetch data from cache and set to placeholders */ $fi->loadRequest(); @@ -42,21 +49,21 @@ $data = $fi->request->dictionary->retrieve(); if (!empty($data)) { /* set data to placeholders */ - foreach ($data as $k=>$v) { + foreach ($data as $k => $v) { /*checkboxes & other multi-values are stored as arrays, must be imploded*/ if (is_array($v)) { - $data[$k] = implode(',',$v); + $data[$k] = implode(',', $v); } } - $modx->toPlaceholders($data,$placeholderPrefix,''); + $modx->toPlaceholders($data, $placeholderPrefix, ''); /* if set, erase the data on load, otherwise depend on cache expiry time */ if ($eraseOnLoad) { $fi->request->dictionary->erase(); } /* if the data's not found, and we want to redirect somewhere if so, do here */ -} else if (!empty($redirectToOnNotFound)) { +} elseif (!empty($redirectToOnNotFound)) { $url = $modx->makeUrl($redirectToOnNotFound); $modx->sendRedirect($url); } -return ''; +return ''; \ No newline at end of file diff --git a/core/components/formit/elements/snippets/snippet.formitstateoptions.php b/core/components/formit/elements/snippets/snippet.formitstateoptions.php index 42328734..0093a4b4 100644 --- a/core/components/formit/elements/snippets/snippet.formitstateoptions.php +++ b/core/components/formit/elements/snippets/snippet.formitstateoptions.php @@ -20,15 +20,25 @@ * @package formit */ /** + * FormItStateOptions + * * Automatically generates and outputs a U.S. state list for usage in forms - * + * + * @var modX $modx + * @var array $scriptProperties + * * @package formit */ -require_once $modx->getOption('formit.core_path',null,$modx->getOption('core_path').'components/formit/').'model/formit/formit.class.php'; -$fi = new FormIt($modx,$scriptProperties); + +$modelPath = $modx->getOption( + 'formit.core_path', + null, + $modx->getOption('core_path', null, MODX_CORE_PATH) . 'components/formit/' +) . 'model/formit/'; +$fi = $modx->getService('formit', 'FormIt', $modelPath, $scriptProperties); /** @var fiStateOptions $so */ -$so = $fi->loadModule('fiStateOptions','stateOptions',$scriptProperties); +$so = $fi->loadModule('fiStateOptions', 'stateOptions', $scriptProperties); $so->initialize(); $so->getData(); $so->iterate(); diff --git a/core/components/formit/includes/be.states.inc.php b/core/components/formit/includes/be.states.inc.php old mode 100755 new mode 100644 diff --git a/core/components/formit/includes/ca.states.inc.php b/core/components/formit/includes/ca.states.inc.php new file mode 100644 index 00000000..48886f30 --- /dev/null +++ b/core/components/formit/includes/ca.states.inc.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 diff --git a/core/components/formit/includes/fr.countries.inc.php b/core/components/formit/includes/fr.countries.inc.php new file mode 100644 index 00000000..eaa2028b --- /dev/null +++ b/core/components/formit/includes/fr.countries.inc.php @@ -0,0 +1,281 @@ + + * + * 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 countries + * @package formit + * @author Treigh PM + */ + return array ( + 'AF' => 'Afghanistan', + 'ZA' => 'Afrique du Sud', + 'AL' => 'Albanie', + 'DZ' => 'Algérie', + 'DE' => 'Allemagne', + 'AD' => 'Andorre', + 'AO' => 'Angola', + 'AI' => 'Anguilla', + 'AQ' => 'Antarctique', + 'AG' => 'Antigua-et-Barbuda', + 'SA' => 'Arabie saoudite', + 'AR' => 'Argentine', + 'AM' => 'Arménie', + 'AW' => 'Aruba', + 'AU' => 'Australie', + 'AT' => 'Autriche', + 'AZ' => 'Azerbaïdjan', + 'BS' => 'Bahamas', + 'BH' => 'Bahreïn', + 'BD' => 'Bangladesh', + 'BB' => 'Barbade', + 'BE' => 'Belgique', + 'BZ' => 'Belize', + 'BJ' => 'Bénin', + 'BM' => 'Bermudes', + 'BT' => 'Bhoutan', + 'BY' => 'Biélorussie', + 'BO' => 'Bolivie', + 'BA' => 'Bosnie-Herzégovine', + 'BW' => 'Botswana', + 'BR' => 'Brésil', + 'BN' => 'Brunéi Darussalam', + 'BG' => 'Bulgarie', + 'BF' => 'Burkina Faso', + 'BI' => 'Burundi', + 'KH' => 'Cambodge', + 'CM' => 'Cameroun', + 'CA' => 'Canada', + 'CV' => 'Cap-Vert', + 'EA' => 'Ceuta et Melilla', + 'CL' => 'Chili', + 'CN' => 'Chine', + 'CY' => 'Chypre', + 'CO' => 'Colombie', + 'KM' => 'Comores', + 'CG' => 'Congo-Brazzaville', + 'CD' => 'Congo-Kinshasa', + 'KP' => 'Corée du Nord', + 'KR' => 'Corée du Sud', + 'CR' => 'Costa Rica', + 'CI' => 'Côte d’Ivoire', + 'HR' => 'Croatie', + 'CU' => 'Cuba', + 'CW' => 'Curaçao', + 'DK' => 'Danemark', + 'DG' => 'Diego Garcia', + 'DJ' => 'Djibouti', + 'DM' => 'Dominique', + 'EG' => 'Égypte', + 'SV' => 'El Salvador', + 'AE' => 'Émirats arabes unis', + 'EC' => 'Équateur', + 'ER' => 'Érythrée', + 'ES' => 'Espagne', + 'EE' => 'Estonie', + 'VA' => 'État de la Cité du Vatican', + 'FM' => 'États fédérés de Micronésie', + 'US' => 'États-Unis', + 'ET' => 'Éthiopie', + 'FJ' => 'Fidji', + 'FI' => 'Finlande', + 'FR' => 'France', + 'GA' => 'Gabon', + 'GM' => 'Gambie', + 'GE' => 'Géorgie', + 'GH' => 'Ghana', + 'GI' => 'Gibraltar', + 'GR' => 'Grèce', + 'GD' => 'Grenade', + 'GL' => 'Groenland', + 'GP' => 'Guadeloupe', + 'GU' => 'Guam', + 'GT' => 'Guatemala', + 'GG' => 'Guernesey', + 'GN' => 'Guinée', + 'GQ' => 'Guinée équatoriale', + 'GW' => 'Guinée-Bissau', + 'GY' => 'Guyana', + 'GF' => 'Guyane française', + 'HT' => 'Haïti', + 'HN' => 'Honduras', + 'HU' => 'Hongrie', + 'CX' => 'Île Christmas', + 'AC' => 'Île de l’Ascension', + 'IM' => 'Île de Man', + 'NF' => 'Île Norfolk', + 'AX' => 'Îles Åland', + 'KY' => 'Îles Caïmans', + 'IC' => 'Îles Canaries', + 'CC' => 'Îles Cocos', + 'CK' => 'Îles Cook', + 'FO' => 'Îles Féroé', + 'GS' => 'Îles Géorgie du Sud et Sandwich du Sud', + 'FK' => 'Îles Malouines', + 'MP' => 'Îles Mariannes du Nord', + 'MH' => 'Îles Marshall', + 'UM' => 'Îles mineures éloignées des états-Unis', + 'SB' => 'Îles Salomon', + 'TC' => 'Îles Turques-et-Caïques', + 'VG' => 'Îles Vierges britanniques', + 'VI' => 'Îles Vierges des états-Unis', + 'IN' => 'Inde', + 'ID' => 'Indonésie', + 'IQ' => 'Irak', + 'IR' => 'Iran', + 'IE' => 'Irlande', + 'IS' => 'Islande', + 'IL' => 'Israël', + 'IT' => 'Italie', + 'JM' => 'Jamaïque', + 'JP' => 'Japon', + 'JE' => 'Jersey', + 'JO' => 'Jordanie', + 'KZ' => 'Kazakhstan', + 'KE' => 'Kenya', + 'KG' => 'Kirghizistan', + 'KI' => 'Kiribati', + 'XK' => 'Kosovo', + 'KW' => 'Koweït', + 'RE' => 'La Réunion', + 'LA' => 'Laos', + 'LS' => 'Lesotho', + 'LV' => 'Lettonie', + 'LB' => 'Liban', + 'LR' => 'Libéria', + 'LY' => 'Libye', + 'LI' => 'Liechtenstein', + 'LT' => 'Lituanie', + 'LU' => 'Luxembourg', + 'MK' => 'Macédoine', + 'MG' => 'Madagascar', + 'MY' => 'Malaisie', + 'MW' => 'Malawi', + 'MV' => 'Maldives', + 'ML' => 'Mali', + 'MT' => 'Malte', + 'MA' => 'Maroc', + 'MQ' => 'Martinique', + 'MU' => 'Maurice', + 'MR' => 'Mauritanie', + 'YT' => 'Mayotte', + 'MX' => 'Mexique', + 'MD' => 'Moldavie', + 'MC' => 'Monaco', + 'MN' => 'Mongolie', + 'ME' => 'Monténégro', + 'MS' => 'Montserrat', + 'MZ' => 'Mozambique', + 'MM' => 'Myanmar', + 'NA' => 'Namibie', + 'NR' => 'Nauru', + 'NP' => 'Népal', + 'NI' => 'Nicaragua', + 'NE' => 'Niger', + 'NG' => 'Nigéria', + 'NU' => 'Niue', + 'NO' => 'Norvège', + 'NC' => 'Nouvelle-Calédonie', + 'NZ' => 'Nouvelle-Zélande', + 'OM' => 'Oman', + 'UG' => 'Ouganda', + 'UZ' => 'Ouzbékistan', + 'PK' => 'Pakistan', + 'PW' => 'Palaos', + 'PA' => 'Panama', + 'PG' => 'Papouasie-Nouvelle-Guinée', + 'PY' => 'Paraguay', + 'NL' => 'Pays-Bas', + 'BQ' => 'Pays-Bas caribéens', + 'PE' => 'Pérou', + 'PH' => 'Philippines', + 'PN' => 'Pitcairn', + 'PL' => 'Pologne', + 'PF' => 'Polynésie française', + 'PR' => 'Porto Rico', + 'PT' => 'Portugal', + 'QA' => 'Qatar', + 'HK' => 'R.A.S. chinoise de Hong Kong', + 'MO' => 'R.A.S. chinoise de Macao', + 'CF' => 'République centrafricaine', + 'DO' => 'République dominicaine', + 'CZ' => 'République tchèque', + 'RO' => 'Roumanie', + 'GB' => 'Royaume-Uni', + 'RU' => 'Russie', + 'RW' => 'Rwanda', + 'EH' => 'Sahara occidental', + 'BL' => 'Saint-Barthélemy', + 'KN' => 'Saint-Christophe-et-Niévès', + 'SM' => 'Saint-Marin', + 'MF' => 'Saint-Martin (partie française)', + 'SX' => 'Saint-Martin (partie néerlandaise)', + 'PM' => 'Saint-Pierre-et-Miquelon', + 'VC' => 'Saint-Vincent-et-les-Grenadines', + 'SH' => 'Sainte-Hélène', + 'LC' => 'Sainte-Lucie', + 'WS' => 'Samoa', + 'AS' => 'Samoa américaines', + 'ST' => 'Sao Tomé-et-Principe', + 'SN' => 'Sénégal', + 'RS' => 'Serbie', + 'SC' => 'Seychelles', + 'SL' => 'Sierra Leone', + 'SG' => 'Singapour', + 'SK' => 'Slovaquie', + 'SI' => 'Slovénie', + 'SO' => 'Somalie', + 'SD' => 'Soudan', + 'SS' => 'Soudan du Sud', + 'LK' => 'Sri Lanka', + 'SE' => 'Suède', + 'CH' => 'Suisse', + 'SR' => 'Suriname', + 'SJ' => 'Svalbard et Jan Mayen', + 'SZ' => 'Swaziland', + 'SY' => 'Syrie', + 'TJ' => 'Tadjikistan', + 'TW' => 'Taïwan', + 'TZ' => 'Tanzanie', + 'TD' => 'Tchad', + 'TF' => 'Terres australes françaises', + 'IO' => 'Territoire britannique de l’océan Indien', + 'PS' => 'Territoires palestiniens', + 'TH' => 'Thaïlande', + 'TL' => 'Timor oriental', + 'TG' => 'Togo', + 'TK' => 'Tokelau', + 'TO' => 'Tonga', + 'TT' => 'Trinité-et-Tobago', + 'TA' => 'Tristan da Cunha', + 'TN' => 'Tunisie', + 'TM' => 'Turkménistan', + 'TR' => 'Turquie', + 'TV' => 'Tuvalu', + 'UA' => 'Ukraine', + 'UY' => 'Uruguay', + 'VU' => 'Vanuatu', + 'VE' => 'Venezuela', + 'VN' => 'Vietnam', + 'WF' => 'Wallis-et-Futuna', + 'YE' => 'Yémen', + 'ZM' => 'Zambie', + 'ZW' => 'Zimbabwe', + ); diff --git a/core/components/formit/includes/it.countries.inc.php b/core/components/formit/includes/it.countries.inc.php new file mode 100644 index 00000000..946e356e --- /dev/null +++ b/core/components/formit/includes/it.countries.inc.php @@ -0,0 +1,266 @@ + + * + * 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 countries + * @package formit + */ +return array( + 'AF' => 'Afghanistan', + 'AL' => 'Albania', + 'DZ' => 'Algeria', + 'AS' => 'Samoa Americane', + 'AD' => 'Andorra', + 'AO' => 'Angola', + 'AI' => 'Anguilla', + 'AQ' => 'Antartide', + 'AG' => 'Antigua e Barbuda', + 'AR' => 'Argentina', + 'AM' => 'Armenia', + 'AW' => 'Aruba', + 'AU' => 'Australia', + 'AT' => 'Austria', + 'AZ' => 'Azerbaijan', + 'BS' => 'Bahamas', + 'BH' => 'Bahrain', + 'BD' => 'Bangladesh', + 'BB' => 'Barbados', + 'BY' => 'Bielorussia', + 'BE' => 'Belgio', + 'BZ' => 'Belize', + 'BJ' => 'Benin', + 'BM' => 'Bermuda', + 'BT' => 'Bhutan', + 'BO' => 'Bolivia', + 'BA' => 'Bosnia Erzegovina', + 'BW' => 'Botswana', + 'BV' => 'Isola Bouvet', + 'BR' => 'Brasile', + 'IO' => 'Territorio britannico dell\'Oceano Indiano', + 'BN' => 'Brunei', + 'BG' => 'Bulgaria', + 'BF' => 'Burkina Faso', + 'BI' => 'Burundi', + 'KH' => 'Cambogia', + 'CM' => 'Camerun', + 'CA' => 'Canada', + 'CV' => 'Capo Verde', + 'KY' => 'Isole Cayman', + 'CF' => 'Repubblica Centrafricana', + 'TD' => 'Chad', + 'CL' => 'Cile', + 'CN' => 'Cina', + 'CX' => 'Isola di Natale', + 'CC' => 'Isole Cocos (Keeling)', + 'CO' => 'Colombia', + 'KM' => 'Comore', + 'CG' => 'Congo', + 'CD' => 'Repubblica Democratica del Congo', + 'CK' => 'Isole Cook', + 'CR' => 'Costa Rica', + 'CI' => 'Costa d\'Avorio', + 'HR' => 'Croazia', + 'CU' => 'Cuba', + 'CY' => 'Cipro', + 'CZ' => 'Repubblica Ceca', + 'DK' => 'Danimarca', + 'DJ' => 'Gibuti', + 'DM' => 'Dominica', + 'DO' => 'Repubblica Dominicana', + 'EC' => 'Ecuador', + 'EG' => 'Egitto', + 'SV' => 'El Salvador', + 'GQ' => 'Guinea Equatoriale', + 'ER' => 'Eritrea', + 'EE' => 'Estonia', + 'ET' => 'Etiopia', + 'FK' => 'Isole Falkland (Malvinas)', + 'FO' => 'Isole Faroe', + 'FJ' => 'Fiji', + 'FI' => 'Finlandia', + 'FR' => 'Francia', + 'GF' => 'Guyana francese', + 'PF' => 'Polinesia Francese', + 'TF' => 'Territori australi francesi', + 'GA' => 'Gabon', + 'GM' => 'Gambia', + 'GE' => 'Georgia', + 'DE' => 'Germania', + 'GH' => 'Ghana', + 'GI' => 'Gibilterra', + 'GR' => 'Grecia', + 'GL' => 'Groenlandia', + 'GD' => 'Grenada', + 'GP' => 'Guadalupa', + 'GU' => 'Guam', + 'GT' => 'Guatemala', + 'GN' => 'Guinea', + 'GW' => 'Guinea-Bissau', + 'GY' => 'Guyana', + 'HT' => 'Haiti', + 'HM' => 'Isola Heard e Isole McDonald', + 'VA' => 'Città del Vaticano', + 'HN' => 'Honduras', + 'HK' => 'Hong Kong', + 'HU' => 'Ungheria', + 'IS' => 'Islanda', + 'IN' => 'India', + 'ID' => 'Indonesia', + 'IR' => 'Iran', + 'IQ' => 'Iraq', + 'IE' => 'Irlanda', + 'IL' => 'Israele', + 'IT' => 'Italia', + 'JM' => 'Giamaica', + 'JP' => 'Giappone', + 'JO' => 'Giordania', + 'KZ' => 'Kazakistan', + 'KE' => 'Kenya', + 'KI' => 'Kiribati', + 'KP' => 'Repubblica Popolare Democratica di Corea', + 'KR' => 'Repubblica di Corea', + 'KW' => 'Kuwait', + 'KG' => 'Kirghizistan', + 'LA' => 'Laos', + 'LV' => 'Lettonia', + 'LB' => 'Libano', + 'LS' => 'Lesotho', + 'LR' => 'Liberia', + 'LY' => 'Libia', + 'LI' => 'Liechtenstein', + 'LT' => 'Lituania', + 'LU' => 'Lussemburgo', + 'MO' => 'Macao', + 'MK' => 'Macedonia', + 'MG' => 'Madagascar', + 'MW' => 'Malawi', + 'MY' => 'Malesia', + 'MV' => 'Maldive', + 'ML' => 'Mali', + 'MT' => 'Malta', + 'MH' => 'Isole Marshall', + 'MQ' => 'Martinica', + 'MR' => 'Mauritania', + 'MU' => 'Mauritius', + 'YT' => 'Mayotte', + 'MX' => 'Messico', + 'FM' => 'Stati Federati di Micronesia', + 'MD' => 'Moldavia', + 'MC' => 'Monaco', + 'MN' => 'Mongolia', + 'MS' => 'Montserrat', + 'MA' => 'Marocco', + 'MZ' => 'Mozambico', + 'MM' => 'Birmania', + 'NA' => 'Namibia', + 'NR' => 'Nauru', + 'NP' => 'Nepal', + 'NL' => 'Olanda', + 'AN' => 'Antille Olandesi', + 'NC' => 'Nuova Caledonia', + 'NZ' => 'Nuova Zelanda', + 'NI' => 'Nicaragua', + 'NE' => 'Niger', + 'NG' => 'Nigeria', + 'NU' => 'Niue', + 'NF' => 'Isola Norfolk', + 'MP' => 'Isole Marianne Settentrionali', + 'NO' => 'Norvegia', + 'OM' => 'Oman', + 'PK' => 'Pakistan', + 'PW' => 'Palau', + 'PS' => 'Territori palestinesi', + 'PA' => 'Panama', + 'PG' => 'Papua Nuova Guinea', + 'PY' => 'Paraguay', + 'PE' => 'Perù', + 'PH' => 'Filippine', + 'PN' => 'Isole Pitcairn', + 'PL' => 'Polonia', + 'PT' => 'Portogallo', + 'PR' => 'Porto Rico', + 'QA' => 'Qatar', + 'RE' => 'Riunione', + 'RO' => 'Romania', + 'RU' => 'Federazione Russa', + 'RW' => 'Ruanda', + 'SH' => 'Sant\'Elena', + 'KN' => 'Saint Kitts e Nevis', + 'LC' => 'Santa Lucia', + 'PM' => 'Saint-Pierre e Miquelon', + 'VC' => 'Saint Vincent e Grenadine', + 'WS' => 'Samoa', + 'SM' => 'San Marino', + 'ST' => 'São Tomé e Príncipe', + 'SA' => 'Arabia Saudita', + 'SN' => 'Senegal', + 'CS' => 'Serbia e Montenegro', + 'SC' => 'Seychelles', + 'SL' => 'Sierra Leone', + 'SG' => 'Singapore', + 'SK' => 'Slovacchia', + 'SI' => 'Slovenia', + 'SB' => 'Isole Solomon', + 'SO' => 'Somalia', + 'ZA' => 'Sud Africa', + 'GS' => 'Georgia del Sud e Sandwich Australi', + 'ES' => 'Spagna', + 'LK' => 'Sri Lanka', + 'SD' => 'Sudan', + 'SR' => 'Suriname', + 'SJ' => 'Svalbard e Jan Mayen', + 'SZ' => 'eSwatini', + 'SE' => 'Svezia', + 'CH' => 'Svizzera', + 'SY' => 'Siria', + 'TW' => 'Taiwan', + 'TJ' => 'Tagikistan', + 'TZ' => 'Tanzania', + 'TH' => 'Tailandia', + 'TL' => 'Timor Est', + 'TG' => 'Togo', + 'TK' => 'Tokelau', + 'TO' => 'Tonga', + 'TT' => 'Trinidad e Tobago', + 'TN' => 'Tunisia', + 'TR' => 'Turchia', + 'TM' => 'Turkmenistan', + 'TC' => 'Isole Turks e Caicos', + 'TV' => 'Tuvalu', + 'UG' => 'Uganda', + 'UA' => 'Ucraina', + 'AE' => 'Emirati Arabi Uniti', + 'GB' => 'Regno Unito', + 'US' => 'Stati Uniti', + 'UM' => 'Isole Minori Esterne degli Stati Uniti', + 'UY' => 'Uruguay', + 'UZ' => 'Uzbekistan', + 'VU' => 'Vanuatu', + 'VE' => 'Venezuela', + 'VN' => 'Vietnam', + 'VG' => 'Isole Vergini britanniche', + 'VI' => 'Isole Vergini Americane', + 'WF' => 'Wallis e Futuna', + 'EH' => 'Sahara Occidentale', + 'YE' => 'Yemen', + 'ZM' => 'Zambia', + 'ZW' => 'Zimbabwe', +); \ No newline at end of file diff --git a/core/components/formit/includes/nl.countries.inc.php b/core/components/formit/includes/nl.countries.inc.php new file mode 100644 index 00000000..f6cb558f --- /dev/null +++ b/core/components/formit/includes/nl.countries.inc.php @@ -0,0 +1,276 @@ + + * + * 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 countries + * @package formit + * @author Jelle Maes at vids-and-bits.be + */ +return array( + 'AF' => 'Afghanistan', + 'AL' => 'Albanië', + 'DZ' => 'Algerije', + 'VI' => 'Amerikaanse Maagdeneilanden', + 'AS' => 'Amerikaans-Samoa', + 'AD' => 'Andorra', + 'AO' => 'Angola', + 'AI' => 'Anguilla', + 'AQ' => 'Antarctica', + 'AG' => 'Antigua en Barbuda', + 'AR' => 'Argentinië', + 'AM' => 'Armenië', + 'AW' => 'Aruba', + 'AU' => 'Australië', + 'AZ' => 'Azerbeidzjan', + 'BS' => 'Bahamas', + 'BH' => 'Bahrein', + 'BD' => 'Bangladesh', + 'BB' => 'Barbados', + 'BE' => 'België', + 'BZ' => 'Belize', + 'BJ' => 'Benin', + 'BM' => 'Bermuda', + 'PS' => 'Bezette Palestijnse gebieden', + 'BT' => 'Bhutan', + 'BO' => 'Bolivië', + 'BQ' => 'Bonaire, Sint-Eustatius en Saba', + 'BA' => 'Bosnië en Herzegovina', + 'BW' => 'Botswana', + 'BV' => 'Bouveteiland', + 'BR' => 'Brazilië', + 'IO' => 'Brits Indische oceaan', + 'VG' => 'Britse Maagdeneilanden', + 'BN' => 'Brunei Darussalam', + 'BG' => 'Bulgarije', + 'BF' => 'Burkina Faso', + 'BI' => 'Burundi', + 'KH' => 'Cambodja', + 'CA' => 'Canada', + 'KY' => 'Caymaneilanden', + 'CF' => 'Centraal-Afrika', + 'CL' => 'Chili', + 'CN' => 'China', + 'CX' => 'Christmaseiland', + 'CC' => 'Cocos- (Keeling-) eilanden', + 'CO' => 'Colombia', + 'KM' => 'Comoren', + 'CD' => 'Congo', + 'CG' => 'Congo', + 'CK' => 'Cookeilanden', + 'CR' => 'Costa Rica', + 'CU' => 'Cuba', + 'CW' => 'Curaçao', + 'CY' => 'Cyprus', + 'DK' => 'Denemarken', + 'DJ' => 'Djibouti', + 'DM' => 'Dominica', + 'DO' => 'Dominicaanse Republiek', + 'DE' => 'Duitsland', + 'EC' => 'Ecuador', + 'EG' => 'Egypte', + 'IM' => 'Eiland Man', + 'SV' => 'El Salvador', + 'GQ' => 'Equatoriaal-Guinea', + 'ER' => 'Eritrea', + 'EE' => 'Estland', + 'ET' => 'Ethiopië', + 'FO' => 'Faeröereilanden', + 'FK' => 'Falklandeilanden (Malvinas)', + 'FJ' => 'Fiji', + 'PH' => 'Filipijnen', + 'FI' => 'Finland', + 'FR' => 'Frankrijk', + 'TF' => 'Franse zuidelijke gebieden', + 'GF' => 'Frans-Guyana', + 'PF' => 'Frans-Polynesië', + 'GA' => 'Gabon', + 'GM' => 'Gambia', + 'GE' => 'Georgië', + 'GH' => 'Ghana', + 'GI' => 'Gibraltar', + 'GD' => 'Grenada', + 'GR' => 'Griekenland', + 'GL' => 'Groenland', + 'GP' => 'Guadeloupe', + 'GU' => 'Guam', + 'GT' => 'Guatemala', + 'GG' => 'Guernsey', + 'GN' => 'Guinea', + 'GW' => 'Guinee-Bissau', + 'GY' => 'Guyana', + 'HT' => 'Haïti', + 'HM' => 'Heard- en McDonaldeilanden', + 'VA' => 'Heilige stoel', + 'HN' => 'Honduras', + 'HU' => 'Hongarije', + 'HK' => 'Hongkong', + 'IE' => 'Ierland', + 'IS' => 'Ijsland', + 'IN' => 'India', + 'ID' => 'Indonesië', + 'IQ' => 'Irak', + 'IR' => 'Iran', + 'IL' => 'Israël', + 'IT' => 'Italië', + 'CI' => 'Ivoorkust', + 'JM' => 'Jamaica', + 'JP' => 'Japan', + 'YE' => 'Jemen', + 'JE' => 'Jersey', + 'JO' => 'Jordanië', + 'CV' => 'Kaapverdië', + 'CM' => 'Kameroen', + 'KZ' => 'Kazachstan', + 'KE' => 'Kenia', + 'KG' => 'Kirgistan', + 'KI' => 'Kiribati', + 'UM' => 'Kleine afgelegen eilanden van de Verenigde Staten', + 'KW' => 'Koeweit', + 'HR' => 'Kroatië', + 'LA' => 'Laos', + 'LS' => 'Lesotho', + 'LV' => 'Letland', + 'LB' => 'Libanon', + 'LR' => 'Liberia', + 'LY' => 'Libië', + 'LI' => 'Liechtenstein', + 'LT' => 'Litouwen', + 'LU' => 'Luxemburg', + 'MO' => 'Macao', + 'MK' => 'Macedonië', + 'MG' => 'Madagascar', + 'MW' => 'Malawi', + 'MV' => 'Maldiven', + 'MY' => 'Maleisië', + 'ML' => 'Mali', + 'MT' => 'Malta', + 'MA' => 'Marokko', + 'MH' => 'Marshalleilanden', + 'MQ' => 'Martinique', + 'MR' => 'Mauritanië', + 'MU' => 'Mauritius', + 'YT' => 'Mayotte', + 'MX' => 'Mexico', + 'FM' => 'Micronesië', + 'MD' => 'Moldavië', + 'MC' => 'Monaco', + 'MN' => 'Mongolië', + 'ME' => 'Montenegro', + 'MS' => 'Montserrat', + 'MZ' => 'Mozambique', + 'MM' => 'Myanmar', + 'NA' => 'Namibië', + 'NR' => 'Nauru', + 'NL' => 'Nederland', + 'NP' => 'Nepal', + 'NI' => 'Nicaragua', + 'NC' => 'Nieuw-Caledonië', + 'NZ' => 'Nieuw-Zeeland', + 'NE' => 'Niger', + 'NG' => 'Nigeria', + 'NU' => 'Niue', + 'MP' => 'Noordelijke Marianen', + 'KP' => 'Noord-Korea', + 'NO' => 'Noorwegen', + 'NF' => 'Norfolkeiland', + 'UG' => 'Oeganda', + 'UA' => 'Oekraïne', + 'UZ' => 'Oezbekistan', + 'OM' => 'Oman', + 'AT' => 'Oostenrijk', + 'TL' => 'Oost-Timor', + 'PK' => 'Pakistan', + 'PW' => 'Palau', + 'PA' => 'Panama', + 'PG' => 'Papoea-Nieuw-Guinea', + 'PY' => 'Paraguay', + 'PE' => 'Peru', + 'PN' => 'Pitcairn', + 'PL' => 'Polen', + 'PT' => 'Portugal', + 'PR' => 'Puerto Rico', + 'QA' => 'Qatar', + 'RE' => 'Réunion', + 'RO' => 'Roemenië', + 'RU' => 'Rusland', + 'RW' => 'Rwanda', + 'KN' => 'Saint Kitts en Nevis', + 'VC' => 'Saint Vincent en de Grenadines', + 'BL' => 'Saint-Barthélemy', + 'PM' => 'Saint-Pierre en Miquelon', + 'SB' => 'Salomonseilanden', + 'WS' => 'Samoa', + 'SM' => 'San Marino', + 'ST' => 'São Tomé en Príncipe', + 'SA' => 'Saoedi-Arabië', + 'SN' => 'Senegal', + 'RS' => 'Servië', + 'SC' => 'Seychellen', + 'SL' => 'Sierra Leone', + 'SG' => 'Singapore', + 'SH' => 'Sint Helena, Ascension en Tristan da Cunha', + 'LC' => 'Sint Lucia', + 'MF' => 'Sint Maarten (Frans deel)', + 'SX' => 'Sint Maarten (Nederlands deel)', + 'SI' => 'Slovenië', + 'SK' => 'Slowakije', + 'SD' => 'Soedan', + 'SO' => 'Somalië', + 'ES' => 'Spanje', + 'LK' => 'Sri Lanka', + 'SR' => 'Suriname', + 'SJ' => 'Svalbard en Jan Mayen', + 'SZ' => 'Swaziland', + 'SY' => 'Syrië', + 'TJ' => 'Tadzjikistan', + 'TW' => 'Taiwan, Chinese provincie', + 'TZ' => 'Tanzanië', + 'TH' => 'Thailand', + 'TG' => 'Togo', + 'TK' => 'Tokelau', + 'TO' => 'Tonga', + 'TT' => 'Trinidad en Tobago', + 'TD' => 'Tsjaad', + 'CZ' => 'Tsjechië', + 'TN' => 'Tunesië', + 'TR' => 'Turkije', + 'TM' => 'Turkmenistan', + 'TC' => 'Turks- en Caicoseilanden', + 'TV' => 'Tuvalu', + 'UY' => 'Uruguay', + 'VU' => 'Vanuatu', + 'VE' => 'Venezuela', + 'GB' => 'Verenigd Koninkrijk', + 'AE' => 'Verenigde Arabische Emiraten', + 'US' => 'Verenigde Staten', + 'VN' => 'Vietnam', + 'WF' => 'Wallis en Futuna', + 'EH' => 'Westelijke Sahara', + 'BY' => 'Wit-Rusland', + 'ZM' => 'Zambia', + 'ZW' => 'Zimbabwe', + 'KR' => 'Zuid Korea', + 'ZA' => 'Zuid-Afrika', + 'GS' => 'Zuid-Georgië en de Zuid-Sandwicheilanden', + 'SS' => 'Zuid-Soedan', + 'SE' => 'Zweden', + 'CH' => 'Zwitserland' +); diff --git a/core/components/formit/includes/nl.states.inc.php b/core/components/formit/includes/nl.states.inc.php old mode 100755 new mode 100644 diff --git a/core/components/formit/includes/ru.countries.inc.php b/core/components/formit/includes/ru.countries.inc.php new file mode 100644 index 00000000..05c897a8 --- /dev/null +++ b/core/components/formit/includes/ru.countries.inc.php @@ -0,0 +1,266 @@ + + * + * 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 countries + * @package formit + */ +return array( + 'AU' => 'Австралия', + 'AT' => 'Австрия', + 'AZ' => 'Азербайджан', + 'AL' => 'Албания', + 'DZ' => 'Алжир', + 'AS' => 'Американское Самоа', + 'AI' => 'Ангилья', + 'AO' => 'Ангола', + 'AD' => 'Андорра', + 'AQ' => 'Антарктида', + 'AG' => 'Антигуа и Барбуда', + 'AR' => 'Аргентина', + 'AM' => 'Армения', + 'AW' => 'Аруба', + 'AF' => 'Афганистан', + 'BS' => 'Багамы', + 'BD' => 'Бангладеш', + 'BB' => 'Барбадос', + 'BH' => 'Бахрейн', + 'BY' => 'Беларусь', + 'BZ' => 'Белиз', + 'BE' => 'Бельгия', + 'BJ' => 'Бенин', + 'BM' => 'Бермудские острова', + 'BG' => 'Болгария', + 'BO' => 'Боливия', + 'BA' => 'Босния и Герцеговина', + 'BW' => 'Ботсвана', + 'BR' => 'Бразилия', + 'IO' => 'Британская территория в Индийском океане', + 'BN' => 'Бруней-Даруссалам', + 'BF' => 'Буркина-Фасо', + 'BI' => 'Бурунди', + 'BT' => 'Бутан', + 'VU' => 'Вануату', + 'HU' => 'Венгрия', + 'VE' => 'Венесуэла', + 'VG' => 'Виргинские острова, Британские', + 'VI' => 'Виргинские острова, США', + 'UM' => 'Внешние малые острова США', + 'RE' => 'Воссоединение', + 'VN' => 'Вьетнам', + 'GA' => 'Габон', + 'HT' => 'Гаити', + 'GY' => 'Гайана', + 'GM' => 'Гамбия', + 'GH' => 'Гана', + 'GP' => 'Гваделупа', + 'GT' => 'Гватемала', + 'GN' => 'Гвинея', + 'GW' => 'Гвинея-Бисау', + 'DE' => 'Германия', + 'GI' => 'Гибралтар', + 'HN' => 'Гондурас', + 'HK' => 'Гонконг', + 'GD' => 'Гренада', + 'GL' => 'Гренландия', + 'GR' => 'Греция', + 'GE' => 'Грузия', + 'GU' => 'Гуам', + 'DK' => 'Дания', + 'CD' => 'Демократическая Республика Конго', + 'DJ' => 'Джибути', + 'DM' => 'Доминика', + 'DO' => 'Доминиканская республика', + 'EG' => 'Египет', + 'ZM' => 'Замбия', + 'EH' => 'Западная Сахара', + 'ZW' => 'Зимбабве', + 'IL' => 'Израиль', + 'IN' => 'Индия', + 'ID' => 'Индонезия', + 'JO' => 'Иордания', + 'IQ' => 'Ирак', + 'IR' => 'Иран, Исламская Республика', + 'IE' => 'Ирландия', + 'IS' => 'Исландия', + 'ES' => 'Испания', + 'IT' => 'Италия', + 'YE' => 'Йемен', + 'CV' => 'Кабо-Верде', + 'KZ' => 'Казахстан', + 'KY' => 'Каймановы острова', + 'KH' => 'Камбоджа', + 'CM' => 'Камерун', + 'CA' => 'Канада', + 'QA' => 'Катар', + 'KE' => 'Кения', + 'CY' => 'Кипр', + 'KI' => 'Кирибати', + 'CN' => 'Китай', + 'CC' => 'Кокосовые (Килинг) острова', + 'CO' => 'Колумбия', + 'KM' => 'Коморские острова', + 'CG' => 'Конго', + 'KP' => 'Корея, Народно-Демократическая Республика', + 'CR' => 'Коста-Рика', + 'CI' => 'Кот-д`Ивуар', + 'CU' => 'Куба', + 'KW' => 'Кувейт', + 'KG' => 'Кыргызстан', + 'LA' => 'Лаосская Народно-Демократическая Республика', + 'LV' => 'Латвия', + 'LS' => 'Лесото', + 'LR' => 'Либерия', + 'LB' => 'Ливан', + 'LY' => 'Ливийская Арабская Джамахирия', + 'LT' => 'Литва', + 'LI' => 'Лихтенштейн', + 'LU' => 'Люксембург', + 'MU' => 'Маврикий', + 'MR' => 'Мавритания', + 'MG' => 'Мадагаскар', + 'YT' => 'Майотта', + 'MO' => 'Макао', + 'MK' => 'Македония, бывшая югославская Республика', + 'MW' => 'Малави', + 'MY' => 'Малайзия', + 'ML' => 'Мали', + 'MV' => 'Мальдивы', + 'MT' => 'Мальта', + 'MA' => 'Марокко', + 'MQ' => 'Мартиника', + 'MH' => 'Маршалловы острова', + 'MX' => 'Мексика', + 'FM' => 'Микронезия, Федеративные Штаты', + 'MZ' => 'Мозамбик', + 'MC' => 'Монако', + 'MN' => 'Монголия', + 'MS' => 'Монтсеррат', + 'MM' => 'Мьянма', + 'NA' => 'Намибия', + 'NR' => 'Науру', + 'NP' => 'Непал', + 'NE' => 'Нигер', + 'NG' => 'Нигерия', + 'AN' => 'Нидерландские Антильские острова', + 'NL' => 'Нидерланды', + 'NI' => 'Никарагуа', + 'NU' => 'Ниуэ', + 'NZ' => 'Новая Зеландия', + 'NC' => 'Новая Каледония', + 'NO' => 'Норвегия', + 'AE' => 'Объединенные Арабские Эмираты', + 'OM' => 'Оман', + 'BV' => 'Остров Буве', + 'NF' => 'Остров Норфолк', + 'CX' => 'Остров Рождества', + 'SH' => 'Остров Святой Елены', + 'HM' => 'Остров Херд и острова Макдональд', + 'CK' => 'Острова Кука', + 'TC' => 'Острова Теркс и Кайкос', + 'PK' => 'Пакистан', + 'PW' => 'Палау', + 'PS' => 'Палестинская территория, оккупированная', + 'PA' => 'Панама', + 'PG' => 'Папуа-Новая Гвинея', + 'PY' => 'Парагвай', + 'PE' => 'Перу', + 'PN' => 'Питкэрн', + 'PL' => 'Польша', + 'PT' => 'Португалия', + 'PR' => 'Пуэрто-Рико', + 'KR' => 'Республика Корея', + 'MD' => 'Республика Молдова', + 'RU' => 'Российская Федерация', + 'RW' => 'Руанда', + 'RO' => 'Румыния', + 'US' => 'США', + 'SV' => 'Сальвадор', + 'WS' => 'Самоа', + 'SM' => 'Сан-Марино', + 'ST' => 'Сан-Томе и Принсипи', + 'SA' => 'Саудовская Аравия', + 'SZ' => 'Свазиленд', + 'VA' => 'Святой Престол (город-государство Ватикан)', + 'MP' => 'Северные Марианские острова', + 'SC' => 'Сейшелы', + 'PM' => 'Сен-Пьер и Микелон', + 'SN' => 'Сенегал', + 'VC' => 'Сент-Винсент и Гренадины', + 'KN' => 'Сент-Китс и Невис', + 'LC' => 'Сент-Люсия', + 'CS' => 'Сербия и Черногория', + 'SG' => 'Сингапур', + 'SY' => 'Сирийская Арабская Республика', + 'SK' => 'Словакия', + 'SI' => 'Словения', + 'GB' => 'Соединённое Королевство Великобритании и Северной Ирландии', + 'SB' => 'Соломоновы Острова', + 'SO' => 'Сомали', + 'SD' => 'Судан', + 'SR' => 'Суринам', + 'SL' => 'Сьерра-Леоне', + 'TJ' => 'Таджикистан', + 'TH' => 'Таиланд', + 'TW' => 'Тайвань', + 'TZ' => 'Танзания, Объединенная Республика', + 'TL' => 'Тимор-Лешти', + 'TG' => 'Того', + 'TK' => 'Токелау', + 'TO' => 'Тонга', + 'TT' => 'Тринидад и Тобаго', + 'TV' => 'Тувалу', + 'TN' => 'Тунис', + 'TM' => 'Туркменистан', + 'TR' => 'Турция', + 'UG' => 'Уганда', + 'UZ' => 'Узбекистан', + 'UA' => 'Украина', + 'WF' => 'Уоллис и Футуна', + 'UY' => 'Уругвай', + 'FO' => 'Фарерские острова', + 'FJ' => 'Фиджи', + 'PH' => 'Филиппины', + 'FI' => 'Финляндия', + 'FK' => 'Фолклендские (Мальвинские) острова', + 'FR' => 'Франция', + 'GF' => 'Французская Гвиана', + 'PF' => 'Французская Полинезия', + 'HR' => 'Хорватия', + 'CF' => 'Центральноафриканская Республика', + 'TD' => 'Чад', + 'CZ' => 'Чешская Республика', + 'CL' => 'Чили', + 'CH' => 'Швейцария', + 'SE' => 'Швеция', + 'SJ' => 'Шпицберген и Ян Майен', + 'LK' => 'Шри-Ланка', + 'EC' => 'Эквадор', + 'GQ' => 'Экваториальная Гвинея', + 'ER' => 'Эритрея', + 'EE' => 'Эстония', + 'ET' => 'Эфиопия', + 'ZA' => 'Южная Африка', + 'GS' => 'Южная Георгия и Южные Сандвичевы острова', + 'TF' => 'Южные французские территории', + 'JM' => 'Ямайка', + 'JP' => 'Япония', +); \ No newline at end of file diff --git a/core/components/formit/includes/ru.states.inc.php b/core/components/formit/includes/ru.states.inc.php new file mode 100644 index 00000000..564f1019 --- /dev/null +++ b/core/components/formit/includes/ru.states.inc.php @@ -0,0 +1,114 @@ + + * + * 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 Russian Federation regions + * @package formit + */ +return array( + '22' => 'Алтайский край', + '28' => 'Амурская область', + '29' => 'Архангельская область', + '30' => 'Астраханская область', + '31' => 'Белгородская область', + '32' => 'Брянская область', + '33' => 'Владимирская область', + '34' => 'Волгоградская область', + '35' => 'Вологодская область', + '36' => 'Воронежская область', + '79' => 'Еврейская автономная область', + '75' => 'Забайкальский край', + '37' => 'Ивановская область', + '99' => 'Иные территории, включая город и космодром Байконур', + '38' => 'Иркутская область', + '07' => 'Кабардино-Балкарская Республика', + '39' => 'Калининградская область', + '40' => 'Калужская область', + '41' => 'Камчатский край', + '09' => 'Карачаево-Черкесская Республика', + '42' => 'Кемеровская область', + '43' => 'Кировская область', + '44' => 'Костромская область', + '23' => 'Краснодарский край', + '24' => 'Красноярский край', + '45' => 'Курганская область', + '46' => 'Курская область', + '47' => 'Ленинградская область', + '48' => 'Липецкая область', + '49' => 'Магаданская область', + '77' => 'Москва', + '50' => 'Московская область', + '51' => 'Мурманская область', + '83' => 'Ненецкий автономный округ', + '52' => 'Нижегородская область', + '53' => 'Новгородская область', + '54' => 'Новосибирская область', + '55' => 'Омская область', + '56' => 'Оренбургская область', + '57' => 'Орловская область', + '58' => 'Пензенская область', + '59' => 'Пермский край', + '25' => 'Приморский край', + '60' => 'Псковская область', + '01' => 'Республика Адыгея (Адыгея)', + '04' => 'Республика Алтай', + '02' => 'Республика Башкортостан', + '03' => 'Республика Бурятия', + '05' => 'Республика Дагестан', + '06' => 'Республика Ингушетия', + '08' => 'Республика Калмыкия', + '10' => 'Республика Карелия', + '11' => 'Республика Коми', + '91' => 'Республика Крым', + '12' => 'Республика Марий Эл', + '13' => 'Республика Мордовия', + '14' => 'Республика Саха (Якутия)', + '15' => 'Республика Северная Осетия - Алания', + '16' => 'Республика Татарстан (Татарстан)', + '17' => 'Республика Тыва', + '19' => 'Республика Хакасия', + '61' => 'Ростовская область', + '62' => 'Рязанская область', + '63' => 'Самарская область', + '78' => 'Санкт-Петербург', + '64' => 'Саратовская область', + '65' => 'Сахалинская область', + '66' => 'Свердловская область', + '92' => 'Севастополь', + '67' => 'Смоленская область', + '26' => 'Ставропольский край', + '68' => 'Тамбовская область', + '69' => 'Тверская область', + '70' => 'Томская область', + '71' => 'Тульская область', + '72' => 'Тюменская область', + '18' => 'Удмуртская Республика', + '73' => 'Ульяновская область', + '27' => 'Хабаровский край', + '86' => 'Ханты-Мансийский автономный округ', + '74' => 'Челябинская область', + '20' => 'Чеченская Республика', + '21' => 'Чувашская Республика', + '87' => 'Чукотский автономный округ', + '89' => 'Ямало-Ненецкий автономный округ', + '76' => 'Ярославская область', +); + 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', diff --git a/core/components/formit/index.class.php b/core/components/formit/index.class.php new file mode 100644 index 00000000..f7905cb0 --- /dev/null +++ b/core/components/formit/index.class.php @@ -0,0 +1,66 @@ + + */ + +abstract class FormItBaseManagerController extends modExtraManagerController +{ + /** + * @access public. + * @return Mixed. + */ + public function initialize() + { + $this->modx->getService('formit', 'FormIt', $this->modx->getOption('formit.core_path', null, $this->modx->getOption('core_path') . 'components/formit/') . 'model/formit/'); + + $this->addCss($this->modx->formit->config['css_url'] . 'mgr/formit.css'); + + $this->addJavascript($this->modx->formit->config['js_url'] . 'mgr/formit.js'); + + $this->addHtml(''); + + return parent::initialize(); + } + + /** + * @access public. + * @return Array. + */ + public function getLanguageTopics() + { + return $this->modx->formit->config['lexicons']; + } + + /** + * @access public. + * @returns Boolean. + */ + public function checkPermissions() + { + return $this->modx->hasPermission('formit'); + } +} + +class IndexManagerController extends FormItBaseManagerController +{ + /** + * @access public. + * @return String. + */ + public static function getDefaultController() + { + return 'home'; + } +} diff --git a/core/components/formit/lexicon/cs/default.inc.php b/core/components/formit/lexicon/cs/default.inc.php index b9f098c1..8518bbd1 100644 --- a/core/components/formit/lexicon/cs/default.inc.php +++ b/core/components/formit/lexicon/cs/default.inc.php @@ -1,58 +1,112 @@ - * - * 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 - */ -/** - * Default Lexicon Topic - * - * @package formit - * @subpackage lexicon - * - * @author modxcms.cz - * @updated 2012-01-20 + * Copyright 2019 by Sterc */ -$_lang['formit.all_group_text'] = 'Všechny země'; -$_lang['formit.contains'] = 'Hodnota musí obsahovat frázi "[[+value]]".'; -$_lang['formit.email_invalid'] = 'Zadejte platnou e-mailovou adresu.'; -$_lang['formit.email_invalid_domain'] = 'Doménové jméno zadané e-mailové adresy není platné.'; -$_lang['formit.email_no_recipient'] = 'Zadejte příjemce e-mailu.'; -$_lang['formit.email_not_sent'] = 'Nastala chyba při odesílání e-mailu.'; -$_lang['formit.email_tpl_nf'] = 'Zadejte šablonu e-mailu.'; -$_lang['formit.field_not_empty'] = 'Toto políčko musí zůstat prázdné.'; -$_lang['formit.field_required'] = 'Toto políčko je vyžadováno.'; -$_lang['formit.math_incorrect'] = 'Nesprávná odpověď!'; -$_lang['formit.math_field_nf'] = 'Políčko [[+field]] nebylo ve formuláři nalezeno.'; -$_lang['formit.max_length'] = 'Obsah tohoto políčka může být dlouhý maximálně [[+length]] znaků.'; -$_lang['formit.max_value'] = 'Hodnota může být maximálně [[+value]].'; -$_lang['formit.min_length'] = 'Obsah tohoto políčka musí být dlouhý alespoň [[+length]] znaků.'; -$_lang['formit.min_value'] = 'Hodnota musí být minimálně [[+value]].'; -$_lang['formit.not_date'] = 'Toto políčko musí obsahovat platné datum.'; -$_lang['formit.not_lowercase'] = 'Obsah tohoto políčka musí být malými písmeny.'; -$_lang['formit.not_number'] = 'Obsah tohoto políčka musí být číslo.'; -$_lang['formit.not_uppercase'] = 'Obsah tohoto políčka musí být velkými písmeny.'; -$_lang['formit.password_dont_match'] = 'Vaše hesla se neshodují.'; -$_lang['formit.password_not_confirmed'] = 'Prosím, potvrďte heslo.'; -$_lang['formit.prioritized_group_text'] = 'Častí návštěvníci'; -$_lang['formit.range_invalid'] = 'Zadán neplatný rozsah.'; -$_lang['formit.range'] = 'Hodnota musí být mezi [[+min]] a [[+max]].'; -$_lang['formit.recaptcha_err_load'] = 'Nelze načíst třídu služby FormItReCaptcha.'; -$_lang['formit.spam_blocked'] = 'Odeslání bylo zablokováno spamovým filtrem: '; -$_lang['formit.spam_marked'] = ' - označen jako spam.'; -$_lang['formit.username_taken'] = 'Uživatelské jméno je již použito. Zadejte jiné.'; + +$_lang['formit'] = 'FormIt'; +$_lang['formit.desc'] = 'View all submitted forms.'; + +$_lang['area_formit'] = 'FormIt'; +$_lang['area_formit_recaptcha'] = 'FormIt reCaptcha'; + +$_lang['formit.form'] = 'Form'; +$_lang['formit.forms'] = 'Forms'; +$_lang['formit.forms_desc'] = 'View all submitted forms.'; +$_lang['formit.form_view'] = 'View form'; +$_lang['formit.form_remove'] = 'Remove form'; +$_lang['formit.form_remove_confirm'] = 'Are you sure you want to remove this form?'; +$_lang['formit.forms_remove'] = 'Remove forms'; +$_lang['formit.forms_remove_confirm'] = 'Are you sure you want to remove all forms?'; +$_lang['formit.forms_clean'] = 'Clean forms'; +$_lang['formit.forms_clean_confirm'] = 'Are you sure you want to clean all old forms?'; +$_lang['formit.forms_export'] = 'Export forms'; +$_lang['formit.form_encrypt'] = 'Encrypt form(s)'; +$_lang['formit.form_encrypt_confirm'] = 'Are you sure you want to encrypt the form(s)?'; +$_lang['formit.form_decrypt'] = 'Undo form encryption(s)'; +$_lang['formit.form_decrypt_confirm'] = 'Are you sure you want to undo the form encryption(s)?'; +$_lang['formit.view_ip'] = 'View all forms from this IP'; + +$_lang['formit.encryption'] = 'Encrypted form'; +$_lang['formit.encryptions'] = 'Encrypted forms'; +$_lang['formit.encryptions_desc'] = 'View all encrypted and non encrypted forms.'; + +$_lang['formit.label_form_name'] = 'Name'; +$_lang['formit.label_form_name_desc'] = 'The name of the form.'; +$_lang['formit.label_form_values'] = 'Form values'; +$_lang['formit.label_form_values_desc'] = 'The values of the form'; +$_lang['formit.label_form_ip'] = 'IP number'; +$_lang['formit.label_form_ip_desc'] = 'The IP number of the visitor that has submitted the form.'; +$_lang['formit.label_form_date'] = 'Date'; +$_lang['formit.label_form_date_desc'] = 'The date when the form is submitted.'; +$_lang['formit.label_form_encrypted'] = 'Encrypted'; +$_lang['formit.label_form_encrypted_desc'] = ''; +$_lang['formit.label_form_decrypted'] = 'Not encrypted'; +$_lang['formit.label_form_decrypted_desc'] = ''; +$_lang['formit.label_form_total'] = 'Total'; +$_lang['formit.label_form_total_desc'] = ''; + +$_lang['formit.label_clean_label'] = 'Remove forms older than'; +$_lang['formit.label_clean_desc'] = 'days'; + +$_lang['formit.label_export_form'] = 'Form'; +$_lang['formit.label_export_form_desc'] = 'Select a form to export.'; +$_lang['formit.label_export_start_date'] = 'Date from'; +$_lang['formit.label_export_start_date_desc'] = 'Select a date to export forms from that date.'; +$_lang['formit.label_export_end_date'] = 'Date till'; +$_lang['formit.label_export_end_date_desc'] = 'Select a date to export forms till that date.'; +$_lang['formit.label_export_delimiter'] = 'CSV delimiter'; +$_lang['formit.label_export_delimiter_desc'] = 'The Het CSV delimiter to separate the columns. Default is ";".'; + +$_lang['formit.filter_form'] = 'Filter on form'; +$_lang['formit.filter_start_date'] = 'Filter from'; +$_lang['formit.filter_end_date'] = 'Filter till'; +$_lang['formit.encryption_unavailable'] = 'PHP OpenSSL functions openssl_encrypt and openssl_decrypt are not available. Please install PHP OpenSSL on your server. See http://www.php.net/manual/en/openssl.requirements.php for more information.'; +$_lang['formit.encryption_unavailable_warning'] = 'Warning: PHP OpenSSL functions openssl_encrypt and openssl_decrypt are not available. This means that you cannot use encryption on your forms. Please install PHP OpenSSL on your server. Visit this page for more information.'; +$_lang['formit.forms_clean_desc'] = 'The European General Data Protection Regulation (GDPR) requires that personal data, which is no longer necessary to possess, is removed. This tool makes it possible to remove saved forms with an age older than the given days. This action can not be undone!'; +$_lang['formit.forms_clean_executing'] = 'Cleaning up forms'; +$_lang['formit.forms_clean_success'] = '[[+amount]] form(s) removed.'; +$_lang['formit.export_failed'] = 'The export of the forms failed, please try again.'; +$_lang['formit.export_dir_failed'] = 'An error occurred while exporting the form, the export folder could not be created.'; + +$_lang['formit.contains'] = 'Hodnota musí obsahovat frázi "[[+value]]".'; +$_lang['formit.email_invalid'] = 'Zadejte platnou e-mailovou adresu.'; +$_lang['formit.email_invalid_domain'] = 'Doménové jméno zadané e-mailové adresy není platné.'; +$_lang['formit.email_no_recipient'] = 'Zadejte příjemce e-mailu.'; +$_lang['formit.email_not_sent'] = 'Nastala chyba při odesílání e-mailu.'; +$_lang['formit.email_tpl_nf'] = 'Zadejte šablonu e-mailu.'; +$_lang['formit.field_not_empty'] = 'Toto políčko musí zůstat prázdné.'; +$_lang['formit.field_required'] = 'Toto políčko je vyžadováno.'; +$_lang['formit.math_incorrect'] = 'Nesprávná odpověď!'; +$_lang['formit.math_field_nf'] = 'Políčko [[+field]] nebylo ve formuláři nalezeno.'; +$_lang['formit.max_length'] = 'Obsah tohoto políčka může být dlouhý maximálně [[+length]] znaků.'; +$_lang['formit.max_value'] = 'Hodnota může být maximálně [[+value]].'; +$_lang['formit.min_length'] = 'Obsah tohoto políčka musí být dlouhý alespoň [[+length]] znaků.'; +$_lang['formit.min_value'] = 'Hodnota musí být minimálně [[+value]].'; +$_lang['formit.not_date'] = 'Toto políčko musí obsahovat platné datum.'; +$_lang['formit.not_lowercase'] = 'Obsah tohoto políčka musí být malými písmeny.'; +$_lang['formit.not_number'] = 'Obsah tohoto políčka musí být číslo.'; +$_lang['formit.not_uppercase'] = 'Obsah tohoto políčka musí být velkými písmeny.'; +$_lang['formit.password_dont_match'] = 'Vaše hesla se neshodují.'; +$_lang['formit.password_not_confirmed'] = 'Prosím, potvrďte heslo.'; +$_lang['formit.prioritized_group_text'] = 'Častí návštěvníci'; +$_lang['formit.range_invalid'] = 'Zadán neplatný rozsah.'; +$_lang['formit.range'] = 'Hodnota musí být mezi [[+min]] a [[+max]].'; +$_lang['formit.recaptcha_err_load'] = 'Nelze načíst třídu služby FormItReCaptcha.'; +$_lang['formit.spam_blocked'] = 'Odeslání bylo zablokováno spamovým filtrem: '; +$_lang['formit.spam_marked'] = ' - označen jako spam.'; +$_lang['formit.username_taken'] = 'Uživatelské jméno je již použito. Zadejte jiné.'; +$_lang['formit.not_regexp'] = 'Your value did not match the expected format.'; +$_lang['formit.all_group_text'] = 'Všechny země'; +$_lang['formit.storeAttachment_mediasource_error'] = 'Cant find MediaSource! Mediasource id is: '; +$_lang['formit.storeAttachment_access_error'] = 'Directory is not writable! Check the permissions for: '; + +$_lang['formit.migrate'] = 'Migrate encrypted form submissions'; +$_lang['formit.migrate_desc'] = 'Upgrading to FormIt 3.0 will also update the encryption method used for encrypting submitted form data. FormIt 2.x used mcrypt for encrypting and decrypting, but 3.0 uses the openssl methods. For this to work correctly the currently encrypted forms need to be migrated from mcrypt to openssl.'; +$_lang['formit.migrate_alert'] = 'FormIt was updated, but your encrypted form submissions need to be migrated. Click here to start the migration.'; +$_lang['formit.migrate_status'] = 'Status'; +$_lang['formit.migrate_running'] = 'Currently running migration process in the background. Please keep this page open in your browser. DO NOT CLOSE THIS PAGE!'; +$_lang['formit.migrate_success'] = 'Migration completed'; +$_lang['formit.migrate_success_msg'] = 'All your encrypted forms have been successfully migrated.'; diff --git a/core/components/formit/lexicon/cs/properties.inc.php b/core/components/formit/lexicon/cs/properties.inc.php index 2dc15141..b1f67bf4 100644 --- a/core/components/formit/lexicon/cs/properties.inc.php +++ b/core/components/formit/lexicon/cs/properties.inc.php @@ -1,122 +1,103 @@ - * - * 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 + * Copyright 2019 by Sterc */ -/** - * Properties Lexicon Topic - * - * @package formit - * @subpackage lexicon - * @language cs - * - * @author modxcms.cz - * @updated 2012-01-20 - */ -/* FormIt properties */ -$_lang['prop_formit.hooks_desc'] = 'Jaké skripty se mají spustit, poté co je pozitivně dokončena validace dat. Jeden nebo čárkou oddělený seznam hooků. Jakmile jeden z hooků vrátí negativní odpověď ("false") je vykonání dalších hooků v pořadí ukončeno. Hook může být také název snippetu, který bude tímto v danou chvíli spuštěn.'; -$_lang['prop_formit.prehooks_desc'] = 'Jaké skripty se mají spustit, při inicializaci formuláře. Tímto je např. možno předvyplnit políčka pomocí konstrukce $scriptProperties[`hook`]->fields[`nazevpolicka`]. Jeden nebo čárkou oddělený seznam hooků. Jakmile jeden vrátí negativní odpověď ("false") je vykonání dalších hooků v pořadí ukončeno. Hook může být také název snippetu, který bude tímto v danou chvíli spuštěn.'; -$_lang['prop_formit.submitvar_desc'] = 'Je-li tento parametr nastaven, formulář nebude zpracován dokud daná proměnná nebude definována v $_POST.'; -$_lang['prop_formit.validate_desc'] = 'Čárkou oddělený seznam názvů políček, které se mají validovat. Pro každé pole musí být zadáno pravidlo ve tvaru nazev:validator (např: username:required, email:required). Validátory mohou být také řetězeny, jako např. email:email:required. Takové pravidlo může být definováno na více řádcích.'; -$_lang['prop_formit.errtpl_desc'] = 'Šablona oblasti pro chybové zprávy.'; -$_lang['prop_formit.validationerrormessage_desc'] = 'Obecná chybová zpráva, která je nastavena do placeholderu pokud validace neproběhla v pořádku. Může obsahovat [[+errors]] v případě, že chcete zobrazit seznam všech chyb nad formulářem.'; -$_lang['prop_formit.validationerrorbulktpl_desc'] = 'HTML šablona, která je použita pro každou chybu v obecné zprávě při zobrazení chyb.'; -$_lang['prop_formit.customvalidators_desc'] = 'Čárkou oddělený seznam uživatelských validátorů (názvů snippetů), které budete využívat v tomto formuláři. Pokud nejsou dané uživatelské validátory uvedeny v tomto parametru nelze je následně využít.'; -$_lang['prop_formit.clearfieldsonsuccess_desc'] = 'Je-li nastaven na "true", budou po úspěšném odeslání formuláře (který se nepřesměrovává) vymazány hodnoty všech políček.'; -$_lang['prop_formit.successmessage_desc'] = 'Je-li tento parametr nastaven, bude nastaven placeholder s názvem z parametru "&successMessagePlaceholder" na hodnotu zapsanou v tomto parametru, výchozí hodnota je `fi.successMessage`. Tato hodnota bude zobrazena po úspěšném odeslání formuláře pokud není nastaveno přesměrování.'; -$_lang['prop_formit.successmessageplaceholder_desc'] = 'Název placeholderu, kam bude uložen text zprávy o úspěšném odeslání formuláře.'; -$_lang['prop_formit.store_desc'] = 'Je-li parametr nastaven na "true", FormIt uloží data z formuláře do cache a umožní tak pozdější zpracování pomocí snippetu FormItRetriever.'; -$_lang['prop_formit.storetime_desc'] = 'Je-li parametr `store` nastaven na "true", pak toto číslo určuje počet sekund, po kterou mají být data uložena od odeslání formuláře. Výchozí hodnotou je 300 sekund = 5 minut.'; -$_lang['prop_formit.allowfiles_desc'] = 'Je-li nastaven na 0, bude zamezeno odeslání souborů skrze formulář.'; -$_lang['prop_formit.placeholderprefix_desc'] = 'Prefix, který bude aplikován na všechny placeholdery pro políčka vygenerovaná snippetem FormIt. Výchozí hodnota je `fi.`'; -$_lang['prop_formit.redirectto_desc'] = 'Je-li nastaven hook `redirect`, musí tento parametr obsahovat ID dokumentu, na který má být přesměrováno.'; -$_lang['prop_formit.redirectparams_desc'] = 'JSON pole parametrů, které se připojí jako $_GET proměnné pro cílovou stránku přesměrování.'; -$_lang['prop_formit.recaptchajs_desc'] = 'Je-li nastaven hook `recaptcha` mohou zde být definovány parametry proměnné RecaptchaOptions jako JSON pole, která dává možnost změnit nastavení reCaptcha widgetu.'; -$_lang['prop_formit.recaptchaheight_desc'] = 'Je-li nastaven hook `recaptcha` lze pomocí tohoto parametru nastavit výšku reCaptcha widgetu.'; -$_lang['prop_formit.recaptchatheme_desc'] = 'Je-li nastaven hook `recaptcha` máte pomocí tohoto parametru možnost nastavit téma pro reCaptcha widget.'; -$_lang['prop_formit.recaptchawidth_desc'] = 'Je-li nastaven hook `recaptcha` můžete tímto parametrem určit šířku reCaptcha widgetu.'; -$_lang['prop_formit.spamemailfields_desc'] = 'Je-li nastaven hook `spam` můžete zde určit čárkou oddělený seznam políček obsahujících e-mailové adresy vůči, kterým se má kontrola provést.'; -$_lang['prop_formit.spamcheckip_desc'] = 'Je-li nastaven hook `spam` a je-li tento parametr nastaven na "true", bude kontrolována také IP adresa.'; -$_lang['prop_formit.emailbcc_desc'] = 'Je-li nastaven hook `email` pak tento parametr obsahuje e-mailové adresy, na které je zpráva odeslána jako příjemce BCC. Může být buď jedna nebo čárkou oddělený seznam e-mailových adres.'; -$_lang['prop_formit.emailbccname_desc'] = 'Volitelné. Je-li nastaven hook `email` pak lze pomocí tohoto parametr nastavit paralelně jména pro e-mailové adresy nastavené pomocí parametru `emailBCC`. Může zde být buď jedno jméno nebo čárkou oddělený seznam jmen. Pozor na stejný počet záznámů v tomto parametru a v parametru `emailBCC`!'; -$_lang['prop_formit.emailcc_desc'] = 'Je-li nastaven hook `email` pak tento parametr obsahuje e-mailové adresy, na které je zpráva odeslána jako příjemce CC. Může být buď jedna nebo čárkou oddělený seznam e-mailových adres.'; -$_lang['prop_formit.emailccname_desc'] = 'Volitelné. Je-li nastaven hook `email` pak lze pomocí tohoto parametru nastavit paralelně jména pro e-mailové adresy nastavené pomocí parametru `emailCC`. Může zde být buď jedno jméno nebo čárkou oddělený seznam jmen. Pozor na stejný počet záznámů v tomto parametru a v parametru `emailCC`!'; -$_lang['prop_formit.emailto_desc'] = 'Je-li nastaven hook `email` pak tento parametr obsahuje e-mailové adresy, na které je zpráva odeslána. Může být buď jedna nebo čárkou oddělený seznam e-mailových adres.'; -$_lang['prop_formit.emailtoname_desc'] = 'Volitelné. Je-li nastaven hook `email` pak lze pomocí tohoto parametr nastavit paralelně jména pro e-mailové adresy nastavené pomocí parametru `emailTo`. Může zde být buď jedno jméno nebo čárkou oddělený seznam jmen. Pozor na stejný počet záznámů v tomto parametru a v parametru `emailTo`!'; -$_lang['prop_formit.emailfrom_desc'] = 'Volitelné. Je-li nastave hook `email` pak tímto parametrem můžete nastavit e-mailovou adresu, která bude zobrazena jako odesílatel zprávy. Není-li parametr nastaven, zjistí se zda ve formuláři existuje políčko `email`, pak je e-mail z tohoto pole použit. Pokud toto políčko ve formuláři neexistuje, použije se jako výchozí hodnota e-mail nastavený v konfiguraci systému klíčem `emailsender`.'; -$_lang['prop_formit.emailfromname_desc'] = 'Volitelné. Je-li nastaven hook `email` pak tímto parametrem můžete nastavit jméno zobrazené jako odesílatel zprávy.'; -$_lang['prop_formit.emailreplyto_desc'] = 'Volitelné. Je-li nastaven hook `email` pak tímto parametrem můžete určit e-mailovou adresu, na kterou budou směřovat případné odpovědi od uživatelů, kteří obdrží zprávu z MODx. (Reply-To).'; -$_lang['prop_formit.emailreplytoname_desc'] = 'Volitelné. Je-li nastaven hook `email` pam můžete tímto parametrem určit jméno, které se bude zobrazovat při odpovědi na danou zprávu uživateli (Reply-To name).'; -$_lang['prop_formit.emailsubject_desc'] = 'Je-li nastaven hook `email` pak je tento parametr vyžadován a definuje předmět zprávy.'; -$_lang['prop_formit.emailusefieldforsubject_desc'] = 'Je-li ve formuláři definováno políčko `subject` a tento parametr je nastaven na "true" bude hodnota formulářového políčka `subject` použita jako předmět zprávy.'; -$_lang['prop_formit.emailhtml_desc'] = 'Volitelné. Je-li nastaven hook `email` pak tímto parametrem můžete aktivovat odeslání zprávy ve formátu HTML, jinak bude zpráva odeslána v textovém formátu. Ve výchozím nastavení se použije HTML.'; -$_lang['prop_formit.emailconvertnewlines_desc'] = 'Je-li nataveno na Ano a emailHtml je nastaveno na 1, budou v e-mailu překonvertovány nové řádky na HTML značku BR.'; -$_lang['prop_formit.emailmulitseparator_desc'] = 'Výchozí oddělovač pro sady hodnot odesálané skrze checkboxy/multi-selecty. Výchozí hodnotou je nový řádek.'; -$_lang['prop_formit.emailmultiwrapper_desc'] = 'Obalovač každé hodnoty sady odesílané skrze checkboxy/multi-selecty. Výchozí hodnotou je pouze hodnota.'; -/* FormIt Auto-Responder properties */ -$_lang['prop_fiar.fiartpl_desc'] = 'Je-li nastaven hook `FormItAutoResponder` pak tímto parametrem nastavíte šablonu e-mailu, která bude automaticky odeslána.'; -$_lang['prop_fiar.fiartofield_desc'] = 'Je-li nastaven hook `FormItAutoResponder` pak tento parametr určí, které formulářové políčko bude použito jako příjemce automaticky odesílané zprávy.'; -$_lang['prop_fiar.fiarbcc_desc'] = 'Je-li nastaven hook `FormItAutoResponder` pak tento parametr obsahuje e-mailové adresy, na které je zpráva odeslána jako příjemce BCC. Může být buď jedna nebo čárkou oddělený seznam e-mailových adres.'; -$_lang['prop_fiar.fiarbccname_desc'] = 'Volitelné. Je-li nastaven hook `FormItAutoResponder` pak lze pomocí tohoto parametru nastavit paralelně jména pro e-mailové adresy nastavené pomocí parametru `emailBCC`. Může zde být buď jedno jméno nebo čárkou oddělený seznam jmen. Pozor na stejný počet záznámů v tomto parametru a v parametru `emailBCC`!'; -$_lang['prop_fiar.fiarcc_desc'] = 'Je-li nastaven hook `FormItAutoResponder` pak tento parametr obsahuje e-mailové adresy, na které je zpráva odeslána jako příjemce CC. Může být buď jedna nebo čárkou oddělený seznam e-mailových adres.'; -$_lang['prop_fiar.fiarccname_desc'] = 'Volitelné. Je-li nastaven hook `FormItAutoResponder` pak lze pomocí tohoto parametru nastavit paralelně jména pro e-mailové adresy nastavené pomocí parametru `emailCC`. Může zde být buď jedno jméno nebo čárkou oddělený seznam jmen.'; -$_lang['prop_fiar.fiarfrom_desc'] = 'Volitelné. Je-li nastaven hook `FormItAutoResponder` pak tímto parametrem můžete nastavit e-mailovou adresu, která bude zobrazena jako odesílatel zprávy. Není-li parametr nastaven, zjistí se zda ve formuláři existuje políčko `email`, pak je e-mail z tohoto pole použit. Pokud toto políčko ve formuláři neexistuje, použije se jako výchozí hodnota e-mail nastavený v konfiguraci systému klíčem `emailsender`.'; -$_lang['prop_fiar.fiarfromname_desc'] = 'Volitelné. Je-li nastaven hook `FormItAutoResponder` pak tímto parametrem můžete nastavit jméno zobrazené jako odesílatel zprávy.'; -$_lang['prop_fiar.fiarreplyto_desc'] = 'Volitelné. Je-li nastaven hook `FormItAutoResponder` pak tímto parametrem můžete určit e-mailovou adresu, na kterou budou směřovat případné odpovědi od uživatelů, kteří obdrží zprávu z MODx. (Reply-To).'; -$_lang['prop_fiar.fiarreplytoname_desc'] = 'Volitelné. Je-li nastaven hook `FormItAutoResponder` pam můžete tímto parametrem určit jméno, které se bude zobrazovat při odpovědi na danou zprávu uživateli (Reply-To name).'; -$_lang['prop_fiar.fiarsubject_desc'] = 'Je-li nastaven hook `FormItAutoResponder` pak je tento parametr vyžadován a definuje předmět zprávy.'; -$_lang['prop_fiar.fiarhtml_desc'] = 'Volitelné. Je-li nastaven hook `FormItAutoResponder` pak tímto parametrem můžete aktivovat odeslání zprávy ve formátu HTML, jinak se použije textová forma zprávy. Ve výchozím nastavení se použije HTML.'; +$_lang['prop_formit.hooks_desc'] = 'Jaké skripty se mají spustit, poté co je pozitivně dokončena validace dat. Jeden nebo čárkou oddělený seznam hooků. Jakmile jeden z hooků vrátí negativní odpověď ("false") je vykonání dalších hooků v pořadí ukončeno. Hook může být také název snippetu, který bude tímto v danou chvíli spuštěn.'; +$_lang['prop_formit.prehooks_desc'] = 'Jaké skripty se mají spustit, při inicializaci formuláře. Tímto je např. možno předvyplnit políčka pomocí konstrukce $scriptProperties[`hook`]->fields[`nazevpolicka`]. Jeden nebo čárkou oddělený seznam hooků. Jakmile jeden vrátí negativní odpověď ("false") je vykonání dalších hooků v pořadí ukončeno. Hook může být také název snippetu, který bude tímto v danou chvíli spuštěn.'; +$_lang['prop_formit.submitvar_desc'] = 'Je-li tento parametr nastaven, formulář nebude zpracován dokud daná proměnná nebude definována v $_POST.'; +$_lang['prop_formit.validate_desc'] = 'Čárkou oddělený seznam názvů políček, které se mají validovat. Pro každé pole musí být zadáno pravidlo ve tvaru nazev:validator (např: username:required, email:required). Validátory mohou být také řetězeny, jako např. email:email:required. Takové pravidlo může být definováno na více řádcích.'; +$_lang['prop_formit.errtpl_desc'] = 'Šablona oblasti pro chybové zprávy.'; +$_lang['prop_formit.validationerrormessage_desc'] = 'Obecná chybová zpráva, která je nastavena do placeholderu pokud validace neproběhla v pořádku. Může obsahovat [[+errors]] v případě, že chcete zobrazit seznam všech chyb nad formulářem.'; +$_lang['prop_formit.validationerrorbulktpl_desc'] = 'HTML šablona, která je použita pro každou chybu v obecné zprávě při zobrazení chyb.'; +$_lang['prop_formit.customvalidators_desc'] = 'Čárkou oddělený seznam uživatelských validátorů (názvů snippetů), které budete využívat v tomto formuláři. Pokud nejsou dané uživatelské validátory uvedeny v tomto parametru nelze je následně využít.'; +$_lang['prop_formit.trimvaluesdeforevalidation_desc'] = 'Whether or not to trim spaces from the beginning and end of values before attempting validation. Defaults to true.'; +$_lang['prop_formit.clearfieldsonsuccess_desc'] = 'Je-li nastaven na "true", budou po úspěšném odeslání formuláře (který se nepřesměrovává) vymazány hodnoty všech políček.'; +$_lang['prop_formit.successmessage_desc'] = 'Je-li tento parametr nastaven, bude nastaven placeholder s názvem z parametru "&successMessagePlaceholder" na hodnotu zapsanou v tomto parametru, výchozí hodnota je `fi.successMessage`. Tato hodnota bude zobrazena po úspěšném odeslání formuláře pokud není nastaveno přesměrování.'; +$_lang['prop_formit.successmessageplaceholder_desc'] = 'Název placeholderu, kam bude uložen text zprávy o úspěšném odeslání formuláře.'; +$_lang['prop_formit.store_desc'] = 'Je-li parametr nastaven na "true", FormIt uloží data z formuláře do cache a umožní tak pozdější zpracování pomocí snippetu FormItRetriever.'; +$_lang['prop_formit.storetime_desc'] = 'Je-li parametr `store` nastaven na "true", pak toto číslo určuje počet sekund, po kterou mají být data uložena od odeslání formuláře. Výchozí hodnotou je 300 sekund = 5 minut.'; +$_lang['prop_formit.storelocation_desc'] = 'If `store` is set to true, this specifies the cache location of the data from the form submission. Defaults to MODX cache.'; +$_lang['prop_formit.allowfiles_desc'] = 'Je-li nastaven na 0, bude zamezeno odeslání souborů skrze formulář.'; +$_lang['prop_formit.placeholderprefix_desc'] = 'Prefix, který bude aplikován na všechny placeholdery pro políčka vygenerovaná snippetem FormIt. Výchozí hodnota je `fi.`'; +$_lang['prop_formit.redirectto_desc'] = 'Je-li nastaven hook `redirect`, musí tento parametr obsahovat ID dokumentu, na který má být přesměrováno.'; +$_lang['prop_formit.redirectparams_desc'] = 'JSON pole parametrů, které se připojí jako $_GET proměnné pro cílovou stránku přesměrování.'; +$_lang['prop_formit.recaptchajs_desc'] = 'Je-li nastaven hook `recaptcha` mohou zde být definovány parametry proměnné RecaptchaOptions jako JSON pole, která dává možnost změnit nastavení reCaptcha widgetu.'; +$_lang['prop_formit.recaptchaheight_desc'] = 'Je-li nastaven hook `recaptcha` lze pomocí tohoto parametru nastavit výšku reCaptcha widgetu.'; +$_lang['prop_formit.recaptchatheme_desc'] = 'Je-li nastaven hook `recaptcha` máte pomocí tohoto parametru možnost nastavit téma pro reCaptcha widget.'; +$_lang['prop_formit.recaptchawidth_desc'] = 'Je-li nastaven hook `recaptcha` můžete tímto parametrem určit šířku reCaptcha widgetu.'; +$_lang['prop_formit.spamemailfields_desc'] = 'Je-li nastaven hook `spam` můžete zde určit čárkou oddělený seznam políček obsahujících e-mailové adresy vůči, kterým se má kontrola provést.'; +$_lang['prop_formit.spamcheckip_desc'] = 'Je-li nastaven hook `spam` a je-li tento parametr nastaven na "true", bude kontrolována také IP adresa.'; +$_lang['prop_formit.emailbcc_desc'] = 'Je-li nastaven hook `email` pak tento parametr obsahuje e-mailové adresy, na které je zpráva odeslána jako příjemce BCC. Může být buď jedna nebo čárkou oddělený seznam e-mailových adres.'; +$_lang['prop_formit.emailbccname_desc'] = 'Volitelné. Je-li nastaven hook `email` pak lze pomocí tohoto parametr nastavit paralelně jména pro e-mailové adresy nastavené pomocí parametru `emailBCC`. Může zde být buď jedno jméno nebo čárkou oddělený seznam jmen. Pozor na stejný počet záznámů v tomto parametru a v parametru `emailBCC`!'; +$_lang['prop_formit.emailcc_desc'] = 'Je-li nastaven hook `email` pak tento parametr obsahuje e-mailové adresy, na které je zpráva odeslána jako příjemce CC. Může být buď jedna nebo čárkou oddělený seznam e-mailových adres.'; +$_lang['prop_formit.emailccname_desc'] = 'Volitelné. Je-li nastaven hook `email` pak lze pomocí tohoto parametru nastavit paralelně jména pro e-mailové adresy nastavené pomocí parametru `emailCC`. Může zde být buď jedno jméno nebo čárkou oddělený seznam jmen. Pozor na stejný počet záznámů v tomto parametru a v parametru `emailCC`!'; +$_lang['prop_formit.emailto_desc'] = 'Je-li nastaven hook `email` pak tento parametr obsahuje e-mailové adresy, na které je zpráva odeslána. Může být buď jedna nebo čárkou oddělený seznam e-mailových adres.'; +$_lang['prop_formit.emailtoname_desc'] = 'Volitelné. Je-li nastaven hook `email` pak lze pomocí tohoto parametr nastavit paralelně jména pro e-mailové adresy nastavené pomocí parametru `emailTo`. Může zde být buď jedno jméno nebo čárkou oddělený seznam jmen. Pozor na stejný počet záznámů v tomto parametru a v parametru `emailTo`!'; +$_lang['prop_formit.emailfrom_desc'] = 'Volitelné. Je-li nastave hook `email` pak tímto parametrem můžete nastavit e-mailovou adresu, která bude zobrazena jako odesílatel zprávy. Není-li parametr nastaven, zjistí se zda ve formuláři existuje políčko `email`, pak je e-mail z tohoto pole použit. Pokud toto políčko ve formuláři neexistuje, použije se jako výchozí hodnota e-mail nastavený v konfiguraci systému klíčem `emailsender`.'; +$_lang['prop_formit.emailfromname_desc'] = 'Volitelné. Je-li nastaven hook `email` pak tímto parametrem můžete nastavit jméno zobrazené jako odesílatel zprávy.'; +$_lang['prop_formit.emailreplyto_desc'] = 'Volitelné. Je-li nastaven hook `email` pak tímto parametrem můžete určit e-mailovou adresu, na kterou budou směřovat případné odpovědi od uživatelů, kteří obdrží zprávu z MODx. (Reply-To).'; +$_lang['prop_formit.emailreplytoname_desc'] = 'Volitelné. Je-li nastaven hook `email` pam můžete tímto parametrem určit jméno, které se bude zobrazovat při odpovědi na danou zprávu uživateli (Reply-To name).'; +$_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'] = 'Je-li nastaven hook `email` pak je tento parametr vyžadován a definuje předmět zprávy.'; +$_lang['prop_formit.emailusefieldforsubject_desc'] = 'Je-li ve formuláři definováno políčko `subject` a tento parametr je nastaven na "true" bude hodnota formulářového políčka `subject` použita jako předmět zprávy.'; +$_lang['prop_formit.emailhtml_desc'] = 'Volitelné. Je-li nastaven hook `email` pak tímto parametrem můžete aktivovat odeslání zprávy ve formátu HTML, jinak bude zpráva odeslána v textovém formátu. Ve výchozím nastavení se použije HTML.'; +$_lang['prop_formit.emailconvertnewlines_desc'] = 'Je-li nataveno na Ano a emailHtml je nastaveno na 1, budou v e-mailu překonvertovány nové řádky na HTML značku BR.'; +$_lang['prop_formit.emailmultiseparator_desc'] = 'Výchozí oddělovač pro sady hodnot odesálané skrze checkboxy/multi-selecty. Výchozí hodnotou je nový řádek.'; +$_lang['prop_formit.emailmultiwrapper_desc'] = 'Obalovač každé hodnoty sady odesílané skrze checkboxy/multi-selecty. Výchozí hodnotou je pouze hodnota.'; + +$_lang['prop_fiar.fiartpl_desc'] = 'Je-li nastaven hook `FormItAutoResponder` pak tímto parametrem nastavíte šablonu e-mailu, která bude automaticky odeslána.'; +$_lang['prop_fiar.fiartofield_desc'] = 'Je-li nastaven hook `FormItAutoResponder` pak tento parametr určí, které formulářové políčko bude použito jako příjemce automaticky odesílané zprávy.'; +$_lang['prop_fiar.fiarbcc_desc'] = 'Je-li nastaven hook `FormItAutoResponder` pak tento parametr obsahuje e-mailové adresy, na které je zpráva odeslána jako příjemce BCC. Může být buď jedna nebo čárkou oddělený seznam e-mailových adres.'; +$_lang['prop_fiar.fiarbccname_desc'] = 'Volitelné. Je-li nastaven hook `FormItAutoResponder` pak lze pomocí tohoto parametru nastavit paralelně jména pro e-mailové adresy nastavené pomocí parametru `emailBCC`. Může zde být buď jedno jméno nebo čárkou oddělený seznam jmen. Pozor na stejný počet záznámů v tomto parametru a v parametru `emailBCC`!'; +$_lang['prop_fiar.fiarcc_desc'] = 'Je-li nastaven hook `FormItAutoResponder` pak tento parametr obsahuje e-mailové adresy, na které je zpráva odeslána jako příjemce CC. Může být buď jedna nebo čárkou oddělený seznam e-mailových adres.'; +$_lang['prop_fiar.fiarccname_desc'] = 'Volitelné. Je-li nastaven hook `FormItAutoResponder` pak lze pomocí tohoto parametru nastavit paralelně jména pro e-mailové adresy nastavené pomocí parametru `emailCC`. Může zde být buď jedno jméno nebo čárkou oddělený seznam jmen.'; +$_lang['prop_fiar.fiarfrom_desc'] = 'Volitelné. Je-li nastaven hook `FormItAutoResponder` pak tímto parametrem můžete nastavit e-mailovou adresu, která bude zobrazena jako odesílatel zprávy. Není-li parametr nastaven, zjistí se zda ve formuláři existuje políčko `email`, pak je e-mail z tohoto pole použit. Pokud toto políčko ve formuláři neexistuje, použije se jako výchozí hodnota e-mail nastavený v konfiguraci systému klíčem `emailsender`.'; +$_lang['prop_fiar.fiarfromname_desc'] = 'Volitelné. Je-li nastaven hook `FormItAutoResponder` pak tímto parametrem můžete nastavit jméno zobrazené jako odesílatel zprávy.'; +$_lang['prop_fiar.fiarreplyto_desc'] = 'Volitelné. Je-li nastaven hook `FormItAutoResponder` pak tímto parametrem můžete určit e-mailovou adresu, na kterou budou směřovat případné odpovědi od uživatelů, kteří obdrží zprávu z MODx. (Reply-To).'; +$_lang['prop_fiar.fiarreplytoname_desc'] = 'Volitelné. Je-li nastaven hook `FormItAutoResponder` pam můžete tímto parametrem určit jméno, které se bude zobrazovat při odpovědi na danou zprávu uživateli (Reply-To name).'; +$_lang['prop_fiar.fiarsubject_desc'] = 'Je-li nastaven hook `FormItAutoResponder` pak je tento parametr vyžadován a definuje předmět zprávy.'; +$_lang['prop_fiar.fiarhtml_desc'] = 'Volitelné. Je-li nastaven hook `FormItAutoResponder` pak tímto parametrem můžete aktivovat odeslání zprávy ve formátu HTML, jinak se použije textová forma zprávy. Ve výchozím nastavení se použije HTML.'; -/* FormItRetriever properties */ -$_lang['prop_fir.placeholderprefix_desc'] = 'Prefix, který bude aplikován na všechny placeholdery pro políčka vygenerované snippetem FormItRetriever.'; -$_lang['prop_fir.redirecttoonnotfound_desc'] = 'Neobdržíli snippet žádná příchozí data, můžete tímto parametrem nastavit ID dokumentu, na který bude provedeno přesměrování.'; -$_lang['prop_fir.eraseonload_desc'] = 'Je-li tento parametr nastaven na "true" budou všechna uložená data vymazána při načtení formuláře. Doporučujeme ponechat "false", data přeci chcete nahrávat jen jednou.'; +$_lang['prop_fir.placeholderprefix_desc'] = 'Prefix, který bude aplikován na všechny placeholdery pro políčka vygenerované snippetem FormItRetriever.'; +$_lang['prop_fir.redirecttoonnotfound_desc'] = 'Neobdržíli snippet žádná příchozí data, můžete tímto parametrem nastavit ID dokumentu, na který bude provedeno přesměrování.'; +$_lang['prop_fir.eraseonload_desc'] = 'Je-li tento parametr nastaven na "true" budou všechna uložená data vymazána při načtení formuláře. Doporučujeme ponechat "false", data přeci chcete nahrávat jen jednou.'; +$_lang['prop_fir.storelocation_desc'] = 'If `store` is set to true, this specifies the cache location of the data from the form submission. Defaults to MODX cache.'; -/* FormIt Math hook properties */ -$_lang['prop_math.mathminrange_desc'] = 'Je-li nastaven hook `math` pak tímto parametrem můžete nastavit minimální hodnotu pro každé číslo v rovnici.'; -$_lang['prop_math.mathmaxrange_desc'] = 'Je-li nastaven hook `math` pak tímto parametrem můžete nastavit maximální hodnotu pro každé číslo v rovnici.'; -$_lang['prop_math.mathfield_desc'] = 'Je-li nastaven hook `math` pak tímto parametrem určíte název formulářového políčka pro výsledek rovnice.'; -$_lang['prop_math.mathop1field_desc'] = 'Je-li nastaven hook `math` pak tímto parametrem určíte název formulářového políčka pro první číslo rovnice.'; -$_lang['prop_math.mathop2field_desc'] = 'Je-li nastaven hook `math` pak tímto parametrem určíte název formulářového políčka pro druhé číslo rovnice.'; -$_lang['prop_math.mathoperatorfield_desc'] = 'Je-li nastaven hook `math` pak tímto parametrem nastavíte název políčka pro operátor rovnice.'; +$_lang['prop_math.mathminrange_desc'] = 'Je-li nastaven hook `math` pak tímto parametrem můžete nastavit minimální hodnotu pro každé číslo v rovnici.'; +$_lang['prop_math.mathmaxrange_desc'] = 'Je-li nastaven hook `math` pak tímto parametrem můžete nastavit maximální hodnotu pro každé číslo v rovnici.'; +$_lang['prop_math.mathfield_desc'] = 'Je-li nastaven hook `math` pak tímto parametrem určíte název formulářového políčka pro výsledek rovnice.'; +$_lang['prop_math.mathop1field_desc'] = 'Je-li nastaven hook `math` pak tímto parametrem určíte název formulářového políčka pro první číslo rovnice.'; +$_lang['prop_math.mathop2field_desc'] = 'Je-li nastaven hook `math` pak tímto parametrem určíte název formulářového políčka pro druhé číslo rovnice.'; +$_lang['prop_math.mathoperatorfield_desc'] = 'Je-li nastaven hook `math` pak tímto parametrem nastavíte název políčka pro operátor rovnice.'; -/* FormItCountryOptions properties */ -$_lang['prop_fico.allgrouptext_desc'] = 'Volitelné. Je-li nastaven a používá se parametr &prioritized, bude zobrazen tento textový popis pro všechny ostatní země při výpisu.'; -$_lang['prop_fico.optgroup_desc'] = 'Volitelné. Je-li nastaven a používá se parametr &prioritized, bude použit chunk tpl pro označení skupin.'; -$_lang['prop_fico.prioritized_desc'] = 'Volitelné. Čárkou oddělený seznam ISO kódů zemí, které budou zobrazeny jako prioriováné pod jmenovkou "Častí návštěvníci" na začátku rozbalovacího seznamu. Tuto volbu lze použít pro nastavení často vybíraných zemí.'; -$_lang['prop_fico.prioritizedgrouptext_desc'] = 'Volitelné. Je-li nastaven a používá se parametr &prioritized, bude tento text použit jako jmenovka pro sadu položek rozbalovacího menu.'; -$_lang['prop_fico.selected_desc'] = 'Hodnota země při volbě.'; -$_lang['prop_fico.selectedattribute_desc'] = 'Volitelné. HTML atribut, který se přidá zvolené zemi.'; -$_lang['prop_fico.toplaceholder_desc'] = 'Volitelné. Toto použijte pokud chcete výstup uložit do placeholderu namísto přímého výpisu na obrazovku.'; -$_lang['prop_fico.tpl_desc'] = 'Volitelné. Chunk, který se má použít jako šablona pro výpis jednotlivých položek rozbalovacího seznamu zemí.'; -$_lang['prop_fico.useisocode_desc'] = 'Je-li nastaveno na 1, budou jako hodnoty použity ISO kódy zemí. Pokud je 0 použijí se názvy zemí.'; +$_lang['prop_fico.allgrouptext_desc'] = 'Volitelné. Je-li nastaven a používá se parametr &prioritized, bude zobrazen tento textový popis pro všechny ostatní země při výpisu.'; +$_lang['prop_fico.optgrouptpl_desc'] = 'Volitelné. Je-li nastaven a používá se parametr &prioritized, bude použit chunk tpl pro označení skupin.'; +$_lang['prop_fico.limited_desc'] = 'Optional. A comma-separated list of ISO codes for selected countries the full list will be limited to.'; +$_lang['prop_fico.prioritized_desc'] = 'Volitelné. Čárkou oddělený seznam ISO kódů zemí, které budou zobrazeny jako prioriováné pod jmenovkou "Častí návštěvníci" na začátku rozbalovacího seznamu. Tuto volbu lze použít pro nastavení často vybíraných zemí.'; +$_lang['prop_fico.prioritizedgrouptext_desc'] = 'Volitelné. Je-li nastaven a používá se parametr &prioritized, bude tento text použit jako jmenovka pro sadu položek rozbalovacího menu.'; +$_lang['prop_fico.selected_desc'] = 'Hodnota země při volbě.'; +$_lang['prop_fico.selectedattribute_desc'] = 'Volitelné. HTML atribut, který se přidá zvolené zemi.'; +$_lang['prop_fico.toplaceholder_desc'] = 'Volitelné. Toto použijte pokud chcete výstup uložit do placeholderu namísto přímého výpisu na obrazovku.'; +$_lang['prop_fico.tpl_desc'] = 'Volitelné. Chunk, který se má použít jako šablona pro výpis jednotlivých položek rozbalovacího seznamu zemí.'; +$_lang['prop_fico.useisocode_desc'] = 'Je-li nastaveno na 1, budou jako hodnoty použity ISO kódy zemí. Pokud je 0 použijí se názvy zemí.'; +$_lang['prop_fico.country_desc'] = 'Optional. Set to use a different countries file when loading a list of countries.'; -/* FormItStateOptions properties */ -$_lang['prop_fiso.selected_desc'] = 'Výběr země.'; -$_lang['prop_fiso.selectedattribute_desc'] = 'Volitelné. HTML atribut přidávaný ke vzvolené zemi.'; -$_lang['prop_fiso.toplaceholder_desc'] = 'Volitelné. Toto použijte pokud chcete uložit výstup do placeholderu namísto jeho přímoho vypsání na obrazovku.'; -$_lang['prop_fiso.tpl_desc'] = 'Volitelné. Chunk, který se použije pro každou položku rozbalovacího menu zemí.'; -$_lang['prop_fiso.useabbr_desc'] = 'Je-li nastaveno na hodnotu 1, budou jako odesílané hodnoty použity zkratky států. Je-li 0, budou se odesílat celé názvy států.'; +$_lang['prop_fiso.country_desc'] = 'Optional. Set to use a different states file when loading a list of states.'; +$_lang['prop_fiso.selected_desc'] = 'Výběr země.'; +$_lang['prop_fiso.selectedattribute_desc'] = 'Volitelné. HTML atribut přidávaný ke vzvolené zemi.'; +$_lang['prop_fiso.toplaceholder_desc'] = 'Volitelné. Toto použijte pokud chcete uložit výstup do placeholderu namísto jeho přímoho vypsání na obrazovku.'; +$_lang['prop_fiso.tpl_desc'] = 'Volitelné. Chunk, který se použije pro každou položku rozbalovacího menu zemí.'; +$_lang['prop_fiso.useabbr_desc'] = 'Je-li nastaveno na hodnotu 1, budou jako odesílané hodnoty použity zkratky států. Je-li 0, budou se odesílat celé názvy států.'; -/* FormIt Options */ -$_lang['formit.opt_blackglass'] = 'Black Glass'; -$_lang['formit.opt_clean'] = 'Clean'; -$_lang['formit.opt_red'] = 'Red'; -$_lang['formit.opt_white'] = 'White'; +$_lang['formit.opt_blackglass'] = 'Black Glass'; +$_lang['formit.opt_clean'] = 'Clean'; +$_lang['formit.opt_red'] = 'Red'; +$_lang['formit.opt_white'] = 'White'; +$_lang['formit.opt_cache'] = 'MODX Cache'; +$_lang['formit.opt_session'] = 'Session'; +$_lang['prop_formit.savetmpfiles_desc'] = 'If set to 1, FormIt will store submitted files in a temporary folder.'; +$_lang['prop_formit.attachfiles_desc'] = 'If true, FormIt will add all file fields as attachments in the email.'; diff --git a/core/components/formit/lexicon/cs/recaptcha.inc.php b/core/components/formit/lexicon/cs/recaptcha.inc.php index 1e24cd85..4c1ca06c 100644 --- a/core/components/formit/lexicon/cs/recaptcha.inc.php +++ b/core/components/formit/lexicon/cs/recaptcha.inc.php @@ -1,37 +1,14 @@ - * - * 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 - */ -/** - * reCaptcha Lexicon Topic - * - * @package formit - * @subpackge lexicon - * - * @author modxcms.cz - * @updated 2010-12-29 + * Copyright 2019 by Sterc */ -$_lang['recaptcha.empty_answer'] = 'Nesprávná captcha slova. Zkontrolujte svou odpověď a zkuste to znovu.'; -$_lang['recaptcha.incorrect'] = 'reCAPTCHA nebyla zadána správně. Jděte zpět a zkuste to znovu. [[+error]]'; -$_lang['recaptcha.mailhide_no_mcrypt'] = 'Pro využívání reCAPTCHA Mailhide musíte mít nainstalovaný PHP modul "mcrypt".'; -$_lang['recaptcha.mailhide_no_api_key'] = 'Pro využívání reCAPTCHA Mailhide se musíte zaregistrovat a tak získat veřejný a soukromý klíč, můžete tak učinit na adrese http://www.google.com/recaptcha'; -$_lang['recaptcha.no_api_key'] = 'Pro využívání reCAPTCHA musíte získat klíč API na adrese http://www.google.com/recaptcha'; -$_lang['recaptcha.no_remote_ip'] = 'Z bezpečnostních důvodů, musíte zadat vzdálenou IP do reCAPTCHA'; +$_lang['recaptcha.empty_answer'] = 'Nesprávná captcha slova. Zkontrolujte svou odpověď a zkuste to znovu.'; +$_lang['recaptcha.incorrect'] = 'reCAPTCHA nebyla zadána správně. Jděte zpět a zkuste to znovu. [[+error]]'; +$_lang['recaptcha.mailhide_no_mcrypt'] = 'Pro využívání reCAPTCHA Mailhide musíte mít nainstalovaný PHP modul "mcrypt".'; +$_lang['recaptcha.mailhide_no_api_key'] = 'Pro využívání reCAPTCHA Mailhide se musíte zaregistrovat a tak získat veřejný a soukromý klíč, můžete tak učinit na adrese http://www.google.com/recaptcha'; +$_lang['recaptcha.no_api_key'] = 'Pro využívání reCAPTCHA musíte získat klíč API na adrese http://www.google.com/recaptcha'; +$_lang['recaptcha.no_remote_ip'] = 'Z bezpečnostních důvodů, musíte zadat vzdálenou IP do reCAPTCHA'; diff --git a/core/components/formit/lexicon/de/default.inc.php b/core/components/formit/lexicon/de/default.inc.php index f3031f49..01afb849 100644 --- a/core/components/formit/lexicon/de/default.inc.php +++ b/core/components/formit/lexicon/de/default.inc.php @@ -1,56 +1,112 @@ - * - * 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 - */ -/** - * German translation by Jörg Lippmann and Anselm Hannemann - * - * @package formit - * @subpackage lexicon - * @language de + * Copyright 2019 by Sterc */ -$_lang['formit.all_group_text'] = 'Alle Länder'; -$_lang['formit.contains'] = 'Ihre Eingabe muss die "[[+value]]" enthalten.'; -$_lang['formit.email_invalid'] = 'Bitte geben Sie eine gültige E-Mail-Adresse ein.'; -$_lang['formit.email_invalid_domain'] = 'Ihre E-Mail-Adresse enthält keinen gültigen Domainnamen.'; -$_lang['formit.email_no_recipient'] = 'Bitte geben Sie einen oder mehrere Empfänger für die E-Mails an.'; -$_lang['formit.email_not_sent'] = 'Beim E-Mail-Versand ist ein Fehler aufgetreten.'; -$_lang['formit.email_tpl_nf'] = 'Bitte geben Sie eine E-Mail-Vorlage an.'; -$_lang['formit.field_not_empty'] = 'Dieses Feld muss leer bleiben.'; -$_lang['formit.field_required'] = 'Dieses Feld muss ausgefüllt werden.'; -$_lang['formit.math_incorrect'] = 'Falsche Antwort!'; -$_lang['formit.math_field_nf'] = '[[+field]] Eingabefeld nicht im Formular definiert.'; -$_lang['formit.max_length'] = 'Dieses Feld darf nicht mehr als [[+length]] Zeichen enthalten.'; -$_lang['formit.max_value'] = 'Dieser Wert darf nicht größer als [[+value]] sein.'; -$_lang['formit.min_length'] = 'Dieses Feld muss mindestens [[+length]] Zeichen lang sein.'; -$_lang['formit.min_value'] = 'Dieser Wert darf nicht kleiner als [[+value]] sein.'; -$_lang['formit.not_date'] = 'Hier bitte ein gültiges Datum eingeben.'; -$_lang['formit.not_lowercase'] = 'Dieses Feld bitte nur in Kleinbuchstaben ausfüllen.'; -$_lang['formit.not_number'] = 'Dieses Feld darf nur eine Zahl enthalten.'; -$_lang['formit.not_uppercase'] = 'Dieses Feld bitte nur in Großbuchstaben ausfüllen.'; -$_lang['formit.password_dont_match'] = 'Passworte stimmen nicht überein.'; -$_lang['formit.password_not_confirmed'] = 'Bitte bestätigen Sie das Passwort.'; -$_lang['formit.prioritized_group_text'] = 'Häufige Besucher'; -$_lang['formit.range_invalid'] = 'Unzulässiger Wertebereich.'; -$_lang['formit.range'] = 'Dieser Wert muss zwischen [[+min]] und [[+max]] liegen.'; -$_lang['formit.recaptcha_err_load'] = 'Konnte reCaptcha-Service-Klasse nicht laden.'; -$_lang['formit.spam_blocked'] = 'Ihre Eingabe wurde durch einen Spamfilter blockiert: '; -$_lang['formit.spam_marked'] = ' - als Spam markiert.'; -$_lang['formit.username_taken'] = 'Benutzername schon vergeben, bitte wählen Sie einen anderen.'; \ No newline at end of file + +$_lang['formit'] = 'FormIt'; +$_lang['formit.desc'] = 'Per Formular übermittelte Daten anzeigen und Formular-Verschlüsselung verwalten.'; + +$_lang['area_formit'] = 'FormIt'; +$_lang['area_formit_recaptcha'] = 'FormIt reCaptcha'; + +$_lang['formit.form'] = 'Formular'; +$_lang['formit.forms'] = 'Formulare'; +$_lang['formit.forms_desc'] = 'Alle bisher in der Datenbank gespeicherten Formulare.'; +$_lang['formit.form_view'] = 'Formular betrachten'; +$_lang['formit.form_remove'] = 'Formular löschen'; +$_lang['formit.form_remove_confirm'] = 'Sind Sie sicher, dass Sie dieses versendete Formular löschen möchten?'; +$_lang['formit.forms_remove'] = 'Formulare entfernen'; +$_lang['formit.forms_remove_confirm'] = 'Möchten Sie wirklich alle Formulare entfernen?'; +$_lang['formit.forms_clean'] = 'Formulare reinigen'; +$_lang['formit.forms_clean_confirm'] = 'Möchten Sie wirklich alle alten Formulare bereinigen?'; +$_lang['formit.forms_export'] = 'Formulare Exportieren'; +$_lang['formit.form_encrypt'] = 'Formular(e) verschlüsseln'; +$_lang['formit.form_encrypt_confirm'] = 'Möchten Sie die Formular(e) wirklich verschlüsseln?'; +$_lang['formit.form_decrypt'] = 'Formularverschlüsselung rückgängig machen'; +$_lang['formit.form_decrypt_confirm'] = 'Möchten Sie die Formularverschlüsselung wirklich rückgängig machen?'; +$_lang['formit.view_ip'] = 'View all forms from this IP'; + +$_lang['formit.encryption'] = 'Verschlüsseltes Formular'; +$_lang['formit.encryptions'] = 'Verschlüsselte Formulare'; +$_lang['formit.encryptions_desc'] = 'Alle verschlüsselten und nicht verschlüsselten Formulare anzeigen.'; + +$_lang['formit.label_form_name'] = 'Name'; +$_lang['formit.label_form_name_desc'] = 'Der Name des Formulars'; +$_lang['formit.label_form_values'] = 'Werte bilden'; +$_lang['formit.label_form_values_desc'] = 'Die Werte des Formulars.'; +$_lang['formit.label_form_ip'] = 'IP Adresse'; +$_lang['formit.label_form_ip_desc'] = 'Die IP Adresse des Besuchers, der das Formular übermittelt hat.'; +$_lang['formit.label_form_date'] = 'Datum'; +$_lang['formit.label_form_date_desc'] = 'Das Datum, an dem das Formular gesendet wird.'; +$_lang['formit.label_form_encrypted'] = 'Verschlüsselt'; +$_lang['formit.label_form_encrypted_desc'] = ''; +$_lang['formit.label_form_decrypted'] = 'Nicht verschlüsselt'; +$_lang['formit.label_form_decrypted_desc'] = ''; +$_lang['formit.label_form_total'] = 'Insgesamt'; +$_lang['formit.label_form_total_desc'] = ''; + +$_lang['formit.label_clean_label'] = 'Remove forms older than'; +$_lang['formit.label_clean_desc'] = 'days'; + +$_lang['formit.label_export_form'] = 'Form'; +$_lang['formit.label_export_form_desc'] = 'Select a form to export.'; +$_lang['formit.label_export_start_date'] = 'Date from'; +$_lang['formit.label_export_start_date_desc'] = 'Select a date to export forms from that date.'; +$_lang['formit.label_export_end_date'] = 'Date till'; +$_lang['formit.label_export_end_date_desc'] = 'Select a date to export forms till that date.'; +$_lang['formit.label_export_delimiter'] = 'CSV delimiter'; +$_lang['formit.label_export_delimiter_desc'] = 'The Het CSV delimiter to separate the columns. Default is ";".'; + +$_lang['formit.filter_form'] = 'Auswahl Formular'; +$_lang['formit.filter_start_date'] = 'Auswahl Startdatum'; +$_lang['formit.filter_end_date'] = 'Auswahl Enddatum'; +$_lang['formit.encryption_unavailable'] = 'Die PHP OpenSSL-Funktionen openssl_encrypt und openssl_decrypt sind nicht verfügbar. Bitte installieren Sie PHP OpenSSL auf Ihrem Server. Weitere Informationen erhalten Sie unter http://www.php.net/manual/en/openssl.requirements.php.'; +$_lang['formit.encryption_unavailable_warning'] = 'Warnung: Die PHP OpenSSL-Funktionen openssl_encrypt und openssl_decrypt sind nicht verfügbar. Dies bedeutet, dass Sie Formulardaten nicht verschlüsseln können. Bitte installieren Sie PHP OpenSSL auf Ihrem Server. Besuchen Sie this page, um weitere Informationen zu erhalten.'; +$_lang['formit.forms_clean_desc'] = 'The European General Data Protection Regulation (GDPR) requires that personal data, which is no longer necessary to possess, is removed. This tool makes it possible to remove saved forms with an age older than the given days. This action can not be undone!'; +$_lang['formit.forms_clean_executing'] = 'Formulare aufräumen'; +$_lang['formit.forms_clean_success'] = '[[+amount]] Formular(e) wurden entfernt.'; +$_lang['formit.export_failed'] = 'The export of the forms failed, please try again.'; +$_lang['formit.export_dir_failed'] = 'An error occurred while exporting the form, the export folder could not be created.'; + +$_lang['formit.contains'] = 'Ihre Eingabe muss die "[[+value]]" enthalten.'; +$_lang['formit.email_invalid'] = 'Bitte geben Sie eine gültige E-Mail-Adresse ein.'; +$_lang['formit.email_invalid_domain'] = 'Ihre E-Mail-Adresse enthält keinen gültigen Domainnamen.'; +$_lang['formit.email_no_recipient'] = 'Bitte geben Sie einen oder mehrere Empfänger für die E-Mail an.'; +$_lang['formit.email_not_sent'] = 'Beim Versuch, die E-Mail zu versenden, ist ein Fehler aufgetreten.'; +$_lang['formit.email_tpl_nf'] = 'Bitte geben Sie eine E-Mail-Vorlage an.'; +$_lang['formit.field_not_empty'] = 'Dieses Feld muss leer bleiben.'; +$_lang['formit.field_required'] = 'Dieses Feld muss ausgefüllt werden.'; +$_lang['formit.math_incorrect'] = 'Falsche Antwort!'; +$_lang['formit.math_field_nf'] = '[[+field]] Eingabefeld nicht im Formular definiert.'; +$_lang['formit.max_length'] = 'Dieses Feld darf nicht mehr als [[+length]] Zeichen enthalten.'; +$_lang['formit.max_value'] = 'Dieser Wert darf nicht größer als [[+value]] sein.'; +$_lang['formit.min_length'] = 'Dieses Feld muss mindestens [[+length]] Zeichen lang sein.'; +$_lang['formit.min_value'] = 'Dieser Wert darf nicht kleiner als [[+value]] sein.'; +$_lang['formit.not_date'] = 'Hier bitte ein gültiges Datum eingeben.'; +$_lang['formit.not_lowercase'] = 'Dieses Feld bitte nur in Kleinbuchstaben ausfüllen.'; +$_lang['formit.not_number'] = 'Dieses Feld darf nur eine Zahl enthalten.'; +$_lang['formit.not_uppercase'] = 'Dieses Feld bitte nur in Großbuchstaben ausfüllen.'; +$_lang['formit.password_dont_match'] = 'Passworte stimmen nicht überein.'; +$_lang['formit.password_not_confirmed'] = 'Bitte bestätigen Sie das Passwort.'; +$_lang['formit.prioritized_group_text'] = 'Häufige Besucher'; +$_lang['formit.range_invalid'] = 'Unzulässiger Wertebereich.'; +$_lang['formit.range'] = 'Dieser Wert muss zwischen [[+min]] und [[+max]] liegen.'; +$_lang['formit.recaptcha_err_load'] = 'Konnte reCaptcha-Service-Klasse nicht laden.'; +$_lang['formit.spam_blocked'] = 'Ihre Eingabe wurde durch einen Spamfilter blockiert: '; +$_lang['formit.spam_marked'] = ' - als Spam markiert.'; +$_lang['formit.username_taken'] = 'Benutzername schon vergeben, bitte wählen Sie einen anderen.'; +$_lang['formit.not_regexp'] = 'Der von Ihnen eingegebene Wert hat nicht das erwartete Format.'; +$_lang['formit.all_group_text'] = 'Alle Länder'; +$_lang['formit.storeAttachment_mediasource_error'] = 'Cant find MediaSource! Mediasource id is: '; +$_lang['formit.storeAttachment_access_error'] = 'Directory is not writable! Check the permissions for: '; + +$_lang['formit.migrate'] = 'Verschlüsselte Daten aus versendeten Formularen migrieren'; +$_lang['formit.migrate_desc'] = 'Beim Upgrade auf FormIt 3.0 wird auch die Verschlüsselungsmethode geändert, die für die Verschlüsselung der Daten aus versendeten Formularen verwendet wird. FormIt 2.x verwendete mcrypt für die Ver- und Entschlüsselung, Version 3.0 dagegen verwendet die OpenSSL-Methoden. Damit dies korrekt funktioniert, müssen die bereits verschlüsselten Formulardaten von mcrypt zu OpenSSL migriert werden.'; +$_lang['formit.migrate_alert'] = 'FormIt wurde upgedatet, aber Ihre verschlüsselten Formulardaten müssen migriert werden. Klicken Sie hier, um die Migration zu starten.'; +$_lang['formit.migrate_status'] = 'Status'; +$_lang['formit.migrate_running'] = 'Der Migrations-Prozess läuft gerade im Hintergrund. Bitte lassen Sie diese Seite in Ihrem Browser geöffnet. SCHLIESSEN SIE AUF KEINEN FALL DIESE SEITE!'; +$_lang['formit.migrate_success'] = 'Migration abgeschlossen'; +$_lang['formit.migrate_success_msg'] = 'Alle Ihre verschlüsselten Formulardaten wurden erfolgreich migriert.'; diff --git a/core/components/formit/lexicon/de/properties.inc.php b/core/components/formit/lexicon/de/properties.inc.php index 0244c33d..6c89af0f 100644 --- a/core/components/formit/lexicon/de/properties.inc.php +++ b/core/components/formit/lexicon/de/properties.inc.php @@ -1,119 +1,103 @@ - * - * 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 + * Copyright 2019 by Sterc */ -/** - * Properties Lexicon Topic : translation by Anselm Hannemann - * - * @package formit - * @subpackage lexicon - * @language de - */ -/* FormIt properties */ -$_lang['prop_formit.hooks_desc'] = 'Gibt an, welche Scripts ausgeführt werden sollen, nachdem das Formular validiert wurde. Dies kann eine kommaseparierte Liste von Hooks sein. Schlägt ein Hook fehl, werden nachfolgende nicht ausgeführt. Ein Hook kann ebenfalls ein Name eines Snippets sein, das daraufhin ausgeführt wird.'; -$_lang['prop_formit.prehooks_desc'] = 'Gibt an, welche Scripts ausgeführt werden sollen (falls vorhanden), sobald das Formular geladen wird. Sie können Formularfelder vorausfüllen: $scriptProperties[`hook`]->fields[`fieldname`]. Dies kann eine kommaseparierte Liste von Hooks sein. Schlägt ein Hook fehl, werden nachfolgende nicht ausgeführt. Ein Hook kann ebenfalls ein Name eines Snippets sein, das daraufhin ausgeführt wird.'; -$_lang['prop_formit.submitvar_desc'] = 'Falls gesetzt, wird das Formular nicht ausgewertet, wenn die POST-Variable nicht übergeben wurde.'; -$_lang['prop_formit.validate_desc'] = 'Dies kann eine kommaseparierte Liste von Feldern, die validiert werden sollen, mit jeweils dem Feldnamen als Validator (Bsp.: username:required,email:required) sein. Validatoren können auch verkettet werden, z.B. email:email:required. Diese Eigenschaft kann in mehreren Zeilen angegeben werden.'; -$_lang['prop_formit.errtpl_desc'] = 'Das Wrapper-Template für Fehlermeldungen.'; -$_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.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.'; -$_lang['prop_formit.store_desc'] = 'Falls gesetzt, werden die eingegebenen Daten im Cache gespeichert, um vom FormItRetriever-Snippet weiterverwendet zu werden.'; -$_lang['prop_formit.storetime_desc'] = 'Falls `store` auf `Ja` gesetzt wurde, wird hier die Zeit in Sekunden angegeben, innerhalb derer die Formulardaten gespeichert werden müssen. Standardwert ist 5 Minuten.'; -$_lang['prop_formit.allowfiles_desc'] = 'Wenn diese Einstellung auf "Nein" gesetzt wird, wird die Übermittlung von Dateien über das Formular verhindert.'; -$_lang['prop_formit.placeholderprefix_desc'] = 'Der zu nutzende Prefix für alle Platzhalter, die von FormIt für Felder gesetzt wurden. Standard ist `fi.`'; -$_lang['prop_formit.redirectto_desc'] = 'Falls `redirect` als Hook gesetzt wurde, geben Sie hier die Ressourcen-ID an, zu der weitergeleitet werden soll.'; -$_lang['prop_formit.redirectparams_desc'] = 'Ein JSON-Array mit Parametern, die an den Redirect-Hook übergeben werden sollen.'; -$_lang['prop_formit.recaptchajs_desc'] = 'Falls `recaptcha` als Hook gesetzt wurde, kann dies ein JSON Objekt sein, das als JavaScript-RecaptchaOptions-Variable gesetzt wird, die die Optionen für reCaptcha definiert.'; -$_lang['prop_formit.recaptchaheight_desc'] = 'Falls `recaptcha` als Hook gesetzt wurde, wird hier die Höhe des reCaptcha-Widgets festgelegt.'; -$_lang['prop_formit.recaptchatheme_desc'] = 'Falls `recaptcha` als Hook gesetzt wurde, wird hier das Theme des reCaptcha-Widgets festgelegt.'; -$_lang['prop_formit.recaptchawidth_desc'] = 'Falls `recaptcha` als Hook gesetzt wurde, wird hier die Breite des reCaptcha-Widgets festgelegt.'; -$_lang['prop_formit.spamemailfields_desc'] = 'Falls `spam` als Hook gesetzt wurde, geben Sie hier eine kommaseparierte Liste von Feldern an, die E-Mail-Adressen enthalten und auf Spam geprüft werden sollen.'; -$_lang['prop_formit.spamcheckip_desc'] = 'Falls `spam` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird die IP ebenfalls geprüft.'; -$_lang['prop_formit.emailbcc_desc'] = 'Falls `email` als Hook gesetzt wurde, werden hier E-Mail-Adressen angegeben, an die die E-Mail per BCC gesendet wird. Kann eine kommaseparierte Liste von E-Mail-Adressen sein.'; -$_lang['prop_formit.emailbccname_desc'] = 'Optional. Falls `email` als Hook gesetzt wurde, muss dies eine parallele Liste von kommaseparierten Namen für die entsprechenden E-Mail-Adressen sein, die im `emailBCC` festgelegt wurden.'; -$_lang['prop_formit.emailcc_desc'] = 'Falls `email` als Hook gesetzt wurde, werden hier E-Mail-Adressen angegeben, an die die E-Mail per CC gesendet wird. Kann eine kommaseparierte Liste von E-Mail-Adressen sein.'; -$_lang['prop_formit.emailccname_desc'] = 'Optional. Falls `email` als Hook gesetzt wurde, muss dies eine parallele Liste von kommaseparierten Namen für die entsprechenden E-Mail-Adressen sein, die im `emailCC` festgelegt wurden.'; -$_lang['prop_formit.emailto_desc'] = 'Falls `email` als Hook gesetzt wurde, werden hier E-Mail-Adressen angegeben, an die die E-Mail gesendet wird. Kann eine kommaseparierte Liste von E-Mail-Adressen sein.'; -$_lang['prop_formit.emailtoname_desc'] = 'Optional. Falls `email` als Hook gesetzt wurde, muss dies eine parallele Liste von kommaseparierten Namen für die entsprechenden E-Mail-Adressen sein, die im `emailTo` festgelegt wurden.'; -$_lang['prop_formit.emailfrom_desc'] = 'Optional. Falls `email` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird hier die Absenderadresse gesetzt. Falls nicht gesetzt, wird nach einem email-Feld gesucht. Wird keines gefunden, wird die E-Mail-Adresse aus den Systemeinstellungen verwendet.'; -$_lang['prop_formit.emailfromname_desc'] = 'Optional. Falls `email` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird hier der Name des Absenders zur passenden E-Mail-Adresse angegeben.'; -$_lang['prop_formit.emailreplyto_desc'] = 'Optional. Falls `email` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird hier die Antwort-E-Mail-Adresse angegeben.'; -$_lang['prop_formit.emailreplytoname_desc'] = 'Optional. Falls `email` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird hier der Name des Antwortadresskontakts zur passenden E-Mail-Adresse angegeben.'; -$_lang['prop_formit.emailsubject_desc'] = 'Falls `email` als Hook gesetzt wurde, ist dies der Betreff für die E-Mail.'; -$_lang['prop_formit.emailusefieldforsubject_desc'] = 'Falls ein Formularfeld `subject` im Formular mit übergeben wird und dieses einen Wert enthält, wird dieser Wert als Betreff verwendet.'; -$_lang['prop_formit.emailhtml_desc'] = 'Optional. Falls `email` als Hook gesetzt wurde, kann hier zwischen Plaintext und HTML-Mail gewählt werden. Standard ist HTML.'; -$_lang['prop_formit.emailconvertnewlines_desc'] = 'Falls sowohl diese Einstellung als auch emailHtml auf "Ja" gesetzt wurden, werden Zeilenumbrüche in BR-Tags konvertiert.'; -$_lang['prop_formit.emailmulitseparator_desc'] = 'Der Standardseparator für Sammlungen von Einträgen, die über Checkboxen oder Multi-Auswahlfelder übergeben werden. Standard ist \newline'; -$_lang['prop_formit.emailmultiwrapper_desc'] = 'Umfasst jeden Eintrag einer Sammlung von Feldern, die über Checkboxen oder Multi-Auswahlfelder übergeben werden. Standard ist `value`'; -/* FormIt Auto-Responder properties */ -$_lang['prop_fiar.fiartpl_desc'] = 'Falls `FormItAutoResponder` als Hook gesetzt wurde, wird hier das Template für die automatische Antwort-E-Mail angebeben.'; -$_lang['prop_fiar.fiartofield_desc'] = 'Falls `FormItAutoResponder` als Hook gesetzt wurde, wird hier angegeben, welches Formularfeld für die Empfänger-Adresse in der automatischen Antwort-E-Mail verwendet werden soll.'; -$_lang['prop_fiar.fiarbcc_desc'] = 'Falls `FormItAutoResponder` als Hook gesetzt wurde, werden hier die E-Mail-Adressen angebeben, an die die E-Mail als BCC gesendet werden soll. Kann eine kommaseparierte Liste sein.'; -$_lang['prop_fiar.fiarbccname_desc'] = 'Optional. Falls `FormItAutoResponder` als Hook gesetzt wurde, muss dies eine parallele Liste von kommaseparierten Namen für die entsprechenden E-Mail-Adressen sein, die im `emailBCC` festgelegt wurden.'; -$_lang['prop_fiar.fiarcc_desc'] = 'Falls `FormItAutoResponder` als Hook gesetzt wurde, werden hier E-Mail-Adressen angegeben, an die die E-Mail per CC gesendet wird. Kann eine kommaseparierte Liste von E-Mail-Adressen sein.'; -$_lang['prop_fiar.fiarccname_desc'] = 'Optional. Falls `FormItAutoResponder` als Hook gesetzt wurde, muss dies eine parallele Liste von kommaseparierten Namen für die entsprechenden E-Mail-Adressen sein, die in `emailCC` festgelegt wurden.'; -$_lang['prop_fiar.fiarfrom_desc'] = 'Optional. Falls `FormItAutoResponder` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird hier die Absenderadresse festgelegt. Falls nicht gesetzt, wird nach einem email-Feld gesucht. Wird keines gefunden, wird die E-Mail-Adresse aus den Systemeinstellungen verwendet.'; -$_lang['prop_fiar.fiarfromname_desc'] = 'Optional. Falls `FormItAutoResponder` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird hier der Name des Absenders zur passenden E-Mail-Adresse angegeben.'; -$_lang['prop_fiar.fiarreplyto_desc'] = 'Optional. Falls `FormItAutoResponder` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird hier die Antwort-E-Mail-Adresse angegeben.'; -$_lang['prop_fiar.fiarreplytoname_desc'] = 'Optional. Falls `FormItAutoResponder` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird hier der Name des Antwortadresskontakts zur passenden E-Mail-Adresse angegeben.'; -$_lang['prop_fiar.fiarsubject_desc'] = 'Falls `FormItAutoResponder` als Hook gesetzt wurde, ist dies der Betreff für die E-Mail.'; -$_lang['prop_fiar.fiarhtml_desc'] = 'Optional. Falls `FormItAutoResponder` als Hook gesetzt wurde, kann hier zwischen Plaintext und HTML-Mail gewählt werden. Standard ist HTML.'; +$_lang['prop_formit.hooks_desc'] = 'Gibt an, welche Scripts ausgeführt werden sollen, nachdem das Formular validiert wurde. Dies kann eine kommaseparierte Liste von Hooks sein. Schlägt ein Hook fehl, werden nachfolgende nicht ausgeführt. Ein Hook kann ebenfalls ein Name eines Snippets sein, das daraufhin ausgeführt wird.'; +$_lang['prop_formit.prehooks_desc'] = 'Gibt an, welche Scripts ausgeführt werden sollen (falls vorhanden), sobald das Formular geladen wird. Sie können Formularfelder vorausfüllen: $scriptProperties[`hook`]->fields[`fieldname`]. Dies kann eine kommaseparierte Liste von Hooks sein. Schlägt ein Hook fehl, werden nachfolgende nicht ausgeführt. Ein Hook kann ebenfalls ein Name eines Snippets sein, das daraufhin ausgeführt wird.'; +$_lang['prop_formit.submitvar_desc'] = 'Falls gesetzt, wird das Formular nicht ausgewertet, wenn die POST-Variable nicht übergeben wurde.'; +$_lang['prop_formit.validate_desc'] = 'Dies kann eine kommaseparierte Liste von Feldern, die validiert werden sollen, mit jeweils dem Feldnamen als Validator (Bsp.: username:required,email:required) sein. Validatoren können auch verkettet werden, z.B. email:email:required. Diese Eigenschaft kann in mehreren Zeilen angegeben werden.'; +$_lang['prop_formit.errtpl_desc'] = 'Das Wrapper-Template für Fehlermeldungen.'; +$_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.'; +$_lang['prop_formit.store_desc'] = 'Falls gesetzt, werden die eingegebenen Daten im Cache gespeichert, um vom FormItRetriever-Snippet weiterverwendet zu werden.'; +$_lang['prop_formit.storetime_desc'] = 'Falls `store` auf `Ja` gesetzt wurde, wird hier die Zeit in Sekunden angegeben, innerhalb derer die Formulardaten gespeichert werden müssen. Standardwert ist 5 Minuten.'; +$_lang['prop_formit.storelocation_desc'] = 'Falls `store` auf `Ja` gesetzt wurde, wird hier angegeben, wo die vom Formular übermittelten Daten gecacht werden. Standard ist der MODX-Cache.'; +$_lang['prop_formit.allowfiles_desc'] = 'Wenn diese Einstellung auf "Nein" gesetzt wird, wird die Übermittlung von Dateien über das Formular verhindert.'; +$_lang['prop_formit.placeholderprefix_desc'] = 'Der zu nutzende Prefix für alle Platzhalter, die von FormIt für Felder gesetzt wurden. Standard ist `fi.`'; +$_lang['prop_formit.redirectto_desc'] = 'Falls `redirect` als Hook gesetzt wurde, geben Sie hier die Ressourcen-ID an, zu der weitergeleitet werden soll.'; +$_lang['prop_formit.redirectparams_desc'] = 'Ein JSON-Array mit Parametern, die an den Redirect-Hook übergeben werden sollen.'; +$_lang['prop_formit.recaptchajs_desc'] = 'Falls `recaptcha` als Hook gesetzt wurde, kann dies ein JSON Objekt sein, das als JavaScript-RecaptchaOptions-Variable gesetzt wird, die die Optionen für reCaptcha definiert.'; +$_lang['prop_formit.recaptchaheight_desc'] = 'Falls `recaptcha` als Hook gesetzt wurde, wird hier die Höhe des reCaptcha-Widgets festgelegt.'; +$_lang['prop_formit.recaptchatheme_desc'] = 'Falls `recaptcha` als Hook gesetzt wurde, wird hier das Theme des reCaptcha-Widgets festgelegt.'; +$_lang['prop_formit.recaptchawidth_desc'] = 'Falls `recaptcha` als Hook gesetzt wurde, wird hier die Breite des reCaptcha-Widgets festgelegt.'; +$_lang['prop_formit.spamemailfields_desc'] = 'Falls `spam` als Hook gesetzt wurde, geben Sie hier eine kommaseparierte Liste von Feldern an, die E-Mail-Adressen enthalten und auf Spam geprüft werden sollen.'; +$_lang['prop_formit.spamcheckip_desc'] = 'Falls `spam` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird die IP ebenfalls geprüft.'; +$_lang['prop_formit.emailbcc_desc'] = 'Falls `email` als Hook gesetzt wurde, werden hier E-Mail-Adressen angegeben, an die die E-Mail per BCC gesendet wird. Kann eine kommaseparierte Liste von E-Mail-Adressen sein.'; +$_lang['prop_formit.emailbccname_desc'] = 'Optional. Falls `email` als Hook gesetzt wurde, muss dies eine parallele Liste von kommaseparierten Namen für die entsprechenden E-Mail-Adressen sein, die im `emailBCC` festgelegt wurden.'; +$_lang['prop_formit.emailcc_desc'] = 'Falls `email` als Hook gesetzt wurde, werden hier E-Mail-Adressen angegeben, an die die E-Mail per CC gesendet wird. Kann eine kommaseparierte Liste von E-Mail-Adressen sein.'; +$_lang['prop_formit.emailccname_desc'] = 'Optional. Falls `email` als Hook gesetzt wurde, muss dies eine parallele Liste von kommaseparierten Namen für die entsprechenden E-Mail-Adressen sein, die im `emailCC` festgelegt wurden.'; +$_lang['prop_formit.emailto_desc'] = 'Falls `email` als Hook gesetzt wurde, werden hier E-Mail-Adressen angegeben, an die die E-Mail gesendet wird. Kann eine kommaseparierte Liste von E-Mail-Adressen sein.'; +$_lang['prop_formit.emailtoname_desc'] = 'Optional. Falls `email` als Hook gesetzt wurde, muss dies eine parallele Liste von kommaseparierten Namen für die entsprechenden E-Mail-Adressen sein, die im `emailTo` festgelegt wurden.'; +$_lang['prop_formit.emailfrom_desc'] = 'Optional. Falls `email` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird hier die Absenderadresse gesetzt. Falls nicht gesetzt, wird nach einem email-Feld gesucht. Wird keines gefunden, wird die E-Mail-Adresse aus den Systemeinstellungen verwendet.'; +$_lang['prop_formit.emailfromname_desc'] = 'Optional. Falls `email` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird hier der Name des Absenders zur passenden E-Mail-Adresse angegeben.'; +$_lang['prop_formit.emailreplyto_desc'] = 'Optional. Falls `email` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird hier die Antwort-E-Mail-Adresse angegeben.'; +$_lang['prop_formit.emailreplytoname_desc'] = 'Optional. Falls `email` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird hier der Name des Antwortadresskontakts zur passenden E-Mail-Adresse angegeben.'; +$_lang['prop_formit.emailreturnpath_desc'] = 'Optional. Falls `email` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird hier die Return-path-Adresse der E-Mail angegeben. Wird hier nichts angegeben, wird der Wert der Eigenschaft `emailFrom` verwendet.'; +$_lang['prop_formit.emailsubject_desc'] = 'Falls `email` als Hook gesetzt wurde, ist dies der Betreff für die E-Mail.'; +$_lang['prop_formit.emailusefieldforsubject_desc'] = 'Falls ein Formularfeld `subject` im Formular mit übergeben wird und dieses einen Wert enthält, wird dieser Wert als Betreff verwendet.'; +$_lang['prop_formit.emailhtml_desc'] = 'Optional. Falls `email` als Hook gesetzt wurde, kann hier zwischen Plaintext und HTML-Mail gewählt werden. Standard ist HTML.'; +$_lang['prop_formit.emailconvertnewlines_desc'] = 'Falls sowohl diese Einstellung als auch emailHtml auf "Ja" gesetzt wurden, werden Zeilenumbrüche in BR-Tags konvertiert.'; +$_lang['prop_formit.emailmultiseparator_desc'] = 'Der Standardseparator für Sammlungen von Einträgen, die über Checkboxen oder Multi-Auswahlfelder übergeben werden. Standard ist \newline'; +$_lang['prop_formit.emailmultiwrapper_desc'] = 'Umfasst jeden Eintrag einer Sammlung von Feldern, die über Checkboxen oder Multi-Auswahlfelder übergeben werden. Standard ist `value`'; + +$_lang['prop_fiar.fiartpl_desc'] = 'Falls `FormItAutoResponder` als Hook gesetzt wurde, wird hier das Template für die automatische Antwort-E-Mail angebeben.'; +$_lang['prop_fiar.fiartofield_desc'] = 'Falls `FormItAutoResponder` als Hook gesetzt wurde, wird hier angegeben, welches Formularfeld für die Empfänger-Adresse in der automatischen Antwort-E-Mail verwendet werden soll.'; +$_lang['prop_fiar.fiarbcc_desc'] = 'Falls `FormItAutoResponder` als Hook gesetzt wurde, werden hier die E-Mail-Adressen angebeben, an die die E-Mail als BCC gesendet werden soll. Kann eine kommaseparierte Liste sein.'; +$_lang['prop_fiar.fiarbccname_desc'] = 'Optional. Falls `FormItAutoResponder` als Hook gesetzt wurde, muss dies eine parallele Liste von kommaseparierten Namen für die entsprechenden E-Mail-Adressen sein, die im `emailBCC` festgelegt wurden.'; +$_lang['prop_fiar.fiarcc_desc'] = 'Falls `FormItAutoResponder` als Hook gesetzt wurde, werden hier E-Mail-Adressen angegeben, an die die E-Mail per CC gesendet wird. Kann eine kommaseparierte Liste von E-Mail-Adressen sein.'; +$_lang['prop_fiar.fiarccname_desc'] = 'Optional. Falls `FormItAutoResponder` als Hook gesetzt wurde, muss dies eine parallele Liste von kommaseparierten Namen für die entsprechenden E-Mail-Adressen sein, die in `emailCC` festgelegt wurden.'; +$_lang['prop_fiar.fiarfrom_desc'] = 'Optional. Falls `FormItAutoResponder` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird hier die Absenderadresse festgelegt. Falls nicht gesetzt, wird nach einem email-Feld gesucht. Wird keines gefunden, wird die E-Mail-Adresse aus den Systemeinstellungen verwendet.'; +$_lang['prop_fiar.fiarfromname_desc'] = 'Optional. Falls `FormItAutoResponder` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird hier der Name des Absenders zur passenden E-Mail-Adresse angegeben.'; +$_lang['prop_fiar.fiarreplyto_desc'] = 'Optional. Falls `FormItAutoResponder` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird hier die Antwort-E-Mail-Adresse angegeben.'; +$_lang['prop_fiar.fiarreplytoname_desc'] = 'Optional. Falls `FormItAutoResponder` als Hook gesetzt wurde und diese Einstellung auf "Ja" gestellt wird, wird hier der Name des Antwortadresskontakts zur passenden E-Mail-Adresse angegeben.'; +$_lang['prop_fiar.fiarsubject_desc'] = 'Falls `FormItAutoResponder` als Hook gesetzt wurde, ist dies der Betreff für die E-Mail.'; +$_lang['prop_fiar.fiarhtml_desc'] = 'Optional. Falls `FormItAutoResponder` als Hook gesetzt wurde, kann hier zwischen Plaintext und HTML-Mail gewählt werden. Standard ist HTML.'; -/* FormItRetriever properties */ -$_lang['prop_fir.placeholderprefix_desc'] = 'Das Präfix, das für Platzhalter aus den Formular-Daten genutzt werden soll.'; -$_lang['prop_fir.redirecttoonnotfound_desc'] = 'Falls keine Daten gefunden wurden, leite zur angegebenen Ressourcen-ID weiter.'; -$_lang['prop_fir.eraseonload_desc'] = 'Falls zutreffend, werden die gespeicherten Formulardaten beim Laden gelöscht. Es wird dringend empfohlen, diese Einstellung auf "Nein" zu lassen, wenn Sie die Daten nicht nur ein einziges Mal wiederverwenden möchten.'; +$_lang['prop_fir.placeholderprefix_desc'] = 'Das Präfix, das für Platzhalter aus den Formular-Daten genutzt werden soll.'; +$_lang['prop_fir.redirecttoonnotfound_desc'] = 'Falls keine Daten gefunden wurden, leite zur angegebenen Ressourcen-ID weiter.'; +$_lang['prop_fir.eraseonload_desc'] = 'Falls zutreffend, werden die gespeicherten Formulardaten beim Laden gelöscht. Es wird dringend empfohlen, diese Einstellung auf "Nein" zu lassen, wenn Sie die Daten nicht nur ein einziges Mal wiederverwenden möchten.'; +$_lang['prop_fir.storelocation_desc'] = 'Falls `store` auf `Ja` gesetzt wurde, wird hier angegeben, wo die vom Formular übermittelten Daten gecacht werden. Standard ist der MODX-Cache.'; -/* FormIt Math hook properties */ -$_lang['prop_math.mathminrange_desc'] = 'Falls `math` als Hook gesetzt wurde, der minimale Bereich für jede Zahl in der Gleichung.'; -$_lang['prop_math.mathmaxrange_desc'] = 'Falls `math` als Hook gesetzt wurde, der maximale Bereich für jede Zahl in der Gleichung.'; -$_lang['prop_math.mathfield_desc'] = 'Falls `math` als Hook gesetzt wurde, der Name des Formularfeldes für die Antwort.'; -$_lang['prop_math.mathop1field_desc'] = 'Falls `math` als Hook gesetzt wurde, der Name des Formularfeldes für die 1. Zahl in der Gleichung.'; -$_lang['prop_math.mathop2field_desc'] = 'Falls `math` als Hook gesetzt wurde, der Name des Formularfeldes für die 2. Zahl in der Gleichung.'; -$_lang['prop_math.mathoperatorfield_desc'] = 'Falls `math` als Hook gesetzt wurde, der Name des Formularfeldes für den Operator in der Gleichung.'; +$_lang['prop_math.mathminrange_desc'] = 'Falls `math` als Hook gesetzt wurde, der minimale Bereich für jede Zahl in der Gleichung.'; +$_lang['prop_math.mathmaxrange_desc'] = 'Falls `math` als Hook gesetzt wurde, der maximale Bereich für jede Zahl in der Gleichung.'; +$_lang['prop_math.mathfield_desc'] = 'Falls `math` als Hook gesetzt wurde, der Name des Formularfeldes für die Antwort.'; +$_lang['prop_math.mathop1field_desc'] = 'Falls `math` als Hook gesetzt wurde, der Name des Formularfeldes für die 1. Zahl in der Gleichung.'; +$_lang['prop_math.mathop2field_desc'] = 'Falls `math` als Hook gesetzt wurde, der Name des Formularfeldes für die 2. Zahl in der Gleichung.'; +$_lang['prop_math.mathoperatorfield_desc'] = 'Falls `math` als Hook gesetzt wurde, der Name des Formularfeldes für den Operator in der Gleichung.'; -/* FormItCountryOptions properties */ -$_lang['prop_fico.allgrouptext_desc'] = 'Optional. Falls hier etwas eingegeben wird und &prioritized genutzt wird, wird hier das Text-Label für die Optionsgruppe für alle anderen Länder festgelegt.'; -$_lang['prop_fico.optgroup_desc'] = 'Optional. Falls hier etwas eingegeben wird und &prioritized genutzt wird, ist dies das Chunk-Template, das für das Optionsgruppen-Markup verwendet wird.'; -$_lang['prop_fico.prioritized_desc'] = 'Optional. Eine kommaseparierte Liste von ISO-Codes für Länder, die in die priorisierte Listengruppe der "häufigen Besucher" gehören sollen. Dies kann für Ihre üblicherweise ausgewählten Länder verwendet werden.'; -$_lang['prop_fico.prioritizedgrouptext_desc'] = 'Optional. Falls hier etwas eingegeben wird und &prioritized genutzt wird, wird hier das Text-Label für die Optionsgruppe der priorisierten Länder festgelegt.'; -$_lang['prop_fico.selected_desc'] = 'Der auszuwählende Länderwert.'; -$_lang['prop_fico.selectedattribute_desc'] = 'Optional. Das HTML-Attribut, das einem ausgewählten Land hinzugefügt wird.'; -$_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.allgrouptext_desc'] = 'Optional. Falls hier etwas eingegeben wird und &prioritized genutzt wird, wird hier das Text-Label für die Optionsgruppe für alle anderen Länder festgelegt.'; +$_lang['prop_fico.optgrouptpl_desc'] = 'Optional. Falls hier etwas eingegeben wird und &prioritized genutzt wird, ist dies das Chunk-Template, das für das Optionsgruppen-Markup verwendet wird.'; +$_lang['prop_fico.limited_desc'] = 'Optional. Eine kommaseparierte Liste von ISO-Codes für ausgewählte Länder auf welche die vollständige Liste beschränkt wird.'; +$_lang['prop_fico.prioritized_desc'] = 'Optional. Eine kommaseparierte Liste von ISO-Codes für Länder, die in die priorisierte Listengruppe der "häufigen Besucher" gehören sollen. Dies kann für Ihre üblicherweise ausgewählten Länder verwendet werden.'; +$_lang['prop_fico.prioritizedgrouptext_desc'] = 'Optional. Falls hier etwas eingegeben wird und &prioritized genutzt wird, wird hier das Text-Label für die Optionsgruppe der priorisierten Länder festgelegt.'; +$_lang['prop_fico.selected_desc'] = 'Der auszuwählende Länderwert.'; +$_lang['prop_fico.selectedattribute_desc'] = 'Optional. Das HTML-Attribut, das einem ausgewählten Land hinzugefügt wird.'; +$_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.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.'; -$_lang['prop_fiso.tpl_desc'] = 'Optional. Der zu nutzende Chunk für jede Option der Länderauswahl.'; -$_lang['prop_fiso.useabbr_desc'] = 'Falls diese Einstellung auf "Ja" steht, wird die Abkürzung des Bundesstaates verwendet. Falls diese Einstellung auf "Nein" steht, wird der vollständige Name des Bundesstaates verwendet.'; +$_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.'; +$_lang['prop_fiso.tpl_desc'] = 'Optional. Der zu nutzende Chunk für jede Option der Länderauswahl.'; +$_lang['prop_fiso.useabbr_desc'] = 'Falls diese Einstellung auf "Ja" steht, wird die Abkürzung des Bundesstaates verwendet. Falls diese Einstellung auf "Nein" steht, wird der vollständige Name des Bundesstaates verwendet.'; -/* FormIt Options */ -$_lang['formit.opt_blackglass'] = 'schwarzes Glas'; -$_lang['formit.opt_clean'] = 'aufgeräumt'; -$_lang['formit.opt_red'] = 'rot'; -$_lang['formit.opt_white'] = 'weiß'; \ No newline at end of file +$_lang['formit.opt_blackglass'] = 'schwarzes Glas'; +$_lang['formit.opt_clean'] = 'aufgeräumt'; +$_lang['formit.opt_red'] = 'rot'; +$_lang['formit.opt_white'] = 'weiß'; +$_lang['formit.opt_cache'] = 'MODX-Cache'; +$_lang['formit.opt_session'] = 'Session'; +$_lang['prop_formit.savetmpfiles_desc'] = 'Wenn diese Einstellung auf "Ja" gesetzt wird, speichert FormIt übertragene Dateien in einem temporären Verzeichnis.'; +$_lang['prop_formit.attachfiles_desc'] = 'Wenn diese Einstellung auf "Ja" gesetzt wird, fügt FormItn der E-Mail alle übertragenen Dateien als Anhänge hinzu.'; diff --git a/core/components/formit/lexicon/de/recaptcha.inc.php b/core/components/formit/lexicon/de/recaptcha.inc.php index 5aa70972..3a2dc8d8 100644 --- a/core/components/formit/lexicon/de/recaptcha.inc.php +++ b/core/components/formit/lexicon/de/recaptcha.inc.php @@ -1,35 +1,14 @@ - * - * 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 - */ -/** - * German translation by Jörg Lippmann - * - * @package formit - * @subpackage lexicon - * @language de + * Copyright 2019 by Sterc */ -$_lang['recaptcha.empty_answer'] = 'reCAPTCHA-Eingabe leer. Bitte versuchen Sie es noch einmal.'; -$_lang['recaptcha.incorrect'] = 'reCAPTCHA-Worte falsch. Bitte überprüfen Sie die Eingabe und versuchen Sie es erneut. [[+error]]'; -$_lang['recaptcha.mailhide_no_mcrypt'] = 'Um reCAPTCHA Mailhide verwenden zu können, muss das mcrypt-PHP-Modul installiert sein.'; -$_lang['recaptcha.mailhide_no_api_key'] = 'Um reCAPTCHA Mailhide verwenden zu können, müssen Sie einen öffentlichen und einen privaten Schlüssel beantragen. Dies können Sie unter http://www.google.com/recaptcha erledigen.'; -$_lang['recaptcha.no_api_key'] = 'Um reCAPTCHA verwenden zu können, benötigen Sie einen API-Schlüssel von http://www.google.com/recaptcha.'; -$_lang['recaptcha.no_remote_ip'] = 'Aus Sicherheitsgründen muss die IP-Adresse an reCAPTCHA übertragen werden.'; +$_lang['recaptcha.empty_answer'] = 'reCAPTCHA-Eingabe leer. Bitte versuchen Sie es noch einmal.'; +$_lang['recaptcha.incorrect'] = 'reCAPTCHA-Worte falsch. Bitte überprüfen Sie die Eingabe und versuchen Sie es erneut. [[+error]]'; +$_lang['recaptcha.mailhide_no_mcrypt'] = 'Um reCAPTCHA Mailhide verwenden zu können, muss das mcrypt-PHP-Modul installiert sein.'; +$_lang['recaptcha.mailhide_no_api_key'] = 'Um reCAPTCHA Mailhide verwenden zu können, müssen Sie einen öffentlichen und einen privaten Schlüssel beantragen. Dies können Sie unter http://www.google.com/recaptcha erledigen.'; +$_lang['recaptcha.no_api_key'] = 'Um reCAPTCHA verwenden zu können, benötigen Sie einen API-Schlüssel von http://www.google.com/recaptcha.'; +$_lang['recaptcha.no_remote_ip'] = 'Aus Sicherheitsgründen muss die IP-Adresse an reCAPTCHA übertragen werden.'; diff --git a/core/components/formit/lexicon/en/default.inc.php b/core/components/formit/lexicon/en/default.inc.php index 45941bcd..414bf7ac 100644 --- a/core/components/formit/lexicon/en/default.inc.php +++ b/core/components/formit/lexicon/en/default.inc.php @@ -1,55 +1,112 @@ - * - * 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 - */ -/** - * Default Lexicon Topic - * - * @package formit - * @subpackage lexicon + * Copyright 2020 by Sterc */ -$_lang['formit.all_group_text'] = 'All Countries'; -$_lang['formit.contains'] = 'Your value must contain the phrase "[[+value]]".'; -$_lang['formit.email_invalid'] = 'Please enter a valid email address.'; -$_lang['formit.email_invalid_domain'] = 'Your email address does not have a valid domain name.'; -$_lang['formit.email_no_recipient'] = 'Please specify a recipient or recipients for the email.'; -$_lang['formit.email_not_sent'] = 'An error occurred while trying to send the email.'; -$_lang['formit.email_tpl_nf'] = 'Please specify an email template.'; -$_lang['formit.field_not_empty'] = 'This field must be empty.'; -$_lang['formit.field_required'] = 'This field is required.'; -$_lang['formit.math_incorrect'] = 'Incorrect answer!'; -$_lang['formit.math_field_nf'] = '[[+field]] input field not specified in form.'; -$_lang['formit.max_length'] = 'This field cannot be longer than [[+length]] characters long.'; -$_lang['formit.max_value'] = 'This field cannot be larger than [[+value]].'; -$_lang['formit.min_length'] = 'This field must be at least [[+length]] characters long.'; -$_lang['formit.min_value'] = 'This field cannot be smaller than [[+value]].'; -$_lang['formit.not_date'] = 'This field must be a valid date.'; -$_lang['formit.not_lowercase'] = 'This field must be all lowercase.'; -$_lang['formit.not_number'] = 'This field must be a valid number.'; -$_lang['formit.not_uppercase'] = 'This field must be all uppercase.'; -$_lang['formit.password_dont_match'] = 'Your passwords do not match.'; -$_lang['formit.password_not_confirmed'] = 'Please confirm your password.'; -$_lang['formit.prioritized_group_text'] = 'Frequent Visitors'; -$_lang['formit.range_invalid'] = 'Invalid range specification.'; -$_lang['formit.range'] = 'Your value must be between [[+min]] and [[+max]].'; -$_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'] = 'FormIt'; +$_lang['formit.desc'] = 'View all submitted forms.'; + +$_lang['area_formit'] = 'FormIt'; +$_lang['area_formit_recaptcha'] = 'FormIt reCAPTCHA'; + +$_lang['formit.form'] = 'Form'; +$_lang['formit.forms'] = 'Forms'; +$_lang['formit.forms_desc'] = 'View all submitted forms.'; +$_lang['formit.form_view'] = 'View form'; +$_lang['formit.form_remove'] = 'Remove form'; +$_lang['formit.form_remove_confirm'] = 'Are you sure you want to remove this form?'; +$_lang['formit.forms_remove'] = 'Remove forms'; +$_lang['formit.forms_remove_confirm'] = 'Are you sure you want to remove all forms?'; +$_lang['formit.forms_clean'] = 'Clean forms'; +$_lang['formit.forms_clean_confirm'] = 'Are you sure you want to clean all old forms?'; +$_lang['formit.forms_export'] = 'Export forms'; +$_lang['formit.form_encrypt'] = 'Encrypt form(s)'; +$_lang['formit.form_encrypt_confirm'] = 'Are you sure you want to encrypt the form(s)?'; +$_lang['formit.form_decrypt'] = 'Undo form encryption(s)'; +$_lang['formit.form_decrypt_confirm'] = 'Are you sure you want to undo the form encryption(s)?'; +$_lang['formit.view_ip'] = 'View all forms from this IP'; + +$_lang['formit.encryption'] = 'Encrypted form'; +$_lang['formit.encryptions'] = 'Encrypted forms'; +$_lang['formit.encryptions_desc'] = 'View all encrypted and non encrypted forms.'; + +$_lang['formit.label_form_name'] = 'Name'; +$_lang['formit.label_form_name_desc'] = 'The name of the form.'; +$_lang['formit.label_form_values'] = 'Form values'; +$_lang['formit.label_form_values_desc'] = 'The values of the form.'; +$_lang['formit.label_form_ip'] = 'IP number'; +$_lang['formit.label_form_ip_desc'] = 'The IP number of the visitor that has submitted the form.'; +$_lang['formit.label_form_date'] = 'Date'; +$_lang['formit.label_form_date_desc'] = 'The date when the form is submitted.'; +$_lang['formit.label_form_encrypted'] = 'Encrypted'; +$_lang['formit.label_form_encrypted_desc'] = ''; +$_lang['formit.label_form_decrypted'] = 'Not encrypted'; +$_lang['formit.label_form_decrypted_desc'] = ''; +$_lang['formit.label_form_total'] = 'Total'; +$_lang['formit.label_form_total_desc'] = ''; + +$_lang['formit.label_clean_label'] = 'Remove forms older than'; +$_lang['formit.label_clean_desc'] = 'days'; + +$_lang['formit.label_export_form'] = 'Form'; +$_lang['formit.label_export_form_desc'] = 'Select a form to export.'; +$_lang['formit.label_export_start_date'] = 'Date from'; +$_lang['formit.label_export_start_date_desc'] = 'Select a date to export forms from that date.'; +$_lang['formit.label_export_end_date'] = 'Date till'; +$_lang['formit.label_export_end_date_desc'] = 'Select a date to export forms till that date.'; +$_lang['formit.label_export_delimiter'] = 'CSV delimiter'; +$_lang['formit.label_export_delimiter_desc'] = 'The Het CSV delimiter to separate the columns. Default is ";".'; + +$_lang['formit.filter_form'] = 'Filter on form'; +$_lang['formit.filter_start_date'] = 'Filter from'; +$_lang['formit.filter_end_date'] = 'Filter till'; +$_lang['formit.encryption_unavailable'] = 'PHP OpenSSL functions openssl_encrypt and openssl_decrypt are not available. Please install PHP OpenSSL on your server. See https://www.php.net/manual/en/openssl.requirements.php for more information.'; +$_lang['formit.encryption_unavailable_warning'] = 'Warning: PHP OpenSSL functions openssl_encrypt and openssl_decrypt are not available. This means that you cannot use encryption on your forms. Please install PHP OpenSSL on your server. Visit https://www.php.net/manual/en/openssl.requirements.php for more information.'; +$_lang['formit.forms_clean_desc'] = 'The European General Data Protection Regulation (GDPR) requires that personal data, which is no longer necessary to possess, is removed. This tool makes it possible to remove saved forms with an age older than the given days. This action can not be undone!'; +$_lang['formit.forms_clean_executing'] = 'Cleaning up forms'; +$_lang['formit.forms_clean_success'] = '[[+amount]] form(s) removed.'; +$_lang['formit.export_failed'] = 'The export of the forms failed, please try again.'; +$_lang['formit.export_dir_failed'] = 'An error occurred while exporting the form, the export folder could not be created.'; + +$_lang['formit.contains'] = 'Your value must contain the phrase "[[+value]]".'; +$_lang['formit.email_invalid'] = 'Please enter a valid email address.'; +$_lang['formit.email_invalid_domain'] = 'Your email address does not have a valid domain name.'; +$_lang['formit.email_no_recipient'] = 'Please specify a recipient or recipients for the email.'; +$_lang['formit.email_not_sent'] = 'An error occurred while trying to send the email.'; +$_lang['formit.email_tpl_nf'] = 'Please specify an email template.'; +$_lang['formit.field_not_empty'] = 'This field must be empty.'; +$_lang['formit.field_required'] = 'This field is required.'; +$_lang['formit.math_incorrect'] = 'Incorrect answer!'; +$_lang['formit.math_field_nf'] = '[[+field]] input field not specified in form.'; +$_lang['formit.max_length'] = 'This field cannot be longer than [[+length]] characters long.'; +$_lang['formit.max_value'] = 'This field cannot be larger than [[+value]].'; +$_lang['formit.min_length'] = 'This field must be at least [[+length]] characters long.'; +$_lang['formit.min_value'] = 'This field cannot be smaller than [[+value]].'; +$_lang['formit.not_date'] = 'This field must be a valid date.'; +$_lang['formit.not_lowercase'] = 'This field must be all lowercase.'; +$_lang['formit.not_number'] = 'This field must be a valid number.'; +$_lang['formit.not_uppercase'] = 'This field must be all uppercase.'; +$_lang['formit.password_dont_match'] = 'Your passwords do not match.'; +$_lang['formit.password_not_confirmed'] = 'Please confirm your password.'; +$_lang['formit.prioritized_group_text'] = 'Frequent Visitors'; +$_lang['formit.range_invalid'] = 'Invalid range specification.'; +$_lang['formit.range'] = 'Your value must be between [[+min]] and [[+max]].'; +$_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.'; +$_lang['formit.not_regexp'] = 'Your value did not match the expected format.'; +$_lang['formit.all_group_text'] = 'All Countries'; +$_lang['formit.storeAttachment_mediasource_error'] = 'Cant find Media Source! Media Source ID is: '; +$_lang['formit.storeAttachment_access_error'] = 'Directory is not writable! Check the permissions for: '; + +$_lang['formit.migrate'] = 'Migrate encrypted form submissions'; +$_lang['formit.migrate_desc'] = 'Upgrading to FormIt 3.0 will also update the encryption method used for encrypting submitted form data. FormIt 2.x used mcrypt for encrypting and decrypting, but 3.0 uses the openssl methods. For this to work correctly the currently encrypted forms need to be migrated from mcrypt to openssl.'; +$_lang['formit.migrate_alert'] = 'FormIt was updated, but your encrypted form submissions need to be migrated. Click here to start the migration.'; +$_lang['formit.migrate_status'] = 'Status'; +$_lang['formit.migrate_running'] = 'Currently running migration process in the background. Please keep this page open in your browser. DO NOT CLOSE THIS PAGE!'; +$_lang['formit.migrate_success'] = 'Migration completed'; +$_lang['formit.migrate_success_msg'] = 'All your encrypted forms have been successfully migrated.'; diff --git a/core/components/formit/lexicon/en/properties.inc.php b/core/components/formit/lexicon/en/properties.inc.php index a2b1e9c5..31fd42d0 100644 --- a/core/components/formit/lexicon/en/properties.inc.php +++ b/core/components/formit/lexicon/en/properties.inc.php @@ -1,122 +1,103 @@ - * - * 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 + * Copyright 2020 by Sterc */ -/** - * Properties Lexicon Topic - * - * @package formit - * @subpackage lexicon - * @language en - */ -/* FormIt properties */ -$_lang['prop_formit.hooks_desc'] = 'What scripts to fire, if any, after the form passes validation. This can be a comma-separated list of hooks, and if the first fails, the proceeding ones will not fire. A hook can also be a Snippet name that will execute that Snippet.'; -$_lang['prop_formit.prehooks_desc'] = 'What scripts to fire, if any, once the form loads. You can pre-set form fields via $scriptProperties[`hook`]->fields[`fieldname`]. This can be a comma-separated list of hooks, and if the first fails, the proceeding ones will not fire. A hook can also be a Snippet name that will execute that Snippet.'; -$_lang['prop_formit.submitvar_desc'] = 'If set, will not begin form processing if this POST variable is not passed.'; -$_lang['prop_formit.validate_desc'] = 'A comma-separated list of fields to validate, with each field name as name:validator (eg: username:required,email:required). Validators can also be chained, like email:email:required. This property can be specified on multiple lines.'; -$_lang['prop_formit.errtpl_desc'] = 'The wrapper template for error messages.'; -$_lang['prop_formit.validationerrormessage_desc'] = 'A general error message to set to a placeholder if validation fails. Can contain [[+errors]] if you want to display a list of all errors at the top.'; -$_lang['prop_formit.validationerrorbulktpl_desc'] = 'HTML tpl that is used for each individual error in the generic validation error message value.'; -$_lang['prop_formit.customvalidators_desc'] = 'A comma-separated list of custom validator names (snippets) you plan to use in this form. They must be explicitly stated here, or they will not be run.'; -$_lang['prop_formit.trimvaluesdeforevalidation_desc'] = 'Whether or not to trim spaces from the beginning and end of values before attempting validation. Defaults to true.'; -$_lang['prop_formit.clearfieldsonsuccess_desc'] = 'If true, will clear the fields on a successful form submission that does not redirect.'; -$_lang['prop_formit.successmessage_desc'] = 'If set, will set this a placeholder with the name of the value of the property &successMessagePlaceholder, which defaults to `fi.successMessage`.'; -$_lang['prop_formit.successmessageplaceholder_desc'] = 'The placeholder to set the success message to.'; -$_lang['prop_formit.store_desc'] = 'If true, will store the data in the cache for retrieval using the FormItRetriever snippet.'; -$_lang['prop_formit.storetime_desc'] = 'If `store` is set to true, this specifies the number of seconds to store the data from the form submission. Defaults to five minutes.'; -$_lang['prop_formit.allowfiles_desc'] = 'If set to 0, will prevent files from being submitted on the form.'; -$_lang['prop_formit.placeholderprefix_desc'] = 'The prefix to use for all placeholders set by FormIt for fields. Defaults to `fi.`'; -$_lang['prop_formit.redirectto_desc'] = 'If `redirect` is set as a hook, this must specify the Resource ID to redirect to.'; -$_lang['prop_formit.redirectparams_desc'] = 'A JSON array of parameters to pass to the redirect hook that will be passed when redirecting.'; -$_lang['prop_formit.recaptchajs_desc'] = 'If `recaptcha` is set as a hook, this can be a JSON object that will be set to the JS RecaptchaOptions variable, which configures options for reCaptcha.'; -$_lang['prop_formit.recaptchaheight_desc'] = 'If `recaptcha` is set as a hook, this will select the height for the reCaptcha widget.'; -$_lang['prop_formit.recaptchatheme_desc'] = 'If `recaptcha` is set as a hook, this will select a theme for the reCaptcha widget.'; -$_lang['prop_formit.recaptchawidth_desc'] = 'If `recaptcha` is set as a hook, this will set the width for the reCaptcha widget.'; -$_lang['prop_formit.spamemailfields_desc'] = 'If `spam` is set as a hook, a comma-separated list of fields containing emails to check spam against.'; -$_lang['prop_formit.spamcheckip_desc'] = 'If `spam` is set as a hook, and this is true, will check the IP as well.'; -$_lang['prop_formit.emailbcc_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to as a BCC. Can be a comma-separated list of email addresses.'; -$_lang['prop_formit.emailbccname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailBCC` property.'; -$_lang['prop_formit.emailcc_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to as a CC. Can be a comma-separated list of email addresses.'; -$_lang['prop_formit.emailccname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailCC` property.'; -$_lang['prop_formit.emailto_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to. Can be a comma-separated list of email addresses.'; -$_lang['prop_formit.emailtoname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailTo` property.'; -$_lang['prop_formit.emailfrom_desc'] = 'Optional. If `email` is set as a hook, and this is set, will specify the From: address for the email. If not set, will first look for an `email` form field. If none is found, will default to the `emailsender` system setting.'; -$_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.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.'; -$_lang['prop_formit.emailconvertnewlines_desc'] = 'If true and emailHtml is set to 1, will convert newlines to BR tags in the email.'; -$_lang['prop_formit.emailmulitseparator_desc'] = 'The default separator for collections of items sent through checkboxes/multi-selects. Defaults to a newline.'; -$_lang['prop_formit.emailmultiwrapper_desc'] = 'Will wrap each item in a collection of fields sent via checkboxes/multi-selects. Defaults to just the value.'; -/* FormIt Auto-Responder properties */ -$_lang['prop_fiar.fiartpl_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies auto-response template to send as the email.'; -$_lang['prop_fiar.fiartofield_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies which form field shall be used for the To: address in the auto-response email.'; -$_lang['prop_fiar.fiarbcc_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies the email(s) to send the email to as a BCC. Can be a comma-separated list of email addresses.'; -$_lang['prop_fiar.fiarbccname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailBCC` property.'; -$_lang['prop_fiar.fiarcc_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies the email(s) to send the email to as a CC. Can be a comma-separated list of email addresses.'; -$_lang['prop_fiar.fiarccname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailCC` property.'; -$_lang['prop_fiar.fiarfrom_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the From: address for the email. If not set, will first look for an `email` form field. If none is found, will default to the `emailsender` system setting.'; -$_lang['prop_fiar.fiarfromname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the From: name for the email.'; -$_lang['prop_fiar.fiarreplyto_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the Reply-To: address for the email.'; -$_lang['prop_fiar.fiarreplytoname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the Reply-To: name for the email.'; -$_lang['prop_fiar.fiarsubject_desc'] = 'If `FormItAutoResponder` is set as a hook, this is required as a subject line for the email.'; -$_lang['prop_fiar.fiarhtml_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, this toggles HTML emails or not. Defaults to true.'; +$_lang['prop_formit.hooks_desc'] = 'What scripts to fire, if any, after the form passes validation. This can be a comma-separated list of hooks, and if the first fails, the proceeding ones will not fire. A hook can also be a Snippet name that will execute that Snippet.'; +$_lang['prop_formit.prehooks_desc'] = 'What scripts to fire, if any, once the form loads. You can pre-set form fields via $scriptProperties[`hook`]->fields[`fieldname`]. This can be a comma-separated list of hooks, and if the first fails, the proceeding ones will not fire. A hook can also be a Snippet name that will execute that Snippet.'; +$_lang['prop_formit.submitvar_desc'] = 'If set, will not begin form processing if this POST variable is not passed.'; +$_lang['prop_formit.validate_desc'] = 'A comma-separated list of fields to validate, with each field name as name:validator (eg: username:required,email:required). Validators can also be chained, like email:email:required. This property can be specified on multiple lines.'; +$_lang['prop_formit.errtpl_desc'] = 'The wrapper template for error messages.'; +$_lang['prop_formit.validationerrormessage_desc'] = 'A general error message to set to a placeholder if validation fails. Can contain [[+errors]] if you want to display a list of all errors at the top.'; +$_lang['prop_formit.validationerrorbulktpl_desc'] = 'HTML tpl that is used for each individual error in the generic validation error message value.'; +$_lang['prop_formit.customvalidators_desc'] = 'A comma-separated list of custom validator names (snippets) you plan to use in this form. They must be explicitly stated here, or they will not be run.'; +$_lang['prop_formit.trimvaluesdeforevalidation_desc'] = 'Whether or not to trim spaces from the beginning and end of values before attempting validation. Defaults to true.'; +$_lang['prop_formit.clearfieldsonsuccess_desc'] = 'If true, will clear the fields on a successful form submission that does not redirect.'; +$_lang['prop_formit.successmessage_desc'] = 'If set, will set this a placeholder with the name of the value of the property &successMessagePlaceholder, which defaults to `fi.successMessage`.'; +$_lang['prop_formit.successmessageplaceholder_desc'] = 'The placeholder to set the success message to.'; +$_lang['prop_formit.store_desc'] = 'If true, will store the data in the cache for retrieval using the FormItRetriever snippet.'; +$_lang['prop_formit.storetime_desc'] = 'If `store` is set to true, this specifies the number of seconds to store the data from the form submission. Defaults to five minutes.'; +$_lang['prop_formit.storelocation_desc'] = 'If `store` is set to true, this specifies the cache location of the data from the form submission. Defaults to MODX cache.'; +$_lang['prop_formit.allowfiles_desc'] = 'If set to 0, will prevent files from being submitted on the form.'; +$_lang['prop_formit.placeholderprefix_desc'] = 'The prefix to use for all placeholders set by FormIt for fields. Defaults to `fi.`'; +$_lang['prop_formit.redirectto_desc'] = 'If `redirect` is set as a hook, this must specify the Resource ID to redirect to.'; +$_lang['prop_formit.redirectparams_desc'] = 'A JSON array of parameters to pass to the redirect hook that will be passed when redirecting.'; +$_lang['prop_formit.recaptchajs_desc'] = 'If `recaptcha` is set as a hook, this can be a JSON object that will be set to the JS RecaptchaOptions variable, which configures options for reCAPTCHA.'; +$_lang['prop_formit.recaptchaheight_desc'] = 'If `recaptcha` is set as a hook, this will select the height for the reCAPTCHA widget.'; +$_lang['prop_formit.recaptchatheme_desc'] = 'If `recaptcha` is set as a hook, this will select a theme for the reCAPTCHA widget.'; +$_lang['prop_formit.recaptchawidth_desc'] = 'If `recaptcha` is set as a hook, this will set the width for the reCAPTCHA widget.'; +$_lang['prop_formit.spamemailfields_desc'] = 'If `spam` is set as a hook, a comma-separated list of fields containing emails to check spam against.'; +$_lang['prop_formit.spamcheckip_desc'] = 'If `spam` is set as a hook, and this is true, will check the IP as well.'; +$_lang['prop_formit.emailbcc_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to as a BCC. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailbccname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailBCC` property.'; +$_lang['prop_formit.emailcc_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to as a CC. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailccname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailCC` property.'; +$_lang['prop_formit.emailto_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailtoname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailTo` property.'; +$_lang['prop_formit.emailfrom_desc'] = 'Optional. If `email` is set as a hook, and this is set, will specify the From: address for the email. If not set, will first look for an `email` form field. If none is found, will default to the `emailsender` system setting.'; +$_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.'; +$_lang['prop_formit.emailconvertnewlines_desc'] = 'If true and emailHtml is set to 1, will convert newlines to BR tags in the email.'; +$_lang['prop_formit.emailmultiseparator_desc'] = 'The default separator for collections of items sent through checkboxes/multi-selects. Defaults to a newline.'; +$_lang['prop_formit.emailmultiwrapper_desc'] = 'Will wrap each item in a collection of fields sent via checkboxes/multi-selects. Defaults to just the value.'; + +$_lang['prop_fiar.fiartpl_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies auto-response template to send as the email.'; +$_lang['prop_fiar.fiartofield_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies which form field shall be used for the To: address in the auto-response email.'; +$_lang['prop_fiar.fiarbcc_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies the email(s) to send the email to as a BCC. Can be a comma-separated list of email addresses.'; +$_lang['prop_fiar.fiarbccname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailBCC` property.'; +$_lang['prop_fiar.fiarcc_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies the email(s) to send the email to as a CC. Can be a comma-separated list of email addresses.'; +$_lang['prop_fiar.fiarccname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailCC` property.'; +$_lang['prop_fiar.fiarfrom_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the From: address for the email. If not set, will first look for an `email` form field. If none is found, will default to the `emailsender` system setting.'; +$_lang['prop_fiar.fiarfromname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the From: name for the email.'; +$_lang['prop_fiar.fiarreplyto_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the Reply-To: address for the email.'; +$_lang['prop_fiar.fiarreplytoname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the Reply-To: name for the email.'; +$_lang['prop_fiar.fiarsubject_desc'] = 'If `FormItAutoResponder` is set as a hook, this is required as a subject line for the email.'; +$_lang['prop_fiar.fiarhtml_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, this toggles HTML emails or not. Defaults to true.'; -/* FormItRetriever properties */ -$_lang['prop_fir.placeholderprefix_desc'] = 'The prefix to use with placeholders from the form data.'; -$_lang['prop_fir.redirecttoonnotfound_desc'] = 'If the data is not found, if this is set, redirect to the Resource with this ID.'; -$_lang['prop_fir.eraseonload_desc'] = 'If true, will erase the stored form data on load. Strongly recommended to leave to false unless you only want the data to load once.'; +$_lang['prop_fir.placeholderprefix_desc'] = 'The prefix to use with placeholders from the form data.'; +$_lang['prop_fir.redirecttoonnotfound_desc'] = 'If the data is not found, if this is set, redirect to the Resource with this ID.'; +$_lang['prop_fir.eraseonload_desc'] = 'If true, will erase the stored form data on load. Strongly recommended to leave to false unless you only want the data to load once.'; +$_lang['prop_fir.storelocation_desc'] = 'If `store` is set to true, this specifies the cache location of the data from the form submission. Defaults to MODX cache.'; -/* FormIt Math hook properties */ -$_lang['prop_math.mathminrange_desc'] = 'If `math` is set as a hook, the minimum range for each number in the equation.'; -$_lang['prop_math.mathmaxrange_desc'] = 'If `math` is set as a hook, the maximum range for each number in the equation.'; -$_lang['prop_math.mathfield_desc'] = 'If `math` is set as a hook, the name of the input field for the answer.'; -$_lang['prop_math.mathop1field_desc'] = 'If `math` is set as a hook, the name of the field for the 1st number in the equation.'; -$_lang['prop_math.mathop2field_desc'] = 'If `math` is set as a hook, the name of the field for the 2nd number in the equation.'; -$_lang['prop_math.mathoperatorfield_desc'] = 'If `math` is set as a hook, the name of the field for the operator in the equation.'; +$_lang['prop_math.mathminrange_desc'] = 'If `math` is set as a hook, the minimum range for each number in the equation.'; +$_lang['prop_math.mathmaxrange_desc'] = 'If `math` is set as a hook, the maximum range for each number in the equation.'; +$_lang['prop_math.mathfield_desc'] = 'If `math` is set as a hook, the name of the input field for the answer.'; +$_lang['prop_math.mathop1field_desc'] = 'If `math` is set as a hook, the name of the field for the 1st number in the equation.'; +$_lang['prop_math.mathop2field_desc'] = 'If `math` is set as a hook, the name of the field for the 2nd number in the equation.'; +$_lang['prop_math.mathoperatorfield_desc'] = 'If `math` is set as a hook, the name of the field for the operator in the equation.'; -/* FormItCountryOptions properties */ -$_lang['prop_fico.allgrouptext_desc'] = 'Optional. If set and &prioritized is in use, will be the text label for the all other countries option group.'; -$_lang['prop_fico.optgroup_desc'] = 'Optional. If set and &prioritized is in use, will be the chunk tpl to use for the option group markup.'; -$_lang['prop_fico.prioritized_desc'] = 'Optional. A comma-separated list of ISO codes for countries that will move them into a prioritized "Frequent Visitors" group at the top of the dropdown. This can be used for your commonly-selected countries.'; -$_lang['prop_fico.prioritizedgrouptext_desc'] = 'Optional. If set and &prioritized is in use, will be the text label for the prioritized option group.'; -$_lang['prop_fico.selected_desc'] = 'The country value to select.'; -$_lang['prop_fico.selectedattribute_desc'] = 'Optional. The HTML attribute to add to a selected country.'; -$_lang['prop_fico.toplaceholder_desc'] = 'Optional. Use this to set the output to a placeholder instead of outputting directly.'; -$_lang['prop_fico.tpl_desc'] = 'Optional. The chunk to use for each country dropdown option.'; -$_lang['prop_fico.useisocode_desc'] = 'If 1, will use the ISO country code for the value. If 0, will use the country name.'; -$_lang['prop_fico.country_desc'] = 'Optional. Set to use a different countries file when loading a list of countries.'; +$_lang['prop_fico.allgrouptext_desc'] = 'Optional. If set and &prioritized is in use, will be the text label for the all other countries option group.'; +$_lang['prop_fico.optgrouptpl_desc'] = 'Optional. If set and &prioritized is in use, will be the chunk tpl to use for the option group markup.'; +$_lang['prop_fico.limited_desc'] = 'Optional. A comma-separated list of ISO codes for selected countries the full list will be limited to.'; +$_lang['prop_fico.prioritized_desc'] = 'Optional. A comma-separated list of ISO codes for countries that will move them into a prioritized "Frequent Visitors" group at the top of the dropdown. This can be used for your commonly-selected countries.'; +$_lang['prop_fico.prioritizedgrouptext_desc'] = 'Optional. If set and &prioritized is in use, will be the text label for the prioritized option group.'; +$_lang['prop_fico.selected_desc'] = 'The country value to select.'; +$_lang['prop_fico.selectedattribute_desc'] = 'Optional. The HTML attribute to add to a selected country.'; +$_lang['prop_fico.toplaceholder_desc'] = 'Optional. Use this to set the output to a placeholder instead of outputting directly.'; +$_lang['prop_fico.tpl_desc'] = 'Optional. The chunk to use for each country dropdown option.'; +$_lang['prop_fico.useisocode_desc'] = 'If 1, will use the ISO country code for the value. If 0, will use the country name.'; +$_lang['prop_fico.country_desc'] = 'Optional. Set to use a different countries file when loading a list of countries.'; -/* FormItStateOptions properties */ -$_lang['prop_fiso.country_desc'] = 'Optional. Set to use a different states file when loading a list of states.'; -$_lang['prop_fiso.selected_desc'] = 'The country value to select.'; -$_lang['prop_fiso.selectedattribute_desc'] = 'Optional. The HTML attribute to add to a selected country.'; -$_lang['prop_fiso.toplaceholder_desc'] = 'Optional. Use this to set the output to a placeholder instead of outputting directly.'; -$_lang['prop_fiso.tpl_desc'] = 'Optional. The chunk to use for each country dropdown option.'; -$_lang['prop_fiso.useabbr_desc'] = 'If 1, will use the state abbreviation for the value. If 0, will use the full state name.'; +$_lang['prop_fiso.country_desc'] = 'Optional. Set to use a different states file when loading a list of states.'; +$_lang['prop_fiso.selected_desc'] = 'The country value to select.'; +$_lang['prop_fiso.selectedattribute_desc'] = 'Optional. The HTML attribute to add to a selected country.'; +$_lang['prop_fiso.toplaceholder_desc'] = 'Optional. Use this to set the output to a placeholder instead of outputting directly.'; +$_lang['prop_fiso.tpl_desc'] = 'Optional. The chunk to use for each country dropdown option.'; +$_lang['prop_fiso.useabbr_desc'] = 'If 1, will use the state abbreviation for the value. If 0, will use the full state name.'; -/* FormIt Options */ -$_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_blackglass'] = 'Black Glass'; +$_lang['formit.opt_clean'] = 'Clean'; +$_lang['formit.opt_red'] = 'Red'; +$_lang['formit.opt_white'] = 'White'; +$_lang['formit.opt_cache'] = 'MODX Cache'; +$_lang['formit.opt_session'] = 'Session'; +$_lang['prop_formit.savetmpfiles_desc'] = 'If set to 1, FormIt will store submitted files in a temporary folder.'; +$_lang['prop_formit.attachfiles_desc'] = 'If true, FormIt will add all file fields as attachments in the email.'; diff --git a/core/components/formit/lexicon/en/recaptcha.inc.php b/core/components/formit/lexicon/en/recaptcha.inc.php index 378350ca..d78ecc5b 100644 --- a/core/components/formit/lexicon/en/recaptcha.inc.php +++ b/core/components/formit/lexicon/en/recaptcha.inc.php @@ -1,34 +1,14 @@ - * - * 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 - */ -/** - * reCaptcha Lexicon Topic - * - * @package formit - * @subpackage lexicon + * Copyright 2020 by Sterc */ -$_lang['recaptcha.empty_answer'] = 'Incorrect captcha words. Please check your answer and try again.'; -$_lang['recaptcha.incorrect'] = 'The reCAPTCHA wasn\'t entered correctly. Go back and try it again. [[+error]]'; -$_lang['recaptcha.mailhide_no_mcrypt'] = 'To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.'; -$_lang['recaptcha.mailhide_no_api_key'] = 'To use reCAPTCHA Mailhide, you have to sign up for a public and private key, you can do so at http://www.google.com/recaptcha'; -$_lang['recaptcha.no_api_key'] = 'To use reCAPTCHA you must get an API key from http://www.google.com/recaptcha'; -$_lang['recaptcha.no_remote_ip'] = 'For security reasons, you must pass the remote ip to reCAPTCHA'; +$_lang['recaptcha.empty_answer'] = 'Incorrect captcha words. Please check your answer and try again.'; +$_lang['recaptcha.incorrect'] = 'The reCAPTCHA wasn\'t entered correctly. Go back and try it again. [[+error]]'; +$_lang['recaptcha.mailhide_no_mcrypt'] = 'To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.'; +$_lang['recaptcha.mailhide_no_api_key'] = 'To use reCAPTCHA Mailhide, you have to sign up for a public and private key, you can do so at https://www.google.com/recaptcha'; +$_lang['recaptcha.no_api_key'] = 'To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha'; +$_lang['recaptcha.no_remote_ip'] = 'For security reasons, you must pass the remote IP to reCAPTCHA'; diff --git a/core/components/formit/lexicon/es/default.inc.php b/core/components/formit/lexicon/es/default.inc.php new file mode 100644 index 00000000..4561c6c7 --- /dev/null +++ b/core/components/formit/lexicon/es/default.inc.php @@ -0,0 +1,112 @@ + + */ + +$_lang['formit'] = 'FormIt'; +$_lang['formit.desc'] = 'Vea todos sus formularios completados.'; + +$_lang['area_formit'] = 'FormIt'; +$_lang['area_formit_recaptcha'] = 'FormIt reCaptcha'; + +$_lang['formit.form'] = 'Form'; +$_lang['formit.forms'] = 'Forms'; +$_lang['formit.forms_desc'] = 'View all submitted forms.'; +$_lang['formit.form_view'] = 'View form'; +$_lang['formit.form_remove'] = 'Remove form'; +$_lang['formit.form_remove_confirm'] = 'Are you sure you want to remove this form?'; +$_lang['formit.forms_remove'] = 'Remove forms'; +$_lang['formit.forms_remove_confirm'] = 'Are you sure you want to remove all forms?'; +$_lang['formit.forms_clean'] = 'Clean forms'; +$_lang['formit.forms_clean_confirm'] = 'Are you sure you want to clean all old forms?'; +$_lang['formit.forms_export'] = 'Export forms'; +$_lang['formit.form_encrypt'] = 'Encrypt form(s)'; +$_lang['formit.form_encrypt_confirm'] = 'Are you sure you want to encrypt the form(s)?'; +$_lang['formit.form_decrypt'] = 'Undo form encryption(s)'; +$_lang['formit.form_decrypt_confirm'] = 'Are you sure you want to undo the form encryption(s)?'; +$_lang['formit.view_ip'] = 'View all forms from this IP'; + +$_lang['formit.encryption'] = 'Encrypted form'; +$_lang['formit.encryptions'] = 'Encrypted forms'; +$_lang['formit.encryptions_desc'] = 'View all encrypted and non encrypted forms.'; + +$_lang['formit.label_form_name'] = 'Name'; +$_lang['formit.label_form_name_desc'] = 'The name of the form.'; +$_lang['formit.label_form_values'] = 'Form values'; +$_lang['formit.label_form_values_desc'] = 'The values of the form.'; +$_lang['formit.label_form_ip'] = 'IP number'; +$_lang['formit.label_form_ip_desc'] = 'The IP number of the visitor that has submitted the form.'; +$_lang['formit.label_form_date'] = 'Date'; +$_lang['formit.label_form_date_desc'] = 'The date when the form is submitted.'; +$_lang['formit.label_form_encrypted'] = 'Encrypted'; +$_lang['formit.label_form_encrypted_desc'] = ''; +$_lang['formit.label_form_decrypted'] = 'Not encrypted'; +$_lang['formit.label_form_decrypted_desc'] = ''; +$_lang['formit.label_form_total'] = 'Total'; +$_lang['formit.label_form_total_desc'] = ''; + +$_lang['formit.label_clean_label'] = 'Remove forms older than'; +$_lang['formit.label_clean_desc'] = 'days'; + +$_lang['formit.label_export_form'] = 'Form'; +$_lang['formit.label_export_form_desc'] = 'Select a form to export.'; +$_lang['formit.label_export_start_date'] = 'Date from'; +$_lang['formit.label_export_start_date_desc'] = 'Select a date to export forms from that date.'; +$_lang['formit.label_export_end_date'] = 'Date till'; +$_lang['formit.label_export_end_date_desc'] = 'Select a date to export forms till that date.'; +$_lang['formit.label_export_delimiter'] = 'CSV delimiter'; +$_lang['formit.label_export_delimiter_desc'] = 'The Het CSV delimiter to separate the columns. Default is ";".'; + +$_lang['formit.filter_form'] = 'Filter on form'; +$_lang['formit.filter_start_date'] = 'Filter from'; +$_lang['formit.filter_end_date'] = 'Filter till'; +$_lang['formit.encryption_unavailable'] = 'PHP OpenSSL functions openssl_encrypt and openssl_decrypt are not available. Please install PHP OpenSSL on your server. See http://www.php.net/manual/en/openssl.requirements.php for more information.'; +$_lang['formit.encryption_unavailable_warning'] = 'Warning: PHP OpenSSL functions openssl_encrypt and openssl_decrypt are not available. This means that you cannot use encryption on your forms. Please install PHP OpenSSL on your server. Visit this page for more information.'; +$_lang['formit.forms_clean_desc'] = 'The European General Data Protection Regulation (GDPR) requires that personal data, which is no longer necessary to possess, is removed. This tool makes it possible to remove saved forms with an age older than the given days. This action can not be undone!'; +$_lang['formit.forms_clean_executing'] = 'Cleaning up forms'; +$_lang['formit.forms_clean_success'] = '[[+amount]] form(s) removed.'; +$_lang['formit.export_failed'] = 'The export of the forms failed, please try again.'; +$_lang['formit.export_dir_failed'] = 'An error occurred while exporting the form, the export folder could not be created.'; + +$_lang['formit.contains'] = 'Su valor debe contener la frase "[[+value]]".'; +$_lang['formit.email_invalid'] = 'Por favor introduzca una dirección de correo electrónico válida.'; +$_lang['formit.email_invalid_domain'] = 'Su dirección de correo electrónico no tiene un nombre de dominio válido.'; +$_lang['formit.email_no_recipient'] = 'Por favor especifique el destinatario o los destinatarios para el correo electrónico.'; +$_lang['formit.email_not_sent'] = 'Ocurrió un error al intentar enviar el correo electrónico.'; +$_lang['formit.email_tpl_nf'] = 'Por favor especifique una plantilla de correo electrónico.'; +$_lang['formit.field_not_empty'] = 'Este campo debe estar vacío.'; +$_lang['formit.field_required'] = 'Este campo es requerido.'; +$_lang['formit.math_incorrect'] = '¡Respuesta incorrecta!'; +$_lang['formit.math_field_nf'] = 'El campo de entrada, [[+field]] , no fue especificado en el formulario.'; +$_lang['formit.max_length'] = 'Este campo no puede tener más de [[+length]] caracteres.'; +$_lang['formit.max_value'] = 'Este campo no puede ser mayor que [[+value]].'; +$_lang['formit.min_length'] = 'Este campo debe tener al menos [[+length]] caracteres.'; +$_lang['formit.min_value'] = 'Este campo no puede ser menor que [[+value]].'; +$_lang['formit.not_date'] = 'Este campo debe ser una fecha válida.'; +$_lang['formit.not_lowercase'] = 'Este campo debe estar en minúsculas.'; +$_lang['formit.not_number'] = 'Este campo debe ser un número válido.'; +$_lang['formit.not_uppercase'] = 'Este campo debe estar en mayúsculas.'; +$_lang['formit.password_dont_match'] = 'Las contraseñas no coinciden.'; +$_lang['formit.password_not_confirmed'] = 'Por favor, confirme su contraseña.'; +$_lang['formit.prioritized_group_text'] = 'Visitantes frecuentes'; +$_lang['formit.range_invalid'] = 'Especificaciones de rango inválido.'; +$_lang['formit.range'] = 'Su valor debe estar entre [[+min]] y [[+max]].'; +$_lang['formit.recaptcha_err_load'] = 'No se pudo cargar la clase de servicio reCaptcha.'; +$_lang['formit.spam_blocked'] = 'Su envío fue bloqueado por un filtro de spam: '; +$_lang['formit.spam_marked'] = ' - marcado como spam.'; +$_lang['formit.username_taken'] = 'Nombre de usuario ya está en uso. Por favor, elige otro.'; +$_lang['formit.not_regexp'] = 'Su valor no coincide con el formato esperado.'; +$_lang['formit.all_group_text'] = 'Todos los países'; +$_lang['formit.storeAttachment_mediasource_error'] = 'Cant find MediaSource! Mediasource id is: '; +$_lang['formit.storeAttachment_access_error'] = 'Directory is not writable! Check the permissions for: '; + +$_lang['formit.migrate'] = 'Migrate encrypted form submissions'; +$_lang['formit.migrate_desc'] = 'Upgrading to FormIt 3.0 will also update the encryption method used for encrypting submitted form data. FormIt 2.x used mcrypt for encrypting and decrypting, but 3.0 uses the openssl methods. For this to work correctly the currently encrypted forms need to be migrated from mcrypt to openssl.'; +$_lang['formit.migrate_alert'] = 'FormIt was updated, but your encrypted form submissions need to be migrated. Click here to start the migration.'; +$_lang['formit.migrate_status'] = 'Status'; +$_lang['formit.migrate_running'] = 'Currently running migration process in the background. Please keep this page open in your browser. DO NOT CLOSE THIS PAGE!'; +$_lang['formit.migrate_success'] = 'Migration completed'; +$_lang['formit.migrate_success_msg'] = 'All your encrypted forms have been successfully migrated.'; diff --git a/core/components/formit/lexicon/es/properties.inc.php b/core/components/formit/lexicon/es/properties.inc.php new file mode 100644 index 00000000..4c68d040 --- /dev/null +++ b/core/components/formit/lexicon/es/properties.inc.php @@ -0,0 +1,103 @@ + + */ + +$_lang['prop_formit.hooks_desc'] = 'What scripts to fire, if any, after the form passes validation. This can be a comma-separated list of hooks, and if the first fails, the proceeding ones will not fire. A hook can also be a Snippet name that will execute that Snippet.'; +$_lang['prop_formit.prehooks_desc'] = 'What scripts to fire, if any, once the form loads. You can pre-set form fields via $scriptProperties[`hook`]->fields[`fieldname`]. This can be a comma-separated list of hooks, and if the first fails, the proceeding ones will not fire. A hook can also be a Snippet name that will execute that Snippet.'; +$_lang['prop_formit.submitvar_desc'] = 'If set, will not begin form processing if this POST variable is not passed.'; +$_lang['prop_formit.validate_desc'] = 'A comma-separated list of fields to validate, with each field name as name:validator (eg: username:required,email:required). Validators can also be chained, like email:email:required. This property can be specified on multiple lines.'; +$_lang['prop_formit.errtpl_desc'] = 'The wrapper template for error messages.'; +$_lang['prop_formit.validationerrormessage_desc'] = 'A general error message to set to a placeholder if validation fails. Can contain [[+errors]] if you want to display a list of all errors at the top.'; +$_lang['prop_formit.validationerrorbulktpl_desc'] = 'HTML tpl that is used for each individual error in the generic validation error message value.'; +$_lang['prop_formit.customvalidators_desc'] = 'A comma-separated list of custom validator names (snippets) you plan to use in this form. They must be explicitly stated here, or they will not be run.'; +$_lang['prop_formit.trimvaluesdeforevalidation_desc'] = 'Whether or not to trim spaces from the beginning and end of values before attempting validation. Defaults to true.'; +$_lang['prop_formit.clearfieldsonsuccess_desc'] = 'If true, will clear the fields on a successful form submission that does not redirect.'; +$_lang['prop_formit.successmessage_desc'] = 'If set, will set this a placeholder with the name of the value of the property &successMessagePlaceholder, which defaults to `fi.successMessage`.'; +$_lang['prop_formit.successmessageplaceholder_desc'] = 'The placeholder to set the success message to.'; +$_lang['prop_formit.store_desc'] = 'If true, will store the data in the cache for retrieval using the FormItRetriever snippet.'; +$_lang['prop_formit.storetime_desc'] = 'If `store` is set to true, this specifies the number of seconds to store the data from the form submission. Defaults to five minutes.'; +$_lang['prop_formit.storelocation_desc'] = 'If `store` is set to true, this specifies the cache location of the data from the form submission. Defaults to MODX cache.'; +$_lang['prop_formit.allowfiles_desc'] = 'If set to 0, will prevent files from being submitted on the form.'; +$_lang['prop_formit.placeholderprefix_desc'] = 'The prefix to use for all placeholders set by FormIt for fields. Defaults to `fi.`'; +$_lang['prop_formit.redirectto_desc'] = 'If `redirect` is set as a hook, this must specify the Resource ID to redirect to.'; +$_lang['prop_formit.redirectparams_desc'] = 'A JSON array of parameters to pass to the redirect hook that will be passed when redirecting.'; +$_lang['prop_formit.recaptchajs_desc'] = 'If `recaptcha` is set as a hook, this can be a JSON object that will be set to the JS RecaptchaOptions variable, which configures options for reCaptcha.'; +$_lang['prop_formit.recaptchaheight_desc'] = 'If `recaptcha` is set as a hook, this will select the height for the reCaptcha widget.'; +$_lang['prop_formit.recaptchatheme_desc'] = 'If `recaptcha` is set as a hook, this will select a theme for the reCaptcha widget.'; +$_lang['prop_formit.recaptchawidth_desc'] = 'If `recaptcha` is set as a hook, this will set the width for the reCaptcha widget.'; +$_lang['prop_formit.spamemailfields_desc'] = 'If `spam` is set as a hook, a comma-separated list of fields containing emails to check spam against.'; +$_lang['prop_formit.spamcheckip_desc'] = 'If `spam` is set as a hook, and this is true, will check the IP as well.'; +$_lang['prop_formit.emailbcc_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to as a BCC. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailbccname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailBCC` property.'; +$_lang['prop_formit.emailcc_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to as a CC. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailccname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailCC` property.'; +$_lang['prop_formit.emailto_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailtoname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailTo` property.'; +$_lang['prop_formit.emailfrom_desc'] = 'Optional. If `email` is set as a hook, and this is set, will specify the From: address for the email. If not set, will first look for an `email` form field. If none is found, will default to the `emailsender` system setting.'; +$_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.'; +$_lang['prop_formit.emailconvertnewlines_desc'] = 'If true and emailHtml is set to 1, will convert newlines to BR tags in the email.'; +$_lang['prop_formit.emailmultiseparator_desc'] = 'The default separator for collections of items sent through checkboxes/multi-selects. Defaults to a newline.'; +$_lang['prop_formit.emailmultiwrapper_desc'] = 'Will wrap each item in a collection of fields sent via checkboxes/multi-selects. Defaults to just the value.'; + +$_lang['prop_fiar.fiartpl_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies auto-response template to send as the email.'; +$_lang['prop_fiar.fiartofield_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies which form field shall be used for the To: address in the auto-response email.'; +$_lang['prop_fiar.fiarbcc_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies the email(s) to send the email to as a BCC. Can be a comma-separated list of email addresses.'; +$_lang['prop_fiar.fiarbccname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailBCC` property.'; +$_lang['prop_fiar.fiarcc_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies the email(s) to send the email to as a CC. Can be a comma-separated list of email addresses.'; +$_lang['prop_fiar.fiarccname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailCC` property.'; +$_lang['prop_fiar.fiarfrom_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the From: address for the email. If not set, will first look for an `email` form field. If none is found, will default to the `emailsender` system setting.'; +$_lang['prop_fiar.fiarfromname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the From: name for the email.'; +$_lang['prop_fiar.fiarreplyto_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the Reply-To: address for the email.'; +$_lang['prop_fiar.fiarreplytoname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the Reply-To: name for the email.'; +$_lang['prop_fiar.fiarsubject_desc'] = 'If `FormItAutoResponder` is set as a hook, this is required as a subject line for the email.'; +$_lang['prop_fiar.fiarhtml_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, this toggles HTML emails or not. Defaults to true.'; + +$_lang['prop_fir.placeholderprefix_desc'] = 'The prefix to use with placeholders from the form data.'; +$_lang['prop_fir.redirecttoonnotfound_desc'] = 'If the data is not found, if this is set, redirect to the Resource with this ID.'; +$_lang['prop_fir.eraseonload_desc'] = 'If true, will erase the stored form data on load. Strongly recommended to leave to false unless you only want the data to load once.'; +$_lang['prop_fir.storelocation_desc'] = 'If `store` is set to true, this specifies the cache location of the data from the form submission. Defaults to MODX cache.'; + +$_lang['prop_math.mathminrange_desc'] = 'If `math` is set as a hook, the minimum range for each number in the equation.'; +$_lang['prop_math.mathmaxrange_desc'] = 'If `math` is set as a hook, the maximum range for each number in the equation.'; +$_lang['prop_math.mathfield_desc'] = 'If `math` is set as a hook, the name of the input field for the answer.'; +$_lang['prop_math.mathop1field_desc'] = 'If `math` is set as a hook, the name of the field for the 1st number in the equation.'; +$_lang['prop_math.mathop2field_desc'] = 'If `math` is set as a hook, the name of the field for the 2nd number in the equation.'; +$_lang['prop_math.mathoperatorfield_desc'] = 'If `math` is set as a hook, the name of the field for the operator in the equation.'; + +$_lang['prop_fico.allgrouptext_desc'] = 'Optional. If set and &prioritized is in use, will be the text label for the all other countries option group.'; +$_lang['prop_fico.optgrouptpl_desc'] = 'Optional. If set and &prioritized is in use, will be the chunk tpl to use for the option group markup.'; +$_lang['prop_fico.limited_desc'] = 'Optional. A comma-separated list of ISO codes for selected countries the full list will be limited to.'; +$_lang['prop_fico.prioritized_desc'] = 'Optional. A comma-separated list of ISO codes for countries that will move them into a prioritized "Frequent Visitors" group at the top of the dropdown. This can be used for your commonly-selected countries.'; +$_lang['prop_fico.prioritizedgrouptext_desc'] = 'Optional. If set and &prioritized is in use, will be the text label for the prioritized option group.'; +$_lang['prop_fico.selected_desc'] = 'The country value to select.'; +$_lang['prop_fico.selectedattribute_desc'] = 'Optional. The HTML attribute to add to a selected country.'; +$_lang['prop_fico.toplaceholder_desc'] = 'Optional. Use this to set the output to a placeholder instead of outputting directly.'; +$_lang['prop_fico.tpl_desc'] = 'Optional. The chunk to use for each country dropdown option.'; +$_lang['prop_fico.useisocode_desc'] = 'If 1, will use the ISO country code for the value. If 0, will use the country name.'; +$_lang['prop_fico.country_desc'] = 'Optional. Set to use a different countries file when loading a list of countries.'; + +$_lang['prop_fiso.country_desc'] = 'Optional. Set to use a different states file when loading a list of states.'; +$_lang['prop_fiso.selected_desc'] = 'The country value to select.'; +$_lang['prop_fiso.selectedattribute_desc'] = 'Optional. The HTML attribute to add to a selected country.'; +$_lang['prop_fiso.toplaceholder_desc'] = 'Optional. Use this to set the output to a placeholder instead of outputting directly.'; +$_lang['prop_fiso.tpl_desc'] = 'Optional. The chunk to use for each country dropdown option.'; +$_lang['prop_fiso.useabbr_desc'] = 'If 1, will use the state abbreviation for the value. If 0, will use the full state name.'; + +$_lang['formit.opt_blackglass'] = 'Black Glass'; +$_lang['formit.opt_clean'] = 'Clean'; +$_lang['formit.opt_red'] = 'Red'; +$_lang['formit.opt_white'] = 'White'; +$_lang['formit.opt_cache'] = 'MODX Cache'; +$_lang['formit.opt_session'] = 'Session'; +$_lang['prop_formit.savetmpfiles_desc'] = 'If set to 1, FormIt will store submitted files in a temporary folder.'; +$_lang['prop_formit.attachfiles_desc'] = 'If true, FormIt will add all file fields as attachments in the email.'; diff --git a/core/components/formit/lexicon/es/recaptcha.inc.php b/core/components/formit/lexicon/es/recaptcha.inc.php new file mode 100644 index 00000000..7117e27f --- /dev/null +++ b/core/components/formit/lexicon/es/recaptcha.inc.php @@ -0,0 +1,14 @@ + + */ + +$_lang['recaptcha.empty_answer'] = 'Palabras de captcha incorrectas. Por favor revise sus datos y intentelo de nuevo.'; +$_lang['recaptcha.incorrect'] = 'El reCAPTCHA no fue introducido correctamente. Regrese a la pagina anterior y intentelo de nuevo. [[+error]]'; +$_lang['recaptcha.mailhide_no_mcrypt'] = 'Para utilizar reCAPTCHA Mailhide, necesita tener el módulo de php de mcrypt instalado.'; +$_lang['recaptcha.mailhide_no_api_key'] = 'Para utilizar reCAPTCHA Mailhide, necesita registrarse por una clave publica y privada, lo puede hacer en esta pagina http://www.google.com/recaptcha'; +$_lang['recaptcha.no_api_key'] = 'Para utilizar reCAPTCHA necesita obtener una clave de API de http://www.google.com/recaptcha'; +$_lang['recaptcha.no_remote_ip'] = 'Por razones de seguridad, tiene que pasar el IP remoto a reCAPTCHA'; diff --git a/core/components/formit/lexicon/fr/default.inc.php b/core/components/formit/lexicon/fr/default.inc.php index f68e874a..adc5c9f6 100644 --- a/core/components/formit/lexicon/fr/default.inc.php +++ b/core/components/formit/lexicon/fr/default.inc.php @@ -1,51 +1,112 @@ - * - * 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 - */ -/** - * Default Lexicon Topic - * - * @package formit - * @subpackge lexicon + * Copyright 2019 by Sterc */ -$_lang['formit.contains'] = 'Votre valeur doit contenir la phrase "[[+value]]".'; -$_lang['formit.email_invalid'] = 'Entrez une adresse courriel valide.'; -$_lang['formit.email_invalid_domain'] = 'Votre adresse courriel n\'a pas un nom de domaine valide.'; -$_lang['formit.email_no_recipient'] = 'Spécifiez un ou plusieurs destinataires du courriel.'; -$_lang['formit.email_not_sent'] = 'Une erreur s\'est produite lors de l\'envoi du courriel.'; -$_lang['formit.email_tpl_nf'] = 'Spécifiez un modéle de courriel.'; -$_lang['formit.field_not_empty'] = 'Ce champ doit être vide.'; -$_lang['formit.field_required'] = 'Ce champ est obligatoire.'; -$_lang['formit.max_length'] = 'Ce champ ne peut pas être plus long que [[+length]] caractéres.'; -$_lang['formit.max_value'] = 'Ce champ ne peut pas être plus grand que [[+value]].'; -$_lang['formit.min_length'] = 'Ce champ doit contenir au moins [[+length]] caractéres.'; -$_lang['formit.min_value'] = 'Ce champ ne peut pas être plus petit que [[+value]].'; -$_lang['formit.not_date'] = 'Ce champ doit contenir une date valide.'; -$_lang['formit.not_lowercase'] = 'Ce champ doit être en minuscule.'; -$_lang['formit.not_number'] = 'Ce champ doit être un nombre valide.'; -$_lang['formit.not_uppercase'] = 'Ce champ doit être en majuscules.'; -$_lang['formit.password_dont_match'] = 'Les mots de passe ne correspondent pas.'; -$_lang['formit.password_not_confirmed'] = 'Confirmez le mot de passe.'; -$_lang['formit.range_invalid'] = 'Valeurs invalides.'; -$_lang['formit.range'] = 'La valeur doit être comprise entre [[+min]] et [[+max]].'; -$_lang['formit.recaptcha_err_load'] = 'Le service ReCaptcha n\'a pas pu charger la classe.'; -$_lang['formit.spam_blocked'] = 'Votre inscription a été bloquée par un filtre anti-spam: '; -$_lang['formit.spam_marked'] = ' - marqués comme spam.'; -$_lang['formit.username_taken'] = 'Ce nom d\'utilisateur existe déjà , choisissez en un autre.'; \ No newline at end of file + +$_lang['formit'] = 'FormIt'; +$_lang['formit.desc'] = 'View all submitted forms.'; + +$_lang['area_formit'] = 'FormIt'; +$_lang['area_formit_recaptcha'] = 'FormIt reCaptcha'; + +$_lang['formit.form'] = 'Form'; +$_lang['formit.forms'] = 'Forms'; +$_lang['formit.forms_desc'] = 'View all submitted forms.'; +$_lang['formit.form_view'] = 'View form'; +$_lang['formit.form_remove'] = 'Remove form'; +$_lang['formit.form_remove_confirm'] = 'Are you sure you want to remove this form?'; +$_lang['formit.forms_remove'] = 'Remove forms'; +$_lang['formit.forms_remove_confirm'] = 'Are you sure you want to remove all forms?'; +$_lang['formit.forms_clean'] = 'Clean forms'; +$_lang['formit.forms_clean_confirm'] = 'Are you sure you want to clean all old forms?'; +$_lang['formit.forms_export'] = 'Export forms'; +$_lang['formit.form_encrypt'] = 'Encrypt form(s)'; +$_lang['formit.form_encrypt_confirm'] = 'Are you sure you want to encrypt the form(s)?'; +$_lang['formit.form_decrypt'] = 'Undo form encryption(s)'; +$_lang['formit.form_decrypt_confirm'] = 'Are you sure you want to undo the form encryption(s)?'; +$_lang['formit.view_ip'] = 'View all forms from this IP'; + +$_lang['formit.encryption'] = 'Encrypted form'; +$_lang['formit.encryptions'] = 'Encrypted forms'; +$_lang['formit.encryptions_desc'] = 'View all encrypted and non encrypted forms.'; + +$_lang['formit.label_form_name'] = 'Name'; +$_lang['formit.label_form_name_desc'] = 'The name of the form.'; +$_lang['formit.label_form_values'] = 'Form values'; +$_lang['formit.label_form_values_desc'] = 'The values of the form.'; +$_lang['formit.label_form_ip'] = 'IP number'; +$_lang['formit.label_form_ip_desc'] = 'The IP number of the visitor that has submitted the form.'; +$_lang['formit.label_form_date'] = 'Date'; +$_lang['formit.label_form_date_desc'] = 'The date when the form is submitted.'; +$_lang['formit.label_form_encrypted'] = 'Encrypted'; +$_lang['formit.label_form_encrypted_desc'] = ''; +$_lang['formit.label_form_decrypted'] = 'Not encrypted'; +$_lang['formit.label_form_decrypted_desc'] = ''; +$_lang['formit.label_form_total'] = 'Total'; +$_lang['formit.label_form_total_desc'] = ''; + +$_lang['formit.label_clean_label'] = 'Remove forms older than'; +$_lang['formit.label_clean_desc'] = 'days'; + +$_lang['formit.label_export_form'] = 'Form'; +$_lang['formit.label_export_form_desc'] = 'Select a form to export.'; +$_lang['formit.label_export_start_date'] = 'Date from'; +$_lang['formit.label_export_start_date_desc'] = 'Select a date to export forms from that date.'; +$_lang['formit.label_export_end_date'] = 'Date till'; +$_lang['formit.label_export_end_date_desc'] = 'Select a date to export forms till that date.'; +$_lang['formit.label_export_delimiter'] = 'CSV delimiter'; +$_lang['formit.label_export_delimiter_desc'] = 'The Het CSV delimiter to separate the columns. Default is ";".'; + +$_lang['formit.filter_form'] = 'Filter on form'; +$_lang['formit.filter_start_date'] = 'Filter from'; +$_lang['formit.filter_end_date'] = 'Filter till'; +$_lang['formit.encryption_unavailable'] = 'PHP OpenSSL functions openssl_encrypt and openssl_decrypt are not available. Please install PHP OpenSSL on your server. See http://www.php.net/manual/en/openssl.requirements.php for more information.'; +$_lang['formit.encryption_unavailable_warning'] = 'Warning: PHP OpenSSL functions openssl_encrypt and openssl_decrypt are not available. This means that you cannot use encryption on your forms. Please install PHP OpenSSL on your server. Visit this page for more information.'; +$_lang['formit.forms_clean_desc'] = 'The European General Data Protection Regulation (GDPR) requires that personal data, which is no longer necessary to possess, is removed. This tool makes it possible to remove saved forms with an age older than the given days. This action can not be undone!'; +$_lang['formit.forms_clean_executing'] = 'Cleaning up forms'; +$_lang['formit.forms_clean_success'] = '[[+amount]] form(s) removed.'; +$_lang['formit.export_failed'] = 'The export of the forms failed, please try again.'; +$_lang['formit.export_dir_failed'] = 'An error occurred while exporting the form, the export folder could not be created.'; + +$_lang['formit.contains'] = 'Votre valeur doit contenir la phrase "[[+value]]".'; +$_lang['formit.email_invalid'] = 'Entrez une adresse courriel valide.'; +$_lang['formit.email_invalid_domain'] = 'Votre adresse courriel n\'a pas un nom de domaine valide.'; +$_lang['formit.email_no_recipient'] = 'Spécifiez un ou plusieurs destinataires du courriel.'; +$_lang['formit.email_not_sent'] = 'Une erreur s\'est produite lors de l\'envoi du courriel.'; +$_lang['formit.email_tpl_nf'] = 'Spécifiez un modéle de courriel.'; +$_lang['formit.field_not_empty'] = 'Ce champ doit être vide.'; +$_lang['formit.field_required'] = 'Ce champ est obligatoire.'; +$_lang['formit.math_incorrect'] = 'Incorrect answer!'; +$_lang['formit.math_field_nf'] = '[[+field]] input field not specified in form.'; +$_lang['formit.max_length'] = 'Ce champ ne peut pas être plus long que [[+length]] caractéres.'; +$_lang['formit.max_value'] = 'Ce champ ne peut pas être plus grand que [[+value]].'; +$_lang['formit.min_length'] = 'Ce champ doit contenir au moins [[+length]] caractéres.'; +$_lang['formit.min_value'] = 'Ce champ ne peut pas être plus petit que [[+value]].'; +$_lang['formit.not_date'] = 'Ce champ doit contenir une date valide.'; +$_lang['formit.not_lowercase'] = 'Ce champ doit être en minuscule.'; +$_lang['formit.not_number'] = 'Ce champ doit être un nombre valide.'; +$_lang['formit.not_uppercase'] = 'Ce champ doit être en majuscules.'; +$_lang['formit.password_dont_match'] = 'Les mots de passe ne correspondent pas.'; +$_lang['formit.password_not_confirmed'] = 'Confirmez le mot de passe.'; +$_lang['formit.prioritized_group_text'] = 'Frequent Visitors'; +$_lang['formit.range_invalid'] = 'Valeurs invalides.'; +$_lang['formit.range'] = 'La valeur doit être comprise entre [[+min]] et [[+max]].'; +$_lang['formit.recaptcha_err_load'] = 'Le service ReCaptcha n\'a pas pu charger la classe.'; +$_lang['formit.spam_blocked'] = 'Votre inscription a été bloquée par un filtre anti-spam: '; +$_lang['formit.spam_marked'] = ' - marqués comme spam.'; +$_lang['formit.username_taken'] = 'Ce nom d\'utilisateur existe déjà , choisissez en un autre.'; +$_lang['formit.not_regexp'] = 'Your value did not match the expected format.'; +$_lang['formit.all_group_text'] = 'All Countries'; +$_lang['formit.storeAttachment_mediasource_error'] = 'Cant find MediaSource! Mediasource id is: '; +$_lang['formit.storeAttachment_access_error'] = 'Directory is not writable! Check the permissions for: '; + +$_lang['formit.migrate'] = 'Migrate encrypted form submissions'; +$_lang['formit.migrate_desc'] = 'Upgrading to FormIt 3.0 will also update the encryption method used for encrypting submitted form data. FormIt 2.x used mcrypt for encrypting and decrypting, but 3.0 uses the openssl methods. For this to work correctly the currently encrypted forms need to be migrated from mcrypt to openssl.'; +$_lang['formit.migrate_alert'] = 'FormIt was updated, but your encrypted form submissions need to be migrated. Click here to start the migration.'; +$_lang['formit.migrate_status'] = 'Status'; +$_lang['formit.migrate_running'] = 'Currently running migration process in the background. Please keep this page open in your browser. DO NOT CLOSE THIS PAGE!'; +$_lang['formit.migrate_success'] = 'Migration completed'; +$_lang['formit.migrate_success_msg'] = 'All your encrypted forms have been successfully migrated.'; diff --git a/core/components/formit/lexicon/fr/properties.inc.php b/core/components/formit/lexicon/fr/properties.inc.php new file mode 100644 index 00000000..4c68d040 --- /dev/null +++ b/core/components/formit/lexicon/fr/properties.inc.php @@ -0,0 +1,103 @@ + + */ + +$_lang['prop_formit.hooks_desc'] = 'What scripts to fire, if any, after the form passes validation. This can be a comma-separated list of hooks, and if the first fails, the proceeding ones will not fire. A hook can also be a Snippet name that will execute that Snippet.'; +$_lang['prop_formit.prehooks_desc'] = 'What scripts to fire, if any, once the form loads. You can pre-set form fields via $scriptProperties[`hook`]->fields[`fieldname`]. This can be a comma-separated list of hooks, and if the first fails, the proceeding ones will not fire. A hook can also be a Snippet name that will execute that Snippet.'; +$_lang['prop_formit.submitvar_desc'] = 'If set, will not begin form processing if this POST variable is not passed.'; +$_lang['prop_formit.validate_desc'] = 'A comma-separated list of fields to validate, with each field name as name:validator (eg: username:required,email:required). Validators can also be chained, like email:email:required. This property can be specified on multiple lines.'; +$_lang['prop_formit.errtpl_desc'] = 'The wrapper template for error messages.'; +$_lang['prop_formit.validationerrormessage_desc'] = 'A general error message to set to a placeholder if validation fails. Can contain [[+errors]] if you want to display a list of all errors at the top.'; +$_lang['prop_formit.validationerrorbulktpl_desc'] = 'HTML tpl that is used for each individual error in the generic validation error message value.'; +$_lang['prop_formit.customvalidators_desc'] = 'A comma-separated list of custom validator names (snippets) you plan to use in this form. They must be explicitly stated here, or they will not be run.'; +$_lang['prop_formit.trimvaluesdeforevalidation_desc'] = 'Whether or not to trim spaces from the beginning and end of values before attempting validation. Defaults to true.'; +$_lang['prop_formit.clearfieldsonsuccess_desc'] = 'If true, will clear the fields on a successful form submission that does not redirect.'; +$_lang['prop_formit.successmessage_desc'] = 'If set, will set this a placeholder with the name of the value of the property &successMessagePlaceholder, which defaults to `fi.successMessage`.'; +$_lang['prop_formit.successmessageplaceholder_desc'] = 'The placeholder to set the success message to.'; +$_lang['prop_formit.store_desc'] = 'If true, will store the data in the cache for retrieval using the FormItRetriever snippet.'; +$_lang['prop_formit.storetime_desc'] = 'If `store` is set to true, this specifies the number of seconds to store the data from the form submission. Defaults to five minutes.'; +$_lang['prop_formit.storelocation_desc'] = 'If `store` is set to true, this specifies the cache location of the data from the form submission. Defaults to MODX cache.'; +$_lang['prop_formit.allowfiles_desc'] = 'If set to 0, will prevent files from being submitted on the form.'; +$_lang['prop_formit.placeholderprefix_desc'] = 'The prefix to use for all placeholders set by FormIt for fields. Defaults to `fi.`'; +$_lang['prop_formit.redirectto_desc'] = 'If `redirect` is set as a hook, this must specify the Resource ID to redirect to.'; +$_lang['prop_formit.redirectparams_desc'] = 'A JSON array of parameters to pass to the redirect hook that will be passed when redirecting.'; +$_lang['prop_formit.recaptchajs_desc'] = 'If `recaptcha` is set as a hook, this can be a JSON object that will be set to the JS RecaptchaOptions variable, which configures options for reCaptcha.'; +$_lang['prop_formit.recaptchaheight_desc'] = 'If `recaptcha` is set as a hook, this will select the height for the reCaptcha widget.'; +$_lang['prop_formit.recaptchatheme_desc'] = 'If `recaptcha` is set as a hook, this will select a theme for the reCaptcha widget.'; +$_lang['prop_formit.recaptchawidth_desc'] = 'If `recaptcha` is set as a hook, this will set the width for the reCaptcha widget.'; +$_lang['prop_formit.spamemailfields_desc'] = 'If `spam` is set as a hook, a comma-separated list of fields containing emails to check spam against.'; +$_lang['prop_formit.spamcheckip_desc'] = 'If `spam` is set as a hook, and this is true, will check the IP as well.'; +$_lang['prop_formit.emailbcc_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to as a BCC. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailbccname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailBCC` property.'; +$_lang['prop_formit.emailcc_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to as a CC. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailccname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailCC` property.'; +$_lang['prop_formit.emailto_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailtoname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailTo` property.'; +$_lang['prop_formit.emailfrom_desc'] = 'Optional. If `email` is set as a hook, and this is set, will specify the From: address for the email. If not set, will first look for an `email` form field. If none is found, will default to the `emailsender` system setting.'; +$_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.'; +$_lang['prop_formit.emailconvertnewlines_desc'] = 'If true and emailHtml is set to 1, will convert newlines to BR tags in the email.'; +$_lang['prop_formit.emailmultiseparator_desc'] = 'The default separator for collections of items sent through checkboxes/multi-selects. Defaults to a newline.'; +$_lang['prop_formit.emailmultiwrapper_desc'] = 'Will wrap each item in a collection of fields sent via checkboxes/multi-selects. Defaults to just the value.'; + +$_lang['prop_fiar.fiartpl_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies auto-response template to send as the email.'; +$_lang['prop_fiar.fiartofield_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies which form field shall be used for the To: address in the auto-response email.'; +$_lang['prop_fiar.fiarbcc_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies the email(s) to send the email to as a BCC. Can be a comma-separated list of email addresses.'; +$_lang['prop_fiar.fiarbccname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailBCC` property.'; +$_lang['prop_fiar.fiarcc_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies the email(s) to send the email to as a CC. Can be a comma-separated list of email addresses.'; +$_lang['prop_fiar.fiarccname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailCC` property.'; +$_lang['prop_fiar.fiarfrom_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the From: address for the email. If not set, will first look for an `email` form field. If none is found, will default to the `emailsender` system setting.'; +$_lang['prop_fiar.fiarfromname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the From: name for the email.'; +$_lang['prop_fiar.fiarreplyto_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the Reply-To: address for the email.'; +$_lang['prop_fiar.fiarreplytoname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the Reply-To: name for the email.'; +$_lang['prop_fiar.fiarsubject_desc'] = 'If `FormItAutoResponder` is set as a hook, this is required as a subject line for the email.'; +$_lang['prop_fiar.fiarhtml_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, this toggles HTML emails or not. Defaults to true.'; + +$_lang['prop_fir.placeholderprefix_desc'] = 'The prefix to use with placeholders from the form data.'; +$_lang['prop_fir.redirecttoonnotfound_desc'] = 'If the data is not found, if this is set, redirect to the Resource with this ID.'; +$_lang['prop_fir.eraseonload_desc'] = 'If true, will erase the stored form data on load. Strongly recommended to leave to false unless you only want the data to load once.'; +$_lang['prop_fir.storelocation_desc'] = 'If `store` is set to true, this specifies the cache location of the data from the form submission. Defaults to MODX cache.'; + +$_lang['prop_math.mathminrange_desc'] = 'If `math` is set as a hook, the minimum range for each number in the equation.'; +$_lang['prop_math.mathmaxrange_desc'] = 'If `math` is set as a hook, the maximum range for each number in the equation.'; +$_lang['prop_math.mathfield_desc'] = 'If `math` is set as a hook, the name of the input field for the answer.'; +$_lang['prop_math.mathop1field_desc'] = 'If `math` is set as a hook, the name of the field for the 1st number in the equation.'; +$_lang['prop_math.mathop2field_desc'] = 'If `math` is set as a hook, the name of the field for the 2nd number in the equation.'; +$_lang['prop_math.mathoperatorfield_desc'] = 'If `math` is set as a hook, the name of the field for the operator in the equation.'; + +$_lang['prop_fico.allgrouptext_desc'] = 'Optional. If set and &prioritized is in use, will be the text label for the all other countries option group.'; +$_lang['prop_fico.optgrouptpl_desc'] = 'Optional. If set and &prioritized is in use, will be the chunk tpl to use for the option group markup.'; +$_lang['prop_fico.limited_desc'] = 'Optional. A comma-separated list of ISO codes for selected countries the full list will be limited to.'; +$_lang['prop_fico.prioritized_desc'] = 'Optional. A comma-separated list of ISO codes for countries that will move them into a prioritized "Frequent Visitors" group at the top of the dropdown. This can be used for your commonly-selected countries.'; +$_lang['prop_fico.prioritizedgrouptext_desc'] = 'Optional. If set and &prioritized is in use, will be the text label for the prioritized option group.'; +$_lang['prop_fico.selected_desc'] = 'The country value to select.'; +$_lang['prop_fico.selectedattribute_desc'] = 'Optional. The HTML attribute to add to a selected country.'; +$_lang['prop_fico.toplaceholder_desc'] = 'Optional. Use this to set the output to a placeholder instead of outputting directly.'; +$_lang['prop_fico.tpl_desc'] = 'Optional. The chunk to use for each country dropdown option.'; +$_lang['prop_fico.useisocode_desc'] = 'If 1, will use the ISO country code for the value. If 0, will use the country name.'; +$_lang['prop_fico.country_desc'] = 'Optional. Set to use a different countries file when loading a list of countries.'; + +$_lang['prop_fiso.country_desc'] = 'Optional. Set to use a different states file when loading a list of states.'; +$_lang['prop_fiso.selected_desc'] = 'The country value to select.'; +$_lang['prop_fiso.selectedattribute_desc'] = 'Optional. The HTML attribute to add to a selected country.'; +$_lang['prop_fiso.toplaceholder_desc'] = 'Optional. Use this to set the output to a placeholder instead of outputting directly.'; +$_lang['prop_fiso.tpl_desc'] = 'Optional. The chunk to use for each country dropdown option.'; +$_lang['prop_fiso.useabbr_desc'] = 'If 1, will use the state abbreviation for the value. If 0, will use the full state name.'; + +$_lang['formit.opt_blackglass'] = 'Black Glass'; +$_lang['formit.opt_clean'] = 'Clean'; +$_lang['formit.opt_red'] = 'Red'; +$_lang['formit.opt_white'] = 'White'; +$_lang['formit.opt_cache'] = 'MODX Cache'; +$_lang['formit.opt_session'] = 'Session'; +$_lang['prop_formit.savetmpfiles_desc'] = 'If set to 1, FormIt will store submitted files in a temporary folder.'; +$_lang['prop_formit.attachfiles_desc'] = 'If true, FormIt will add all file fields as attachments in the email.'; diff --git a/core/components/formit/lexicon/fr/recaptcha.inc.php b/core/components/formit/lexicon/fr/recaptcha.inc.php new file mode 100644 index 00000000..8b253907 --- /dev/null +++ b/core/components/formit/lexicon/fr/recaptcha.inc.php @@ -0,0 +1,14 @@ + + */ + +$_lang['recaptcha.empty_answer'] = 'Incorrect captcha words. Please check your answer and try again.'; +$_lang['recaptcha.incorrect'] = 'The reCAPTCHA wasn\'t entered correctly. Go back and try it again. [[+error]]'; +$_lang['recaptcha.mailhide_no_mcrypt'] = 'To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.'; +$_lang['recaptcha.mailhide_no_api_key'] = 'To use reCAPTCHA Mailhide, you have to sign up for a public and private key, you can do so at http://www.google.com/recaptcha'; +$_lang['recaptcha.no_api_key'] = 'To use reCAPTCHA you must get an API key from http://www.google.com/recaptcha'; +$_lang['recaptcha.no_remote_ip'] = 'For security reasons, you must pass the remote ip to reCAPTCHA'; diff --git a/core/components/formit/lexicon/it/default.inc.php b/core/components/formit/lexicon/it/default.inc.php index 406fdfd9..44914fb0 100644 --- a/core/components/formit/lexicon/it/default.inc.php +++ b/core/components/formit/lexicon/it/default.inc.php @@ -1,53 +1,112 @@ - * - * 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 - */ -/** - * Default Lexicon Topic - * - * @package formit - * @subpackge lexicon + * Copyright 2019 by Sterc */ -$_lang['formit.contains'] = 'Il vostro valore deve contenere la frase "[[+value]]".'; -$_lang['formit.email_invalid'] = 'Si prega di inserire un indirizzo e-mail valido.'; -$_lang['formit.email_invalid_domain'] = 'Il vostro indirizzo e-mail non ha un nome del dominio valido.'; -$_lang['formit.email_no_recipient'] = 'Si prega di specificare uno o più mittenti per l\'e-mail.'; -$_lang['formit.email_not_sent'] = 'Si è verificato un errore durante il tentativo di spedire l\'e-mail.'; -$_lang['formit.email_tpl_nf'] = 'Si prega di specificare un tema per l\'e-mail.'; -$_lang['formit.field_not_empty'] = 'Questo campo deve essere vuoto.'; -$_lang['formit.field_required'] = 'Questo campo è obbligatorio.'; -$_lang['formit.math_incorrect'] = 'Risposta sbagliata!'; -$_lang['formit.math_field_nf'] = 'Il campo [[+field]] non è specificato nel modulo.'; -$_lang['formit.max_length'] = 'Questo campo non può essere più lungo di [[+length]] caratteri.'; -$_lang['formit.max_value'] = 'Questo campo non può essere più largo di: [[+value]].'; -$_lang['formit.min_length'] = 'Questo campo deve essere lungo almeno [[+length]] caratteri.'; -$_lang['formit.min_value'] = 'Questo campo non può essere più piccolo di: [[+value]].'; -$_lang['formit.not_date'] = 'Questo campo deve essere una data valida.'; -$_lang['formit.not_lowercase'] = 'Questo campo deve essere tutto in minuscolo.'; -$_lang['formit.not_number'] = 'Questo campo deve essere un numero valido.'; -$_lang['formit.not_uppercase'] = 'Questo campo deve essere tutto in maiuscolo.'; -$_lang['formit.password_dont_match'] = 'La vostra chiave di accesso non coincide.'; -$_lang['formit.password_not_confirmed'] = 'Si prega di confermare la vostra chiave di accesso.'; -$_lang['formit.range_invalid'] = 'Specificazione del raggio non valida.'; -$_lang['formit.range'] = 'Il vostro valore deve essere fra [[+min]] e [[+max]].'; -$_lang['formit.recaptcha_err_load'] = 'Impossibile caricare la classe di servizio FormItReCaptcha.'; -$_lang['formit.spam_blocked'] = 'La vostra richiesta è stata bloccata da un filtro anti-spam: '; -$_lang['formit.spam_marked'] = ' - segnalato come spam.'; -$_lang['formit.username_taken'] = 'Nome utente già esistente. Si prega di sceglierne uno differente.'; \ No newline at end of file + +$_lang['formit'] = 'FormIt'; +$_lang['formit.desc'] = 'View all submitted forms.'; + +$_lang['area_formit'] = 'FormIt'; +$_lang['area_formit_recaptcha'] = 'FormIt reCaptcha'; + +$_lang['formit.form'] = 'Form'; +$_lang['formit.forms'] = 'Forms'; +$_lang['formit.forms_desc'] = 'View all submitted forms.'; +$_lang['formit.form_view'] = 'View form'; +$_lang['formit.form_remove'] = 'Remove form'; +$_lang['formit.form_remove_confirm'] = 'Are you sure you want to remove this form?'; +$_lang['formit.forms_remove'] = 'Remove forms'; +$_lang['formit.forms_remove_confirm'] = 'Are you sure you want to remove all forms?'; +$_lang['formit.forms_clean'] = 'Clean forms'; +$_lang['formit.forms_clean_confirm'] = 'Are you sure you want to clean all old forms?'; +$_lang['formit.forms_export'] = 'Export forms'; +$_lang['formit.form_encrypt'] = 'Encrypt form(s)'; +$_lang['formit.form_encrypt_confirm'] = 'Are you sure you want to encrypt the form(s)?'; +$_lang['formit.form_decrypt'] = 'Undo form encryption(s)'; +$_lang['formit.form_decrypt_confirm'] = 'Are you sure you want to undo the form encryption(s)?'; +$_lang['formit.view_ip'] = 'View all forms from this IP'; + +$_lang['formit.encryption'] = 'Encrypted form'; +$_lang['formit.encryptions'] = 'Encrypted forms'; +$_lang['formit.encryptions_desc'] = 'View all encrypted and non encrypted forms.'; + +$_lang['formit.label_form_name'] = 'Name'; +$_lang['formit.label_form_name_desc'] = 'The name of the form.'; +$_lang['formit.label_form_values'] = 'Form values'; +$_lang['formit.label_form_values_desc'] = 'The values of the form.'; +$_lang['formit.label_form_ip'] = 'IP number'; +$_lang['formit.label_form_ip_desc'] = 'The IP number of the visitor that has submitted the form.'; +$_lang['formit.label_form_date'] = 'Date'; +$_lang['formit.label_form_date_desc'] = 'The date when the form is submitted.'; +$_lang['formit.label_form_encrypted'] = 'Encrypted'; +$_lang['formit.label_form_encrypted_desc'] = ''; +$_lang['formit.label_form_decrypted'] = 'Not encrypted'; +$_lang['formit.label_form_decrypted_desc'] = ''; +$_lang['formit.label_form_total'] = 'Total'; +$_lang['formit.label_form_total_desc'] = ''; + +$_lang['formit.label_clean_label'] = 'Remove forms older than'; +$_lang['formit.label_clean_desc'] = 'days'; + +$_lang['formit.label_export_form'] = 'Form'; +$_lang['formit.label_export_form_desc'] = 'Select a form to export.'; +$_lang['formit.label_export_start_date'] = 'Date from'; +$_lang['formit.label_export_start_date_desc'] = 'Select a date to export forms from that date.'; +$_lang['formit.label_export_end_date'] = 'Date till'; +$_lang['formit.label_export_end_date_desc'] = 'Select a date to export forms till that date.'; +$_lang['formit.label_export_delimiter'] = 'CSV delimiter'; +$_lang['formit.label_export_delimiter_desc'] = 'The Het CSV delimiter to separate the columns. Default is ";".'; + +$_lang['formit.filter_form'] = 'Filter on form'; +$_lang['formit.filter_start_date'] = 'Filter from'; +$_lang['formit.filter_end_date'] = 'Filter till'; +$_lang['formit.encryption_unavailable'] = 'PHP OpenSSL functions openssl_encrypt and openssl_decrypt are not available. Please install PHP OpenSSL on your server. See http://www.php.net/manual/en/openssl.requirements.php for more information.'; +$_lang['formit.encryption_unavailable_warning'] = 'Warning: PHP OpenSSL functions openssl_encrypt and openssl_decrypt are not available. This means that you cannot use encryption on your forms. Please install PHP OpenSSL on your server. Visit this page for more information.'; +$_lang['formit.forms_clean_desc'] = 'The European General Data Protection Regulation (GDPR) requires that personal data, which is no longer necessary to possess, is removed. This tool makes it possible to remove saved forms with an age older than the given days. This action can not be undone!'; +$_lang['formit.forms_clean_executing'] = 'Cleaning up forms'; +$_lang['formit.forms_clean_success'] = '[[+amount]] form(s) removed.'; +$_lang['formit.export_failed'] = 'The export of the forms failed, please try again.'; +$_lang['formit.export_dir_failed'] = 'An error occurred while exporting the form, the export folder could not be created.'; + +$_lang['formit.contains'] = 'Il vostro valore deve contenere la frase "[[+value]]".'; +$_lang['formit.email_invalid'] = 'Si prega di inserire un indirizzo e-mail valido.'; +$_lang['formit.email_invalid_domain'] = 'Il vostro indirizzo e-mail non ha un nome del dominio valido.'; +$_lang['formit.email_no_recipient'] = 'Si prega di specificare uno o più mittenti per l\'e-mail.'; +$_lang['formit.email_not_sent'] = 'Si è verificato un errore durante il tentativo di spedire l\'e-mail.'; +$_lang['formit.email_tpl_nf'] = 'Si prega di specificare un tema per l\'e-mail.'; +$_lang['formit.field_not_empty'] = 'Questo campo deve essere vuoto.'; +$_lang['formit.field_required'] = 'Questo campo è obbligatorio.'; +$_lang['formit.math_incorrect'] = 'Risposta sbagliata!'; +$_lang['formit.math_field_nf'] = 'Il campo [[+field]] non è specificato nel modulo.'; +$_lang['formit.max_length'] = 'Questo campo non può essere più lungo di [[+length]] caratteri.'; +$_lang['formit.max_value'] = 'Questo campo non può essere più largo di: [[+value]].'; +$_lang['formit.min_length'] = 'Questo campo deve essere lungo almeno [[+length]] caratteri.'; +$_lang['formit.min_value'] = 'Questo campo non può essere più piccolo di: [[+value]].'; +$_lang['formit.not_date'] = 'Questo campo deve essere una data valida.'; +$_lang['formit.not_lowercase'] = 'Questo campo deve essere tutto in minuscolo.'; +$_lang['formit.not_number'] = 'Questo campo deve essere un numero valido.'; +$_lang['formit.not_uppercase'] = 'Questo campo deve essere tutto in maiuscolo.'; +$_lang['formit.password_dont_match'] = 'La vostra chiave di accesso non coincide.'; +$_lang['formit.password_not_confirmed'] = 'Si prega di confermare la vostra chiave di accesso.'; +$_lang['formit.prioritized_group_text'] = 'Frequent Visitors'; +$_lang['formit.range_invalid'] = 'Specificazione del raggio non valida.'; +$_lang['formit.range'] = 'Il vostro valore deve essere fra [[+min]] e [[+max]].'; +$_lang['formit.recaptcha_err_load'] = 'Impossibile caricare la classe di servizio FormItReCaptcha.'; +$_lang['formit.spam_blocked'] = 'La vostra richiesta è stata bloccata da un filtro anti-spam: '; +$_lang['formit.spam_marked'] = ' - segnalato come spam.'; +$_lang['formit.username_taken'] = 'Nome utente già esistente. Si prega di sceglierne uno differente.'; +$_lang['formit.not_regexp'] = 'Your value did not match the expected format.'; +$_lang['formit.all_group_text'] = 'All Countries'; +$_lang['formit.storeAttachment_mediasource_error'] = 'Cant find MediaSource! Mediasource id is: '; +$_lang['formit.storeAttachment_access_error'] = 'Directory is not writable! Check the permissions for: '; + +$_lang['formit.migrate'] = 'Migrate encrypted form submissions'; +$_lang['formit.migrate_desc'] = 'Upgrading to FormIt 3.0 will also update the encryption method used for encrypting submitted form data. FormIt 2.x used mcrypt for encrypting and decrypting, but 3.0 uses the openssl methods. For this to work correctly the currently encrypted forms need to be migrated from mcrypt to openssl.'; +$_lang['formit.migrate_alert'] = 'FormIt was updated, but your encrypted form submissions need to be migrated. Click here to start the migration.'; +$_lang['formit.migrate_status'] = 'Status'; +$_lang['formit.migrate_running'] = 'Currently running migration process in the background. Please keep this page open in your browser. DO NOT CLOSE THIS PAGE!'; +$_lang['formit.migrate_success'] = 'Migration completed'; +$_lang['formit.migrate_success_msg'] = 'All your encrypted forms have been successfully migrated.'; diff --git a/core/components/formit/lexicon/it/properties.inc.php b/core/components/formit/lexicon/it/properties.inc.php index 11516a78..2fcbc40f 100644 --- a/core/components/formit/lexicon/it/properties.inc.php +++ b/core/components/formit/lexicon/it/properties.inc.php @@ -1,100 +1,103 @@ - * - * 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 + * Copyright 2019 by Sterc */ -/** - * Properties Lexicon Topic - * - * @package formit - * @subpackge lexicon - * @language it - */ -/* FormIt properties */ -$_lang['prop_formit.hooks_desc'] = 'Quale programma da inquadrare, se nessuno, in seguito alla validazione del modulo passata correttamente. Può essere una lista di Hooks separata da virgola, se il primo fallisce, i seguenti non saranno inquadrati. Un hook può essere anche uno Snippet che eseguirà tale Snippet.'; -$_lang['prop_formit.prehooks_desc'] = 'Quale programma da inquadrare, se nessuno, una volta che il modulo è caricato. Potete pre-impostare i campi del modulo attraverso $scriptProperties[`hook`]->fields[`fieldname`]. Può essere una lista di hooks separati con una virgola, e se il primo fallisce, i seguenti non saranno inquadrati. Un hook può anche essere un nome di Snippet che eseguirà tale Snippet.'; -$_lang['prop_formit.submitvar_desc'] = 'Se impostato, non comincerà il procedimento del modulo se questa variabile POST non è passata.'; -$_lang['prop_formit.validate_desc'] = 'Una lista di campi da validare separati con una virgola, con ogni nome del campo come nome:validatore (es: nomeutente:obbligatorio,email:obbligatoria). I validatori possono anche essere concatenati, come email:email:obbligatoria. Questa proprietà può essere specificata su linee multiple.'; -$_lang['prop_formit.errtpl_desc'] = 'Il tema utilizzato per i messaggi di errore'; -$_lang['prop_formit.validationerrormessage_desc'] = 'Un messaggio di errore generale da impostare come segnaposto se la validazione fallisce. Può contenere [[+errors]] se volete mostrare una lista di tutti gli errori all\'inizio.'; -$_lang['prop_formit.validationerrorbulktpl_desc'] = 'Il tpl HTML che è utilizzato per ogni errore individuale nel valore del messaggio di errore generico.'; -$_lang['prop_formit.customvalidators_desc'] = 'Una lista di nomi per una validazione personalizzata (snippets) separati da una virgola che avete intenzione di utilizzare in questo modulo. Loro devono essere esplicitamente dichiarati qui, oppure non saranno lanciati.'; -$_lang['prop_formit.clearfieldsonsuccess_desc'] = 'Se vero, pulirà i campi nella prossima corretta sottoscrizione al modulo che non reinderizza.'; -$_lang['prop_formit.successmessage_desc'] = 'Se impostato, imposterà questo come segnaposto con il nome del valore della proprietà &successMessagePlaceholder, che di predefinito è impostato a `fi.successMessage`.'; -$_lang['prop_formit.successmessageplaceholder_desc'] = 'Il segnaposto a cui impostare il messaggio di successo.'; -$_lang['prop_formit.store_desc'] = 'Se VERO, immagazzinerà i dati nella cache per il recupero utilizzando lo snippet FormItRetriever.'; -$_lang['prop_formit.storetime_desc'] = 'Se `store` è impostato a VERO, questo specifica il numero di secondi da immagazzinare i dati dall\'invio del modulo. I valori predefiniti sono cinque minuti.'; -$_lang['prop_formit.placeholderprefix_desc'] = 'Il prefisso da utilizzare per tutti i segnaposto impostati da FormIt per i campi. Il valore predefinito è impostato a `fi.`'; -$_lang['prop_formit.redirectto_desc'] = 'Se `redirect` è impostato come hook, questo deve specificare l\'ID della Risorsa a cui reindirizzare.'; -$_lang['prop_formit.redirectparams_desc'] = 'Una lista di parametri JSON da passare all\'hook di reindirizzamento che sarà passato durante il reinderizzamento.'; -$_lang['prop_formit.recaptchajs_desc'] = 'Se `recaptcha` è impostato come hook, questo può essere un oggetto JSON che sarà impostato alla variabile JS RecaptchaOptions, che configura le opzioni per il reCaptcha.'; -$_lang['prop_formit.recaptchaheight_desc'] = 'Se `recaptcha` è impostato come hook, questo selezionerà l\'altezza del widget reCaptcha.'; -$_lang['prop_formit.recaptchatheme_desc'] = 'Se `recaptcha` è impostato come hook, questo selezionerà un tema per il widget reCaptcha.'; -$_lang['prop_formit.recaptchawidth_desc'] = 'Se `recaptcha` è impostato come hook, questo imposterà la larghezza per il widget reCaptcha.'; -$_lang['prop_formit.spamemailfields_desc'] = 'Se `spam` è impostato come hook, una lista di campi separati da una virgola contenenti gli indirizzi e-mail da controllare contro lo spam.'; -$_lang['prop_formit.spamcheckip_desc'] = 'Se `spam` è impostato come hook, e questo è VERO, controllerà anche l\'IP.'; -$_lang['prop_formit.emailbcc_desc'] = 'Se `email` è impostato come hook, allora questo specifica gli indirizzi e-mail a cui inviare le e-mail come un BCC.Può essere una lista di indirizzi e-mail separati da una virgola.'; -$_lang['prop_formit.emailbccname_desc'] = 'Opzionale. Se `email` è impostato come hook, allora questo deve essere una lista parallela di nomi separati da una virgola per gli indirizzi e-mail specificati nella proprietà `emailBCC`.'; -$_lang['prop_formit.emailcc_desc'] = 'Se `email` è impostato come hook, allora questo specifica gli indirizzi e-mail a cui inviare le e-mail come un CC.Può essere una lista di indirizzi e-mail separati da una virgola.'; -$_lang['prop_formit.emailccname_desc'] = 'Opzionale. Se `email` è impostato come hook, allora questo deve essere una lista parallela di nomi separati da una virgola per gli indirizzi e-mail specificati nella proprietà `emailCC`.'; -$_lang['prop_formit.emailto_desc'] = 'Se `email` è impostato come hook, allora questo specifica gli indirizzi e-mail a cui inviare le e-mail. Può essere una lista di indirizzi e-mail separati da una virgola.'; -$_lang['prop_formit.emailtoname_desc'] = 'Opzionale. Se `email` è impostato come hook, allora questo deve essere una lista parallela di nomi separati da una virgola per gli indirizzi e-mail specificati nella proprietà `emailTo`.'; -$_lang['prop_formit.emailfrom_desc'] = 'Opzionale. Se `email` è impostato come hook, e questo è impostato, specificherà l\'indirizzo Da: per le e-mail. Se non è impostato, ricercherà per primo un campo `email` nel modulo. Se nessuno viene trovato, il valore predefinito sarà impostato ad `emailsender` delle impostazioni di sistema.'; -$_lang['prop_formit.emailfromname_desc'] = 'Opzionale. Se `email` è impostato come hook, e questo è impostato, specificherà il nome del campo Da: per le e-mail.'; -$_lang['prop_formit.emailreplyto_desc'] = 'Opzionale. Se `email` è impostato come hook, e questo è impostato, specificherà l\'indirizzo del campo Reply-To: per le e-mail.'; -$_lang['prop_formit.emailreplytoname_desc'] = 'Opzionale. Se `email` è impostato come hook, e questo è impostato, specificherà il nome del campo Reply-To: per le e-mail.'; -$_lang['prop_formit.emailsubject_desc'] = 'Se `email` è impostato come hook, questo è obbligatorio come una linea di oggetto per le e-mail.'; -$_lang['prop_formit.emailusefieldforsubject_desc'] = 'Se il campo `oggetto` è passato nel modulo, se questo è VERO, sarà utilizzato il campo contenuto come linea dell\'oggetto e-mail.'; -$_lang['prop_formit.emailhtml_desc'] = 'Opzionale. Se `email` è impostato come hook, questo alterna le e-mail in HTML oppure no. Il valore predefinito è settato a VERO.'; -$_lang['prop_formit.emailconvertnewlines_desc'] = 'Se VERO ed emailHtml è impostato a 1, convertirà le Nuove linee al marcatore BR nelle e-mail.'; -$_lang['prop_formit.emailmulitseparator_desc'] = 'Il separatore predefinito per le collezioni di voci inviate attraverso campi di controllo/multi-selezioni.Valore predefinito settato a Nuova linea.'; -$_lang['prop_formit.emailmultiwrapper_desc'] = 'Includerà ogni voce in una collezione di campi inviati attraverso Controlli di campo/selezioni-multiple. I valori predefiniti sono impostati giusto al valore.'; -/* FormIt Auto-Responder properties */ -$_lang['prop_fiar.fiartpl_desc'] = 'Se `FormItAutoResponder` è impostato come hook, allora questo specifica il tema delle e-mail auto-risposte a cui inviare come e-mail.'; -$_lang['prop_fiar.fiartofield_desc'] = 'Se `FormItAutoResponder` è impostato come hook, allora questo specifica quale campo del modulo verrà utilizzato come indirizzo per il campo A: nella e-mail di auto-risposta.'; -$_lang['prop_fiar.fiarbcc_desc'] = 'Se `FormItAutoResponder` è impostato come hook, allora questo specifica gli indirizzi e-mail a cui inviare le e-mail come un BCC. Può essere una lista di indirizzi e-mail separati da una virgola.'; -$_lang['prop_fiar.fiarbccname_desc'] = 'Opzionale. Se `FormItAutoResponder` è impostato come hook, allora questo deve essere una lista parallela di nomi separati da una virgola per gli indirizzi e-mail specificati nella proprietà `emailBCC`.'; -$_lang['prop_fiar.fiarcc_desc'] = 'Se `FormItAutoResponder` è impostato come hook, allora questo specifica gli indirizzi e-mail a cui inviare le e-mail come un CC. Può essere una lista di indirizzi e-mail separati da una virgola.'; -$_lang['prop_fiar.fiarccname_desc'] = 'Opzionale. Se `FormItAutoResponder` è impostato come hook, allora questo deve essere una lista parallela di nomi separati da una virgola per gli indirizzi e-mail specificati nella proprietà `emailCC`.'; -$_lang['prop_fiar.fiarfrom_desc'] = 'Opzionale. Se `FormItAutoResponder` è impostato come hook, è questo è impostato, specificherà l\'indirizzo del campo Da: per le e-mail. Se non impostato, sarà ricercato per primo un campo `email` nel modulo. Se nessuno sarà stato trovato, sarà impostato come predefinito il campo `emailsender` nelle impostazioni di sistema.'; -$_lang['prop_fiar.fiarfromname_desc'] = 'Opzionale. Se `FormItAutoResponder` è impostato come hook, è questo è impostato, specificherà il nome Da: per le e-mail.'; -$_lang['prop_fiar.fiarreplyto_desc'] = 'Opzionale. Se `FormItAutoResponder` è impostato come hook, e questo è impostato, specificherà l\'indirizzo Reply-To: per le e-mail.'; -$_lang['prop_fiar.fiarreplytoname_desc'] = 'Opzionale. Se `FormItAutoResponder` è impostato come hook, e questo è impostato, specificherà il nome Reply-To: per le e-mail.'; -$_lang['prop_fiar.fiarsubject_desc'] = 'Se `FormItAutoResponder` è impostato come hook, questo è obbligatorio come una linea di oggetto per l\'e-mail.'; -$_lang['prop_fiar.fiarhtml_desc'] = 'Opzionale. Se `FormItAutoResponder` è impostato come hook, questo alterna e-mail in HTML oppure no. Valore predefinito settato a VERO.'; +$_lang['prop_formit.hooks_desc'] = 'Quale programma da inquadrare, se nessuno, in seguito alla validazione del modulo passata correttamente. Può essere una lista di Hooks separata da virgola, se il primo fallisce, i seguenti non saranno inquadrati. Un hook può essere anche uno Snippet che eseguirà tale Snippet.'; +$_lang['prop_formit.prehooks_desc'] = 'Quale programma da inquadrare, se nessuno, una volta che il modulo è caricato. Potete pre-impostare i campi del modulo attraverso $scriptProperties[`hook`]->fields[`fieldname`]. Può essere una lista di hooks separati con una virgola, e se il primo fallisce, i seguenti non saranno inquadrati. Un hook può anche essere un nome di Snippet che eseguirà tale Snippet.'; +$_lang['prop_formit.submitvar_desc'] = 'Se impostato, non comincerà il procedimento del modulo se questa variabile POST non è passata.'; +$_lang['prop_formit.validate_desc'] = 'Una lista di campi da validare separati con una virgola, con ogni nome del campo come nome:validatore (es: nomeutente:obbligatorio,email:obbligatoria). I validatori possono anche essere concatenati, come email:email:obbligatoria. Questa proprietà può essere specificata su linee multiple.'; +$_lang['prop_formit.errtpl_desc'] = 'Il tema utilizzato per i messaggi di errore'; +$_lang['prop_formit.validationerrormessage_desc'] = 'Un messaggio di errore generale da impostare come segnaposto se la validazione fallisce. Può contenere [[+errors]] se volete mostrare una lista di tutti gli errori all\'inizio.'; +$_lang['prop_formit.validationerrorbulktpl_desc'] = 'Il tpl HTML che è utilizzato per ogni errore individuale nel valore del messaggio di errore generico.'; +$_lang['prop_formit.customvalidators_desc'] = 'Una lista di nomi per una validazione personalizzata (snippets) separati da una virgola che avete intenzione di utilizzare in questo modulo. Loro devono essere esplicitamente dichiarati qui, oppure non saranno lanciati.'; +$_lang['prop_formit.trimvaluesdeforevalidation_desc'] = 'Whether or not to trim spaces from the beginning and end of values before attempting validation. Defaults to true.'; +$_lang['prop_formit.clearfieldsonsuccess_desc'] = 'Se vero, pulirà i campi nella prossima corretta sottoscrizione al modulo che non reinderizza.'; +$_lang['prop_formit.successmessage_desc'] = 'Se impostato, imposterà questo come segnaposto con il nome del valore della proprietà &successMessagePlaceholder, che di predefinito è impostato a `fi.successMessage`.'; +$_lang['prop_formit.successmessageplaceholder_desc'] = 'Il segnaposto a cui impostare il messaggio di successo.'; +$_lang['prop_formit.store_desc'] = 'Se VERO, immagazzinerà i dati nella cache per il recupero utilizzando lo snippet FormItRetriever.'; +$_lang['prop_formit.storetime_desc'] = 'Se `store` è impostato a VERO, questo specifica il numero di secondi da immagazzinare i dati dall\'invio del modulo. I valori predefiniti sono cinque minuti.'; +$_lang['prop_formit.storelocation_desc'] = 'If `store` is set to true, this specifies the cache location of the data from the form submission. Defaults to MODX cache.'; +$_lang['prop_formit.allowfiles_desc'] = 'If set to 0, will prevent files from being submitted on the form.'; +$_lang['prop_formit.placeholderprefix_desc'] = 'Il prefisso da utilizzare per tutti i segnaposto impostati da FormIt per i campi. Il valore predefinito è impostato a `fi.`'; +$_lang['prop_formit.redirectto_desc'] = 'Se `redirect` è impostato come hook, questo deve specificare l\'ID della Risorsa a cui reindirizzare.'; +$_lang['prop_formit.redirectparams_desc'] = 'Una lista di parametri JSON da passare all\'hook di reindirizzamento che sarà passato durante il reinderizzamento.'; +$_lang['prop_formit.recaptchajs_desc'] = 'Se `recaptcha` è impostato come hook, questo può essere un oggetto JSON che sarà impostato alla variabile JS RecaptchaOptions, che configura le opzioni per il reCaptcha.'; +$_lang['prop_formit.recaptchaheight_desc'] = 'Se `recaptcha` è impostato come hook, questo selezionerà l\'altezza del widget reCaptcha.'; +$_lang['prop_formit.recaptchatheme_desc'] = 'Se `recaptcha` è impostato come hook, questo selezionerà un tema per il widget reCaptcha.'; +$_lang['prop_formit.recaptchawidth_desc'] = 'Se `recaptcha` è impostato come hook, questo imposterà la larghezza per il widget reCaptcha.'; +$_lang['prop_formit.spamemailfields_desc'] = 'Se `spam` è impostato come hook, una lista di campi separati da una virgola contenenti gli indirizzi e-mail da controllare contro lo spam.'; +$_lang['prop_formit.spamcheckip_desc'] = 'Se `spam` è impostato come hook, e questo è VERO, controllerà anche l\'IP.'; +$_lang['prop_formit.emailbcc_desc'] = 'Se `email` è impostato come hook, allora questo specifica gli indirizzi e-mail a cui inviare le e-mail come un BCC.Può essere una lista di indirizzi e-mail separati da una virgola.'; +$_lang['prop_formit.emailbccname_desc'] = 'Opzionale. Se `email` è impostato come hook, allora questo deve essere una lista parallela di nomi separati da una virgola per gli indirizzi e-mail specificati nella proprietà `emailBCC`.'; +$_lang['prop_formit.emailcc_desc'] = 'Se `email` è impostato come hook, allora questo specifica gli indirizzi e-mail a cui inviare le e-mail come un CC.Può essere una lista di indirizzi e-mail separati da una virgola.'; +$_lang['prop_formit.emailccname_desc'] = 'Opzionale. Se `email` è impostato come hook, allora questo deve essere una lista parallela di nomi separati da una virgola per gli indirizzi e-mail specificati nella proprietà `emailCC`.'; +$_lang['prop_formit.emailto_desc'] = 'Se `email` è impostato come hook, allora questo specifica gli indirizzi e-mail a cui inviare le e-mail. Può essere una lista di indirizzi e-mail separati da una virgola.'; +$_lang['prop_formit.emailtoname_desc'] = 'Opzionale. Se `email` è impostato come hook, allora questo deve essere una lista parallela di nomi separati da una virgola per gli indirizzi e-mail specificati nella proprietà `emailTo`.'; +$_lang['prop_formit.emailfrom_desc'] = 'Opzionale. Se `email` è impostato come hook, e questo è impostato, specificherà l\'indirizzo Da: per le e-mail. Se non è impostato, ricercherà per primo un campo `email` nel modulo. Se nessuno viene trovato, il valore predefinito sarà impostato ad `emailsender` delle impostazioni di sistema.'; +$_lang['prop_formit.emailfromname_desc'] = 'Opzionale. Se `email` è impostato come hook, e questo è impostato, specificherà il nome del campo Da: per le e-mail.'; +$_lang['prop_formit.emailreplyto_desc'] = 'Opzionale. Se `email` è impostato come hook, e questo è impostato, specificherà l\'indirizzo del campo Reply-To: per le e-mail.'; +$_lang['prop_formit.emailreplytoname_desc'] = 'Opzionale. Se `email` è impostato come hook, e questo è impostato, specificherà il nome del campo Reply-To: per le e-mail.'; +$_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'] = 'Se `email` è impostato come hook, questo è obbligatorio come una linea di oggetto per le e-mail.'; +$_lang['prop_formit.emailusefieldforsubject_desc'] = 'Se il campo `oggetto` è passato nel modulo, se questo è VERO, sarà utilizzato il campo contenuto come linea dell\'oggetto e-mail.'; +$_lang['prop_formit.emailhtml_desc'] = 'Opzionale. Se `email` è impostato come hook, questo alterna le e-mail in HTML oppure no. Il valore predefinito è settato a VERO.'; +$_lang['prop_formit.emailconvertnewlines_desc'] = 'Se VERO ed emailHtml è impostato a 1, convertirà le Nuove linee al marcatore BR nelle e-mail.'; +$_lang['prop_formit.emailmultiseparator_desc'] = 'Il separatore predefinito per le collezioni di voci inviate attraverso campi di controllo/multi-selezioni.Valore predefinito settato a Nuova linea.'; +$_lang['prop_formit.emailmultiwrapper_desc'] = 'Includerà ogni voce in una collezione di campi inviati attraverso Controlli di campo/selezioni-multiple. I valori predefiniti sono impostati giusto al valore.'; + +$_lang['prop_fiar.fiartpl_desc'] = 'Se `FormItAutoResponder` è impostato come hook, allora questo specifica il tema delle e-mail auto-risposte a cui inviare come e-mail.'; +$_lang['prop_fiar.fiartofield_desc'] = 'Se `FormItAutoResponder` è impostato come hook, allora questo specifica quale campo del modulo verrà utilizzato come indirizzo per il campo A: nella e-mail di auto-risposta.'; +$_lang['prop_fiar.fiarbcc_desc'] = 'Se `FormItAutoResponder` è impostato come hook, allora questo specifica gli indirizzi e-mail a cui inviare le e-mail come un BCC. Può essere una lista di indirizzi e-mail separati da una virgola.'; +$_lang['prop_fiar.fiarbccname_desc'] = 'Opzionale. Se `FormItAutoResponder` è impostato come hook, allora questo deve essere una lista parallela di nomi separati da una virgola per gli indirizzi e-mail specificati nella proprietà `emailBCC`.'; +$_lang['prop_fiar.fiarcc_desc'] = 'Se `FormItAutoResponder` è impostato come hook, allora questo specifica gli indirizzi e-mail a cui inviare le e-mail come un CC. Può essere una lista di indirizzi e-mail separati da una virgola.'; +$_lang['prop_fiar.fiarccname_desc'] = 'Opzionale. Se `FormItAutoResponder` è impostato come hook, allora questo deve essere una lista parallela di nomi separati da una virgola per gli indirizzi e-mail specificati nella proprietà `emailCC`.'; +$_lang['prop_fiar.fiarfrom_desc'] = 'Opzionale. Se `FormItAutoResponder` è impostato come hook, è questo è impostato, specificherà l\'indirizzo del campo Da: per le e-mail. Se non impostato, sarà ricercato per primo un campo `email` nel modulo. Se nessuno sarà stato trovato, sarà impostato come predefinito il campo `emailsender` nelle impostazioni di sistema.'; +$_lang['prop_fiar.fiarfromname_desc'] = 'Opzionale. Se `FormItAutoResponder` è impostato come hook, è questo è impostato, specificherà il nome Da: per le e-mail.'; +$_lang['prop_fiar.fiarreplyto_desc'] = 'Opzionale. Se `FormItAutoResponder` è impostato come hook, e questo è impostato, specificherà l\'indirizzo Reply-To: per le e-mail.'; +$_lang['prop_fiar.fiarreplytoname_desc'] = 'Opzionale. Se `FormItAutoResponder` è impostato come hook, e questo è impostato, specificherà il nome Reply-To: per le e-mail.'; +$_lang['prop_fiar.fiarsubject_desc'] = 'Se `FormItAutoResponder` è impostato come hook, questo è obbligatorio come una linea di oggetto per l\'e-mail.'; +$_lang['prop_fiar.fiarhtml_desc'] = 'Opzionale. Se `FormItAutoResponder` è impostato come hook, questo alterna e-mail in HTML oppure no. Valore predefinito settato a VERO.'; + +$_lang['prop_fir.placeholderprefix_desc'] = 'Il prefisso da utilizzare con i segnaposto dai dati del modulo.'; +$_lang['prop_fir.redirecttoonnotfound_desc'] = 'Se i dati non vengono trovati, e questo è impostato, reindirizza alla Risorsa con questo ID.'; +$_lang['prop_fir.eraseonload_desc'] = 'Se VERO, questo eliminerà i dati del modulo immagazzinati al caricamento. Si raccomanda fortemente di lasciarlo impostato a FALSE a meno che non si desideri che i dati siano caricati una sola volta.'; +$_lang['prop_fir.storelocation_desc'] = 'If `store` is set to true, this specifies the cache location of the data from the form submission. Defaults to MODX cache.'; + +$_lang['prop_math.mathminrange_desc'] = 'Se `math` è impostato come hook, il minimo raggio per ogni numero nella equazione.'; +$_lang['prop_math.mathmaxrange_desc'] = 'Se `math` è impostato come hook, il raggio massimo per ogni numero nella equazione.'; +$_lang['prop_math.mathfield_desc'] = 'Se `math` è impostato come hook, il nome del campo di inserimento per la risposta.'; +$_lang['prop_math.mathop1field_desc'] = 'Se `math` è impostato come hook, il nome del campo per il primo numero nella equazione.'; +$_lang['prop_math.mathop2field_desc'] = 'Se `math` è impostato come hook, il nome del campo per il secondo numero nella equazione.'; +$_lang['prop_math.mathoperatorfield_desc'] = 'Se `math` è impostato come hook, il nome del campo per l\'operatore nella equazione.'; -/* FormItRetriever properties */ -$_lang['prop_fir.placeholderprefix_desc'] = 'Il prefisso da utilizzare con i segnaposto dai dati del modulo.'; -$_lang['prop_fir.redirecttoonnotfound_desc'] = 'Se i dati non vengono trovati, e questo è impostato, reindirizza alla Risorsa con questo ID.'; -$_lang['prop_fir.eraseonload_desc'] = 'Se VERO, questo eliminerà i dati del modulo immagazzinati al caricamento. Si raccomanda fortemente di lasciarlo impostato a FALSE a meno che non si desideri che i dati siano caricati una sola volta.'; +$_lang['prop_fico.allgrouptext_desc'] = 'Optional. If set and &prioritized is in use, will be the text label for the all other countries option group.'; +$_lang['prop_fico.optgrouptpl_desc'] = 'Optional. If set and &prioritized is in use, will be the chunk tpl to use for the option group markup.'; +$_lang['prop_fico.limited_desc'] = 'Optional. A comma-separated list of ISO codes for selected countries the full list will be limited to.'; +$_lang['prop_fico.prioritized_desc'] = 'Optional. A comma-separated list of ISO codes for countries that will move them into a prioritized "Frequent Visitors" group at the top of the dropdown. This can be used for your commonly-selected countries.'; +$_lang['prop_fico.prioritizedgrouptext_desc'] = 'Optional. If set and &prioritized is in use, will be the text label for the prioritized option group.'; +$_lang['prop_fico.selected_desc'] = 'The country value to select.'; +$_lang['prop_fico.selectedattribute_desc'] = 'Optional. The HTML attribute to add to a selected country.'; +$_lang['prop_fico.toplaceholder_desc'] = 'Optional. Use this to set the output to a placeholder instead of outputting directly.'; +$_lang['prop_fico.tpl_desc'] = 'Optional. The chunk to use for each country dropdown option.'; +$_lang['prop_fico.useisocode_desc'] = 'If 1, will use the ISO country code for the value. If 0, will use the country name.'; +$_lang['prop_fico.country_desc'] = 'Optional. Set to use a different countries file when loading a list of countries.'; -/* FormIt Math hook properties */ -$_lang['prop_math.mathminrange_desc'] = 'Se `math` è impostato come hook, il minimo raggio per ogni numero nella equazione.'; -$_lang['prop_math.mathmaxrange_desc'] = 'Se `math` è impostato come hook, il raggio massimo per ogni numero nella equazione.'; -$_lang['prop_math.mathfield_desc'] = 'Se `math` è impostato come hook, il nome del campo di inserimento per la risposta.'; -$_lang['prop_math.mathop1field_desc'] = 'Se `math` è impostato come hook, il nome del campo per il primo numero nella equazione.'; -$_lang['prop_math.mathop2field_desc'] = 'Se `math` è impostato come hook, il nome del campo per il secondo numero nella equazione.'; -$_lang['prop_math.mathoperatorfield_desc'] = 'Se `math` è impostato come hook, il nome del campo per l\'operatore nella equazione.'; +$_lang['prop_fiso.country_desc'] = 'Optional. Set to use a different states file when loading a list of states.'; +$_lang['prop_fiso.selected_desc'] = 'The country value to select.'; +$_lang['prop_fiso.selectedattribute_desc'] = 'Optional. The HTML attribute to add to a selected country.'; +$_lang['prop_fiso.toplaceholder_desc'] = 'Optional. Use this to set the output to a placeholder instead of outputting directly.'; +$_lang['prop_fiso.tpl_desc'] = 'Optional. The chunk to use for each country dropdown option.'; +$_lang['prop_fiso.useabbr_desc'] = 'If 1, will use the state abbreviation for the value. If 0, will use the full state name.'; -/* FormIt Options */ -$_lang['formit.opt_blackglass'] = 'Bicchiere nero'; -$_lang['formit.opt_clean'] = 'Pulito'; -$_lang['formit.opt_red'] = 'Rosso'; -$_lang['formit.opt_white'] = 'Bianco'; \ No newline at end of file +$_lang['formit.opt_blackglass'] = 'Bicchiere nero'; +$_lang['formit.opt_clean'] = 'Pulito'; +$_lang['formit.opt_red'] = 'Rosso'; +$_lang['formit.opt_white'] = 'Bianco'; +$_lang['formit.opt_cache'] = 'MODX Cache'; +$_lang['formit.opt_session'] = 'Session'; +$_lang['prop_formit.savetmpfiles_desc'] = 'If set to 1, FormIt will store submitted files in a temporary folder.'; +$_lang['prop_formit.attachfiles_desc'] = 'If true, FormIt will add all file fields as attachments in the email.'; diff --git a/core/components/formit/lexicon/it/recaptcha.inc.php b/core/components/formit/lexicon/it/recaptcha.inc.php index 3554924c..bea5b1ba 100644 --- a/core/components/formit/lexicon/it/recaptcha.inc.php +++ b/core/components/formit/lexicon/it/recaptcha.inc.php @@ -1,34 +1,14 @@ - * - * 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 - */ -/** - * reCaptcha Lexicon Topic - * - * @package formit - * @subpackge lexicon + * Copyright 2019 by Sterc */ -$_lang['recaptcha.empty_answer'] = 'Parole della validazione non valide. Si prega di controllare la vostra risposta e riprovare.'; -$_lang['recaptcha.incorrect'] = 'La validazione non è stata immessa correttamente. Tornare indietro e riprovare. [[+error]]'; -$_lang['recaptcha.mailhide_no_mcrypt'] = 'Per utilizzare la validazione reCAPTCHA Mailhide, dovete avere il modulo PHP mcrypt installato.'; -$_lang['recaptcha.mailhide_no_api_key'] = 'Per utilizzare la validazione reCAPTCHA Mailhide, dovete iscrivervi per le chiavi pubbliche e private, potete farlo all\'indirizzo http://www.google.com/recaptcha/mailhide/'; -$_lang['recaptcha.no_api_key'] = 'Per utilizzare la validazione reCAPTCHA dovete creare una chiave API da https://www.google.com/recaptcha/admin/create'; -$_lang['recaptcha.no_remote_ip'] = 'Per una questione di sicurezza, dovete si deve passare l\'IP remoto a reCAPTCHA'; +$_lang['recaptcha.empty_answer'] = 'Parole della validazione non valide. Si prega di controllare la vostra risposta e riprovare.'; +$_lang['recaptcha.incorrect'] = 'La validazione non è stata immessa correttamente. Tornare indietro e riprovare. [[+error]]'; +$_lang['recaptcha.mailhide_no_mcrypt'] = 'Per utilizzare la validazione reCAPTCHA Mailhide, dovete avere il modulo PHP mcrypt installato.'; +$_lang['recaptcha.mailhide_no_api_key'] = 'Per utilizzare la validazione reCAPTCHA Mailhide, dovete iscrivervi per le chiavi pubbliche e private, potete farlo all\'indirizzo http://www.google.com/recaptcha/mailhide/'; +$_lang['recaptcha.no_api_key'] = 'Per utilizzare la validazione reCAPTCHA dovete creare una chiave API da https://www.google.com/recaptcha/admin/create'; +$_lang['recaptcha.no_remote_ip'] = 'Per una questione di sicurezza, dovete si deve passare l\'IP remoto a reCAPTCHA'; diff --git a/core/components/formit/lexicon/nl/default.inc.php b/core/components/formit/lexicon/nl/default.inc.php index b3a784cf..08ee48be 100644 --- a/core/components/formit/lexicon/nl/default.inc.php +++ b/core/components/formit/lexicon/nl/default.inc.php @@ -1,47 +1,104 @@ - * - * 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 - */ -/** - * Dutch translation by Ronald Lokers - * - * @topic default - * @namespace formit - * @language nl + * Copyright 2019 by Sterc */ -$_lang['formit.contains'] = 'Het veld moet de volgende waarde bevatten: "[[+value]]".'; -$_lang['formit.email_invalid'] = 'Vul een geldig email adres in.'; -$_lang['formit.email_invalid_domain'] = 'Het email adres heeft geen geldige domeinnaam.'; -$_lang['formit.email_no_recipient'] = 'Voer de ontvanger of ontvangers voor deze email in.'; -$_lang['formit.email_not_sent'] = 'Er is iets fout gegaan tijdens het verzenden van de email.'; -$_lang['formit.email_tpl_nf'] = 'Er is geen email template opgegeven.'; -$_lang['formit.field_not_empty'] = 'Het veld moet leeg zijn.'; -$_lang['formit.field_required'] = 'Het veld is verplicht.'; -$_lang['formit.max_length'] = 'De invoer mag niet langer zijn dan [[+length]] tekens.'; -$_lang['formit.max_value'] = 'De invoer mag niet groter zijn dan [[+value]].'; -$_lang['formit.min_length'] = 'De invoer moet minstens [[+length]] tekens lang zijn.'; -$_lang['formit.min_value'] = 'De invoer mag niet kleiner zijn dan [[+value]].'; -$_lang['formit.not_number'] = 'De invoer moet een geldig nummer zijn.'; -$_lang['formit.password_dont_match'] = 'De wachtwoorden zijn niet hetzelfde.'; -$_lang['formit.password_not_confirmed'] = 'Bevestig het wachtwoord.'; -$_lang['formit.range_invalid'] = 'Ongeldig bereik ingevoerd.'; -$_lang['formit.range'] = 'De invoer moet tussen de [[+min]] en [[+max]] zijn.'; -$_lang['formit.username_taken'] = 'Gebruikersnaam al in gebruik. Kies een andere'; +$_lang['formit'] = 'FormIt'; +$_lang['formit.desc'] = 'Bekijk hier alle ingezonden formulieren.'; + +$_lang['area_formit'] = 'FormIt'; +$_lang['area_formit_recaptcha'] = 'FormIt reCAPTCHA'; + +$_lang['formit.form'] = 'Formulier'; +$_lang['formit.forms'] = 'Formulieren'; +$_lang['formit.forms_desc'] = 'Bekijk hier alle ingezonden formulieren.'; +$_lang['formit.form_view'] = 'Formulier bekijken'; +$_lang['formit.form_remove'] = 'Formulier verwijderen'; +$_lang['formit.form_remove_confirm'] = 'Weet je zeker dat je dit formulier wilt verwijderen?'; +$_lang['formit.forms_remove'] = 'Formulieren verwijderen'; +$_lang['formit.forms_remove_confirm'] = 'Weet je zeker dat je de geselecteerde formulier(en) wilt verwijderen?'; +$_lang['formit.forms_clean'] = 'Formulieren opruimen'; +$_lang['formit.forms_clean_confirm'] = 'Weet je zeker dat je alle oude formulieren wilt opruimen?'; +$_lang['formit.forms_export'] = 'Formulieren exporteren'; +$_lang['formit.form_encrypt'] = 'Formulier(en) versleutelen'; +$_lang['formit.form_encrypt_confirm'] = 'Weet je zeker dat je de formulier(en) wilt versleutelen?'; +$_lang['formit.form_decrypt'] = 'Formulier versleuteling(en) ongedaan maken'; +$_lang['formit.form_decrypt_confirm'] = 'Weet je zeker dat je de formulier versleuteling(en) ongedaan wilt maken?'; +$_lang['formit.view_ip'] = 'Alle formulieren van dit IP bekijken'; + +$_lang['formit.encryption'] = 'Versleuteld formulier'; +$_lang['formit.encryptions'] = 'Versleutelde formulieren'; +$_lang['formit.encryptions_desc'] = 'Bekijk hier alle versleutelde en niet versleutelde formulieren.'; + +$_lang['formit.label_form_name'] = 'Naam'; +$_lang['formit.label_form_name_desc'] = 'De naam van het formulier.'; +$_lang['formit.label_form_values'] = 'Formulier waardes'; +$_lang['formit.label_form_values_desc'] = 'De waardes van het formulier'; +$_lang['formit.label_form_ip'] = 'IP nummer'; +$_lang['formit.label_form_ip_desc'] = 'Het IP nummer van de bezoeker die het formulier ingezonden heeft.'; +$_lang['formit.label_form_date'] = 'Datum'; +$_lang['formit.label_form_date_desc'] = 'De datum van wanneer het formulier ingezonden is.'; +$_lang['formit.label_form_encrypted'] = 'Versleuteld'; +$_lang['formit.label_form_encrypted_desc'] = ''; +$_lang['formit.label_form_decrypted'] = 'Niet versleuteld'; +$_lang['formit.label_form_decrypted_desc'] = ''; +$_lang['formit.label_form_total'] = 'Totaal'; +$_lang['formit.label_form_total_desc'] = ''; + +$_lang['formit.label_clean_label'] = 'Verwijder formulieren ouder dan'; +$_lang['formit.label_clean_desc'] = 'dagen'; + +$_lang['formit.label_export_form'] = 'Formulier'; +$_lang['formit.label_export_form_desc'] = 'Selecteer een formulier om te exporteren.'; +$_lang['formit.label_export_start_date'] = 'Datum vanaf'; +$_lang['formit.label_export_start_date_desc'] = 'Selecteer een datum om vanaf die datum de formulieren te exporteren.'; +$_lang['formit.label_export_end_date'] = 'Datum tot'; +$_lang['formit.label_export_end_date_desc'] = 'Selecteer een datum om tot die datum de formulieren te exporteren.'; +$_lang['formit.label_export_delimiter'] = 'CSV scheidingsteken'; +$_lang['formit.label_export_delimiter_desc'] = 'Het CSV scheidingsteken waarmee kolommen gescheiden worden. Standaard is ";".'; + +$_lang['formit.filter_form'] = 'Filter op formulier'; +$_lang['formit.filter_start_date'] = 'Filter vanaf'; +$_lang['formit.filter_end_date'] = 'Filter tot'; +$_lang['formit.encryption_unavailable'] = 'PHP OpenSSL functies openssl_encrypt en openssl_decrypt zijn niet beschikbaar. Om deze functies beschikbaar te maken installeer PHP OpenSSL op je server. Bekijk http://www.php.net/manual/en/openssl.requirements.php voor meer informatie.'; +$_lang['formit.encryption_unavailable_warning'] = 'Waarschuwing: PHP OpenSSL functies openssl_encrypt en openssl_decrypt zijn niet beschikbaar. Dit betekend dat je formulieren niet kunt versleutelen. Om deze functies beschikbaar te maken installeer PHP OpenSSL op je server. Bekijk deze pagina voor meer informatie.'; +$_lang['formit.forms_clean_desc'] = 'De Algemene verordening gegevensbescherming (AVG) stelt verplicht dat persoonlijke data, dat niet langer noodzakelijk is om te bewaren, wordt verwijderd. Deze functie maakt het mogelijk om formulieren, ouder dan het opgegeven aantal dagen, te verwijderen. Deze actie kan niet worden teruggedraaid!'; +$_lang['formit.forms_clean_executing'] = 'Bezig met opruimen van formulieren'; +$_lang['formit.forms_clean_success'] = '[[+amount]] formulier(en) verwijderd.'; +$_lang['formit.export_failed'] = 'Het exporteren van de formulieren is mislukt, probeer het nog eens.'; +$_lang['formit.export_dir_failed'] = 'Er is een fout opgetreden tijdens het exporteren van de formulier, de export map kon niet aangemaakt worden.'; + +$_lang['formit.contains'] = 'Het veld moet de volgende waarde bevatten: "[[+value]]".'; +$_lang['formit.email_invalid'] = 'Vul een geldig e-mailadres in.'; +$_lang['formit.email_invalid_domain'] = 'Het e-mailadres heeft geen geldige domeinnaam.'; +$_lang['formit.email_no_recipient'] = 'Voer de ontvanger of ontvangers voor deze e-mail in.'; +$_lang['formit.email_not_sent'] = 'Er is iets fout gegaan tijdens het verzenden van de e-mail.'; +$_lang['formit.email_tpl_nf'] = 'Er is geen e-mail template opgegeven.'; +$_lang['formit.field_not_empty'] = 'Het veld moet leeg zijn.'; +$_lang['formit.field_required'] = 'Het veld is verplicht.'; +$_lang['formit.math_incorrect'] = 'Onjuist antwoord!'; +$_lang['formit.math_field_nf'] = '[[+field]] is niet gespecificeerd in het formulier.'; +$_lang['formit.max_length'] = 'De invoer mag niet langer zijn dan [[+length]] tekens.'; +$_lang['formit.max_value'] = 'De invoer mag niet groter zijn dan [[+value]].'; +$_lang['formit.min_length'] = 'De invoer moet minstens [[+length]] tekens lang zijn.'; +$_lang['formit.min_value'] = 'De invoer mag niet kleiner zijn dan [[+value]].'; +$_lang['formit.not_date'] = 'De waarde moet een datum zijn.'; +$_lang['formit.not_lowercase'] = 'De waarde mag geen hoofdletters bevatten.'; +$_lang['formit.not_number'] = 'De invoer moet een geldig nummer zijn.'; +$_lang['formit.not_uppercase'] = 'De waarde mag geen kleine letters bevatten.'; +$_lang['formit.password_dont_match'] = 'De wachtwoorden zijn niet hetzelfde.'; +$_lang['formit.password_not_confirmed'] = 'Bevestig het wachtwoord.'; +$_lang['formit.prioritized_group_text'] = 'Frequente bezoekers'; +$_lang['formit.range_invalid'] = 'Ongeldig bereik ingevoerd.'; +$_lang['formit.range'] = 'De invoer moet tussen de [[+min]] en [[+max]] zijn.'; +$_lang['formit.recaptcha_err_load'] = 'Could not load FormItReCaptcha service class.'; +$_lang['formit.spam_blocked'] = 'Het formulier is geweigerd door een spamfilter.'; +$_lang['formit.spam_marked'] = ' - gemarkeerd als spam.'; +$_lang['formit.username_taken'] = 'Gebruikersnaam al in gebruik. Kies een andere'; +$_lang['formit.not_regexp'] = 'De waarde voldoet niet aan het verwachte formaat.'; +$_lang['formit.all_group_text'] = 'Alle landen'; +$_lang['formit.storeAttachment_mediasource_error'] = 'Kan Mediabron niet vinden! Mediabron ID is: '; +$_lang['formit.storeAttachment_access_error'] = 'Directory is niet schrijfbaar! Controleer de machtigingen voor: '; diff --git a/core/components/formit/lexicon/nl/properties.inc.php b/core/components/formit/lexicon/nl/properties.inc.php new file mode 100644 index 00000000..4c68d040 --- /dev/null +++ b/core/components/formit/lexicon/nl/properties.inc.php @@ -0,0 +1,103 @@ + + */ + +$_lang['prop_formit.hooks_desc'] = 'What scripts to fire, if any, after the form passes validation. This can be a comma-separated list of hooks, and if the first fails, the proceeding ones will not fire. A hook can also be a Snippet name that will execute that Snippet.'; +$_lang['prop_formit.prehooks_desc'] = 'What scripts to fire, if any, once the form loads. You can pre-set form fields via $scriptProperties[`hook`]->fields[`fieldname`]. This can be a comma-separated list of hooks, and if the first fails, the proceeding ones will not fire. A hook can also be a Snippet name that will execute that Snippet.'; +$_lang['prop_formit.submitvar_desc'] = 'If set, will not begin form processing if this POST variable is not passed.'; +$_lang['prop_formit.validate_desc'] = 'A comma-separated list of fields to validate, with each field name as name:validator (eg: username:required,email:required). Validators can also be chained, like email:email:required. This property can be specified on multiple lines.'; +$_lang['prop_formit.errtpl_desc'] = 'The wrapper template for error messages.'; +$_lang['prop_formit.validationerrormessage_desc'] = 'A general error message to set to a placeholder if validation fails. Can contain [[+errors]] if you want to display a list of all errors at the top.'; +$_lang['prop_formit.validationerrorbulktpl_desc'] = 'HTML tpl that is used for each individual error in the generic validation error message value.'; +$_lang['prop_formit.customvalidators_desc'] = 'A comma-separated list of custom validator names (snippets) you plan to use in this form. They must be explicitly stated here, or they will not be run.'; +$_lang['prop_formit.trimvaluesdeforevalidation_desc'] = 'Whether or not to trim spaces from the beginning and end of values before attempting validation. Defaults to true.'; +$_lang['prop_formit.clearfieldsonsuccess_desc'] = 'If true, will clear the fields on a successful form submission that does not redirect.'; +$_lang['prop_formit.successmessage_desc'] = 'If set, will set this a placeholder with the name of the value of the property &successMessagePlaceholder, which defaults to `fi.successMessage`.'; +$_lang['prop_formit.successmessageplaceholder_desc'] = 'The placeholder to set the success message to.'; +$_lang['prop_formit.store_desc'] = 'If true, will store the data in the cache for retrieval using the FormItRetriever snippet.'; +$_lang['prop_formit.storetime_desc'] = 'If `store` is set to true, this specifies the number of seconds to store the data from the form submission. Defaults to five minutes.'; +$_lang['prop_formit.storelocation_desc'] = 'If `store` is set to true, this specifies the cache location of the data from the form submission. Defaults to MODX cache.'; +$_lang['prop_formit.allowfiles_desc'] = 'If set to 0, will prevent files from being submitted on the form.'; +$_lang['prop_formit.placeholderprefix_desc'] = 'The prefix to use for all placeholders set by FormIt for fields. Defaults to `fi.`'; +$_lang['prop_formit.redirectto_desc'] = 'If `redirect` is set as a hook, this must specify the Resource ID to redirect to.'; +$_lang['prop_formit.redirectparams_desc'] = 'A JSON array of parameters to pass to the redirect hook that will be passed when redirecting.'; +$_lang['prop_formit.recaptchajs_desc'] = 'If `recaptcha` is set as a hook, this can be a JSON object that will be set to the JS RecaptchaOptions variable, which configures options for reCaptcha.'; +$_lang['prop_formit.recaptchaheight_desc'] = 'If `recaptcha` is set as a hook, this will select the height for the reCaptcha widget.'; +$_lang['prop_formit.recaptchatheme_desc'] = 'If `recaptcha` is set as a hook, this will select a theme for the reCaptcha widget.'; +$_lang['prop_formit.recaptchawidth_desc'] = 'If `recaptcha` is set as a hook, this will set the width for the reCaptcha widget.'; +$_lang['prop_formit.spamemailfields_desc'] = 'If `spam` is set as a hook, a comma-separated list of fields containing emails to check spam against.'; +$_lang['prop_formit.spamcheckip_desc'] = 'If `spam` is set as a hook, and this is true, will check the IP as well.'; +$_lang['prop_formit.emailbcc_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to as a BCC. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailbccname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailBCC` property.'; +$_lang['prop_formit.emailcc_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to as a CC. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailccname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailCC` property.'; +$_lang['prop_formit.emailto_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailtoname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailTo` property.'; +$_lang['prop_formit.emailfrom_desc'] = 'Optional. If `email` is set as a hook, and this is set, will specify the From: address for the email. If not set, will first look for an `email` form field. If none is found, will default to the `emailsender` system setting.'; +$_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.'; +$_lang['prop_formit.emailconvertnewlines_desc'] = 'If true and emailHtml is set to 1, will convert newlines to BR tags in the email.'; +$_lang['prop_formit.emailmultiseparator_desc'] = 'The default separator for collections of items sent through checkboxes/multi-selects. Defaults to a newline.'; +$_lang['prop_formit.emailmultiwrapper_desc'] = 'Will wrap each item in a collection of fields sent via checkboxes/multi-selects. Defaults to just the value.'; + +$_lang['prop_fiar.fiartpl_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies auto-response template to send as the email.'; +$_lang['prop_fiar.fiartofield_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies which form field shall be used for the To: address in the auto-response email.'; +$_lang['prop_fiar.fiarbcc_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies the email(s) to send the email to as a BCC. Can be a comma-separated list of email addresses.'; +$_lang['prop_fiar.fiarbccname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailBCC` property.'; +$_lang['prop_fiar.fiarcc_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies the email(s) to send the email to as a CC. Can be a comma-separated list of email addresses.'; +$_lang['prop_fiar.fiarccname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailCC` property.'; +$_lang['prop_fiar.fiarfrom_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the From: address for the email. If not set, will first look for an `email` form field. If none is found, will default to the `emailsender` system setting.'; +$_lang['prop_fiar.fiarfromname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the From: name for the email.'; +$_lang['prop_fiar.fiarreplyto_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the Reply-To: address for the email.'; +$_lang['prop_fiar.fiarreplytoname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the Reply-To: name for the email.'; +$_lang['prop_fiar.fiarsubject_desc'] = 'If `FormItAutoResponder` is set as a hook, this is required as a subject line for the email.'; +$_lang['prop_fiar.fiarhtml_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, this toggles HTML emails or not. Defaults to true.'; + +$_lang['prop_fir.placeholderprefix_desc'] = 'The prefix to use with placeholders from the form data.'; +$_lang['prop_fir.redirecttoonnotfound_desc'] = 'If the data is not found, if this is set, redirect to the Resource with this ID.'; +$_lang['prop_fir.eraseonload_desc'] = 'If true, will erase the stored form data on load. Strongly recommended to leave to false unless you only want the data to load once.'; +$_lang['prop_fir.storelocation_desc'] = 'If `store` is set to true, this specifies the cache location of the data from the form submission. Defaults to MODX cache.'; + +$_lang['prop_math.mathminrange_desc'] = 'If `math` is set as a hook, the minimum range for each number in the equation.'; +$_lang['prop_math.mathmaxrange_desc'] = 'If `math` is set as a hook, the maximum range for each number in the equation.'; +$_lang['prop_math.mathfield_desc'] = 'If `math` is set as a hook, the name of the input field for the answer.'; +$_lang['prop_math.mathop1field_desc'] = 'If `math` is set as a hook, the name of the field for the 1st number in the equation.'; +$_lang['prop_math.mathop2field_desc'] = 'If `math` is set as a hook, the name of the field for the 2nd number in the equation.'; +$_lang['prop_math.mathoperatorfield_desc'] = 'If `math` is set as a hook, the name of the field for the operator in the equation.'; + +$_lang['prop_fico.allgrouptext_desc'] = 'Optional. If set and &prioritized is in use, will be the text label for the all other countries option group.'; +$_lang['prop_fico.optgrouptpl_desc'] = 'Optional. If set and &prioritized is in use, will be the chunk tpl to use for the option group markup.'; +$_lang['prop_fico.limited_desc'] = 'Optional. A comma-separated list of ISO codes for selected countries the full list will be limited to.'; +$_lang['prop_fico.prioritized_desc'] = 'Optional. A comma-separated list of ISO codes for countries that will move them into a prioritized "Frequent Visitors" group at the top of the dropdown. This can be used for your commonly-selected countries.'; +$_lang['prop_fico.prioritizedgrouptext_desc'] = 'Optional. If set and &prioritized is in use, will be the text label for the prioritized option group.'; +$_lang['prop_fico.selected_desc'] = 'The country value to select.'; +$_lang['prop_fico.selectedattribute_desc'] = 'Optional. The HTML attribute to add to a selected country.'; +$_lang['prop_fico.toplaceholder_desc'] = 'Optional. Use this to set the output to a placeholder instead of outputting directly.'; +$_lang['prop_fico.tpl_desc'] = 'Optional. The chunk to use for each country dropdown option.'; +$_lang['prop_fico.useisocode_desc'] = 'If 1, will use the ISO country code for the value. If 0, will use the country name.'; +$_lang['prop_fico.country_desc'] = 'Optional. Set to use a different countries file when loading a list of countries.'; + +$_lang['prop_fiso.country_desc'] = 'Optional. Set to use a different states file when loading a list of states.'; +$_lang['prop_fiso.selected_desc'] = 'The country value to select.'; +$_lang['prop_fiso.selectedattribute_desc'] = 'Optional. The HTML attribute to add to a selected country.'; +$_lang['prop_fiso.toplaceholder_desc'] = 'Optional. Use this to set the output to a placeholder instead of outputting directly.'; +$_lang['prop_fiso.tpl_desc'] = 'Optional. The chunk to use for each country dropdown option.'; +$_lang['prop_fiso.useabbr_desc'] = 'If 1, will use the state abbreviation for the value. If 0, will use the full state name.'; + +$_lang['formit.opt_blackglass'] = 'Black Glass'; +$_lang['formit.opt_clean'] = 'Clean'; +$_lang['formit.opt_red'] = 'Red'; +$_lang['formit.opt_white'] = 'White'; +$_lang['formit.opt_cache'] = 'MODX Cache'; +$_lang['formit.opt_session'] = 'Session'; +$_lang['prop_formit.savetmpfiles_desc'] = 'If set to 1, FormIt will store submitted files in a temporary folder.'; +$_lang['prop_formit.attachfiles_desc'] = 'If true, FormIt will add all file fields as attachments in the email.'; diff --git a/core/components/formit/lexicon/nl/recaptcha.inc.php b/core/components/formit/lexicon/nl/recaptcha.inc.php new file mode 100644 index 00000000..efce0111 --- /dev/null +++ b/core/components/formit/lexicon/nl/recaptcha.inc.php @@ -0,0 +1,14 @@ + + */ + +$_lang['recaptcha.empty_answer'] = 'Captcha woorden onjuist. Controleer het antwoord en probeer het opnieuw.'; +$_lang['recaptcha.incorrect'] = 'De reCAPTCHA was niet (juist) ingevoerd. Ga terug en probeer het opnieuw. [[+error]]'; +$_lang['recaptcha.mailhide_no_mcrypt'] = 'To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.'; +$_lang['recaptcha.mailhide_no_api_key'] = 'To use reCAPTCHA Mailhide, you have to sign up for a public and private key, you can do so at http://www.google.com/recaptcha'; +$_lang['recaptcha.no_api_key'] = 'To use reCAPTCHA you must get an API key from http://www.google.com/recaptcha'; +$_lang['recaptcha.no_remote_ip'] = 'For security reasons, you must pass the remote ip to reCAPTCHA'; diff --git a/core/components/formit/lexicon/pl/default.inc.php b/core/components/formit/lexicon/pl/default.inc.php index 872c27e2..a9862745 100644 --- a/core/components/formit/lexicon/pl/default.inc.php +++ b/core/components/formit/lexicon/pl/default.inc.php @@ -1,55 +1,112 @@ - * - * 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 - */ -/** - * Default Lexicon Topic - * - * @package formit - * @subpackage lexicon + * Copyright 2019 by Sterc */ -$_lang['formit.all_group_text'] = 'Wszystkie kraje'; -$_lang['formit.contains'] = 'Wartość musi zawierać "[[+value]]".'; -$_lang['formit.email_invalid'] = 'Wprowadź poprawny adres email.'; -$_lang['formit.email_invalid_domain'] = 'Email musi być w istniejącej domenie.'; -$_lang['formit.email_no_recipient'] = 'Wpisz odbiorcę lub odbiorców tej wiadomości.'; -$_lang['formit.email_not_sent'] = 'Wystąpił błąd przy wysyłaniu wiadomości.'; -$_lang['formit.email_tpl_nf'] = 'Wybierz szablon wiadomości.'; -$_lang['formit.field_not_empty'] = 'Pole nie może być puste.'; -$_lang['formit.field_required'] = 'Pole jest wymagane.'; -$_lang['formit.math_incorrect'] = 'Zła odpowiedź!'; -$_lang['formit.math_field_nf'] = 'Pole [[+field]] nie istnieje w formularzu.'; -$_lang['formit.max_length'] = 'Treść nie może być dłuższa niż [[+length]] znaków.'; -$_lang['formit.max_value'] = 'Wartość nie może być większa niż [[+value]].'; -$_lang['formit.min_length'] = 'Treść musi zawierać przynajmniej [[+length]] znaków.'; -$_lang['formit.min_value'] = 'Wartość nie może być mniejsza niż [[+value]].'; -$_lang['formit.not_date'] = 'Wpisz poprawną datę.'; -$_lang['formit.not_lowercase'] = 'Pole może zawierać tylko małe litery.'; -$_lang['formit.not_number'] = 'Pole musi zawierać liczbę.'; -$_lang['formit.not_uppercase'] = 'Pole może zawierać tylko wielkie litery.'; -$_lang['formit.password_dont_match'] = 'Hasła nie są takie same.'; -$_lang['formit.password_not_confirmed'] = 'Wpisz potwierdzenie hasła.'; -$_lang['formit.prioritized_group_text'] = 'Frequent Visitors'; -$_lang['formit.range_invalid'] = 'Niepoprawny zakres.'; -$_lang['formit.range'] = 'Wartość musi zawierać się pomiędzy [[+min]] i [[+max]].'; -$_lang['formit.recaptcha_err_load'] = 'Nie można załadować klasy FormItReCaptcha.'; -$_lang['formit.spam_blocked'] = 'Twój formularz został zablokowany przez filtr samu: '; -$_lang['formit.spam_marked'] = ' - oznaczone jako spam.'; -$_lang['formit.username_taken'] = 'Nazwa użytkownika już zajęta. Wybierz inną.'; \ No newline at end of file + +$_lang['formit'] = 'FormIt'; +$_lang['formit.desc'] = 'View all submitted forms.'; + +$_lang['area_formit'] = 'FormIt'; +$_lang['area_formit_recaptcha'] = 'FormIt reCaptcha'; + +$_lang['formit.form'] = 'Form'; +$_lang['formit.forms'] = 'Forms'; +$_lang['formit.forms_desc'] = 'View all submitted forms.'; +$_lang['formit.form_view'] = 'View form'; +$_lang['formit.form_remove'] = 'Remove form'; +$_lang['formit.form_remove_confirm'] = 'Are you sure you want to remove this form?'; +$_lang['formit.forms_remove'] = 'Remove forms'; +$_lang['formit.forms_remove_confirm'] = 'Are you sure you want to remove all forms?'; +$_lang['formit.forms_clean'] = 'Clean forms'; +$_lang['formit.forms_clean_confirm'] = 'Are you sure you want to clean all old forms?'; +$_lang['formit.forms_export'] = 'Export forms'; +$_lang['formit.form_encrypt'] = 'Encrypt form(s)'; +$_lang['formit.form_encrypt_confirm'] = 'Are you sure you want to encrypt the form(s)?'; +$_lang['formit.form_decrypt'] = 'Undo form encryption(s)'; +$_lang['formit.form_decrypt_confirm'] = 'Are you sure you want to undo the form encryption(s)?'; +$_lang['formit.view_ip'] = 'View all forms from this IP'; + +$_lang['formit.encryption'] = 'Encrypted form'; +$_lang['formit.encryptions'] = 'Encrypted forms'; +$_lang['formit.encryptions_desc'] = 'View all encrypted and non encrypted forms.'; + +$_lang['formit.label_form_name'] = 'Name'; +$_lang['formit.label_form_name_desc'] = 'The name of the form.'; +$_lang['formit.label_form_values'] = 'Form values'; +$_lang['formit.label_form_values_desc'] = 'The values of the form.'; +$_lang['formit.label_form_ip'] = 'IP number'; +$_lang['formit.label_form_ip_desc'] = 'The IP number of the visitor that has submitted the form.'; +$_lang['formit.label_form_date'] = 'Date'; +$_lang['formit.label_form_date_desc'] = 'The date when the form is submitted.'; +$_lang['formit.label_form_encrypted'] = 'Encrypted'; +$_lang['formit.label_form_encrypted_desc'] = ''; +$_lang['formit.label_form_decrypted'] = 'Not encrypted'; +$_lang['formit.label_form_decrypted_desc'] = ''; +$_lang['formit.label_form_total'] = 'Total'; +$_lang['formit.label_form_total_desc'] = ''; + +$_lang['formit.label_clean_label'] = 'Remove forms older than'; +$_lang['formit.label_clean_desc'] = 'days'; + +$_lang['formit.label_export_form'] = 'Form'; +$_lang['formit.label_export_form_desc'] = 'Select a form to export.'; +$_lang['formit.label_export_start_date'] = 'Date from'; +$_lang['formit.label_export_start_date_desc'] = 'Select a date to export forms from that date.'; +$_lang['formit.label_export_end_date'] = 'Date till'; +$_lang['formit.label_export_end_date_desc'] = 'Select a date to export forms till that date.'; +$_lang['formit.label_export_delimiter'] = 'CSV delimiter'; +$_lang['formit.label_export_delimiter_desc'] = 'The Het CSV delimiter to separate the columns. Default is ";".'; + +$_lang['formit.filter_form'] = 'Filter on form'; +$_lang['formit.filter_start_date'] = 'Filter from'; +$_lang['formit.filter_end_date'] = 'Filter till'; +$_lang['formit.encryption_unavailable'] = 'PHP OpenSSL functions openssl_encrypt and openssl_decrypt are not available. Please install PHP OpenSSL on your server. See http://www.php.net/manual/en/openssl.requirements.php for more information.'; +$_lang['formit.encryption_unavailable_warning'] = 'Warning: PHP OpenSSL functions openssl_encrypt and openssl_decrypt are not available. This means that you cannot use encryption on your forms. Please install PHP OpenSSL on your server. Visit this page for more information.'; +$_lang['formit.forms_clean_desc'] = 'The European General Data Protection Regulation (GDPR) requires that personal data, which is no longer necessary to possess, is removed. This tool makes it possible to remove saved forms with an age older than the given days. This action can not be undone!'; +$_lang['formit.forms_clean_executing'] = 'Cleaning up forms'; +$_lang['formit.forms_clean_success'] = '[[+amount]] form(s) removed.'; +$_lang['formit.export_failed'] = 'The export of the forms failed, please try again.'; +$_lang['formit.export_dir_failed'] = 'An error occurred while exporting the form, the export folder could not be created.'; + +$_lang['formit.contains'] = 'Wartość musi zawierać "[[+value]]".'; +$_lang['formit.email_invalid'] = 'Wprowadź poprawny adres email.'; +$_lang['formit.email_invalid_domain'] = 'Email musi być w istniejącej domenie.'; +$_lang['formit.email_no_recipient'] = 'Wpisz odbiorcę lub odbiorców tej wiadomości.'; +$_lang['formit.email_not_sent'] = 'Wystąpił błąd przy wysyłaniu wiadomości.'; +$_lang['formit.email_tpl_nf'] = 'Wybierz szablon wiadomości.'; +$_lang['formit.field_not_empty'] = 'Pole nie może być puste.'; +$_lang['formit.field_required'] = 'Pole jest wymagane.'; +$_lang['formit.math_incorrect'] = 'Zła odpowiedź!'; +$_lang['formit.math_field_nf'] = 'Pole [[+field]] nie istnieje w formularzu.'; +$_lang['formit.max_length'] = 'Treść nie może być dłuższa niż [[+length]] znaków.'; +$_lang['formit.max_value'] = 'Wartość nie może być większa niż [[+value]].'; +$_lang['formit.min_length'] = 'Treść musi zawierać przynajmniej [[+length]] znaków.'; +$_lang['formit.min_value'] = 'Wartość nie może być mniejsza niż [[+value]].'; +$_lang['formit.not_date'] = 'Wpisz poprawną datę.'; +$_lang['formit.not_lowercase'] = 'Pole może zawierać tylko małe litery.'; +$_lang['formit.not_number'] = 'Pole musi zawierać liczbę.'; +$_lang['formit.not_uppercase'] = 'Pole może zawierać tylko wielkie litery.'; +$_lang['formit.password_dont_match'] = 'Hasła nie są takie same.'; +$_lang['formit.password_not_confirmed'] = 'Wpisz potwierdzenie hasła.'; +$_lang['formit.prioritized_group_text'] = 'Frequent Visitors'; +$_lang['formit.range_invalid'] = 'Niepoprawny zakres.'; +$_lang['formit.range'] = 'Wartość musi zawierać się pomiędzy [[+min]] i [[+max]].'; +$_lang['formit.recaptcha_err_load'] = 'Nie można załadować klasy FormItReCaptcha.'; +$_lang['formit.spam_blocked'] = 'Twój formularz został zablokowany przez filtr samu: '; +$_lang['formit.spam_marked'] = ' - oznaczone jako spam.'; +$_lang['formit.username_taken'] = 'Nazwa użytkownika już zajęta. Wybierz inną.'; +$_lang['formit.not_regexp'] = 'Your value did not match the expected format.'; +$_lang['formit.all_group_text'] = 'Wszystkie kraje'; +$_lang['formit.storeAttachment_mediasource_error'] = 'Cant find MediaSource! Mediasource id is: '; +$_lang['formit.storeAttachment_access_error'] = 'Directory is not writable! Check the permissions for: '; + +$_lang['formit.migrate'] = 'Migrate encrypted form submissions'; +$_lang['formit.migrate_desc'] = 'Upgrading to FormIt 3.0 will also update the encryption method used for encrypting submitted form data. FormIt 2.x used mcrypt for encrypting and decrypting, but 3.0 uses the openssl methods. For this to work correctly the currently encrypted forms need to be migrated from mcrypt to openssl.'; +$_lang['formit.migrate_alert'] = 'FormIt was updated, but your encrypted form submissions need to be migrated. Click here to start the migration.'; +$_lang['formit.migrate_status'] = 'Status'; +$_lang['formit.migrate_running'] = 'Currently running migration process in the background. Please keep this page open in your browser. DO NOT CLOSE THIS PAGE!'; +$_lang['formit.migrate_success'] = 'Migration completed'; +$_lang['formit.migrate_success_msg'] = 'All your encrypted forms have been successfully migrated.'; diff --git a/core/components/formit/lexicon/pl/properties.inc.php b/core/components/formit/lexicon/pl/properties.inc.php new file mode 100644 index 00000000..4c68d040 --- /dev/null +++ b/core/components/formit/lexicon/pl/properties.inc.php @@ -0,0 +1,103 @@ + + */ + +$_lang['prop_formit.hooks_desc'] = 'What scripts to fire, if any, after the form passes validation. This can be a comma-separated list of hooks, and if the first fails, the proceeding ones will not fire. A hook can also be a Snippet name that will execute that Snippet.'; +$_lang['prop_formit.prehooks_desc'] = 'What scripts to fire, if any, once the form loads. You can pre-set form fields via $scriptProperties[`hook`]->fields[`fieldname`]. This can be a comma-separated list of hooks, and if the first fails, the proceeding ones will not fire. A hook can also be a Snippet name that will execute that Snippet.'; +$_lang['prop_formit.submitvar_desc'] = 'If set, will not begin form processing if this POST variable is not passed.'; +$_lang['prop_formit.validate_desc'] = 'A comma-separated list of fields to validate, with each field name as name:validator (eg: username:required,email:required). Validators can also be chained, like email:email:required. This property can be specified on multiple lines.'; +$_lang['prop_formit.errtpl_desc'] = 'The wrapper template for error messages.'; +$_lang['prop_formit.validationerrormessage_desc'] = 'A general error message to set to a placeholder if validation fails. Can contain [[+errors]] if you want to display a list of all errors at the top.'; +$_lang['prop_formit.validationerrorbulktpl_desc'] = 'HTML tpl that is used for each individual error in the generic validation error message value.'; +$_lang['prop_formit.customvalidators_desc'] = 'A comma-separated list of custom validator names (snippets) you plan to use in this form. They must be explicitly stated here, or they will not be run.'; +$_lang['prop_formit.trimvaluesdeforevalidation_desc'] = 'Whether or not to trim spaces from the beginning and end of values before attempting validation. Defaults to true.'; +$_lang['prop_formit.clearfieldsonsuccess_desc'] = 'If true, will clear the fields on a successful form submission that does not redirect.'; +$_lang['prop_formit.successmessage_desc'] = 'If set, will set this a placeholder with the name of the value of the property &successMessagePlaceholder, which defaults to `fi.successMessage`.'; +$_lang['prop_formit.successmessageplaceholder_desc'] = 'The placeholder to set the success message to.'; +$_lang['prop_formit.store_desc'] = 'If true, will store the data in the cache for retrieval using the FormItRetriever snippet.'; +$_lang['prop_formit.storetime_desc'] = 'If `store` is set to true, this specifies the number of seconds to store the data from the form submission. Defaults to five minutes.'; +$_lang['prop_formit.storelocation_desc'] = 'If `store` is set to true, this specifies the cache location of the data from the form submission. Defaults to MODX cache.'; +$_lang['prop_formit.allowfiles_desc'] = 'If set to 0, will prevent files from being submitted on the form.'; +$_lang['prop_formit.placeholderprefix_desc'] = 'The prefix to use for all placeholders set by FormIt for fields. Defaults to `fi.`'; +$_lang['prop_formit.redirectto_desc'] = 'If `redirect` is set as a hook, this must specify the Resource ID to redirect to.'; +$_lang['prop_formit.redirectparams_desc'] = 'A JSON array of parameters to pass to the redirect hook that will be passed when redirecting.'; +$_lang['prop_formit.recaptchajs_desc'] = 'If `recaptcha` is set as a hook, this can be a JSON object that will be set to the JS RecaptchaOptions variable, which configures options for reCaptcha.'; +$_lang['prop_formit.recaptchaheight_desc'] = 'If `recaptcha` is set as a hook, this will select the height for the reCaptcha widget.'; +$_lang['prop_formit.recaptchatheme_desc'] = 'If `recaptcha` is set as a hook, this will select a theme for the reCaptcha widget.'; +$_lang['prop_formit.recaptchawidth_desc'] = 'If `recaptcha` is set as a hook, this will set the width for the reCaptcha widget.'; +$_lang['prop_formit.spamemailfields_desc'] = 'If `spam` is set as a hook, a comma-separated list of fields containing emails to check spam against.'; +$_lang['prop_formit.spamcheckip_desc'] = 'If `spam` is set as a hook, and this is true, will check the IP as well.'; +$_lang['prop_formit.emailbcc_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to as a BCC. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailbccname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailBCC` property.'; +$_lang['prop_formit.emailcc_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to as a CC. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailccname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailCC` property.'; +$_lang['prop_formit.emailto_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailtoname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailTo` property.'; +$_lang['prop_formit.emailfrom_desc'] = 'Optional. If `email` is set as a hook, and this is set, will specify the From: address for the email. If not set, will first look for an `email` form field. If none is found, will default to the `emailsender` system setting.'; +$_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.'; +$_lang['prop_formit.emailconvertnewlines_desc'] = 'If true and emailHtml is set to 1, will convert newlines to BR tags in the email.'; +$_lang['prop_formit.emailmultiseparator_desc'] = 'The default separator for collections of items sent through checkboxes/multi-selects. Defaults to a newline.'; +$_lang['prop_formit.emailmultiwrapper_desc'] = 'Will wrap each item in a collection of fields sent via checkboxes/multi-selects. Defaults to just the value.'; + +$_lang['prop_fiar.fiartpl_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies auto-response template to send as the email.'; +$_lang['prop_fiar.fiartofield_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies which form field shall be used for the To: address in the auto-response email.'; +$_lang['prop_fiar.fiarbcc_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies the email(s) to send the email to as a BCC. Can be a comma-separated list of email addresses.'; +$_lang['prop_fiar.fiarbccname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailBCC` property.'; +$_lang['prop_fiar.fiarcc_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies the email(s) to send the email to as a CC. Can be a comma-separated list of email addresses.'; +$_lang['prop_fiar.fiarccname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailCC` property.'; +$_lang['prop_fiar.fiarfrom_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the From: address for the email. If not set, will first look for an `email` form field. If none is found, will default to the `emailsender` system setting.'; +$_lang['prop_fiar.fiarfromname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the From: name for the email.'; +$_lang['prop_fiar.fiarreplyto_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the Reply-To: address for the email.'; +$_lang['prop_fiar.fiarreplytoname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the Reply-To: name for the email.'; +$_lang['prop_fiar.fiarsubject_desc'] = 'If `FormItAutoResponder` is set as a hook, this is required as a subject line for the email.'; +$_lang['prop_fiar.fiarhtml_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, this toggles HTML emails or not. Defaults to true.'; + +$_lang['prop_fir.placeholderprefix_desc'] = 'The prefix to use with placeholders from the form data.'; +$_lang['prop_fir.redirecttoonnotfound_desc'] = 'If the data is not found, if this is set, redirect to the Resource with this ID.'; +$_lang['prop_fir.eraseonload_desc'] = 'If true, will erase the stored form data on load. Strongly recommended to leave to false unless you only want the data to load once.'; +$_lang['prop_fir.storelocation_desc'] = 'If `store` is set to true, this specifies the cache location of the data from the form submission. Defaults to MODX cache.'; + +$_lang['prop_math.mathminrange_desc'] = 'If `math` is set as a hook, the minimum range for each number in the equation.'; +$_lang['prop_math.mathmaxrange_desc'] = 'If `math` is set as a hook, the maximum range for each number in the equation.'; +$_lang['prop_math.mathfield_desc'] = 'If `math` is set as a hook, the name of the input field for the answer.'; +$_lang['prop_math.mathop1field_desc'] = 'If `math` is set as a hook, the name of the field for the 1st number in the equation.'; +$_lang['prop_math.mathop2field_desc'] = 'If `math` is set as a hook, the name of the field for the 2nd number in the equation.'; +$_lang['prop_math.mathoperatorfield_desc'] = 'If `math` is set as a hook, the name of the field for the operator in the equation.'; + +$_lang['prop_fico.allgrouptext_desc'] = 'Optional. If set and &prioritized is in use, will be the text label for the all other countries option group.'; +$_lang['prop_fico.optgrouptpl_desc'] = 'Optional. If set and &prioritized is in use, will be the chunk tpl to use for the option group markup.'; +$_lang['prop_fico.limited_desc'] = 'Optional. A comma-separated list of ISO codes for selected countries the full list will be limited to.'; +$_lang['prop_fico.prioritized_desc'] = 'Optional. A comma-separated list of ISO codes for countries that will move them into a prioritized "Frequent Visitors" group at the top of the dropdown. This can be used for your commonly-selected countries.'; +$_lang['prop_fico.prioritizedgrouptext_desc'] = 'Optional. If set and &prioritized is in use, will be the text label for the prioritized option group.'; +$_lang['prop_fico.selected_desc'] = 'The country value to select.'; +$_lang['prop_fico.selectedattribute_desc'] = 'Optional. The HTML attribute to add to a selected country.'; +$_lang['prop_fico.toplaceholder_desc'] = 'Optional. Use this to set the output to a placeholder instead of outputting directly.'; +$_lang['prop_fico.tpl_desc'] = 'Optional. The chunk to use for each country dropdown option.'; +$_lang['prop_fico.useisocode_desc'] = 'If 1, will use the ISO country code for the value. If 0, will use the country name.'; +$_lang['prop_fico.country_desc'] = 'Optional. Set to use a different countries file when loading a list of countries.'; + +$_lang['prop_fiso.country_desc'] = 'Optional. Set to use a different states file when loading a list of states.'; +$_lang['prop_fiso.selected_desc'] = 'The country value to select.'; +$_lang['prop_fiso.selectedattribute_desc'] = 'Optional. The HTML attribute to add to a selected country.'; +$_lang['prop_fiso.toplaceholder_desc'] = 'Optional. Use this to set the output to a placeholder instead of outputting directly.'; +$_lang['prop_fiso.tpl_desc'] = 'Optional. The chunk to use for each country dropdown option.'; +$_lang['prop_fiso.useabbr_desc'] = 'If 1, will use the state abbreviation for the value. If 0, will use the full state name.'; + +$_lang['formit.opt_blackglass'] = 'Black Glass'; +$_lang['formit.opt_clean'] = 'Clean'; +$_lang['formit.opt_red'] = 'Red'; +$_lang['formit.opt_white'] = 'White'; +$_lang['formit.opt_cache'] = 'MODX Cache'; +$_lang['formit.opt_session'] = 'Session'; +$_lang['prop_formit.savetmpfiles_desc'] = 'If set to 1, FormIt will store submitted files in a temporary folder.'; +$_lang['prop_formit.attachfiles_desc'] = 'If true, FormIt will add all file fields as attachments in the email.'; diff --git a/core/components/formit/lexicon/pl/recaptcha.inc.php b/core/components/formit/lexicon/pl/recaptcha.inc.php index 9ebd1902..a24f9cbf 100644 --- a/core/components/formit/lexicon/pl/recaptcha.inc.php +++ b/core/components/formit/lexicon/pl/recaptcha.inc.php @@ -1,34 +1,14 @@ - * - * 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 - */ -/** - * reCaptcha Lexicon Topic - * - * @package formit - * @subpackage lexicon + * Copyright 2019 by Sterc */ -$_lang['recaptcha.empty_answer'] = 'Niepoprawne słowa captcha. Sprawdź swoją odpowiedź i spróbuj jeszcze raz.'; -$_lang['recaptcha.incorrect'] = 'Niepoprawne słowa captcha. Sprawdź swoją odpowiedź i spróbuj jeszcze raz. [[+error]]'; -$_lang['recaptcha.mailhide_no_mcrypt'] = 'Jeśli chcesz używać reCAPTCHA Mailhide, musisz mieć zainstalowany moduł mcrypt w php.'; -$_lang['recaptcha.mailhide_no_api_key'] = 'Jeśli chcesz używać reCAPTCHA Mailhide, musisz się zarejestrować i pobrać klucz prywatny i publiczny. Możesz to zrobić pod adresem http://www.google.com/recaptcha'; -$_lang['recaptcha.no_api_key'] = 'Do używania reCAPTCHA musisz pobrać klucz API pod adresem http://www.google.com/recaptcha'; -$_lang['recaptcha.no_remote_ip'] = 'Ze względów bezpieczeństwa, należy wysłać zdalny adres ip do reCAPTCHA'; +$_lang['recaptcha.empty_answer'] = 'Niepoprawne słowa captcha. Sprawdź swoją odpowiedź i spróbuj jeszcze raz.'; +$_lang['recaptcha.incorrect'] = 'Niepoprawne słowa captcha. Sprawdź swoją odpowiedź i spróbuj jeszcze raz. [[+error]]'; +$_lang['recaptcha.mailhide_no_mcrypt'] = 'Jeśli chcesz używać reCAPTCHA Mailhide, musisz mieć zainstalowany moduł mcrypt w php.'; +$_lang['recaptcha.mailhide_no_api_key'] = 'Jeśli chcesz używać reCAPTCHA Mailhide, musisz się zarejestrować i pobrać klucz prywatny i publiczny. Możesz to zrobić pod adresem http://www.google.com/recaptcha'; +$_lang['recaptcha.no_api_key'] = 'Do używania reCAPTCHA musisz pobrać klucz API pod adresem http://www.google.com/recaptcha'; +$_lang['recaptcha.no_remote_ip'] = 'Ze względów bezpieczeństwa, należy wysłać zdalny adres ip do reCAPTCHA'; diff --git a/core/components/formit/lexicon/ru/default.inc.php b/core/components/formit/lexicon/ru/default.inc.php index 6582c1a8..70f2e8a1 100644 --- a/core/components/formit/lexicon/ru/default.inc.php +++ b/core/components/formit/lexicon/ru/default.inc.php @@ -1,28 +1,112 @@ + */ + +$_lang['formit'] = 'FormIt'; +$_lang['formit.desc'] = 'Посмотреть все отправленные формы'; + +$_lang['area_formit'] = 'FormIt'; +$_lang['area_formit_recaptcha'] = 'FormIt reCAPTCHA'; + +$_lang['formit.form'] = 'Форма'; +$_lang['formit.forms'] = 'Формы'; +$_lang['formit.forms_desc'] = 'Посмотреть все отправленные формы'; +$_lang['formit.form_view'] = 'Посмотреть форму'; +$_lang['formit.form_remove'] = 'Удалить форму'; +$_lang['formit.form_remove_confirm'] = 'Вы уверены, что хотите удалить эту форму?'; +$_lang['formit.forms_remove'] = 'Удалить формы'; +$_lang['formit.forms_remove_confirm'] = 'Вы уверены, что хотите удалить все формы?'; +$_lang['formit.forms_clean'] = 'Очистить формы'; +$_lang['formit.forms_clean_confirm'] = 'Вы уверены, что хотите очистить все старые формы?'; +$_lang['formit.forms_export'] = 'Экспорт Формы'; +$_lang['formit.form_encrypt'] = 'Зашифровать форму(ы)'; +$_lang['formit.form_encrypt_confirm'] = 'Вы уверены, что хотите зашифровать форму(ы)?'; +$_lang['formit.form_decrypt'] = 'Отменить шифрование форм(ы)'; +$_lang['formit.form_decrypt_confirm'] = 'Вы уверены, что хотите отменить шифрование форм(ы)?'; +$_lang['formit.view_ip'] = 'Посмотреть все формы с этого IP'; + +$_lang['formit.encryption'] = 'Зашифрованная форма'; +$_lang['formit.encryptions'] = 'Зашифрованные формы'; +$_lang['formit.encryptions_desc'] = 'Посмотреть все зашифрованные и не зашифрованные формы.'; + +$_lang['formit.label_form_name'] = 'Название'; +$_lang['formit.label_form_name_desc'] = 'Название формы.'; +$_lang['formit.label_form_values'] = 'Значения'; +$_lang['formit.label_form_values_desc'] = 'Значения формы.'; +$_lang['formit.label_form_ip'] = 'IP адрес'; +$_lang['formit.label_form_ip_desc'] = 'IP адрес посетителей, которые отправляли формы.'; +$_lang['formit.label_form_date'] = 'Дата'; +$_lang['formit.label_form_date_desc'] = 'Дата отправления формы'; +$_lang['formit.label_form_encrypted'] = 'Зашифрована'; +$_lang['formit.label_form_encrypted_desc'] = ''; +$_lang['formit.label_form_decrypted'] = 'Не зашифрована'; +$_lang['formit.label_form_decrypted_desc'] = ''; +$_lang['formit.label_form_total'] = 'Всего'; +$_lang['formit.label_form_total_desc'] = ''; + +$_lang['formit.label_clean_label'] = 'Удалить формы старше'; +$_lang['formit.label_clean_desc'] = 'дней'; + +$_lang['formit.label_export_form'] = 'Форма'; +$_lang['formit.label_export_form_desc'] = 'Выберите формы, которые необходимо экспортировать.'; +$_lang['formit.label_export_start_date'] = 'Дата от'; +$_lang['formit.label_export_start_date_desc'] = 'Выберите дату, с которой будут экспортироваться формы.'; +$_lang['formit.label_export_end_date'] = 'Дата до'; +$_lang['formit.label_export_end_date_desc'] = 'Выберите дату, до которой будут экспортироваться формы.'; +$_lang['formit.label_export_delimiter'] = 'CSV разделитель'; +$_lang['formit.label_export_delimiter_desc'] = 'Разделитель для столбцов в CSV. По умолчанию ";".'; + +$_lang['formit.filter_form'] = 'Выберите форму'; +$_lang['formit.filter_start_date'] = 'Выберите начальную дату'; +$_lang['formit.filter_end_date'] = 'Выберите конечную дату'; +$_lang['formit.encryption_unavailable'] = 'PHP OpenSSL функции openssl_encrypt и openssl_decrypt недоступны. Пожалуйста, установите PHP OpenSSL на ваш сервер. Смотрите https://www.php.net/manual/ru/openssl.requirements.php для более подробной информации.'; +$_lang['formit.encryption_unavailable_warning'] = 'Внимание: PHP OpenSSL функции openssl_encrypt и openssl_decrypt недоступны. Это означает, что вы не можете использовать шифрование в ваших формах. Пожалуйста, установите PHP OpenSSL на ваш сервер. Посетите https://www.php.net/manual/ru/openssl.requirements.php для более подробной информации.'; +$_lang['formit.forms_clean_desc'] = 'Европейский Общий регламент по защите данных (GDPR) требует, чтобы личные данные, которые больше не используются, были удалены. Этот инструмент позволяет удалять сохраненные формы старше указанных ниже дней. Это действие не может быть отменено!'; +$_lang['formit.forms_clean_executing'] = 'Очистка форм'; +$_lang['formit.forms_clean_success'] = 'Удалено форм: [[+amount]].'; +$_lang['formit.export_failed'] = 'Не удалось экспортировать формы, пожалуйста, попробуйте еще раз.'; +$_lang['formit.export_dir_failed'] = 'Произошла ошибка при экспорте формы, не удалось создать папку экспорта.'; + +$_lang['formit.contains'] = 'Поле должно содержать фразу "[[+value]]".'; +$_lang['formit.email_invalid'] = 'Пожалуйста, введите правильный адрес электронной почты.'; +$_lang['formit.email_invalid_domain'] = 'Ваш адрес электронной почты не является допустимым именем домена.'; +$_lang['formit.email_no_recipient'] = 'Пожалуйста, укажите получателя или получателей электронной почты.'; +$_lang['formit.email_not_sent'] = 'Произошла ошибка при попытке отправить почту.'; +$_lang['formit.email_tpl_nf'] = 'Пожалуйста, укажите шаблон письма.'; +$_lang['formit.field_not_empty'] = 'Это поле должно быть пустым.'; +$_lang['formit.field_required'] = 'Это поле обязательно для заполнения.'; +$_lang['formit.math_incorrect'] = 'Неправильный ответ!'; +$_lang['formit.math_field_nf'] = '[[+field]] поле ввода не указано в форме.'; +$_lang['formit.max_length'] = 'Это поле не может быть длиннее, чем [[+length]] символ(а/ов).'; +$_lang['formit.max_value'] = 'Это поле не может быть больше, чем [[+value]].'; +$_lang['formit.min_length'] = 'Это поле должно быть не меньше [[+length]] символов.'; +$_lang['formit.min_value'] = 'Это поле не может быть меньше, чем [[+value]].'; +$_lang['formit.not_date'] = 'Это поле должно быть действительной датой.'; +$_lang['formit.not_lowercase'] = 'Все символы в этом поле должны быть в нижнем регистре.'; +$_lang['formit.not_number'] = 'Это поле должно быть допустимым числом.'; +$_lang['formit.not_uppercase'] = 'Все символы в этом поле должны быть заглавными.'; +$_lang['formit.password_dont_match'] = 'Пароли не совпадают.'; +$_lang['formit.password_not_confirmed'] = 'Пожалуйста, подтвердите свой пароль'; +$_lang['formit.prioritized_group_text'] = 'Постоянные посетители'; +$_lang['formit.range_invalid'] = 'Неверный диапазон.'; +$_lang['formit.range'] = 'Ваше значение должно быть между [[+min]] и [[+max]].'; +$_lang['formit.recaptcha_err_load'] = 'Невозможно загрузить класс reCAPTCHA.'; +$_lang['formit.spam_blocked'] = 'Ваше сообщение было заблокировано спам фильтром: '; +$_lang['formit.spam_marked'] = ' - помечено как спам.'; +$_lang['formit.username_taken'] = 'Имя пользователя уже занято. Пожалуйста, выберите другое.'; +$_lang['formit.not_regexp'] = 'Ваше значение не совпадает с предполагаемым форматом.'; +$_lang['formit.all_group_text'] = 'Все страны'; +$_lang['formit.storeAttachment_mediasource_error'] = 'Источник медиа (Media Source) не найден! ID источника: '; +$_lang['formit.storeAttachment_access_error'] = 'Папка не доступна для загрузки! Проверьте права на папку: '; + +$_lang['formit.migrate'] = 'Перенос данных с зашифрованных форм'; +$_lang['formit.migrate_desc'] = 'Обновление до FormIt 3.0 также обновит метод шифрования, используемый для шифрования отправленных данных форм. FormIt 2.x использует mcrypt для шифрования и дешифрования, а в 3.0 использует методы openssl. Для правильной работы зашифрованные в настоящее время формы необходимо перенести из mcrypt в openssl.'; +$_lang['formit.migrate_alert'] = 'FormIt успешно обновлен, но отправленные вами зашифрованные формы необходимо перенести. Нажмите сюда, чтобы начать перенос.'; +$_lang['formit.migrate_status'] = 'Статус'; +$_lang['formit.migrate_running'] = 'В настоящее время выполняется процесс переноса данных в фоновом режиме. Пожалуйста, держите эту страницу открытой в вашем браузере. НЕ ЗАКРЫВАЙТЕ ЭТУ СТРАНИЦУ!'; +$_lang['formit.migrate_success'] = 'Перенос завершен'; +$_lang['formit.migrate_success_msg'] = 'Все ваши зашифрованные формы были успешно перенесены.'; diff --git a/core/components/formit/lexicon/ru/properties.inc.php b/core/components/formit/lexicon/ru/properties.inc.php index 04f0174f..0e3d2bf1 100644 --- a/core/components/formit/lexicon/ru/properties.inc.php +++ b/core/components/formit/lexicon/ru/properties.inc.php @@ -1,68 +1,103 @@ fields[`fieldname`]. Хук также может быть именем сниппета, этот сниппет будет выполнен как хук.'; -$_lang['prop_formit.submitvar_desc'] = 'Если установлено значение, то обработка формы не начнётся пока POST параметр с этим именем не будет передан.'; -$_lang['prop_formit.validate_desc'] = 'Разделённый запятыми список полей для проверки, для каждого поля пишется имя:валидатор (т.е.: username:required,email:required). Валидаторы могут быть объединены через двоеточие, например email:email:required. Этот параметр может быть задан на нескольких строках.'; -$_lang['prop_formit.errtpl_desc'] = 'Шаблон сообщения об ошибке.'; -$_lang['prop_formit.customvalidators_desc'] = 'Разделённый запятыми список имён пользовательских валидаторов(сниппетов), которые вы планируете использовать в этой форме. Пользовательские валидаторы должны быть обязательно указаны в этом параметре, иначе они не будут работать.'; -$_lang['prop_formit.clearfieldsonsuccess_desc'] = 'Если установлено значение true, то поля формы будут очищатся после успешной отправки формы.'; -$_lang['prop_formit.successmessage_desc'] = 'Значение подстановщика для сообщения об успехе. Имя подстановщика устанавливается в параметре &successMessagePlaceholder, по умолчанию «fi.successMessage».'; -$_lang['prop_formit.successmessageplaceholder_desc'] = 'Подстановщик для сообщения об успехе.'; -$_lang['prop_formit.store_desc'] = 'Если установлено true, данные переданные через форму будет сохранятcя в кэше, для дальнейшего их использования с помощью сниппета FormItRetriever.'; -$_lang['prop_formit.storetime_desc'] = 'Если выбрано `запоминание` данных формы, то этот параметр указывает время(в секундах) для хранения данных из отправленной формы. По умолчанию пять минут.'; -$_lang['prop_formit.placeholderprefix_desc'] = 'Префикс который используется всеми подстановщиками установлеными FormIt для полей. По умолчанию «fi.»'; -$_lang['prop_formit.redirectto_desc'] = 'Хук «redirect». В этом параметре надо указать идентификатор ресурса на который будет происходить редирект после успешной отправки формы.'; -$_lang['prop_formit.redirectparams_desc'] = ' JSON array of parameters to pass to the redirect hook that will be passed when redirecting.'; -$_lang['prop_formit.recaptchajs_desc'] = 'Хук «recaptcha». JSON объект который содержит в себе настройки для виджета reCaptcha.'; -$_lang['prop_formit.recaptchaheight_desc'] = 'Хук «recaptcha». Высота виджета reCaptcha.'; -$_lang['prop_formit.recaptchatheme_desc'] = 'Хук «recaptcha». Тема оформления для виджета reCaptcha.'; -$_lang['prop_formit.recaptchawidth_desc'] = 'Хук «recaptcha». Ширина виджета reCaptcha.'; -$_lang['prop_formit.spamemailfields_desc'] = 'Хук «spam». Разделённый запятыми список полей содержащих адреса электронной почты для проверки на причастность к спаму.'; -$_lang['prop_formit.spamcheckip_desc'] = 'Хук «spam». Если это параметр установлен в true, то будет проверяться ip-адресс отправителя формы на причастность к спаму.'; -$_lang['prop_formit.emailbcc_desc'] = 'Хук «email». Разделённый запятыми список адресов электронной почты на которые надо послать скрытую копию письма.'; -$_lang['prop_formit.emailbccname_desc'] = 'Хук «email». Необязательный параметр. Разделённый запятыми список имён владельцев адресов электронной почты указанных в параметре «emailBCC».'; -$_lang['prop_formit.emailcc_desc'] = 'Хук «email». Разделённый запятыми список адресов электронной почты на которые надо послать копию письма.'; -$_lang['prop_formit.emailccname_desc'] = 'Хук «email». Необязательный параметр. Разделённый запятыми список имён владельцев адресов электронной почты указанных в параметре «emailCC».'; -$_lang['prop_formit.emailto_desc'] = 'Хук «email». Разделённый запятыми список адресов электронной почты на которые надо послать письмо.'; -$_lang['prop_formit.emailtoname_desc'] = 'Хук «email». Необязательный параметр. Разделённый запятыми список имён владельцев адресов электронной почты указанных в параметре «emailTo».'; -$_lang['prop_formit.emailfrom_desc'] = 'Хук «email». Необязательный параметр. Если этот параметр установлен, то он будет определять адрес электронной почты отправителя письма. Если не установлен, то сначала адрес электронной почты будет искаться в данных формы в поле с именем «email», если это поле не будет найдено, то будет использоваться адрес электронной почты из системной настройки «emailsender».'; -$_lang['prop_formit.emailfromname_desc'] = 'Хук «email». Необязательный параметр. Имя отправителя письма.'; -$_lang['prop_formit.emailreplyto_desc'] = 'Хук «email». Необязательный параметр. Адрес электронной почты для ответа на письмо.'; -$_lang['prop_formit.emailreplytoname_desc'] = 'Хук «email». Необязательный параметр. Имя владельца адреса электронной почты который используется для ответа на письмо.'; -$_lang['prop_formit.emailsubject_desc'] = 'Хук «email». В этом параметре можно указать тему электронного письма.'; -$_lang['prop_formit.emailusefieldforsubject_desc'] = 'Если поле «subject» используется в форме, и это параметр установлен в true,то содержимое этого поля будет использоваться как тема электронного письма.'; -$_lang['prop_formit.emailhtml_desc'] = 'Хук «email». Необязательный параметр. Этот параметр включает использование html разметки в электронном письме. По умолчанию включено.'; -/* FormIt Auto-Responder properties */ -$_lang['prop_fiar.fiartpl_desc'] = 'Хук «FormItAutoResponder». Обязательный параметр. Имя чанка который будет использоватся как шаблон письма для автоматического ответа.'; -$_lang['prop_fiar.fiartofield_desc'] = ' Хук «FormItAutoResponder». Поле формы которое будет использовано как адрес на который надо отправить автоматический ответ.'; -$_lang['prop_fiar.fiarbcc_desc'] = 'Хук «FormItAutoResponder». Разделённый запятыми список адресов электронной почты на которые надо послать скрытую копию письма.'; -$_lang['prop_fiar.fiarbccname_desc'] = 'Хук «FormItAutoResponder». Необязательный параметр. Разделённый запятыми список имён владельцев адресов электронной почты указанных в параметре «emailBCC».'; -$_lang['prop_fiar.fiarcc_desc'] = 'Хук «FormItAutoResponder». Разделённый запятыми список адресов электронной почты на которые надо послать копию письма.'; -$_lang['prop_fiar.fiarccname_desc'] = 'Хук «FormItAutoResponder». Необязательный параметр. Разделённый запятыми список имён владельцев адресов электронной почты указанных в параметре «emailCC».'; -$_lang['prop_fiar.fiarfrom_desc'] = 'Хук «FormItAutoResponder». Необязательный параметр. Если этот параметр установлен, то он будет определять адрес электронной почты отправителя письма. Если не установлен, то сначала адрес электронной почты будет искаться в данных формы в поле с именем «email», если это поле не будет найдено, то будет использоваться адрес электронной почты из системной настройки «emailsender».'; -$_lang['prop_fiar.fiarfromname_desc'] = 'Хук «FormItAutoResponder». Необязательный параметр. Имя отправителя письма.'; -$_lang['prop_fiar.fiarreplyto_desc'] = 'Хук «FormItAutoResponder». Необязательный параметр. Адрес электронной почты для ответа на письмо.'; -$_lang['prop_fiar.fiarreplytoname_desc'] = 'Хук «FormItAutoResponder». Необязательный параметр. Имя владельца адреса электронной почты который используется для ответа на письмо.'; -$_lang['prop_fiar.fiarsubject_desc'] = 'Хук «FormItAutoResponder». Тема письма.'; -$_lang['prop_fiar.fiarhtml_desc'] = 'Хук «FormItAutoResponder». Необязательный параметр. Включает или выключает использование html разметки в электронном письме. По умолчанию включено.'; +/** + * FormIt + * + * Copyright 2020 by Sterc + */ -/* FormItRetriever properties */ -$_lang['prop_fir.placeholderprefix_desc'] = 'Префикс который используется подстановщиками выводящими сохранённые данные формы.'; -$_lang['prop_fir.redirecttoonnotfound_desc'] = 'Идентификатор ресурса на который произойдёт редирект, если данные не найдены.'; -$_lang['prop_fir.eraseonload_desc'] = 'Если включено, сохранённые данные будут стираться при первой загрузке. Настоятельно рекомендуется оставить этот параметр выключенным. Включите его если вы хотите чтобы данные загружались только один раз.'; +$_lang['prop_formit.hooks_desc'] = 'Разделённый запятыми список хуков которые будут выполнятся по очереди после того как форма пройдёт проверку. Если какой-то из хуков вернёт false, то следующие хуки не будут выполнены. Хук также может быть именем сниппета, этот сниппет будет выполнен как хук.'; +$_lang['prop_formit.prehooks_desc'] = 'Разделённый запятыми список хуков которые будут выполнятся по очереди после того как форма будет загружена. Если какой-то из хуков вернёт false, то следующие хуки не будут выполнены. Например: можно предварительно устанавливать значения полей формы с помощью $scriptProperties[`hook`]->fields[`fieldname`]. Хук также может быть именем сниппета, этот сниппет будет выполнен как хук.'; +$_lang['prop_formit.submitvar_desc'] = 'Если установлено значение, то обработка формы не начнётся пока POST параметр с этим именем не будет передан.'; +$_lang['prop_formit.validate_desc'] = 'Разделённый запятыми список полей для проверки, для каждого поля пишется имя:валидатор (т.е.: username:required,email:required). Валидаторы могут быть объединены через двоеточие, например email:email:required. Этот параметр может быть задан на нескольких строках.'; +$_lang['prop_formit.errtpl_desc'] = 'Шаблон сообщения об ошибке.'; +$_lang['prop_formit.validationerrormessage_desc'] = 'Общее сообщение об ошибке для установки в качестве плейсхолдера в случае если валидация не прошла. Может содержать [[+errors]], если вы хотите отобразить список всех ошибок.'; +$_lang['prop_formit.validationerrorbulktpl_desc'] = 'HTML шаблон (tpl), который используется для каждой отдельной ошибки в общем значении сообщения об ошибке при валидации.'; +$_lang['prop_formit.customvalidators_desc'] = 'Разделённый запятыми список имён пользовательских валидаторов (сниппетов), которые вы планируете использовать в этой форме. Пользовательские валидаторы должны быть обязательно указаны в этом параметре, иначе они не будут работать.'; +$_lang['prop_formit.trimvaluesdeforevalidation_desc'] = 'Обрезать ли пробелы от начала и конца значения до начала валидации. По умолчанию true.'; +$_lang['prop_formit.clearfieldsonsuccess_desc'] = 'Если установлено значение true, то поля формы будут очищатся после успешной отправки формы без редиректа.'; +$_lang['prop_formit.successmessage_desc'] = 'Значение плейсхолдера для сообщения об успехе. Имя подстановщика устанавливается в параметре &successMessagePlaceholder, по умолчанию «fi.successMessage».'; +$_lang['prop_formit.successmessageplaceholder_desc'] = 'Плейсхолдер для сообщения об успехе.'; +$_lang['prop_formit.store_desc'] = 'Если установлено true, данные переданные через форму будут сохранятcя в кэше, для дальнейшего их использования с помощью сниппета FormItRetriever.'; +$_lang['prop_formit.storetime_desc'] = 'Если для `store` задано значение true, то этот параметр указывает время (в секундах) для хранения данных из отправленной формы. По умолчанию пять минут.'; +$_lang['prop_formit.storelocation_desc'] = 'Если для `store` задано значение true, то этот параметр указывает местоположение кэша данных из форм. По умолчанию используется кэш MODX.'; +$_lang['prop_formit.allowfiles_desc'] = 'Если установлено значение 0, файлы не будут отправлены в форму.'; +$_lang['prop_formit.placeholderprefix_desc'] = 'Префикс который используется всеми плейсхолдерами установлеными FormIt для полей. По умолчанию «fi.»'; +$_lang['prop_formit.redirectto_desc'] = 'Хук «redirect». В этом параметре надо указать идентификатор ресурса на который будет происходить редирект после успешной отправки формы.'; +$_lang['prop_formit.redirectparams_desc'] = 'JSON-массив параметров для передачи в хук «redirect», который будет передаваться при редиректе.'; +$_lang['prop_formit.recaptchajs_desc'] = 'Хук «recaptcha». JSON объект который содержит в себе настройки для виджета reCAPTCHA.'; +$_lang['prop_formit.recaptchaheight_desc'] = 'Хук «recaptcha». Высота виджета reCAPTCHA.'; +$_lang['prop_formit.recaptchatheme_desc'] = 'Хук «recaptcha». Тема оформления для виджета reCAPTCHA.'; +$_lang['prop_formit.recaptchawidth_desc'] = 'Хук «recaptcha». Ширина виджета reCAPTCHA.'; +$_lang['prop_formit.spamemailfields_desc'] = 'Хук «spam». Разделённый запятыми список полей содержащих адреса электронной почты для проверки на причастность к спаму.'; +$_lang['prop_formit.spamcheckip_desc'] = 'Хук «spam». Если этот параметр установлен в true, то будет проверяться IP-адрес отправителя формы на причастность к спаму.'; +$_lang['prop_formit.emailbcc_desc'] = 'Хук «email». Разделённый запятыми список адресов электронной почты на которые надо послать скрытую копию письма (BCC).'; +$_lang['prop_formit.emailbccname_desc'] = 'Хук «email». Необязательный параметр. Разделённый запятыми список имён владельцев адресов электронной почты указанных в параметре «emailBCC».'; +$_lang['prop_formit.emailcc_desc'] = 'Хук «email». Разделённый запятыми список адресов электронной почты на которые надо послать копию письма.'; +$_lang['prop_formit.emailccname_desc'] = 'Хук «email». Необязательный параметр. Разделённый запятыми список имён владельцев адресов электронной почты указанных в параметре «emailCC».'; +$_lang['prop_formit.emailto_desc'] = 'Хук «email». Разделённый запятыми список адресов электронной почты на которые надо послать письмо.'; +$_lang['prop_formit.emailtoname_desc'] = 'Хук «email». Необязательный параметр. Разделённый запятыми список имён владельцев адресов электронной почты указанных в параметре «emailTo».'; +$_lang['prop_formit.emailfrom_desc'] = 'Хук «email». Необязательный параметр. Если этот параметр установлен, то он будет определять адрес электронной почты отправителя письма. Если не установлен, то сначала адрес электронной почты будет искаться в данных формы в поле с именем «email», если это поле не будет найдено, то будет использоваться адрес электронной почты из системной настройки «emailsender».'; +$_lang['prop_formit.emailfromname_desc'] = 'Хук «email». Необязательный параметр. Имя отправителя письма.'; +$_lang['prop_formit.emailreplyto_desc'] = 'Хук «email». Необязательный параметр. Адрес электронной почты для ответа на письмо.'; +$_lang['prop_formit.emailreplytoname_desc'] = 'Хук «email». Необязательный параметр. Имя владельца адреса электронной почты который используется для ответа на письмо.'; +$_lang['prop_formit.emailreturnpath_desc'] = 'Необязательный параметр. Если `email` установлен как хук и этот параметр включен, то будет указан Return-path: адрес для электронной почты. Если не установлен, будет принимать значение свойства `emailFrom`.'; +$_lang['prop_formit.emailsubject_desc'] = 'Хук «email». В этом параметре можно указать тему электронного письма.'; +$_lang['prop_formit.emailusefieldforsubject_desc'] = 'Если поле «subject» используется в форме и этот параметр установлен в true, то содержимое этого поля будет использоваться как тема электронного письма.'; +$_lang['prop_formit.emailhtml_desc'] = 'Хук «email». Необязательный параметр. Этот параметр включает использование HTML разметки в электронном письме. По умолчанию включено.'; +$_lang['prop_formit.emailconvertnewlines_desc'] = 'Если true и emailHtml установлен в 1, то в письме перенос строки будет конвертирован в тег BR.'; +$_lang['prop_formit.emailmultiseparator_desc'] = 'Разделитель по умолчанию для списка значений, отправляемых через поля типа checkboxes/multi-selects. По умолчанию используется перенос строки.'; +$_lang['prop_formit.emailmultiwrapper_desc'] = 'Обернет каждое значение в списке полей отправленных из полей типа checkboxes/multi-selects. По умолчанию передаются только значения, без обертки.'; -/* FormIt Math hook properties */ -$_lang['prop_math.mathminrange_desc'] = 'Хук «math». Минимальный диапазон для каждого числа в примере.'; -$_lang['prop_math.mathmaxrange_desc'] = 'Хук «math». Максимальный диапазон для каждого числа в примере.'; -$_lang['prop_math.mathfield_desc'] = 'Хук «math». Имя поля ввода для ответа.'; -$_lang['prop_math.mathop1field_desc'] = 'Хук «math». Имя поля для первого числа в примере.'; -$_lang['prop_math.mathop2field_desc'] = 'Хук «math». Имя поля для второго числа в примере.'; -$_lang['prop_math.mathoperatorfield_desc'] = 'Хук «math». Имя поля для оператора в примере.'; +$_lang['prop_fiar.fiartpl_desc'] = 'Хук «FormItAutoResponder». Обязательный параметр. Имя чанка который будет использоватся как шаблон письма для автоматического ответа.'; +$_lang['prop_fiar.fiartofield_desc'] = 'Хук «FormItAutoResponder». Поле формы которое будет использовано как адрес на который надо отправить автоматический ответ.'; +$_lang['prop_fiar.fiarbcc_desc'] = 'Хук «FormItAutoResponder». Разделённый запятыми список адресов электронной почты на которые надо послать скрытую копию письма (BCC).'; +$_lang['prop_fiar.fiarbccname_desc'] = 'Хук «FormItAutoResponder». Необязательный параметр. Разделённый запятыми список имён владельцев адресов электронной почты указанных в параметре «emailBCC».'; +$_lang['prop_fiar.fiarcc_desc'] = 'Хук «FormItAutoResponder». Разделённый запятыми список адресов электронной почты на которые надо послать копию письма.'; +$_lang['prop_fiar.fiarccname_desc'] = 'Хук «FormItAutoResponder». Необязательный параметр. Разделённый запятыми список имён владельцев адресов электронной почты указанных в параметре «emailCC».'; +$_lang['prop_fiar.fiarfrom_desc'] = 'Хук «FormItAutoResponder». Необязательный параметр. Если этот параметр установлен, то он будет определять адрес электронной почты отправителя письма. Если не установлен, то сначала адрес электронной почты будет искаться в данных формы в поле с именем «email», если это поле не будет найдено, то будет использоваться адрес электронной почты из системной настройки «emailsender».'; +$_lang['prop_fiar.fiarfromname_desc'] = 'Хук «FormItAutoResponder». Необязательный параметр. Имя отправителя письма.'; +$_lang['prop_fiar.fiarreplyto_desc'] = 'Хук «FormItAutoResponder». Необязательный параметр. Адрес электронной почты для ответа на письмо.'; +$_lang['prop_fiar.fiarreplytoname_desc'] = 'Хук «FormItAutoResponder». Необязательный параметр. Имя владельца адреса электронной почты которое используется для ответа на письмо.'; +$_lang['prop_fiar.fiarsubject_desc'] = 'Хук «FormItAutoResponder». Тема письма.'; +$_lang['prop_fiar.fiarhtml_desc'] = 'Хук «FormItAutoResponder». Необязательный параметр. Включает или выключает использование HTML разметки в электронном письме. По умолчанию включено.'; -/* FormIt Options */ -$_lang['formit.opt_blackglass'] = 'Black Glass'; -$_lang['formit.opt_clean'] = 'Clean'; -$_lang['formit.opt_red'] = 'Red'; -$_lang['formit.opt_white'] = 'White'; +$_lang['prop_fir.placeholderprefix_desc'] = 'Префикс который используется плейсхолдерами выводящими сохранённые данные формы.'; +$_lang['prop_fir.redirecttoonnotfound_desc'] = 'Идентификатор ресурса на который произойдёт редирект, если данные не найдены.'; +$_lang['prop_fir.eraseonload_desc'] = 'Если включено, сохранённые данные формы будут стираться при первой загрузке. Настоятельно рекомендуется оставить этот параметр выключенным. Включите его если вы хотите чтобы данные загружались только один раз.'; +$_lang['prop_fir.storelocation_desc'] = 'Если для `store` задано значение true, то это указывает местоположение кэша данных из форм. По умолчанию используется кэш MODX.'; + +$_lang['prop_math.mathminrange_desc'] = 'Хук «math». Минимальный диапазон для каждого числа в уравнении.'; +$_lang['prop_math.mathmaxrange_desc'] = 'Хук «math». Максимальный диапазон для каждого числа в уравнении.'; +$_lang['prop_math.mathfield_desc'] = 'Хук «math». Имя поля ввода для ответа.'; +$_lang['prop_math.mathop1field_desc'] = 'Хук «math». Имя поля для первого числа в уравнении.'; +$_lang['prop_math.mathop2field_desc'] = 'Хук «math». Имя поля для второго числа в уравнении.'; +$_lang['prop_math.mathoperatorfield_desc'] = 'Хук «math». Имя поля для оператора в уравнении.'; + +$_lang['prop_fico.allgrouptext_desc'] = 'Необязательный параметр. Если установлено и используется &prioritized, то будет использоваться метка (label) для всех других стран в группах опций.'; +$_lang['prop_fico.optgrouptpl_desc'] = 'Необязательный параметр. Если установлено и используется &prioritized, то это будет чанк tpl для разметки группы опций.'; +$_lang['prop_fico.limited_desc'] = 'Необязательный параметр. Разделенный запятыми список кодов ISO для выбранных стран, полный список которых будет ограничен.'; +$_lang['prop_fico.prioritized_desc'] = 'Необязательный параметр. Разделенный запятыми список кодов ISO для стран, которые будут перемещать их в приоритетную группу «Частых посетителей» в верхней части выпадающего списка. Это можно использовать для часто выбираемых стран.'; +$_lang['prop_fico.prioritizedgrouptext_desc'] = 'Необязательный параметр. Если установлено и используется &prioritized, то используется текстовая метка для группы параметров с приоритетом.'; +$_lang['prop_fico.selected_desc'] = 'Значение страны для выбора.'; +$_lang['prop_fico.selectedattribute_desc'] = 'Необязательный параметр. Атрибут HTML для добавления к выбранной стране.'; +$_lang['prop_fico.toplaceholder_desc'] = 'Необязательный параметр. Используйте этот параметр, чтобы установить вывод в качестве плейсхоледра вместо непосредственного вывода на экран.'; +$_lang['prop_fico.tpl_desc'] = 'Необязательный параметр. Чанк для вывода каждой страны в выпадающем списке.'; +$_lang['prop_fico.useisocode_desc'] = 'Если 1, будет использовать код страны ISO для значения. Если 0, будет использовать название страны.'; +$_lang['prop_fico.country_desc'] = 'Необязательный параметр. Установите для использования альтернативного файла со списком стран для загрузки в значение поля.'; + +$_lang['prop_fiso.country_desc'] = 'Необязательный параметр. Установите для использования альтернативного файла со списком штатов для загрузки в значение поля.'; +$_lang['prop_fiso.selected_desc'] = 'Значение страны для выбора.'; +$_lang['prop_fiso.selectedattribute_desc'] = 'Необязательный параметр. Атрибут HTML для добавления к выбранной стране.'; +$_lang['prop_fiso.toplaceholder_desc'] = 'Необязательный параметр. Используйте этот параметр, чтобы установить вывод в качестве плейсхоледра вместо непосредственного вывода на экран.'; +$_lang['prop_fiso.tpl_desc'] = 'Необязательный параметр. Чанк для вывода каждой страны в выпадающем списке.'; +$_lang['prop_fiso.useabbr_desc'] = 'Если 1, будет использоваться аббревиатура штата для значения. Если 0, будет использоваться полное название штата.'; + +$_lang['formit.opt_blackglass'] = 'Black Glass'; +$_lang['formit.opt_clean'] = 'Clean'; +$_lang['formit.opt_red'] = 'Red'; +$_lang['formit.opt_white'] = 'White'; +$_lang['formit.opt_cache'] = 'MODX Cache'; +$_lang['formit.opt_session'] = 'Сессия'; +$_lang['prop_formit.savetmpfiles_desc'] = 'Если установлено значение 1, FormIt будет хранить отправленные файлы во временной папке.'; +$_lang['prop_formit.attachfiles_desc'] = 'Если true, FormIt добавит все поля файла как вложения в электронное письмо.'; diff --git a/core/components/formit/lexicon/ru/recaptcha.inc.php b/core/components/formit/lexicon/ru/recaptcha.inc.php index 36f9e326..98567009 100644 --- a/core/components/formit/lexicon/ru/recaptcha.inc.php +++ b/core/components/formit/lexicon/ru/recaptcha.inc.php @@ -1,8 +1,14 @@ http://www.google.com/recaptcha'; -$_lang['recaptcha.no_api_key'] = 'Для использования reCAPTCHA вам надо получить API ключ наhttp://www.google.com/recaptcha'; -$_lang['recaptcha.no_remote_ip'] = 'For security reasons, you must pass the remote ip to reCAPTCHA'; +/** + * FormIt + * + * Copyright 2020 by Sterc + */ + +$_lang['recaptcha.empty_answer'] = 'Слова введены неправильно. Пожалуйста, проверьте ваш ответ и повторите попытку.'; +$_lang['recaptcha.incorrect'] = 'Слова с картинки введены неправильно. Пожалуйста, попробуйте ещё раз. [[+error]]'; +$_lang['recaptcha.mailhide_no_mcrypt'] = 'Для использования reCAPTCHA Mailhide у вас должен быть установлен PHP модуль mcrypt.'; +$_lang['recaptcha.mailhide_no_api_key'] = 'Для использования reCAPTCHA Mailhide, вам надо получить публичный и приватный ключи, это можно сделать на https://www.google.com/recaptcha'; +$_lang['recaptcha.no_api_key'] = 'Для использования reCAPTCHA вам надо получить API ключ на https://www.google.com/recaptcha'; +$_lang['recaptcha.no_remote_ip'] = 'По соображениям безопасности, вы должны передать удаленный IP в reCAPTCHA'; diff --git a/core/components/formit/lexicon/sv/default.inc.php b/core/components/formit/lexicon/sv/default.inc.php index 2315b35c..73dfff00 100644 --- a/core/components/formit/lexicon/sv/default.inc.php +++ b/core/components/formit/lexicon/sv/default.inc.php @@ -1,55 +1,112 @@ - * - * 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 - */ -/** - * Default Lexicon Topic - * - * @package formit - * @subpackage lexicon + * Copyright 2019 by Sterc */ -$_lang['formit.all_group_text'] = 'Alla länder'; -$_lang['formit.contains'] = 'Ditt värde måste innehålla frasen "[[+value]]".'; -$_lang['formit.email_invalid'] = 'Ange en giltig e-postadress.'; -$_lang['formit.email_invalid_domain'] = 'Din e-postadress har inte ett giltigt domännamn.'; -$_lang['formit.email_no_recipient'] = 'Ange ett eller flera mottagare för e-postmeddelandet.'; -$_lang['formit.email_not_sent'] = 'Ett fel uppstod vid försök att skicka e-post.'; -$_lang['formit.email_tpl_nf'] = 'Vänligen ange en e-post mall.'; -$_lang['formit.field_not_empty'] = 'Detta fält måste vara tomt.'; -$_lang['formit.field_required'] = 'Detta fält är obligatoriskt.'; -$_lang['formit.math_incorrect'] = 'Felaktigt svar!'; -$_lang['formit.math_field_nf'] = '[[+field]] inmatningsfältet inte anges i formen.'; -$_lang['formit.max_length'] = 'Detta fält får inte vara längre än [[+length]] tecken.'; -$_lang['formit.max_value'] = 'Detta fält får inte vara större än [[+value]].'; -$_lang['formit.min_length'] = 'Detta fält måste vara minst [[+length]] tecken.'; -$_lang['formit.min_value'] = 'Detta fält får inte vara mindre än [[+value]].'; -$_lang['formit.not_date'] = 'Detta fält måste vara ett giltigt datum.'; -$_lang['formit.not_lowercase'] = 'Detta fält måste skrivas med gemener.'; -$_lang['formit.not_number'] = 'Detta fält måste vara ett giltigt nummer.'; -$_lang['formit.not_uppercase'] = 'Detta fält måste vara versaler.'; -$_lang['formit.password_dont_match'] = 'Dina lösenord matchar inte.'; -$_lang['formit.password_not_confirmed'] = 'Vänligen bekräfta ditt lösenord.'; -$_lang['formit.prioritized_group_text'] = 'Frekventa besökare'; -$_lang['formit.range_invalid'] = 'Ogiltigt intervall specifikation.'; -$_lang['formit.range'] = 'Ditt värde måste vara mellan [[+min]] och [[+max]].'; -$_lang['formit.recaptcha_err_load'] = 'Det gick inte att läsa in FormItReCaptcha serviceklass.'; -$_lang['formit.spam_blocked'] = 'Ditt bidrag blockerades av ett spamfilter: '; -$_lang['formit.spam_marked'] = ' - markeras som skräppost.'; -$_lang['formit.username_taken'] = 'Användarnamn redan tagit. Välj ett annat.'; \ No newline at end of file + +$_lang['formit'] = 'FormIt'; +$_lang['formit.desc'] = 'Visa inskickade formulär och hantera kryptering av formulär.'; + +$_lang['area_formit'] = 'FormIt'; +$_lang['area_formit_recaptcha'] = 'FormIt reCaptcha'; + +$_lang['formit.form'] = 'Form'; +$_lang['formit.forms'] = 'Forms'; +$_lang['formit.forms_desc'] = 'View all submitted forms.'; +$_lang['formit.form_view'] = 'View form'; +$_lang['formit.form_remove'] = 'Remove form'; +$_lang['formit.form_remove_confirm'] = 'Are you sure you want to remove this form?'; +$_lang['formit.forms_remove'] = 'Remove forms'; +$_lang['formit.forms_remove_confirm'] = 'Are you sure you want to remove all forms?'; +$_lang['formit.forms_clean'] = 'Clean forms'; +$_lang['formit.forms_clean_confirm'] = 'Are you sure you want to clean all old forms?'; +$_lang['formit.forms_export'] = 'Export forms'; +$_lang['formit.form_encrypt'] = 'Encrypt form(s)'; +$_lang['formit.form_encrypt_confirm'] = 'Are you sure you want to encrypt the form(s)?'; +$_lang['formit.form_decrypt'] = 'Undo form encryption(s)'; +$_lang['formit.form_decrypt_confirm'] = 'Are you sure you want to undo the form encryption(s)?'; +$_lang['formit.view_ip'] = 'View all forms from this IP'; + +$_lang['formit.encryption'] = 'Encrypted form'; +$_lang['formit.encryptions'] = 'Encrypted forms'; +$_lang['formit.encryptions_desc'] = 'View all encrypted and non encrypted forms.'; + +$_lang['formit.label_form_name'] = 'Name'; +$_lang['formit.label_form_name_desc'] = 'The name of the form.'; +$_lang['formit.label_form_values'] = 'Form values'; +$_lang['formit.label_form_values_desc'] = 'The values of the form.'; +$_lang['formit.label_form_ip'] = 'IP number'; +$_lang['formit.label_form_ip_desc'] = 'The IP number of the visitor that has submitted the form.'; +$_lang['formit.label_form_date'] = 'Date'; +$_lang['formit.label_form_date_desc'] = 'The date when the form is submitted.'; +$_lang['formit.label_form_encrypted'] = 'Encrypted'; +$_lang['formit.label_form_encrypted_desc'] = ''; +$_lang['formit.label_form_decrypted'] = 'Not encrypted'; +$_lang['formit.label_form_decrypted_desc'] = ''; +$_lang['formit.label_form_total'] = 'Total'; +$_lang['formit.label_form_total_desc'] = ''; + +$_lang['formit.label_clean_label'] = 'Remove forms older than'; +$_lang['formit.label_clean_desc'] = 'days'; + +$_lang['formit.label_export_form'] = 'Form'; +$_lang['formit.label_export_form_desc'] = 'Select a form to export.'; +$_lang['formit.label_export_start_date'] = 'Date from'; +$_lang['formit.label_export_start_date_desc'] = 'Select a date to export forms from that date.'; +$_lang['formit.label_export_end_date'] = 'Date till'; +$_lang['formit.label_export_end_date_desc'] = 'Select a date to export forms till that date.'; +$_lang['formit.label_export_delimiter'] = 'CSV delimiter'; +$_lang['formit.label_export_delimiter_desc'] = 'The Het CSV delimiter to separate the columns. Default is ";".'; + +$_lang['formit.filter_form'] = 'Filter on form'; +$_lang['formit.filter_start_date'] = 'Filter from'; +$_lang['formit.filter_end_date'] = 'Filter till'; +$_lang['formit.encryption_unavailable'] = 'PHP OpenSSL functions openssl_encrypt and openssl_decrypt are not available. Please install PHP OpenSSL on your server. See http://www.php.net/manual/en/openssl.requirements.php for more information.'; +$_lang['formit.encryption_unavailable_warning'] = 'Warning: PHP OpenSSL functions openssl_encrypt and openssl_decrypt are not available. This means that you cannot use encryption on your forms. Please install PHP OpenSSL on your server. Visit this page for more information.'; +$_lang['formit.forms_clean_desc'] = 'The European General Data Protection Regulation (GDPR) requires that personal data, which is no longer necessary to possess, is removed. This tool makes it possible to remove saved forms with an age older than the given days. This action can not be undone!'; +$_lang['formit.forms_clean_executing'] = 'Cleaning up forms'; +$_lang['formit.forms_clean_success'] = '[[+amount]] form(s) removed.'; +$_lang['formit.export_failed'] = 'The export of the forms failed, please try again.'; +$_lang['formit.export_dir_failed'] = 'An error occurred while exporting the form, the export folder could not be created.'; + +$_lang['formit.contains'] = 'Ditt värde måste innehålla frasen "[[+value]]".'; +$_lang['formit.email_invalid'] = 'Ange en giltig e-postadress.'; +$_lang['formit.email_invalid_domain'] = 'Din e-postadress har inte ett giltigt domännamn.'; +$_lang['formit.email_no_recipient'] = 'Ange ett eller flera mottagare för e-postmeddelandet.'; +$_lang['formit.email_not_sent'] = 'Ett fel uppstod vid försök att skicka e-post.'; +$_lang['formit.email_tpl_nf'] = 'Vänligen ange en e-post mall.'; +$_lang['formit.field_not_empty'] = 'Detta fält måste vara tomt.'; +$_lang['formit.field_required'] = 'Detta fält är obligatoriskt.'; +$_lang['formit.math_incorrect'] = 'Felaktigt svar!'; +$_lang['formit.math_field_nf'] = '[[+field]] inmatningsfältet finns inte i formuläret.'; +$_lang['formit.max_length'] = 'Detta fält får inte vara längre än [[+length]] tecken.'; +$_lang['formit.max_value'] = 'Detta fält får inte vara större än [[+value]].'; +$_lang['formit.min_length'] = 'Detta fält måste vara minst [[+length]] tecken.'; +$_lang['formit.min_value'] = 'Detta fält får inte vara mindre än [[+value]].'; +$_lang['formit.not_date'] = 'Detta fält måste vara ett giltigt datum.'; +$_lang['formit.not_lowercase'] = 'Detta fält måste skrivas med gemener.'; +$_lang['formit.not_number'] = 'Detta fält måste vara ett giltigt nummer.'; +$_lang['formit.not_uppercase'] = 'Detta fält måste skrivas med versaler.'; +$_lang['formit.password_dont_match'] = 'Dina lösenord matchar inte.'; +$_lang['formit.password_not_confirmed'] = 'Vänligen bekräfta ditt lösenord.'; +$_lang['formit.prioritized_group_text'] = 'Frekventa besökare'; +$_lang['formit.range_invalid'] = 'Ogiltig specifikation av intervall.'; +$_lang['formit.range'] = 'Ditt värde måste vara mellan [[+min]] och [[+max]].'; +$_lang['formit.recaptcha_err_load'] = 'Det gick inte att läsa in serviceklassen FormItReCaptcha.'; +$_lang['formit.spam_blocked'] = 'Ditt bidrag blockerades av ett spamfilter: '; +$_lang['formit.spam_marked'] = ' - markeras som skräppost.'; +$_lang['formit.username_taken'] = 'Användarnamn är redan tagit. Välj ett annat.'; +$_lang['formit.not_regexp'] = 'Värdet matchade inte det förväntade formatet.'; +$_lang['formit.all_group_text'] = 'Alla länder'; +$_lang['formit.storeAttachment_mediasource_error'] = 'Kunde inte hitta Mediakällan! Mediakällans id är: '; +$_lang['formit.storeAttachment_access_error'] = 'Katalogen är inte skrivbar! Kontrollera behörigheterna för: '; + +$_lang['formit.migrate'] = 'Migrate encrypted form submissions'; +$_lang['formit.migrate_desc'] = 'Upgrading to FormIt 3.0 will also update the encryption method used for encrypting submitted form data. FormIt 2.x used mcrypt for encrypting and decrypting, but 3.0 uses the openssl methods. For this to work correctly the currently encrypted forms need to be migrated from mcrypt to openssl.'; +$_lang['formit.migrate_alert'] = 'FormIt was updated, but your encrypted form submissions need to be migrated. Click here to start the migration.'; +$_lang['formit.migrate_status'] = 'Status'; +$_lang['formit.migrate_running'] = 'Currently running migration process in the background. Please keep this page open in your browser. DO NOT CLOSE THIS PAGE!'; +$_lang['formit.migrate_success'] = 'Migration completed'; +$_lang['formit.migrate_success_msg'] = 'All your encrypted forms have been successfully migrated.'; diff --git a/core/components/formit/lexicon/sv/properties.inc.php b/core/components/formit/lexicon/sv/properties.inc.php new file mode 100644 index 00000000..4c68d040 --- /dev/null +++ b/core/components/formit/lexicon/sv/properties.inc.php @@ -0,0 +1,103 @@ + + */ + +$_lang['prop_formit.hooks_desc'] = 'What scripts to fire, if any, after the form passes validation. This can be a comma-separated list of hooks, and if the first fails, the proceeding ones will not fire. A hook can also be a Snippet name that will execute that Snippet.'; +$_lang['prop_formit.prehooks_desc'] = 'What scripts to fire, if any, once the form loads. You can pre-set form fields via $scriptProperties[`hook`]->fields[`fieldname`]. This can be a comma-separated list of hooks, and if the first fails, the proceeding ones will not fire. A hook can also be a Snippet name that will execute that Snippet.'; +$_lang['prop_formit.submitvar_desc'] = 'If set, will not begin form processing if this POST variable is not passed.'; +$_lang['prop_formit.validate_desc'] = 'A comma-separated list of fields to validate, with each field name as name:validator (eg: username:required,email:required). Validators can also be chained, like email:email:required. This property can be specified on multiple lines.'; +$_lang['prop_formit.errtpl_desc'] = 'The wrapper template for error messages.'; +$_lang['prop_formit.validationerrormessage_desc'] = 'A general error message to set to a placeholder if validation fails. Can contain [[+errors]] if you want to display a list of all errors at the top.'; +$_lang['prop_formit.validationerrorbulktpl_desc'] = 'HTML tpl that is used for each individual error in the generic validation error message value.'; +$_lang['prop_formit.customvalidators_desc'] = 'A comma-separated list of custom validator names (snippets) you plan to use in this form. They must be explicitly stated here, or they will not be run.'; +$_lang['prop_formit.trimvaluesdeforevalidation_desc'] = 'Whether or not to trim spaces from the beginning and end of values before attempting validation. Defaults to true.'; +$_lang['prop_formit.clearfieldsonsuccess_desc'] = 'If true, will clear the fields on a successful form submission that does not redirect.'; +$_lang['prop_formit.successmessage_desc'] = 'If set, will set this a placeholder with the name of the value of the property &successMessagePlaceholder, which defaults to `fi.successMessage`.'; +$_lang['prop_formit.successmessageplaceholder_desc'] = 'The placeholder to set the success message to.'; +$_lang['prop_formit.store_desc'] = 'If true, will store the data in the cache for retrieval using the FormItRetriever snippet.'; +$_lang['prop_formit.storetime_desc'] = 'If `store` is set to true, this specifies the number of seconds to store the data from the form submission. Defaults to five minutes.'; +$_lang['prop_formit.storelocation_desc'] = 'If `store` is set to true, this specifies the cache location of the data from the form submission. Defaults to MODX cache.'; +$_lang['prop_formit.allowfiles_desc'] = 'If set to 0, will prevent files from being submitted on the form.'; +$_lang['prop_formit.placeholderprefix_desc'] = 'The prefix to use for all placeholders set by FormIt for fields. Defaults to `fi.`'; +$_lang['prop_formit.redirectto_desc'] = 'If `redirect` is set as a hook, this must specify the Resource ID to redirect to.'; +$_lang['prop_formit.redirectparams_desc'] = 'A JSON array of parameters to pass to the redirect hook that will be passed when redirecting.'; +$_lang['prop_formit.recaptchajs_desc'] = 'If `recaptcha` is set as a hook, this can be a JSON object that will be set to the JS RecaptchaOptions variable, which configures options for reCaptcha.'; +$_lang['prop_formit.recaptchaheight_desc'] = 'If `recaptcha` is set as a hook, this will select the height for the reCaptcha widget.'; +$_lang['prop_formit.recaptchatheme_desc'] = 'If `recaptcha` is set as a hook, this will select a theme for the reCaptcha widget.'; +$_lang['prop_formit.recaptchawidth_desc'] = 'If `recaptcha` is set as a hook, this will set the width for the reCaptcha widget.'; +$_lang['prop_formit.spamemailfields_desc'] = 'If `spam` is set as a hook, a comma-separated list of fields containing emails to check spam against.'; +$_lang['prop_formit.spamcheckip_desc'] = 'If `spam` is set as a hook, and this is true, will check the IP as well.'; +$_lang['prop_formit.emailbcc_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to as a BCC. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailbccname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailBCC` property.'; +$_lang['prop_formit.emailcc_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to as a CC. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailccname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailCC` property.'; +$_lang['prop_formit.emailto_desc'] = 'If `email` is set as a hook, then this specifies the email(s) to send the email to. Can be a comma-separated list of email addresses.'; +$_lang['prop_formit.emailtoname_desc'] = 'Optional. If `email` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailTo` property.'; +$_lang['prop_formit.emailfrom_desc'] = 'Optional. If `email` is set as a hook, and this is set, will specify the From: address for the email. If not set, will first look for an `email` form field. If none is found, will default to the `emailsender` system setting.'; +$_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.'; +$_lang['prop_formit.emailconvertnewlines_desc'] = 'If true and emailHtml is set to 1, will convert newlines to BR tags in the email.'; +$_lang['prop_formit.emailmultiseparator_desc'] = 'The default separator for collections of items sent through checkboxes/multi-selects. Defaults to a newline.'; +$_lang['prop_formit.emailmultiwrapper_desc'] = 'Will wrap each item in a collection of fields sent via checkboxes/multi-selects. Defaults to just the value.'; + +$_lang['prop_fiar.fiartpl_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies auto-response template to send as the email.'; +$_lang['prop_fiar.fiartofield_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies which form field shall be used for the To: address in the auto-response email.'; +$_lang['prop_fiar.fiarbcc_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies the email(s) to send the email to as a BCC. Can be a comma-separated list of email addresses.'; +$_lang['prop_fiar.fiarbccname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailBCC` property.'; +$_lang['prop_fiar.fiarcc_desc'] = 'If `FormItAutoResponder` is set as a hook, then this specifies the email(s) to send the email to as a CC. Can be a comma-separated list of email addresses.'; +$_lang['prop_fiar.fiarccname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, then this must be a parallel list of comma-separated names for the email addresses specified in the `emailCC` property.'; +$_lang['prop_fiar.fiarfrom_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the From: address for the email. If not set, will first look for an `email` form field. If none is found, will default to the `emailsender` system setting.'; +$_lang['prop_fiar.fiarfromname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the From: name for the email.'; +$_lang['prop_fiar.fiarreplyto_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the Reply-To: address for the email.'; +$_lang['prop_fiar.fiarreplytoname_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, and this is set, will specify the Reply-To: name for the email.'; +$_lang['prop_fiar.fiarsubject_desc'] = 'If `FormItAutoResponder` is set as a hook, this is required as a subject line for the email.'; +$_lang['prop_fiar.fiarhtml_desc'] = 'Optional. If `FormItAutoResponder` is set as a hook, this toggles HTML emails or not. Defaults to true.'; + +$_lang['prop_fir.placeholderprefix_desc'] = 'The prefix to use with placeholders from the form data.'; +$_lang['prop_fir.redirecttoonnotfound_desc'] = 'If the data is not found, if this is set, redirect to the Resource with this ID.'; +$_lang['prop_fir.eraseonload_desc'] = 'If true, will erase the stored form data on load. Strongly recommended to leave to false unless you only want the data to load once.'; +$_lang['prop_fir.storelocation_desc'] = 'If `store` is set to true, this specifies the cache location of the data from the form submission. Defaults to MODX cache.'; + +$_lang['prop_math.mathminrange_desc'] = 'If `math` is set as a hook, the minimum range for each number in the equation.'; +$_lang['prop_math.mathmaxrange_desc'] = 'If `math` is set as a hook, the maximum range for each number in the equation.'; +$_lang['prop_math.mathfield_desc'] = 'If `math` is set as a hook, the name of the input field for the answer.'; +$_lang['prop_math.mathop1field_desc'] = 'If `math` is set as a hook, the name of the field for the 1st number in the equation.'; +$_lang['prop_math.mathop2field_desc'] = 'If `math` is set as a hook, the name of the field for the 2nd number in the equation.'; +$_lang['prop_math.mathoperatorfield_desc'] = 'If `math` is set as a hook, the name of the field for the operator in the equation.'; + +$_lang['prop_fico.allgrouptext_desc'] = 'Optional. If set and &prioritized is in use, will be the text label for the all other countries option group.'; +$_lang['prop_fico.optgrouptpl_desc'] = 'Optional. If set and &prioritized is in use, will be the chunk tpl to use for the option group markup.'; +$_lang['prop_fico.limited_desc'] = 'Optional. A comma-separated list of ISO codes for selected countries the full list will be limited to.'; +$_lang['prop_fico.prioritized_desc'] = 'Optional. A comma-separated list of ISO codes for countries that will move them into a prioritized "Frequent Visitors" group at the top of the dropdown. This can be used for your commonly-selected countries.'; +$_lang['prop_fico.prioritizedgrouptext_desc'] = 'Optional. If set and &prioritized is in use, will be the text label for the prioritized option group.'; +$_lang['prop_fico.selected_desc'] = 'The country value to select.'; +$_lang['prop_fico.selectedattribute_desc'] = 'Optional. The HTML attribute to add to a selected country.'; +$_lang['prop_fico.toplaceholder_desc'] = 'Optional. Use this to set the output to a placeholder instead of outputting directly.'; +$_lang['prop_fico.tpl_desc'] = 'Optional. The chunk to use for each country dropdown option.'; +$_lang['prop_fico.useisocode_desc'] = 'If 1, will use the ISO country code for the value. If 0, will use the country name.'; +$_lang['prop_fico.country_desc'] = 'Optional. Set to use a different countries file when loading a list of countries.'; + +$_lang['prop_fiso.country_desc'] = 'Optional. Set to use a different states file when loading a list of states.'; +$_lang['prop_fiso.selected_desc'] = 'The country value to select.'; +$_lang['prop_fiso.selectedattribute_desc'] = 'Optional. The HTML attribute to add to a selected country.'; +$_lang['prop_fiso.toplaceholder_desc'] = 'Optional. Use this to set the output to a placeholder instead of outputting directly.'; +$_lang['prop_fiso.tpl_desc'] = 'Optional. The chunk to use for each country dropdown option.'; +$_lang['prop_fiso.useabbr_desc'] = 'If 1, will use the state abbreviation for the value. If 0, will use the full state name.'; + +$_lang['formit.opt_blackglass'] = 'Black Glass'; +$_lang['formit.opt_clean'] = 'Clean'; +$_lang['formit.opt_red'] = 'Red'; +$_lang['formit.opt_white'] = 'White'; +$_lang['formit.opt_cache'] = 'MODX Cache'; +$_lang['formit.opt_session'] = 'Session'; +$_lang['prop_formit.savetmpfiles_desc'] = 'If set to 1, FormIt will store submitted files in a temporary folder.'; +$_lang['prop_formit.attachfiles_desc'] = 'If true, FormIt will add all file fields as attachments in the email.'; diff --git a/core/components/formit/lexicon/sv/recaptcha.inc.php b/core/components/formit/lexicon/sv/recaptcha.inc.php new file mode 100644 index 00000000..8b253907 --- /dev/null +++ b/core/components/formit/lexicon/sv/recaptcha.inc.php @@ -0,0 +1,14 @@ + + */ + +$_lang['recaptcha.empty_answer'] = 'Incorrect captcha words. Please check your answer and try again.'; +$_lang['recaptcha.incorrect'] = 'The reCAPTCHA wasn\'t entered correctly. Go back and try it again. [[+error]]'; +$_lang['recaptcha.mailhide_no_mcrypt'] = 'To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.'; +$_lang['recaptcha.mailhide_no_api_key'] = 'To use reCAPTCHA Mailhide, you have to sign up for a public and private key, you can do so at http://www.google.com/recaptcha'; +$_lang['recaptcha.no_api_key'] = 'To use reCAPTCHA you must get an API key from http://www.google.com/recaptcha'; +$_lang['recaptcha.no_remote_ip'] = 'For security reasons, you must pass the remote ip to reCAPTCHA'; diff --git a/core/components/formit/lexicon/uk/default.inc.php b/core/components/formit/lexicon/uk/default.inc.php new file mode 100644 index 00000000..916fa18b --- /dev/null +++ b/core/components/formit/lexicon/uk/default.inc.php @@ -0,0 +1,112 @@ + + */ + +$_lang['formit'] = 'FormIt'; +$_lang['formit.desc'] = 'Подивитися всі відправлені форми'; + +$_lang['area_formit'] = 'FormIt'; +$_lang['area_formit_recaptcha'] = 'FormIt reCAPTCHA'; + +$_lang['formit.form'] = 'Форма'; +$_lang['formit.forms'] = 'Форми'; +$_lang['formit.forms_desc'] = 'Подивитися всі відправлені форми'; +$_lang['formit.form_view'] = 'Подивитися форму'; +$_lang['formit.form_remove'] = 'Видалити форму'; +$_lang['formit.form_remove_confirm'] = 'Ви впевнені, що хочете видалити цю форму?'; +$_lang['formit.forms_remove'] = 'Видалити форми'; +$_lang['formit.forms_remove_confirm'] = 'Ви впевнені, що хочете видалити всі форми?'; +$_lang['formit.forms_clean'] = 'Очистити форми'; +$_lang['formit.forms_clean_confirm'] = 'Ви впевнені, що хочете очистити всі старі форми?'; +$_lang['formit.forms_export'] = 'Експорт форм'; +$_lang['formit.form_encrypt'] = 'Зашифрувати форму(и)'; +$_lang['formit.form_encrypt_confirm'] = 'Ви впевнені, що хочете зашифрувати форму(и)?'; +$_lang['formit.form_decrypt'] = 'Скасувати шифрування форм(и)'; +$_lang['formit.form_decrypt_confirm'] = 'Ви впевнені, що хочете скасувати шифрування форм(и)?'; +$_lang['formit.view_ip'] = 'Подивитися всі форми з цього IP'; + +$_lang['formit.encryption'] = 'Зашифрована форма'; +$_lang['formit.encryptions'] = 'Зашифровані форми'; +$_lang['formit.encryptions_desc'] = 'Подивитися всі зашифровані і не зашифровані форми.'; + +$_lang['formit.label_form_name'] = 'Назва'; +$_lang['formit.label_form_name_desc'] = 'Назва форми.'; +$_lang['formit.label_form_values'] = 'Значення'; +$_lang['formit.label_form_values_desc'] = 'Значення форми.'; +$_lang['formit.label_form_ip'] = 'IP адреса'; +$_lang['formit.label_form_ip_desc'] = 'IP адреса відвідувачів, які відправляли форми.'; +$_lang['formit.label_form_date'] = 'Дата'; +$_lang['formit.label_form_date_desc'] = 'Дата відправлення форми'; +$_lang['formit.label_form_encrypted'] = 'Зашифрована'; +$_lang['formit.label_form_encrypted_desc'] = ''; +$_lang['formit.label_form_decrypted'] = 'Не зашифрована'; +$_lang['formit.label_form_decrypted_desc'] = ''; +$_lang['formit.label_form_total'] = 'Всього'; +$_lang['formit.label_form_total_desc'] = ''; + +$_lang['formit.label_clean_label'] = 'Видалити форми старше'; +$_lang['formit.label_clean_desc'] = 'днів'; + +$_lang['formit.label_export_form'] = 'Форма'; +$_lang['formit.label_export_form_desc'] = 'Виберіть форми, які необхідно експортувати.'; +$_lang['formit.label_export_start_date'] = 'Дата від'; +$_lang['formit.label_export_start_date_desc'] = 'Виберіть дату, з якої будуть експортуватися форми.'; +$_lang['formit.label_export_end_date'] = 'Дата до'; +$_lang['formit.label_export_end_date_desc'] = 'Виберіть дату, до якої будуть експортуватися форми.'; +$_lang['formit.label_export_delimiter'] = 'CSV роздільник'; +$_lang['formit.label_export_delimiter_desc'] = 'Роздільник для стовпців в CSV. За замовчуванням ";".'; + +$_lang['formit.filter_form'] = 'Виберіть форму'; +$_lang['formit.filter_start_date'] = 'Виберіть початкову дату'; +$_lang['formit.filter_end_date'] = 'Виберіть кінцеву дату'; +$_lang['formit.encryption_unavailable'] = 'PHP OpenSSL функції openssl_encrypt і openssl_decrypt недоступні. Будь ласка, встановіть PHP OpenSSL на ваш сервер. Дивіться https://www.php.net/manual/en/openssl.requirements.php для більш детальної інформації.'; +$_lang['formit.encryption_unavailable_warning'] = 'Увага: PHP OpenSSL функції openssl_encrypt і openssl_decrypt недоступні. Це означає, що ви не можете використовувати шифрування в ваших формах. Будь ласка, встановіть PHP OpenSSL на ваш сервер. Відвідайте https://www.php.net/manual/en/openssl.requirements.php для більш детальної інформації.'; +$_lang['formit.forms_clean_desc'] = 'Європейський Загальний регламент про захист даних (GDPR) вимагає, щоб особисті дані, які більше не використовуються, були видалені. Цей інструмент дозволяє видалити ці форми старше зазначених нижче днів. Цю дію не можна скасувати!'; +$_lang['formit.forms_clean_executing'] = 'Очищення форм'; +$_lang['formit.forms_clean_success'] = 'Видалено форм: [[+amount]].'; +$_lang['formit.export_failed'] = 'Не вдалось експортувати форми, будь ласка, спробуйте ще раз.'; +$_lang['formit.export_dir_failed'] = 'Сталася помилка під час експорту форми, не вдалося створити папку експорту.'; + +$_lang['formit.contains'] = 'Поле має містити фразу "[[+value]]".'; +$_lang['formit.email_invalid'] = 'Будь ласка, введіть правильну адресу електронної пошти.'; +$_lang['formit.email_invalid_domain'] = 'Ваша електронна адреса не має дійсного доменного імені.'; +$_lang['formit.email_no_recipient'] = 'Будь ласка, вкажіть одержувача або одержувачів електронної пошти.'; +$_lang['formit.email_not_sent'] = 'Сталася помилка під час спроби відправити пошту.'; +$_lang['formit.email_tpl_nf'] = 'Будь ласка, вкажіть шаблон листа.'; +$_lang['formit.field_not_empty'] = 'Це поле повинно бути порожнім.'; +$_lang['formit.field_required'] = 'Це поле є обов\'язковим для заповнення.'; +$_lang['formit.math_incorrect'] = 'Неправильна відповідь!'; +$_lang['formit.math_field_nf'] = '[[+field]] поле введення не вказано в формі.'; +$_lang['formit.max_length'] = 'Це поле не може містити більше [[+length]] символ(а/ів).'; +$_lang['formit.max_value'] = 'Це поле не може бути більше [[+value]].'; +$_lang['formit.min_length'] = 'Це поле має містити не меньше [[+length]] символ(а/ів).'; +$_lang['formit.min_value'] = 'Це поле не може бути менше [[+value]].'; +$_lang['formit.not_date'] = 'Це поле повинно бути дійсною датою.'; +$_lang['formit.not_lowercase'] = 'Всі символи в цьому полі повинні бути в нижньому регістрі.'; +$_lang['formit.not_number'] = 'Це поле повинно бути дійсним числом.'; +$_lang['formit.not_uppercase'] = 'Всі символи в цьому полі повинні бути в верхньому регістрі'; +$_lang['formit.password_dont_match'] = 'Паролі не співпадають.'; +$_lang['formit.password_not_confirmed'] = 'Будь ласка, підтвердіть свій пароль.'; +$_lang['formit.prioritized_group_text'] = 'Постійні відвідувачі'; +$_lang['formit.range_invalid'] = 'Невірний діапазон.'; +$_lang['formit.range'] = 'Ваше значення має бути між [[+min]] і [[+max]].'; +$_lang['formit.recaptcha_err_load'] = 'Неможливо завантажити клас reCAPTCHA.'; +$_lang['formit.spam_blocked'] = 'Ваше повідомлення було заблоковано спам фільтром: '; +$_lang['formit.spam_marked'] = ' - позначено як спам.'; +$_lang['formit.username_taken'] = 'Ім\'я користувача вже зайнято. Будь ласка, виберіть інше.'; +$_lang['formit.not_regexp'] = 'Ваше значення не збігається з очікуваним форматом.'; +$_lang['formit.all_group_text'] = 'Усі країни'; +$_lang['formit.storeAttachment_mediasource_error'] = 'Джерело медіа (Media Source) не знайдено! ID джерела: '; +$_lang['formit.storeAttachment_access_error'] = 'Папка недоступна для завантаження! Перевірте права на папку: '; + +$_lang['formit.migrate'] = 'Перенесення даних з зашифрованих форм'; +$_lang['formit.migrate_desc'] = 'Оновлення до FormIt 3.0 також оновить метод шифрування, який використовується для шифрування відправлених даних форм. FormIt 2.x використовує mcrypt для шифрування і дешифрування, а в 3.0 використовує методи openssl. Для правильної роботи вже зашифровані форми необхідно перенести з mcrypt в openssl.'; +$_lang['formit.migrate_alert'] = 'FormIt успішно оновлений, але відправлені вами зашифровані форми необхідно перенести. Натисніть сюди, щоб почати передачу.'; +$_lang['formit.migrate_status'] = 'Статус'; +$_lang['formit.migrate_running'] = 'В цей час виконується процес перенесення даних у фоновому режимі. Будь ласка, тримайте цю сторінку відкритою в вашому браузері. НЕ ЗАКРИВАЙТЕ ЦЮ СТОРІНКУ!'; +$_lang['formit.migrate_success'] = 'Перенесення завершено'; +$_lang['formit.migrate_success_msg'] = 'Всі ваші зашифровані форми були успішно перенесені.'; diff --git a/core/components/formit/lexicon/uk/properties.inc.php b/core/components/formit/lexicon/uk/properties.inc.php new file mode 100644 index 00000000..4051bdae --- /dev/null +++ b/core/components/formit/lexicon/uk/properties.inc.php @@ -0,0 +1,103 @@ + + */ + +$_lang['prop_formit.hooks_desc'] = 'Розділений комами список хуків які будуть виконуватися по черзі після того, як форма пройде перевірку. Якщо якийсь із хуків поверне false, то наступні хуки не будуть виконані. Хук також може бути ім\'ям сніпету, цей сніпет буде виконаний як хук.'; +$_lang['prop_formit.prehooks_desc'] = 'Розділений комами список хуків які будуть виконуватися по черзі після того, як форма буде завантажена. Якщо якийсь із хуків поверне false, то наступні хуки не будуть виконані. Наприклад: можна попередньо встановлювати значення полів форми за допомогою $scriptProperties[`hook`]->fields[`fieldname`]. Хук також може бути ім\'ям сніпету, цей сніпет буде виконаний як хук.'; +$_lang['prop_formit.submitvar_desc'] = 'Якщо встановлено значення, то обробка форми не почнеться поки POST параметр з цим ім\'ям не буде переданий.'; +$_lang['prop_formit.validate_desc'] = 'Розділений комами список полів для перевірки, для кожного поля пишеться ім\'я:валідатор (тобто: username:required, email:required). Валідатори можуть бути об\'єднані через двокрапку, наприклад email:email:required. Цей параметр може бути заданий на декількох рядках.'; +$_lang['prop_formit.errtpl_desc'] = 'Шаблон повідомлення про помилку.'; +$_lang['prop_formit.validationerrormessage_desc'] = 'Загальне повідомлення про помилку для установки в якості плейсхолдера в разі якщо валідація не пройшла. Може містити [[+errors]], якщо ви хочете показати список усіх помилок.'; +$_lang['prop_formit.validationerrorbulktpl_desc'] = 'HTML шаблон (tpl), який використовується для кожної окремої помилки в загальному значенні повідомлення про помилку при валідації.'; +$_lang['prop_formit.customvalidators_desc'] = 'Розділений комами список імен користувальницьких валідаторів (сніпетів), які ви плануєте використовувати в цій формі. Призначені для користувача валідатори повинні бути обов\'язково вказані в цьому параметрі, інакше вони не будуть працювати.'; +$_lang['prop_formit.trimvaluesdeforevalidation_desc'] = 'Чи обрізати пробіли від початку і кінця значення до початку валідації. За замовчуванням true.'; +$_lang['prop_formit.clearfieldsonsuccess_desc'] = 'Якщо значення true, очистить поля при успішному надсиланні форми без редиректу.'; +$_lang['prop_formit.successmessage_desc'] = 'Значення плейсхолдера для повідомлення про успіх. Ім\'я плейсхолдера встановлюється в параметрі &successMessagePlaceholder, за замовчуванням «fi.successMessage».'; +$_lang['prop_formit.successmessageplaceholder_desc'] = 'Плейсхолдер для повідомлення про успіх.'; +$_lang['prop_formit.store_desc'] = 'Якщо встановлено true, дані передані через форму будуть зберігатись в кеші, для подальшого їх використання за допомогою сніпету FormItRetriever.'; +$_lang['prop_formit.storetime_desc'] = 'Якщо для `store` задано значення true, то цей параметр вказує час (в секундах) для зберігання даних із надісланої форми. За замовчуванням п\'ять хвилин.'; +$_lang['prop_formit.storelocation_desc'] = 'Якщо для `store` задано значення true, то цей параметр вказує місце розташування кешу даних з форм. За замовчуванням використовується кеш MODX.'; +$_lang['prop_formit.allowfiles_desc'] = 'Якщо встановлено значення 0, файли не будуть відправлені в форму.'; +$_lang['prop_formit.placeholderprefix_desc'] = 'Префікс для всіх плейсхолдерів, втановлених FormIt для полів. За замовчуванням `fi.`'; +$_lang['prop_formit.redirectto_desc'] = 'Хук `redirect`. У цьому параметрі треба вказати ідентифікатор ресурсу на який буде відбуватися редирект після успішного відправлення форми.'; +$_lang['prop_formit.redirectparams_desc'] = 'JSON-масив параметрів для передачі в хук `redirect`, який буде передаватися при редиректі.'; +$_lang['prop_formit.recaptchajs_desc'] = 'Хук `recaptcha`. JSON об\'єкт який містить в собі настройки для віджета reCAPTCHA.'; +$_lang['prop_formit.recaptchaheight_desc'] = 'Хук `recaptcha`. Висота віджета reCAPTCHA.'; +$_lang['prop_formit.recaptchatheme_desc'] = 'Хук `recaptcha`. Тема оформлення для віджета reCAPTCHA.'; +$_lang['prop_formit.recaptchawidth_desc'] = 'Хук `recaptcha`. Ширина віджета reCAPTCHA.'; +$_lang['prop_formit.spamemailfields_desc'] = 'Хук `spam`. Розділений комами список полів форми, які містять адреси електронної пошти для перевірки на причетність до спаму.'; +$_lang['prop_formit.spamcheckip_desc'] = 'Хук `spam`. Якщо цей параметр встановлений в true, то буде перевірятися IP-адреса відправника форми на причетність до спаму.'; +$_lang['prop_formit.emailbcc_desc'] = 'Хук `email`. Розділений комами список адрес електронної пошти на які треба послати приховану копію листа (BCC).'; +$_lang['prop_formit.emailbccname_desc'] = 'Хук `email`. Необов\'язковий параметр. Розділений комами список імен власників адрес електронної пошти зазначених в пункті `emailBCC`.'; +$_lang['prop_formit.emailcc_desc'] = 'Хук `email`. Розділений комами список адрес електронної пошти на які треба надіслати копію листа.'; +$_lang['prop_formit.emailccname_desc'] = 'Хук `email`. Необов\'язковий параметр. Розділений комами список імен власників адрес електронної пошти зазначених в пункті `emailCC`.'; +$_lang['prop_formit.emailto_desc'] = 'Хук `email`. Розділений комами список адрес електронної пошти на які треба надіслати листа.'; +$_lang['prop_formit.emailtoname_desc'] = 'Хук `email`. Необов\'язковий параметр. Розділений комами список імен власників адрес електронної пошти зазначених в пункті `emailTo`.'; +$_lang['prop_formit.emailfrom_desc'] = 'Хук `email`. Необов\'язковий параметр. Якщо цей параметр встановлений, то він буде визначати адресу електронної пошти відправника листа. Якщо не встановлено, то спочатку адреса електронної пошти буде шукатися в даних форми в полі з ім\'ям `email`, якщо це поле не буде знайдено, то буде використовуватися адреса електронної пошти з системної настройки `emailsender`.'; +$_lang['prop_formit.emailfromname_desc'] = 'Хук `email`. Необов\'язковий параметр. Ім\'я відправника листа.'; +$_lang['prop_formit.emailreplyto_desc'] = 'Хук `email`. Необов\'язковий параметр. Адреса електронної пошти для відповіді на лист.'; +$_lang['prop_formit.emailreplytoname_desc'] = 'Хук `email`. Необов\'язковий параметр. Ім\'я власника адреси електронної пошти який використовується для відповіді на лист.'; +$_lang['prop_formit.emailreturnpath_desc'] = 'Необов\'язковий параметр. Якщо `email` встановлений як хук і цей параметр включений, то буде вказано Return-path: адреса для електронної пошти. Якщо не увімкнено, то буде приймати значення властивості `emailFrom`.'; +$_lang['prop_formit.emailsubject_desc'] = 'Хук `email`. У цьому параметрі можна вказати тему електронного листа.'; +$_lang['prop_formit.emailusefieldforsubject_desc'] = 'Якщо поле `subject` використовується в формі і цей параметр встановлений в true, то вміст цього поля буде використовуватися як тема електронного листа.'; +$_lang['prop_formit.emailhtml_desc'] = 'Хук `email`. Необов\'язковий параметр. Цей параметр включає використання HTML розмітки в електронному листі. За замовчуванням включено.'; +$_lang['prop_formit.emailconvertnewlines_desc'] = 'Якщо true та emailHtml встановлений в 1, то в листі перенесення рядка буде конвертовано в тег BR.'; +$_lang['prop_formit.emailmultiseparator_desc'] = 'Роздільник за замовчуванням для списку значень, що відправляються через поля типу checkboxes/multi-selects. За замовчуванням використовується перенос рядка.'; +$_lang['prop_formit.emailmultiwrapper_desc'] = 'Оберне кожне значення в списку полів відправлених з полів типу checkboxes/multi-selects. За замовчуванням передаються тільки значення, без обгортки.'; + +$_lang['prop_fiar.fiartpl_desc'] = 'Хук `FormItAutoResponder`. Обов\'язковий параметр. Ім\'я чанка який буде використовуватися як шаблон листа для автоматичної відповіді.'; +$_lang['prop_fiar.fiartofield_desc'] = 'Хук `FormItAutoResponder`. Поле форми яке буде використано як адресу на яку треба відправити автоматичну відповідь.'; +$_lang['prop_fiar.fiarbcc_desc'] = 'Хук `FormItAutoResponder`. Розділений комами список адрес електронної пошти на які треба надіслати приховану копію листа (BCC).'; +$_lang['prop_fiar.fiarbccname_desc'] = 'Хук `FormItAutoResponder`. Необов\'язковий параметр. Розділений комами список імен власників адрес електронної пошти зазначених в параметрі `emailBCC`.'; +$_lang['prop_fiar.fiarcc_desc'] = 'Хук `FormItAutoResponder`. Розділений комами список адрес електронної пошти на які треба надіслати копію листа.'; +$_lang['prop_fiar.fiarccname_desc'] = 'Хук `FormItAutoResponder`. Необов\'язковий параметр. Розділений комами список імен власників адрес електронної пошти зазначених в пункті `emailCC`.'; +$_lang['prop_fiar.fiarfrom_desc'] = 'Хук `FormItAutoResponder`. Необов\'язковий параметр. Якщо цей параметр встановлений, то він буде визначати адресу електронної пошти відправника листа. Якщо не встановлено, то спочатку адреса електронної пошти буде шукатися в даних форми в полі з ім\'ям `email`, якщо це поле не буде знайдено, то буде використовуватися адреса електронної пошти з системного налаштування `emailsender`.'; +$_lang['prop_fiar.fiarfromname_desc'] = 'Хук `FormItAutoResponder`. Необов\'язковий параметр. Ім\'я відправника листа.'; +$_lang['prop_fiar.fiarreplyto_desc'] = 'Хук `FormItAutoResponder`. Необов\'язковий параметр. Адреса електронної пошти для відповіді на лист.'; +$_lang['prop_fiar.fiarreplytoname_desc'] = 'Хук `FormItAutoResponder`. Необов\'язковий параметр. Ім\'я власника адреси електронної пошти яке використовується для відповіді на лист.'; +$_lang['prop_fiar.fiarsubject_desc'] = 'Хук `FormItAutoResponder`. Тема листа.'; +$_lang['prop_fiar.fiarhtml_desc'] = 'Хук `FormItAutoResponder`. Необов\'язковий параметр. Вмикає або вимикає використання HTML розмітки в електронному листі. За замовчуванням включено.'; + +$_lang['prop_fir.placeholderprefix_desc'] = 'Префікс який використовується плейсхолдерами, що виводять збережені дані форми.'; +$_lang['prop_fir.redirecttoonnotfound_desc'] = 'Ідентифікатор ресурсу на який відбудеться редирект, якщо дані не знайдені.'; +$_lang['prop_fir.eraseonload_desc'] = 'Якщо включено, збережені дані форми будуть стиратися при першому завантаженні. Настійно рекомендується залишити цей параметр вимкненим. Увімкніть його якщо ви хочете щоб дані завантажувалися тільки один раз.'; +$_lang['prop_fir.storelocation_desc'] = 'Якщо для `store` задано значення true, то це вказує місце розташування кешу даних з форм. За замовчуванням використовується кеш MODX.'; + +$_lang['prop_math.mathminrange_desc'] = 'Хук `math`. Мінімальний діапазон для кожного числа в рівнянні.'; +$_lang['prop_math.mathmaxrange_desc'] = 'Хук `math`. Максимальний діапазон для кожного числа в рівнянні.'; +$_lang['prop_math.mathfield_desc'] = 'Хук `math`. Ім\'я поля введення для відповіді.'; +$_lang['prop_math.mathop1field_desc'] = 'Хук `math`. Ім\'я поля для першого числа в рівнянні.'; +$_lang['prop_math.mathop2field_desc'] = 'Хук `math`. Ім\'я поля для другого числа в рівнянні.'; +$_lang['prop_math.mathoperatorfield_desc'] = 'Хук `math`. Ім\'я поля для оператора в рівнянні.'; + +$_lang['prop_fico.allgrouptext_desc'] = 'Необов\'язковий параметр. Якщо встановлено і використовується &prioritized, то буде використовуватися мітка (label) для всіх інших країн в групах опцій.'; +$_lang['prop_fico.optgrouptpl_desc'] = 'Необов\'язковий параметр. Якщо встановлено і використовується &prioritized, то це буде чанк tpl для розмітки групи опцій.'; +$_lang['prop_fico.limited_desc'] = 'Необов\'язковий параметр. Розділений комами список кодів ISO для обраних країн, повний список яких буде обмежений.'; +$_lang['prop_fico.prioritized_desc'] = 'Необов\'язковий параметр. Розділений комами список кодів ISO для країн, які будуть переміщувати їх в пріоритетну групу «Частих відвідувачів» у верхній частині випадаючого списку. Це можна використовувати для країн, які часто вибирають.'; +$_lang['prop_fico.prioritizedgrouptext_desc'] = 'Необов\'язковий параметр. Якщо встановлено і використовується &prioritized, то використовується текстова мітка для групи параметрів з пріоритетом.'; +$_lang['prop_fico.selected_desc'] = 'Значення країни для вибору.'; +$_lang['prop_fico.selectedattribute_desc'] = 'Необов\'язковий параметр. Атрибут HTML для додавання до обраної країні.'; +$_lang['prop_fico.toplaceholder_desc'] = 'Необов\'язковий параметр. Використовуйте цей параметр, щоб виводити через плейсхолдер замість безпосереднього виведення на екран.'; +$_lang['prop_fico.tpl_desc'] = 'Необов\'язковий параметр. Чанк для виведення кожної країни в випадаючому списку.'; +$_lang['prop_fico.useisocode_desc'] = 'Якщо 1, буде використовувати код країни ISO для значення. Якщо 0, буде використовувати назву країни.'; +$_lang['prop_fico.country_desc'] = 'Необов\'язковий параметр. Встановіть для використання альтернативного файлу зі списком країн для завантаження в значення поля.'; + +$_lang['prop_fiso.country_desc'] = 'Необов\'язковий параметр. Встановіть для використання альтернативного файлу зі списком штатів для завантаження в значення поля.'; +$_lang['prop_fiso.selected_desc'] = 'Значення країни для вибору.'; +$_lang['prop_fiso.selectedattribute_desc'] = 'Необов\'язковий параметр. Атрибут HTML для додавання до обраної країни.'; +$_lang['prop_fiso.toplaceholder_desc'] = 'Необов\'язковий параметр. Використовуйте цей параметр, щоб виводити через плейсхолдер замість безпосереднього виведення на екран.'; +$_lang['prop_fiso.tpl_desc'] = 'Необов\'язковий параметр. Чанк для виведення кожної країни в випадаючому списку.'; +$_lang['prop_fiso.useabbr_desc'] = 'Якщо 1, буде використовуватися абревіатура штату для значення. Якщо 0, буде використовуватися повна назва штату.'; + +$_lang['formit.opt_blackglass'] = 'Black Glass'; +$_lang['formit.opt_clean'] = 'Clean'; +$_lang['formit.opt_red'] = 'Red'; +$_lang['formit.opt_white'] = 'White'; +$_lang['formit.opt_cache'] = 'MODX Cache'; +$_lang['formit.opt_session'] = 'Сесія'; +$_lang['prop_formit.savetmpfiles_desc'] = 'Якщо встановлено значення 1, FormIt буде зберігати відправлені файли в тимчасовій папці.'; +$_lang['prop_formit.attachfiles_desc'] = 'Якщо true, FormIt додасть всі поля файлу як вкладення в електронний лист.'; diff --git a/core/components/formit/lexicon/uk/recaptcha.inc.php b/core/components/formit/lexicon/uk/recaptcha.inc.php new file mode 100644 index 00000000..9cc4a51a --- /dev/null +++ b/core/components/formit/lexicon/uk/recaptcha.inc.php @@ -0,0 +1,14 @@ + + */ + +$_lang['recaptcha.empty_answer'] = 'Слова введені неправильно. Будь ласка, перевірте вашу відповідь і спробуйте ще раз.'; +$_lang['recaptcha.incorrect'] = 'Слова з картинки введені неправильно. Будь ласка, спробуйте ще раз. [[+error]]'; +$_lang['recaptcha.mailhide_no_mcrypt'] = 'Для використання reCAPTCHA Mailhide у вас повинен бути встановлений PHP модуль mcrypt.'; +$_lang['recaptcha.mailhide_no_api_key'] = 'Для використання reCAPTCHA Mailhide, вам треба отримати публічний і приватний ключі, це можна зробити на https://www.google.com/recaptcha'; +$_lang['recaptcha.no_api_key'] = 'Для використання reCAPTCHA вам треба отримати API ключ на https://www.google.com/recaptcha'; +$_lang['recaptcha.no_remote_ip'] = 'З міркувань безпеки, ви повинні передати віддалений IP в reCAPTCHA'; diff --git a/core/components/formit/model/formit/fidictionary.class.php b/core/components/formit/model/formit/fidictionary.class.php index 9f284753..89d0b86c 100644 --- a/core/components/formit/model/formit/fidictionary.class.php +++ b/core/components/formit/model/formit/fidictionary.class.php @@ -19,141 +19,12 @@ * * @package formit */ + +require_once dirname(dirname(__DIR__)) . '/src/FormIt/Dictionary.php'; + /** * Abstracts storage of values of posted fields and fields set by hooks. * * @package formit */ -class fiDictionary { - /** - * A reference to the modX instance - * @var modX $modx - */ - public $modx; - /** - * A reference to the FormIt instance - * @var FormIt $formit - */ - public $formit; - /** - * A configuration array - * @var array $config - */ - public $config = array(); - /** - * An array of key->name pairs storing the fields passed - * @var array $fields - */ - public $fields = array(); - - /** - * @param FormIt $formit - * @param array $config - */ - function __construct(FormIt &$formit,array $config = array()) { - $this->modx =& $formit->modx; - $this->formit =& $formit; - $this->config = array_merge($this->config,$config); - } - - /** - * Get the fields from POST - * - * @param array $fields A default set of fields to load - * @return void - */ - public function gather(array $fields = array()) { - if (empty($fields)) $fields = array(); - $this->fields = array_merge($fields,$_POST); - if (!empty($_FILES)) { $this->fields = array_merge($this->fields,$_FILES); } - } - - /** - * Set a value - * @param string $field - * @param mixed $value - * @return void - */ - public function set($field,$value) { - $this->fields[$field] = $value; - } - - /** - * Get a field value - * @param string $field - * @return mixed - */ - public function get($field) { - return $this->fields[$field]; - } - - /** - * Return all field values in an array of key->name pairs - * @return array - */ - public function toArray() { - return $this->fields; - } - - /** - * Set a variable number of fields by passing in a key->name pair array - * @param array $array - * @return void - */ - public function fromArray(array $array) { - foreach ($array as $k => $v) { - $this->fields[$k] = $v; - } - } - - /** - * Remove a field from the stack - * @param string $key - * @return void - */ - public function remove($key) { - unset($this->fields[$key]); - } - - /** - * Stash the fields into the cache - * - * @return void - */ - public function store() { - /* default to store data for 5 minutes */ - $storeTime = $this->modx->getOption('storeTime',$this->config,300); - /* create the hash to store */ - $cacheKey = $this->formit->getStoreKey(); - $data = $this->toArray(); - $this->modx->cacheManager->set($cacheKey,$data,$storeTime); - unset($data); - } - - /** - * Retrieve the fields from the cache - * - * @return mixed - */ - public function retrieve() { - $cacheKey = $this->formit->getStoreKey(); - return $this->modx->cacheManager->get($cacheKey); - } - - /** - * Erase the stored fields - * - * @return boolean - */ - public function erase() { - $cacheKey = $this->formit->getStoreKey(); - return $this->modx->cacheManager->delete($cacheKey); - } - - /** - * @return void - */ - public function reset() { - $this->fields = array(); - } -} \ No newline at end of file +class fiDictionary extends Sterc\FormIt\Dictionary {} diff --git a/core/components/formit/model/formit/fihooks.class.php b/core/components/formit/model/formit/fihooks.class.php index b9a80342..8add86a2 100644 --- a/core/components/formit/model/formit/fihooks.class.php +++ b/core/components/formit/model/formit/fihooks.class.php @@ -19,6 +19,9 @@ * * @package formit */ + +require_once dirname(dirname(__DIR__)) . '/src/FormIt/Hook.php'; + /** * Base Hooks handling class. Hooks can be used to run scripts prior to loading the form, or after a form has been * submitted. @@ -29,663 +32,4 @@ * * @package formit */ -class fiHooks { - /** - * A collection of all the processed errors so far. - * @var array $errors - * @access public - */ - public $errors = array(); - /** - * A collection of all the processed hooks so far. - * @var array $hooks - * @access public - */ - public $hooks = array(); - /** - * A reference to the modX instance. - * @var modX $modx - * @access public - */ - public $modx = null; - /** - * A reference to the FormIt instance. - * @var FormIt $formit - * @access public - */ - public $formit = null; - /** - * If a hook redirects, it needs to set this var to use proper order of execution on redirects/stores - * @var string - * @access public - */ - public $redirectUrl = null; - - /** - * The current stored and parsed fields for the FormIt call. - * @var array $fields - */ - public $fields = array(); - - /** - * The type of Hook request that this represents - * @var string $type - */ - public $type; - - /** - * The constructor for the fiHooks class - * - * @param FormIt &$formit A reference to the FormIt class instance. - * @param array $config Optional. An array of configuration parameters. - * @param string $type The type of hooks this service class is loading - * @return fiHooks - */ - function __construct(FormIt &$formit,array $config = array(),$type = '') { - $this->formit =& $formit; - $this->modx =& $formit->modx; - $this->config = array_merge(array( - 'placeholderPrefix' => 'fi.', - 'errTpl' => '[[+error]]', - - 'mathField' => 'math', - 'mathOp1Field' => 'op1', - 'mathOp2Field' => 'op2', - 'mathOperatorField' => 'operator', - ),$config); - $this->type = $type; - } - - /** - * Loads an array of hooks. If one fails, will not proceed. - * - * @access public - * @param array $hooks The hooks to run. - * @param array $fields The fields and values of the form - * @param array $customProperties An array of extra properties to send to the hook - * @return array An array of field name => value pairs. - */ - public function loadMultiple($hooks,array $fields = array(),array $customProperties = array()) { - if (empty($hooks)) return array(); - if (is_string($hooks)) $hooks = explode(',',$hooks); - - $this->hooks = array(); - $this->fields =& $fields; - foreach ($hooks as $hook) { - $hook = trim($hook); - $success = $this->load($hook,$this->fields,$customProperties); - if (!$success) return $this->hooks; - /* dont proceed if hook fails */ - } - return $this->hooks; - } - - /** - * Load a hook. Stores any errors for the hook to $this->errors. - * - * @access public - * @param string $hookName The name of the hook. May be a Snippet name. - * @param array $fields The fields and values of the form. - * @param array $customProperties Any other custom properties to load into a custom hook. - * @return boolean True if hook was successful. - */ - public function load($hookName,array $fields = array(),array $customProperties = array()) { - $success = false; - if (!empty($fields)) $this->fields =& $fields; - $this->hooks[] = $hookName; - - $reserved = array('load','_process','__construct','getErrorMessage'); - if (method_exists($this,$hookName) && !in_array($hookName,$reserved)) { - /* built-in hooks */ - $success = $this->$hookName($this->fields); - - /** @var modSnippet $snippet */ - } else if ($snippet = $this->modx->getObject('modSnippet',array('name' => $hookName))) { - /* custom snippet hook */ - $properties = array_merge($this->formit->config,$customProperties); - $properties['formit'] =& $this->formit; - $properties['hook'] =& $this; - $properties['fields'] = $this->fields; - $properties['errors'] =& $this->errors; - $success = $snippet->process($properties); - } else { - /* search for a file-based hook */ - $this->modx->parser->processElementTags('',$hookName,true,true); - if (file_exists($hookName)) { - $success = $this->_loadFileBasedHook($hookName,$customProperties); - } else { - /* no hook found */ - $this->modx->log(modX::LOG_LEVEL_ERROR,'[FormIt] Could not find hook "'.$hookName.'".'); - $success = true; - } - } - - if (is_array($success) && !empty($success)) { - $this->errors = array_merge($this->errors,$success); - $success = false; - } else if ($success != true) { - if (!isset($this->errors[$hookName])) $this->errors[$hookName] = ''; - $this->errors[$hookName] .= ' '.$success; - $success = false; - } - return $success; - } - - /** - * Attempt to load a file-based hook given a name - * @param string $path The absolute path of the hook file - * @param array $customProperties An array of custom properties to run with the hook - * @return boolean True if the hook succeeded - */ - private function _loadFileBasedHook($path,array $customProperties = array()) { - $scriptProperties = array_merge($this->formit->config,$customProperties); - $formit =& $this->formit; - $hook =& $this; - $fields = $this->fields; - $errors =& $this->errors; - $modx =& $this->modx; - $success = false; - try { - $success = include $path; - } catch (Exception $e) { - $this->modx->log(modX::LOG_LEVEL_ERROR,'[FormIt] '.$e->getMessage()); - } - return $success; - } - - /** - * Gets the error messages compiled into a single string. - * - * @access public - * @param string $delim The delimiter between each message. - * @return string The concatenated error message - */ - public function getErrorMessage($delim = "\n") { - return implode($delim,$this->errors); - } - - /** - * Adds an error to the stack. - * - * @access private - * @param string $key The field to add the error to. - * @param string $value The error message. - * @return string The added error message with the error wrapper. - */ - public function addError($key,$value) { - if (!isset($this->errors[$key])) $this->errors[$key] = ''; - $this->errors[$key] .= $value; - return $this->errors[$key]; - } - - /** - * See if there are any errors in the stack. - * - * @return boolean - */ - public function hasErrors() { - return !empty($this->errors); - } - - /** - * Get all errors for this current request - * - * @return array - */ - public function getErrors() { - return $this->errors; - } - - /** - * Sets the value of a field. - * - * @param string $key The field name to set. - * @param mixed $value The value to set to the field. - * @return mixed The set value. - */ - public function setValue($key,$value) { - $this->fields[$key] = $value; - return $this->fields[$key]; - } - - /** - * Sets an associative array of field name and values. - * - * @param array $values A key/name pair of fields and values to set. - */ - public function setValues(array $values = array()) { - foreach ($values as $key => $value) { - $this->setValue($key,$value); - } - } - - /** - * Gets the value of a field. - * - * @param string $key The field name to get. - * @return mixed The value of the key, or null if non-existent. - */ - public function getValue($key) { - if (array_key_exists($key,$this->fields)) { - return $this->fields[$key]; - } - return null; - } - - /** - * Gets an associative array of field name and values. - * - * @return array $values A key/name pair of fields and values. - */ - public function getValues() { - return $this->fields; - } - - /** - * Redirect to a specified URL. - * - * Properties needed: - * - redirectTo - the ID of the Resource to redirect to. - * - * @param array $fields An array of cleaned POST fields - * @return boolean False if unsuccessful. - */ - public function redirect(array $fields = array()) { - if (empty($this->formit->config['redirectTo'])) return false; - $redirectParams = !empty($this->formit->config['redirectParams']) ? $this->formit->config['redirectParams'] : ''; - if (!empty($redirectParams)) { - $prefix = $this->modx->getOption('placeholderPrefix',$this->formit->config,'fi.'); - $this->modx->setPlaceholders($fields,$prefix); - $this->modx->parser->processElementTags('',$redirectParams,true,true); - $redirectParams = $this->modx->fromJSON($redirectParams); - if (empty($redirectParams)) $redirectParams = ''; - } - $contextKey = $this->modx->context->get('key'); - $resource = $this->modx->getObject('modResource',$this->formit->config['redirectTo']); - if ($resource) { - $contextKey = $resource->get('context_key'); - } - $url = $this->modx->makeUrl($this->formit->config['redirectTo'],$contextKey,$redirectParams,'full'); - $this->setRedirectUrl($url); - return true; - } - - /** - * Send an email of the form. - * - * Properties: - * - emailTpl - The chunk name of the chunk that will be the email template. - * This will send the values of the form as placeholders. - * - emailTo - A comma separated list of email addresses to send to - * - 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. - * - emailFromName - The name of the From: user. - * - emailSubject - The subject of the email. - * - emailHtml - Boolean, if true, email will be in HTML mode. - * - * @access public - * @param array $fields An array of cleaned POST fields - * @return boolean True if email was successfully sent. - */ - public function email(array $fields = array()) { - $tpl = $this->modx->getOption('emailTpl',$this->formit->config,''); - $emailHtml = (boolean)$this->modx->getOption('emailHtml',$this->formit->config,true); - $emailConvertNewlines = (boolean)$this->modx->getOption('emailConvertNewlines',$this->formit->config,false); - - /* get from name */ - $emailFrom = $this->modx->getOption('emailFrom',$this->formit->config,''); - if (empty($emailFrom)) { - $emailFrom = !empty($fields['email']) ? $fields['email'] : $this->modx->getOption('emailsender'); - } - $emailFrom = $this->_process($emailFrom,$fields); - $emailFromName = $this->modx->getOption('emailFromName',$this->formit->config,$emailFrom); - $emailFromName = $this->_process($emailFromName,$fields); - - /* get subject */ - $useEmailFieldForSubject = $this->modx->getOption('emailUseFieldForSubject',$this->formit->config,true); - if (!empty($fields['subject']) && $useEmailFieldForSubject) { - $subject = $fields['subject']; - } else { - $subject = $this->modx->getOption('emailSubject',$this->formit->config,''); - } - $subject = $this->_process($subject,$fields); - - /* check email to */ - $emailTo = $this->modx->getOption('emailTo',$this->formit->config,''); - $emailToName = $this->modx->getOption('emailToName',$this->formit->config,$emailTo); - if (empty($emailTo)) { - $this->errors['emailTo'] = $this->modx->lexicon('formit.email_no_recipient'); - $this->modx->log(modX::LOG_LEVEL_ERROR,'[FormIt] '.$this->modx->lexicon('formit.email_no_recipient')); - return false; - } - - /* compile message */ - $origFields = $fields; - if (empty($tpl)) { - $tpl = 'email'; - $f = ''; - $multiSeparator = $this->modx->getOption('emailMultiSeparator',$this->formit->config,"\n"); - $multiWrapper = $this->modx->getOption('emailMultiWrapper',$this->formit->config,"[[+value]]"); - - foreach ($fields as $k => $v) { - if ($k == 'nospam') continue; - if (is_array($v) && !empty($v['name']) && isset($v['error']) && $v['error'] == UPLOAD_ERR_OK) { - $v = $v['name']; - $f[$k] = ''.$k.': '.$v.'
    '; - } else if (is_array($v)) { - $vOpts = array(); - foreach ($v as $vKey => $vValue) { - if (is_string($vKey) && !empty($vKey)) { - $vKey = $k.'.'.$vKey; - $f[$vKey] = ''.$vKey.': '.$vValue.'
    '; - } else { - $vOpts[] = str_replace('[[+value]]',$vValue,$multiWrapper); - } - } - $newValue = implode($multiSeparator,$vOpts); - if (!empty($vOpts)) { - $f[$k] = ''.$k.':'.$newValue; - } - } else { - $f[$k] = ''.$k.': '.$v.'
    '; - } - } - $fields['fields'] = implode("\n",$f); - } else { - /* handle file/checkboxes in email tpl */ - $multiSeparator = $this->modx->getOption('emailMultiSeparator',$this->formit->config,"\n"); - if (empty($multiSeparator)) $multiSeparator = "\n"; - if ($multiSeparator == '\n') $multiSeparator = "\n"; /* allow for inputted newlines */ - $multiWrapper = $this->modx->getOption('emailMultiWrapper',$this->formit->config,"[[+value]]"); - if (empty($multiWrapper)) $multiWrapper = '[[+value]]'; - - foreach ($fields as $k => &$v) { - if (is_array($v) && !empty($v['name']) && isset($v['error']) && $v['error'] == UPLOAD_ERR_OK) { - $v = $v['name']; - } else if (is_array($v)) { - $vOpts = array(); - foreach ($v as $vKey => $vValue) { - if (is_string($vKey) && !empty($vKey)) { - $vKey = $k.'.'.$vKey; - $fields[$vKey] = $vValue; - unset($fields[$k]); - } else { - $vOpts[] = str_replace('[[+value]]',$vValue,$multiWrapper); - } - } - $v = implode($multiSeparator,$vOpts); - } - } - } - $message = $this->formit->getChunk($tpl,$fields); - $message = $this->_process($message,$this->config); - - /* load mail service */ - $this->modx->getService('mail', 'mail.modPHPMailer'); - - /* set HTML */ - $this->modx->mail->setHTML($emailHtml); - - /* set email main properties */ - $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_SUBJECT, $subject); - - - /* handle file fields */ - 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; - } - $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); - $numAddresses = count($emailTo); - for ($i=0;$i<$numAddresses;$i++) { - $etn = !empty($emailToName[$i]) ? $emailToName[$i] : ''; - if (!empty($etn)) $etn = $this->_process($etn,$fields); - $emailTo[$i] = $this->_process($emailTo[$i],$fields); - if (!empty($emailTo[$i])) { - $this->modx->mail->address('to',$emailTo[$i],$etn); - } - } - - /* reply to */ - $emailReplyTo = $this->modx->getOption('emailReplyTo',$this->formit->config,$emailFrom); - $emailReplyTo = $this->_process($emailReplyTo,$fields); - $emailReplyToName = $this->modx->getOption('emailReplyToName',$this->formit->config,$emailFromName); - $emailReplyToName = $this->_process($emailReplyToName,$fields); - if (!empty($emailReplyTo)) { - $this->modx->mail->address('reply-to',$emailReplyTo,$emailReplyToName); - } - - /* cc */ - $emailCC = $this->modx->getOption('emailCC',$this->formit->config,''); - if (!empty($emailCC)) { - $emailCCName = $this->modx->getOption('emailCCName',$this->formit->config,''); - $emailCC = explode(',',$emailCC); - $emailCCName = explode(',',$emailCCName); - $numAddresses = count($emailCC); - for ($i=0;$i<$numAddresses;$i++) { - $etn = !empty($emailCCName[$i]) ? $emailCCName[$i] : ''; - if (!empty($etn)) $etn = $this->_process($etn,$fields); - $emailCC[$i] = $this->_process($emailCC[$i],$fields); - if (!empty($emailCC[$i])) { - $this->modx->mail->address('cc',$emailCC[$i],$etn); - } - } - } - - /* bcc */ - $emailBCC = $this->modx->getOption('emailBCC',$this->formit->config,''); - if (!empty($emailBCC)) { - $emailBCCName = $this->modx->getOption('emailBCCName',$this->formit->config,''); - $emailBCC = explode(',',$emailBCC); - $emailBCCName = explode(',',$emailBCCName); - $numAddresses = count($emailBCC); - for ($i=0;$i<$numAddresses;$i++) { - $etn = !empty($emailBCCName[$i]) ? $emailBCCName[$i] : ''; - if (!empty($etn)) $etn = $this->_process($etn,$fields); - $emailBCC[$i] = $this->_process($emailBCC[$i],$fields); - if (!empty($emailBCC[$i])) { - $this->modx->mail->address('bcc',$emailBCC[$i],$etn); - } - } - } - - /* send email */ - if (!$this->formit->inTestMode) { - $sent = $this->modx->mail->send(); - } else { - $sent = true; - } - $this->modx->mail->reset(array( - modMail::MAIL_CHARSET => $this->modx->getOption('mail_charset',null,'UTF-8'), - modMail::MAIL_ENCODING => $this->modx->getOption('mail_encoding',null,'8bit'), - )); - - if (!$sent) { - $this->errors[] = $this->modx->lexicon('formit.email_not_sent').' '.print_r($this->modx->mail->mailer->ErrorInfo,true); - $this->modx->log(modX::LOG_LEVEL_ERROR,'[FormIt] '.$this->modx->lexicon('formit.email_not_sent').' '.print_r($this->modx->mail->mailer->ErrorInfo,true)); - } - - return $sent; - } - - /** - * Processes string and sets placeholders - * - * @param string $str The string to process - * @param array $placeholders An array of placeholders to replace with values - * @return string The parsed string - */ - public function _process($str,array $placeholders = array()) { - if (is_string($str)) { - foreach ($placeholders as $k => $v) { - if (is_scalar($k) && is_scalar($v)) { - $str = str_replace('[[+'.$k.']]',$v,$str); - } - } - } - $this->modx->parser->processElementTags('',$str,true,false); - return $str; - } - - /** - * Ensure the a field passes a spam filter. - * - * Properties: - * - spamEmailFields - The email fields to check. A comma-delimited list. - * - * @access public - * @param array $fields An array of cleaned POST fields - * @return boolean True if email was successfully sent. - */ - public function spam(array $fields = array()) { - $passed = true; - $spamEmailFields = $this->modx->getOption('spamEmailFields',$this->formit->config,'email'); - $emails = explode(',',$spamEmailFields); - if ($this->modx->loadClass('stopforumspam.StopForumSpam',$this->formit->config['modelPath'],true,true)) { - $sfspam = new StopForumSpam($this->modx); - $checkIp = $this->modx->getOption('spamCheckIp',$this->formit->config,false); - $ip = $checkIp ? $_SERVER['REMOTE_ADDR'] : ''; - foreach ($emails as $email) { - $spamResult = $sfspam->check($ip,$fields[$email]); - if (!empty($spamResult)) { - $spamFields = implode($this->modx->lexicon('formit.spam_marked')."\n
    ",$spamResult); - $this->addError($email,$this->modx->lexicon('formit.spam_blocked',array( - 'fields' => $spamFields, - ))); - $passed = false; - } - } - } else { - $this->modx->log(modX::LOG_LEVEL_ERROR,'[FormIt] Couldnt load StopForumSpam class.'); - } - return $passed; - } - - /** - * Adds in reCaptcha support to FormIt - * - * @access public - * @param array $fields An array of cleaned POST fields - * @return boolean True if email was successfully sent. - */ - public function recaptcha(array $fields = array()) { - $passed = false; - /** @var FormItReCaptcha $reCaptcha */ - $reCaptcha = $this->formit->request->loadReCaptcha(); - if (empty($reCaptcha->config[FormItReCaptcha::OPT_PRIVATE_KEY])) return false; - - $response = $reCaptcha->checkAnswer($_SERVER['REMOTE_ADDR'],$_POST['recaptcha_challenge_field'],$_POST['recaptcha_response_field']); - - if (!$response->is_valid) { - $this->addError('recaptcha',$this->modx->lexicon('recaptcha.incorrect',array( - 'error' => $response->error != 'incorrect-captcha-sol' ? $response->error : '', - ))); - } else { - $passed = true; - } - return $passed; - } - - /** - * Set a URL to redirect to after all hooks run successfully. - * - * @param string $url The URL to redirect to after all hooks execute - */ - public function setRedirectUrl($url) { - $this->redirectUrl = $url; - } - - /** - * Get the specified redirection url - * - * @return null|string - */ - public function getRedirectUrl() { - return $this->redirectUrl; - } - - /** - * Math field hook for anti-spam math input field. - * - * @access public - * @param array $fields An array of cleaned POST fields - * @return boolean True if email was successfully sent. - */ - public function math(array $fields = array()) { - $mathField = $this->modx->getOption('mathField',$this->config,'math'); - if (!isset($fields[$mathField])) { $this->errors[$mathField] = $this->modx->lexicon('formit.math_field_nf',array('field' => $mathField)); return false; } - if (empty($fields[$mathField])) { $this->errors[$mathField] = $this->modx->lexicon('formit.field_required',array('field' => $mathField)); return false; } - - $op1Field = $this->modx->getOption('mathOp1Field',$this->config,'op1'); - if (empty($fields[$op1Field])) { $this->errors[$mathField] = $this->modx->lexicon('formit.math_field_nf',array('field' => $op1Field)); return false; } - $op2Field = $this->modx->getOption('mathOp2Field',$this->config,'op2'); - if (empty($fields[$op2Field])) { $this->errors[$mathField] = $this->modx->lexicon('formit.math_field_nf',array('field' => $op2Field)); return false; } - $operatorField = $this->modx->getOption('mathOperatorField',$this->config,'operator'); - if (empty($fields[$operatorField])) { $this->errors[$mathField] = $this->modx->lexicon('formit.math_field_nf',array('field' => $operatorField)); return false; } - - $answer = false; - $op1 = (int)$fields[$op1Field]; - $op2 = (int)$fields[$op2Field]; - switch ($fields[$operatorField]) { - case '+': $answer = $op1 + $op2; break; - case '-': $answer = $op1 - $op2; break; - case '*': $answer = $op1 * $op2; break; - } - $guess = (int)$fields[$mathField]; - $passed = (boolean)($guess == $answer); - if (!$passed) { - $this->addError($mathField,$this->modx->lexicon('formit.math_incorrect')); - } - return $passed; - } - - /** - * Process any errors returned by the hooks and set them to placeholders - * @return void - */ - public function processErrors() { - $errors = array(); - $placeholderErrors = $this->getErrors(); - foreach ($placeholderErrors as $key => $error) { - $errors[$key] = str_replace('[[+error]]',$error,$this->config['errTpl']); - } - $this->modx->toPlaceholders($errors,$this->config['placeholderPrefix'].'error'); - - $errorMsg = $this->getErrorMessage(); - if (!empty($errorMsg)) { - $this->modx->setPlaceholder($this->config['placeholderPrefix'].'error_message',$errorMsg); - } - } - - /** - * Gather fields and set them into placeholders for pre-fetching - * @return array - */ - public function gatherFields() { - if (empty($this->fields)) return array(); - - $fs = $this->getValues(); - /* better handling of checkbox values when input name is an array[] */ - foreach ($fs as $f => $v) { - if (is_array($v)) { $v = implode(',',$v); } - $fs[$f] = $v; - } - $this->modx->toPlaceholders($fs,$this->config['placeholderPrefix'],''); - - return $this->getValues(); - } -} \ No newline at end of file +class fiHooks extends Sterc\FormIt\Hook {} diff --git a/core/components/formit/model/formit/firequest.class.php b/core/components/formit/model/formit/firequest.class.php index 1e61d331..f4502907 100644 --- a/core/components/formit/model/formit/firequest.class.php +++ b/core/components/formit/model/formit/firequest.class.php @@ -19,363 +19,12 @@ * * @package formit */ + +require_once dirname(dirname(__DIR__)) . '/src/FormIt/Request.php'; + /** * Handles all pre and POST requests for FormIt and abstracts hooks and validation processing. * * @package formit */ -class fiRequest { - /** - * A reference to the FormIt instance - * @var FormIt $formit - */ - public $formit; - /** - * A reference to the modX instance - * @var modX $modx - */ - public $modx; - /** - * An array of configuration properties - * @var array $config - */ - public $config = array(); - /** - * Set to true if wanting to prevent the clearing of fields at the end - * @var boolean $clearFieldsAtEnd - */ - public $clearFieldsAtEnd = false; - /** - * @var fiValidator $validator - */ - public $validator; - /** - * @var fiDictionary $fiDictionary - */ - public $dictionary; - /** - * @var FormItReCaptcha $reCaptcha - */ - public $reCaptcha; - - /** - * @param FormIt &$formit A reference to the FormIt class instance. - * @param array $config Optional. An array of configuration parameters. - * @return \fiRequest - */ - function __construct(FormIt &$formit,array $config = array()) { - $this->formit =& $formit; - $this->modx =& $formit->modx; - $this->config = array_merge(array( - 'clearFieldsOnSuccess' => true, - 'hooks' => '', - 'placeholderPrefix' => 'fi.', - 'preHooks' => '', - 'store' => false, - 'submitVar' => '', - 'validate' => '', - ),$config); - } - - /** - * Handle all pre-request data, including loading of preHooks, reCaptcha preparation, and the math hook. - * @return array An array of pre-fetched fields and their data, possibly set by preHooks - */ - public function prepare() { - /* if using recaptcha, load recaptcha html */ - if ($this->hasHook('recaptcha')) { - $this->loadReCaptcha($this->config); - if (!empty($this->reCaptcha) && $this->reCaptcha instanceof FormItReCaptcha) { - $this->reCaptcha->render($this->config); - } else { - $this->modx->log(modX::LOG_LEVEL_ERROR,'[FormIt] '.$this->modx->lexicon('formit.recaptcha_err_load')); - } - } - - /* if using math hook, load default placeholders */ - if ($this->hasHook('math') && !$this->hasSubmission()) { - $mathMaxRange = $this->modx->getOption('mathMaxRange',$this->config,100); - $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); - } - } - $operators = array('+','-'); - $operator = rand(0,1); - $this->modx->setPlaceholders(array( - $this->modx->getOption('mathOp1Field',$this->config,'op1') => $op1, - $this->modx->getOption('mathOp2Field',$this->config,'op2') => $op2, - $this->modx->getOption('mathOperatorField',$this->config,'operator') => $operators[$operator], - ),$this->config['placeholderPrefix']); - } - - return $this->runPreHooks(); - } - - /** - * Load and run preHooks, setting any fields passed. - * @return array - */ - public function runPreHooks() { - $fields = array(); - $this->formit->loadHooks('pre',$this->config); - $this->formit->preHooks->loadMultiple($this->config['preHooks'],array(),array( - 'submitVar' => $this->config['submitVar'], - 'hooks' => $this->config['preHooks'], - )); - - /* if a prehook sets a field, do so here, but only if POST isnt submitted */ - if (!$this->hasSubmission()) { - $fields = $this->formit->preHooks->gatherFields(); - } - - /* if any errors in preHooks */ - if ($this->formit->preHooks->hasErrors()) { - $this->formit->preHooks->processErrors(); - } - return $fields; - } - - /** - * Check to see if a hook has been passed - * @param string $hook - * @return boolean - */ - public function hasHook($hook) { - return strpos($this->config['hooks'],$hook) !== false; - } - - /** - * Checks to see if a POST submission for this form has occurred - * @return boolean - */ - public function hasSubmission() { - $inPost = false; - if (!empty($_POST)) { - $inPost = true; - if (!empty($this->config['submitVar']) && empty($_POST[$this->config['submitVar']])) { - $inPost = false; - } - } - return $inPost; - } - - /** - * Load the reCaptcha service class - * - * @param array $config An array of configuration parameters for the reCaptcha class - * @return reCaptcha An instance of the reCaptcha class - */ - public function loadReCaptcha(array $config = array()) { - if (empty($this->reCaptcha)) { - if ($this->modx->loadClass('recaptcha.FormItReCaptcha',$this->config['modelPath'],true,true)) { - $this->reCaptcha = new FormItReCaptcha($this->formit,$config); - } else { - $this->modx->log(modX::LOG_LEVEL_ERROR,'[FormIt] '.$this->modx->lexicon('formit.recaptcha_err_load')); - return false; - } - } - return $this->reCaptcha; - } - - /** - * Handle the POST request - * - * @param array $fields - * @return string|void - */ - public function handle(array $fields = array()) { - if (!$this->hasSubmission()) return ''; - - $this->loadDictionary(); - $this->dictionary->gather($fields); - - /* validate fields */ - $this->loadValidator(); - $this->validator->reset(); - $validated = $this->validate($this->config['validate']); - - if ($validated) { - $this->postProcess(); - } - if (!$this->clearFieldsAtEnd) { - $this->setFieldsAsPlaceholders(); - } - return ''; - } - - /** - * Removes files if allowFiles is set to 0 - * @return void - */ - public function checkForFiles() { - if (!$this->modx->getOption('allowFiles',$this->config,true)) { - $fields = $this->dictionary->toArray(); - foreach ($fields as $key => $value) { - if (is_array($value) && !empty($value['tmp_name'])) { - $this->dictionary->remove($key); - } - } - } - } - - /** - * Loads the Validator class. - * - * @access public - * @return fiValidator An instance of the fiValidator class. - */ - public function loadValidator() { - if ($this->modx->loadClass('formit.fiValidator',$this->formit->config['modelPath'],true,true)) { - $this->validator = new fiValidator($this->formit,$this->config); - } else { - $this->modx->log(modX::LOG_LEVEL_ERROR,'[FormIt] Could not load Validator class.'); - } - return $this->validator; - } - - /** - * Load the dictionary storage mechanism - * @return null|fiDictionary - */ - public function loadDictionary() { - if ($this->modx->loadClass('formit.fiDictionary',$this->formit->config['modelPath'],true,true)) { - $this->dictionary = new fiDictionary($this->formit,$this->config); - } else { - $this->modx->log(modX::LOG_LEVEL_ERROR,'[FormIt] Could not load Dictionary class.'); - } - return $this->dictionary; - - } - - /** - * Validate all fields prior to post processing - * - * @param string $validationString - * @return bool - */ - public function validate($validationString) { - $success = true; - $this->validator->validateFields($this->dictionary,$validationString); - - if ($this->validator->hasErrors()) { - $success = false; - $this->validator->processErrors(); - } - return $success; - } - - /** - * Handle post-processing through postHooks - * @return bool - */ - public function postProcess() { - $success = $this->runPostHooks(); - if ($success) { - /* if store is set for FormItRetriever, store fields here */ - $store = $this->modx->getOption('store',$this->config,false); - if (!empty($store)) { - $this->dictionary->store(); - } - - /* if the redirect URL was set, redirect */ - $this->checkForRedirect(); - - /* set success placeholder */ - $this->setSuccessMessage(); - - /* if clearing fields on success, just end here */ - if ($this->modx->getOption('clearFieldsOnSuccess',$this->config,true)) { - $this->clearFieldsAtEnd = true; - } - } - - return $success; - } - - /** - * Run any postHooks that were specified. - * - * @return boolean True if all hooks executed successfully. - */ - public function runPostHooks() { - $success = true; - /* load posthooks */ - $this->formit->loadHooks('post',$this->config); - $this->formit->postHooks->loadMultiple($this->config['hooks'],$this->dictionary->toArray()); - - /* process form */ - if ($this->formit->preHooks->hasErrors() && $this->modx->getOption('preventPostHooksIfPreHooksErrors',$this->config,true)) { - /* prevent scripts from running with prehook errors */ - $success = false; - $this->formit->preHooks->processErrors(); - } elseif ($this->formit->postHooks->hasErrors()) { - $success = false; - $this->formit->postHooks->processErrors(); - } else { - /* assign new values from postHooks */ - $this->dictionary->fromArray($this->formit->postHooks->fields); - } - return $success; - } - - /** - * Check to see if the redirect URL was set; if so, redirect - * @return void - */ - public function checkForRedirect() { - $url = $this->formit->postHooks->getRedirectUrl(); - if (!empty($url) && !$this->formit->inTestMode) { - $this->modx->sendRedirect($url); - } - } - - /** - * Sets the success message placeholders - * - * @param string $message - * @return void - */ - public function setSuccessMessage($message = '') { - $successMsg = $this->modx->getOption('successMessage',$this->config,$message); - - $this->modx->setPlaceholder($this->config['placeholderPrefix'].'success',true); - if (!empty($successMsg)) { - $smPlaceholder = $this->modx->getOption('successMessagePlaceholder',$this->config,$this->config['placeholderPrefix'].'successMessage'); - $this->modx->setPlaceholder($smPlaceholder,$successMsg); - } - } - - /** - * Sets the fields to MODX placeholders - * @return void - */ - public function setFieldsAsPlaceholders() { - $fields = $this->dictionary->toArray(); - - /* better handling of checkbox values when input name is an array[] */ - $fs = array(); - /** @var mixed $v */ - foreach ($fields as $k => $v) { - if (is_array($v) && !isset($_FILES[$k])) { - foreach ($v as $sk => $sv) { - $fs[$k.'.'.$sk] = $this->convertMODXTags($sv); - } - $v = $this->modx->toJSON($v); - } - /* str_replace to prevent showing of placeholders */ - $fs[$k] = $this->convertMODXTags($v); - } - $this->modx->setPlaceholders($fs,$this->config['placeholderPrefix']); - } - - public function convertMODXTags($v) { - return str_replace(array('[[',']]'),array('[[',']]'),$v); - } -} - +class fiRequest extends Sterc\FormIt\Request {} diff --git a/core/components/formit/model/formit/fivalidator.class.php b/core/components/formit/model/formit/fivalidator.class.php old mode 100755 new mode 100644 index 1c299545..8460e2e2 --- a/core/components/formit/model/formit/fivalidator.class.php +++ b/core/components/formit/model/formit/fivalidator.class.php @@ -27,710 +27,10 @@ * * @package formit */ -class fiValidator { - /** - * @var array $errors A collection of all the processed errors so far. - * @access public - */ - public $errors = array(); - /** - * @var array $errorsRaw A collection of all the non-processed errors so far. - * @access public - */ - public $errorsRaw = array(); - /** - * @var array $fields A collection of all the validated fields so far. - * @access public - */ - public $fields = array(); - /** - * @var modX $modx A reference to the modX instance. - * @access public - */ - public $modx = null; - /** - * @var FormIt $formit A reference to the FormIt instance. - * @access public - */ - public $formit = null; - /** - * The constructor for the fiValidator class - * - * @param FormIt &$formit A reference to the FormIt class instance. - * @param array $config Optional. An array of configuration parameters. - * @return \fiValidator - */ - function __construct(FormIt &$formit,array $config = array()) { - $this->formit =& $formit; - $this->modx =& $formit->modx; - $this->config = array_merge(array( - 'placeholderPrefix' => 'fi.', - 'validationErrorBulkTpl' => '
  • [[+error]]
  • ', - 'validationErrorBulkSeparator' => "\n", - 'validationErrorMessage' => '

    A form validation error occurred. Please check the values you have entered.

    ', - 'use_multibyte' => (boolean)$this->modx->getOption('use_multibyte',null,false), - 'trimValuesBeforeValidation' => (boolean)$this->modx->getOption('trimValuesBeforeValidation',$this->formit->config,true), - 'encoding' => $this->modx->getOption('modx_charset',null,'UTF-8'), - 'customValidators' => !empty($this->formit->config['customValidators']) ? explode(',',$this->formit->config['customValidators']) : array(), - ),$config); - } +require_once dirname(dirname(__DIR__)) . '/vendor/autoload.php'; - /** - * Get an option passed in from parameters - * - * @param string $key - * @param mixed $default - * @param string $method - * @return null - */ - public function getOption($key,$default = null,$method = '!empty') { - $v = $default; +class fiValidator extends Sterc\FormIt\Validator +{ - switch ($method) { - case 'empty': - case '!empty': - if (!empty($this->config[$key])) { - $v = $this->config[$key]; - } - break; - case 'isset': - default: - if (isset($this->config[$key])) { - $v = $this->config[$key]; - } - break; - } - return $v; - } - - /** - * Validates an array of fields. Returns the field names and values, with - * the field names stripped of their validators. - * - * The key names can be in this format: - * - * name:validator=param:anotherValidator:oneMoreValidator=`param` - * - * @access public - * @param fiDictionary $dictionary - * @param string $validationFields - * @return array An array of field name => value pairs. - */ - public function validateFields(fiDictionary $dictionary,$validationFields = '') { - $keys = $dictionary->toArray(); - $this->fields = $keys; - - /* process the list of fields that will be validated */ - $validationFields = explode(',',$validationFields); - $fieldValidators = array(); - foreach ($validationFields as $idx => $v) { - $v = trim(ltrim($v),' '); /* allow multi-line definitions */ - $key = explode(':',$v); /* explode into list separated by : */ - if (!empty($key[0])) { - $field = $key[0]; - array_splice($key,0,1); /* remove the field name from validator list */ - $fieldValidators[$field] = $key; - if (!isset($this->fields[$field]) && strpos($field,'.') === false) { /* prevent someone from bypassing a required field by removing it from the form */ - $keys[$field] = !empty($this->fields[$v]) ? $this->fields[$v] : ''; - } - } - } - - /** @var string|array $v */ - foreach ($keys as $k => $v) { - /* is a array field, ie contact[name] */ - if (is_array($v) && !isset($_FILES[$k]) && is_string($k) && intval($k) == 0 && $k !== 0) { - $isCheckbox = false; - foreach ($v as $key => $val) { - if (!is_string($key)) { $isCheckbox = true; continue; } - $subKey = $k.'.'.$key; - $this->_validate($subKey,$val,$fieldValidators); - } - if ($isCheckbox) { - $this->_validate($k,$v,$fieldValidators); - } - } else { - $this->_validate($k,$v,$fieldValidators); - } - } - /* remove fields that have . in name */ - foreach ($this->fields as $field => $v) { - if (strpos($field,'.') !== false || strpos($field,':')) { - unset($this->fields[$field]); - } - } - - /* add fields back into dictionary */ - foreach ($this->fields as $k => $v) { - $dictionary->set($k,$v); - } - - return $this->fields; - } - - /** - * Helper method for validating fields - * @param string $k - * @param string $v - * @param array $fieldValidators - * @return void - */ - private function _validate($k,$v,array $fieldValidators = array()) { - $key = explode(':',$k); - - $stripTags = strpos($k,'allowTags') === false; - if (isset($fieldValidators[$k])) { - foreach ($fieldValidators[$k] as $fv) { - if (strpos($fv,'allowTags') !== false) { - $stripTags = false; - } - } - } - - /* strip tags by default */ - if ($stripTags && !is_array($v)) { - $v = strip_tags($v); - } - - /* handle checkboxes/radios with empty hiddens before that are field[] names */ - if (is_array($v) && !isset($_FILES[$key[0]]) && empty($v[0])) array_splice($v,0,1); - - /* loop through validators and execute the old way, for backwards compatibility */ - $validators = count($key); - if ($validators > 1) { - $this->fields[$key[0]] = $v; - for ($i=1;$i<$validators;$i++) { - $this->validate($key[0],$v,$key[$i]); - } - } else { - $this->fields[$k] = $v; - } - - /* do new way of validation, which is more secure */ - if (!empty($fieldValidators[$k])) { - foreach ($fieldValidators[$k] as $validator) { - $this->validate($k,$v,$validator); - } - } - } - - /** - * Validates a field based on a custom rule, if specified - * - * @access public - * @param string $key The key of the field - * @param mixed $value The value of the field - * @param string $type Optional. The type of the validator to apply. Can - * either be a method name of fiValidator or a Snippet name. - * @return boolean True if validation was successful. If not, will store - * error messages to $this->errors. - */ - public function validate($key,$value,$type = '') { - /** @var boolean|array $validated */ - $validated = false; - - /** @var mixed $value Trim spaces from the value before validating **/ - if (!empty($this->config['trim_values_before_validation'])) { - $value = trim($value); - } - - /** @var boolean $hasParams */ - $hasParams = $this->config['use_multibyte'] ? mb_strpos($type,'=',0,$this->config['encoding']) : strpos($type,'='); - /** @var string|null $param The parameter value, if one is set */ - $param = null; - if ($hasParams !== false) { - $len = $this->config['use_multibyte'] ? mb_strlen($type,$this->config['encoding']) : strlen($type); - $s = $this->config['use_multibyte'] ? mb_substr($type,$hasParams+1,$len,$this->config['encoding']) : substr($type,$hasParams+1,$len); - $param = str_replace(array('`','^'),'',$s); - $type = $this->config['use_multibyte'] ? mb_substr($type,0,$hasParams,$this->config['encoding']) : substr($type,0,$hasParams); - } - - /** @var array $invNames An array of invalid hook names to skip */ - $invNames = array('validate','validateFields','addError','__construct'); - $customValidators = !empty($this->config['customValidators']) ? $this->config['customValidators'] : ''; - $customValidators = explode(',',$customValidators); - if (method_exists($this,$type) && !in_array($type,$invNames)) { - /* built-in validator */ - $validated = $this->$type($key,$value,$param); - - /* only allow specified validators to prevent brute force execution of unwanted snippets */ - } else if (in_array($type,$customValidators)) { - /* attempt to grab custom validator */ - /** @var modSnippet|null $snippet */ - $snippet = $this->modx->getObject('modSnippet',array('name' => $type)); - if ($snippet) { - /* custom snippet validator */ - $props = array_merge($this->formit->config,array( - 'key' => $key, - 'value' => $value, - 'param' => $param, - 'type' => $type, - 'validator' => &$this, - 'errors' => &$this->errors, - )); - $validated = $snippet->process($props); - } else { - /* no validator found */ - $this->modx->log(modX::LOG_LEVEL_ERROR,'[FormIt] Could not find validator "'.$type.'" for field "'.$key.'".'); - $validated = true; - } - } else { - $this->modx->log(modX::LOG_LEVEL_INFO,'[FormIt] Validator "'.$type.'" for field "'.$key.'" was not specified in the customValidators property.'); - $validated = true; - } - - /** handle return value errors */ - if (!empty($validated)) { - if (is_array($validated)) { - foreach ($validated as $key => $errMsg) { - $this->addError($key,$errMsg); - } - $validated = false; - } elseif ($validated !== '1' && $validated !== 1 && $validated !== true) { - $this->addError($key,$validated); - $validated = false; - } - } - - return $validated; - } - - /** - * Adds an error to the stack. - * - * @access private - * @param string $key The field to add the error to. - * @param string $value The error message. - * @return string The added error message with the error wrapper. - */ - public function addError($key,$value) { - $errTpl = $this->modx->getOption('errTpl',$this->formit->config,'[[+error]]'); - $this->errorsRaw[$key] = $value; - if (!isset($this->errors[$key])) { - $this->errors[$key] = ''; - } - $this->errors[$key] .= ' '.str_replace('[[+error]]',$value,$errTpl); - return $this->errors[$key]; - } - - /** - * Check to see if there are any validator errors in the stack - * - * @return boolean - */ - public function hasErrors() { - return !empty($this->errors); - } - - /** - * Get all errors in the stack - * - * @return array - */ - public function getErrors() { - return $this->errors; - } - - /** - * Get all raw errors in the stack (errors without the wrapper) - * @return array - */ - public function getRawErrors() { - return $this->errorsRaw; - } - - /** - * Checks to see if field is required. - * @param string $key The name of the field - * @param string $value The value of the field - * @return boolean - */ - public function required($key,$value) { - $success = false; - 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; - } - return $success ? true : $this->_getErrorMessage($key,'vTextRequired','formit.field_required',array( - 'field' => $key, - 'value' => is_array($value) ? implode(',',$value) : $value, - )); - } - - /** - * Checks to see if field is blank. - * @param string $key The name of the field - * @param string $value The value of the field - * @return boolean - */ - public function blank($key,$value) { - return empty($value) ? true : $this->_getErrorMessage($key,'vTextBlank','formit.field_not_empty',array( - 'field' => $key, - 'value' => $value, - )); - } - - /** - * Checks to see if passwords match. - * @param string $key The name of the field - * @param string $value The value of the field - * @param string $param The parameter passed into the validator that contains the field to check the password against - * @return boolean - */ - public function password_confirm($key,$value,$param = 'password_confirm') { - if (empty($value) || $this->fields[$param] != $value) { - return $this->_getErrorMessage($key,'vTextPasswordConfirm','formit.password_dont_match',array( - 'field' => $key, - 'password' => $value, - 'password_confirm' => $this->fields[$param], - )); - } - return true; - } - - /** - * Checks to see if field value is an actual email address. - * @param string $key The name of the field - * @param string $value The value of the field - * @return boolean - */ - public function email($key,$value) { - /* allow empty emails, :required should be used to prevent blank field */ - if (empty($value)) return true; - - /* validate length and @ */ - $pattern = "^[^@]{1,64}\@[^\@]{1,255}$"; - $condition = $this->config['use_multibyte'] ? @mb_ereg($pattern,$value) : @ereg($pattern, $value); - if (!$condition) { - return $this->_getErrorMessage($key,'vTextEmailInvalid','formit.email_invalid',array( - 'field' => $key, - 'value' => $value, - )); - } - - $email_array = explode("@", $value); - $local_array = explode(".", $email_array[0]); - for ($i = 0; $i < sizeof($local_array); $i++) { - $pattern = "^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$"; - $condition = $this->config['use_multibyte'] ? @mb_ereg($pattern,$local_array[$i]) : @ereg($pattern,$local_array[$i]); - if (!$condition) { - return $this->_getErrorMessage($key,'vTextEmailInvalid','formit.email_invalid',array( - 'field' => $key, - 'value' => $value, - )); - } - } - /* validate domain */ - $pattern = "^\[?[0-9\.]+\]?$"; - $condition = $this->config['use_multibyte'] ? @mb_ereg($pattern, $email_array[1]) : @ereg($pattern, $email_array[1]); - if (!$condition) { - $domain_array = explode(".", $email_array[1]); - if (sizeof($domain_array) < 2) { - return $this->_getErrorMessage($key,'vTextEmailInvalidDomain','formit.email_invalid_domain',array( - 'field' => $key, - 'value' => $value, - )); - } - for ($i = 0; $i < sizeof($domain_array); $i++) { - $pattern = "^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$"; - $condition = $this->config['use_multibyte'] ? @mb_ereg($pattern,$domain_array[$i]) : @ereg($pattern,$domain_array[$i]); - if (!$condition) { - return $this->_getErrorMessage($key,'vTextEmailInvalidDomain','formit.email_invalid_domain',array( - 'field' => $key, - 'value' => $value, - )); - } - } - } - return true; - } - - /** - * Checks to see if field value is shorter than $param. - * @param string $key The name of the field - * @param string $value The value of the field - * @param int $param The minimum length the field can be - * @return boolean - */ - public function minLength($key,$value,$param = 0) { - $v = $this->config['use_multibyte'] ? mb_strlen($value,$this->config['encoding']) : strlen($value); - if ($v < $param) { - return $this->_getErrorMessage($key,'vTextMinLength','formit.min_length',array( - 'length' => $param, - 'field' => $key, - 'value' => $value, - )); - } - return true; - } - - /** - * Checks to see if field value is longer than $param. - * @param string $key The name of the field - * @param string $value The value of the field - * @param int $param The maximum length the field can be - * @return boolean - */ - public function maxLength($key,$value,$param = 999) { - $v = $this->config['use_multibyte'] ? mb_strlen($value,$this->config['encoding']) : strlen($value); - if ($v > $param) { - return $this->_getErrorMessage($key,'vTextMaxLength','formit.max_length',array( - 'length' => $param, - 'field' => $key, - 'value' => $value, - )); - } - return true; - } - - /** - * Checks to see if field value is less than $param. - * @param string $key The name of the field - * @param string $value The value of the field - * @param int $param The minimum value the field can be - * @return boolean - */ - public function minValue($key,$value,$param = 0) { - if ((float)$value < (float)$param) { - return $this->_getErrorMessage($key,'vTextMinValue','formit.min_value',array( - 'field' => $key, - 'passedValue' => $value, - 'value' => $param, - )); - } - return true; - } - - /** - * Checks to see if field value is greater than $param. - * @param string $key The name of the field - * @param string $value The value of the field - * @param int $param The maximum value the field can be - * @return boolean - */ - public function maxValue($key,$value,$param = 0) { - if ((float)$value > (float)$param) { - return $this->_getErrorMessage($key,'vTextMaxValue','formit.max_value',array( - 'field' => $key, - 'passedValue' => $value, - 'value' => $param, - )); - } - return true; - } - - /** - * See if field contains a certain value. - * @param string $key The name of the field - * @param string $value The value of the field - * @param string $expr The regular expression to check against the field - * @return boolean - */ - public function contains($key,$value,$expr = '') { - if (!preg_match('/'.$expr.'/i',$value)) { - return $this->_getErrorMessage($key,'vTextContains','formit.contains',array( - 'field' => $key, - 'passedValue' => $value, - 'value' => $expr, - )); - } - return true; - } - - /** - * Strip a string from the value. - * @param string $key The name of the field - * @param string $value The value of the field - * @param string $param The value to strip from the field - * @return boolean - */ - public function strip($key,$value,$param = '') { - $this->fields[$key] = str_replace($param,'',$value); - } - - /** - * Strip all tags in the field. The parameter can be a string of allowed - * tags. - * @param string $key The name of the field - * @param string $value The value of the field - * @param string $allowedTags A comma-separated list of tags to allow in the field's value - * @return boolean - */ - public function stripTags($key,$value,$allowedTags = '') { - $this->fields[$key] = strip_tags($value,$allowedTags); - return true; - } - - /** - * Strip all tags in the field. The parameter can be a string of allowed - * tags. - * @param string $key The name of the field - * @param string $value The value of the field - * @param string $allowedTags A comma-separated list of tags to allow in the field's value. Leave blank to allow all. - * @return boolean - */ - public function allowTags($key,$value,$allowedTags = '') { - if (empty($allowedTags)) return true; - $this->fields[$key] = strip_tags($value,$allowedTags); - return true; - } - - /** - * Validates value between a range, specified by min-max. - * @param string $key The name of the field - * @param string $value The value of the field - * @param string $ranges The range the value should reside in - * @return boolean - */ - public function range($key,$value,$ranges = '0-1') { - $range = explode('-',$ranges); - if (count($range) < 2) return $this->modx->lexicon('formit.range_invalid'); - - if ($value < $range[0] || $value > $range[1]) { - return $this->_getErrorMessage($key,'vTextRange','formit.range',array( - 'min' => $range[0], - 'max' => $range[1], - 'field' => $key, - 'value' => $value, - 'ranges' => $ranges, - )); - } - return true; - } - - /** - * Checks to see if the field is a number. - * @param string $key The name of the field - * @param string $value The value of the field - * @return boolean - */ - public function isNumber($key,$value) { - if (!empty($value) && !is_numeric(trim($value))) { - return $this->_getErrorMessage($key,'vTextIsNumber','formit.not_number',array( - 'field' => $key, - 'value' => $value, - )); - } - return true; - } - - /** - * Checks to see if the field is a valid date. Allows for date formatting as - * well. - * @param string $key The name of the field - * @param string $value The value of the field - * @param string $format The format of the date - * @return boolean - */ - public function isDate($key,$value,$format = '%m/%d/%Y') { - $ts = false; - if (!empty($value)) { - $ts = strtotime($value); - } - if ($ts === false || empty($value)) { - return $this->_getErrorMessage($key,'vTextIsDate','formit.not_date',array( - 'format' => $format, - 'field' => $key, - 'value' => $value, - )); - } - if (!empty($format)) { - $this->fields[$key] = strftime($format,$ts); - } - return true; - } - - /** - * Checks to see if a string is all lowercase - * @param string $key The name of the field - * @param string $value The value of the field - * @return boolean - */ - public function islowercase($key,$value) { - $v = $this->config['use_multibyte'] ? mb_strtolower($value,$this->config['encoding']) : strtolower($value); - return strcmp($v,$value) == 0 ? true : $this->_getErrorMessage($key,'vTextIsLowerCase','formit.not_lowercase',array( - 'field' => $key, - 'value' => $value, - )); - } - - /** - * Checks to see if a string is all uppercase - * @param string $key The name of the field - * @param string $value The value of the field - * @return boolean - */ - public function isuppercase($key,$value) { - $v = $this->config['use_multibyte'] ? mb_strtoupper($value,$this->config['encoding']) : strtoupper($value); - return strcmp($v,$value) == 0 ? true : $this->_getErrorMessage($key,'vTextIsUpperCase','formit.not_lowercase',array( - 'field' => $key, - 'value' => $value, - )); - } - - /** - * @param string $key The name of the field - * @param string $value The value of the field - * @param string $expression The regexp to use - * @return boolean - */ - public function regexp($key,$value,$expression) { - preg_match($expression,$value,$matches); - return !empty($matches) && !empty($matches[0]) == true ? true : $this->_getErrorMessage($key,'vTextRegexp','formit.not_regexp',array( - 'field' => $key, - 'value' => $value, - 'regexp' => $expression, - )); - } - - /** - * Check for a custom error message, otherwise use a lexicon entry. - * @param string $field - * @param string $parameter - * @param string $lexiconKey - * @param array $properties - * @return null|string - */ - public function _getErrorMessage($field,$parameter,$lexiconKey,array $properties = array()) { - if (!empty($this->formit->config[$field.'.'.$parameter])) { - $message = $this->formit->config[$field.'.'.$parameter]; - $this->modx->lexicon->set($lexiconKey,$message); - $this->modx->lexicon($lexiconKey,$properties); - } else if (!empty($this->formit->config[$parameter])) { - $message = $this->formit->config[$parameter]; - $this->modx->lexicon->set($lexiconKey,$message); - $this->modx->lexicon($lexiconKey,$properties); - } else { - $message = $this->modx->lexicon($lexiconKey,$properties); - } - return $message; - } - - /** - * Process the errors that have occurred and setup the appropriate placeholders - * @return void - */ - public function processErrors() { - $this->modx->toPlaceholders($this->getErrors(),$this->config['placeholderPrefix'].'error'); - $bulkErrTpl = $this->getOption('validationErrorBulkTpl'); - $errs = array(); - foreach ($this->getRawErrors() as $field => $err) { - $errs[] = str_replace(array('[[+field]]','[[+error]]'),array($field,$err),$bulkErrTpl); - } - $errs = implode($this->getOption('validationErrorBulkSeparator'),$errs); - $validationErrorMessage = str_replace('[[+errors]]',$errs,$this->getOption('validationErrorMessage')); - $this->modx->setPlaceholder($this->getOption('placeholderPrefix').'validation_error',true); - $this->modx->setPlaceholder($this->getOption('placeholderPrefix').'validation_error_message',$validationErrorMessage); - } - - /** - * Resets the validator - * @return void - */ - public function reset() { - $this->errors = array(); - $this->errorsRaw = array(); - } } diff --git a/core/components/formit/model/formit/formit.class.php b/core/components/formit/model/formit/formit.class.php index ff255acd..1e8806b7 100644 --- a/core/components/formit/model/formit/formit.class.php +++ b/core/components/formit/model/formit/formit.class.php @@ -19,305 +19,10 @@ * * @package formit */ -/** - * Base class for FormIt. Used for initializing the form processing engine, handling templating and running snippets. - * - * @package formit - */ -class FormIt { - /** - * A reference to the modX instance - * @var modX $modx - */ - public $modx; - /** - * A configuration array - * @var array $config - */ - public $config; - /** - * In debug mode, will monitor execution time. - * @var int $debugTimer - * @access public - */ - public $debugTimer = 0; - /** - * True if the class has been initialized or not. - * @var boolean $_initialized - */ - private $_initialized = false; - /** - * The fiHooks instance for processing preHooks - * @var fiHooks $preHooks - */ - public $preHooks; - /** - * The fiHooks instance for processing postHooks - * @var fiHooks $postHooks - */ - public $postHooks; - /** - * The request handling class - * @var fiRequest $request - */ - public $request; - /** - * An array of cached chunk tpls for processing - * @var array $chunks - */ - public $chunks; - /** - * Used when running unit tests to prevent emails/headers from being sent - * @var boolean $inTestMode - */ - public $inTestMode = false; - - /** - * FormIt constructor - * - * @param modX &$modx A reference to the modX instance. - * @param array $config An array of configuration options. Optional. - */ - function __construct(modX &$modx,array $config = array()) { - $this->modx =& $modx; - - /* allows you to set paths in different environments - * this allows for easier SVN management of files - */ - $corePath = $this->modx->getOption('formit.core_path',null,MODX_CORE_PATH.'components/formit/'); - $assetsPath = $this->modx->getOption('formit.assets_path',null,MODX_ASSETS_PATH.'components/formit/'); - $assetsUrl = $this->modx->getOption('formit.assets_url',null,MODX_ASSETS_URL.'components/formit/'); - - /* loads some default paths for easier management */ - $this->config = array_merge(array( - 'corePath' => $corePath, - 'modelPath' => $corePath.'model/', - 'chunksPath' => $corePath.'elements/chunks/', - 'snippetsPath' => $corePath.'elements/snippets/', - 'controllersPath' => $corePath.'controllers/', - 'includesPath' => $corePath.'includes/', - 'testsPath' => $corePath.'test/', - - 'assetsPath' => $assetsPath, - 'assetsUrl' => $assetsUrl, - 'cssUrl' => $assetsUrl.'css/', - 'jsUrl' => $assetsUrl.'js/', - - 'debug' => $this->modx->getOption('formit.debug',null,false), - 'use_multibyte' => (boolean)$this->modx->getOption('use_multibyte',null,false), - 'encoding' => $this->modx->getOption('modx_charset',null,'UTF-8'), - ),$config); - if ($this->modx->getOption('formit.debug',$this->config,true)) { - $this->startDebugTimer(); - } - } - - /** - * Initialize the component into a context and provide context-specific - * handling actions. - * - * @access public - * @param string $context The context to initialize FormIt into - * @return mixed - */ - public function initialize($context = 'web') { - switch ($context) { - case 'mgr': break; - case 'web': - default: - $language = isset($this->config['language']) ? $this->config['language'] . ':' : ''; - $this->modx->lexicon->load($language.'formit:default'); - $this->_initialized = true; - break; - } - return $this->_initialized; - } - - /** - * Sees if the FormIt class has been initialized already - * @return boolean - */ - public function isInitialized() { - return $this->_initialized; - } - - /** - * Load the fiRequest class - * @return fiRequest - */ - public function loadRequest() { - $className = $this->modx->getOption('request_class',$this->config,'fiRequest'); - $classPath = $this->modx->getOption('request_class_path',$this->config,''); - if (empty($classPath)) $classPath = $this->config['modelPath'].'formit/'; - if ($this->modx->loadClass($className,$classPath,true,true)) { - $this->request = new fiRequest($this,$this->config); - } else { - $this->modx->log(modX::LOG_LEVEL_ERROR,'[FormIt] Could not load fiRequest class.'); - } - return $this->request; - } +require_once dirname(dirname(__DIR__)) . '/vendor/autoload.php'; - /** - * @param string $className - * @param string $serviceName - * @param array $config - * @return fiModule - */ - public function loadModule($className,$serviceName,array $config = array()) { - if (empty($this->$serviceName)) { - $classPath = $this->modx->getOption('formit.modules_path',null,$this->config['modelPath'].'formit/module/'); - if ($this->modx->loadClass($className,$classPath,true,true)) { - $this->$serviceName = new $className($this,$config); - } else { - $this->modx->log(modX::LOG_LEVEL_ERROR,'[FormIt] Could not load module: '.$className.' from '.$classPath); - } - } - return $this->$serviceName; - } - - /** - * Loads the Hooks class. - * - * @access public - * @param $type string The type of hook to load. - * @param $config array An array of configuration parameters for the - * hooks class - * @return fiHooks An instance of the fiHooks class. - */ - public function loadHooks($type = 'post',$config = array()) { - if (!$this->modx->loadClass('formit.fiHooks',$this->config['modelPath'],true,true)) { - $this->modx->log(modX::LOG_LEVEL_ERROR,'[FormIt] Could not load Hooks class.'); - return false; - } - $typeVar = $type.'Hooks'; - $this->$typeVar = new fiHooks($this,$config,$type); - return $this->$typeVar; - } - - /** - * Gets a unique session-based store key for storing form submissions. - * - * @return string - */ - public function getStoreKey() { - return $this->modx->context->get('key').'/elements/formit/submission/'.md5(session_id()); - } - - - /** - * Gets a Chunk and caches it; also falls back to file-based templates - * for easier debugging. - * - * Will always use the file-based chunk if $debug is set to true. - * - * @access public - * @param string $name The name of the Chunk - * @param array $properties The properties for the Chunk - * @return string The processed content of the Chunk - */ - public function getChunk($name,$properties = array()) { - $chunk = null; - if (!isset($this->chunks[$name])) { - if (!$this->config['debug']) { - $chunk = $this->modx->getObject('modChunk',array('name' => $name),true); - } - if (empty($chunk)) { - $chunk = $this->_getTplChunk($name); - if ($chunk == false) return false; - } - $this->chunks[$name] = $chunk->getContent(); - } else { - $o = $this->chunks[$name]; - $chunk = $this->modx->newObject('modChunk'); - $chunk->setContent($o); - } - $chunk->setCacheable(false); - return $chunk->process($properties); - } - /** - * Returns a modChunk object from a template file. - * - * @access private - * @param string $name The name of the Chunk. Will parse to name.chunk.tpl - * @return modChunk/boolean Returns the modChunk object if found, otherwise - * false. - */ - private function _getTplChunk($name) { - $chunk = false; - if (file_exists($name)) { - $f = $name; - } else { - $lowerCaseName = $this->config['use_multibyte'] ? mb_strtolower($name,$this->config['encoding']) : strtolower($name); - $f = $this->config['chunksPath'].$lowerCaseName.'.chunk.tpl'; - } - if (file_exists($f)) { - $o = file_get_contents($f); - /** @var modChunk $chunk */ - $chunk = $this->modx->newObject('modChunk'); - $chunk->set('name',$name); - $chunk->setContent($o); - } - return $chunk; - } - - /** - * Output the final output and wrap in the wrapper chunk. Optional, but - * recommended for debugging as it outputs the execution time to the output. - * - * Also, it is good to output your snippet code with wrappers for easier - * CSS isolation and styling. - * - * @access public - * @param string $output The output to process - * @return string The final wrapped output - */ - public function output($output) { - if ($this->debugTimer !== false) { - $output .= "
    \nExecution time: ".$this->endDebugTimer()."\n"; - } - return $output; - } - - /** - * Starts the debug timer. - * - * @access protected - * @return int The start time. - */ - protected function startDebugTimer() { - $mtime = microtime(); - $mtime = explode(' ', $mtime); - $mtime = $mtime[1] + $mtime[0]; - $tstart = $mtime; - $this->debugTimer = $tstart; - return $this->debugTimer; - } - - /** - * Ends the debug timer and returns the total number of seconds script took - * to run. - * - * @access protected - * @return int The end total time to execute the script. - */ - protected function endDebugTimer() { - $mtime= microtime(); - $mtime= explode(" ", $mtime); - $mtime= $mtime[1] + $mtime[0]; - $tend= $mtime; - $totalTime= ($tend - $this->debugTimer); - $totalTime= sprintf("%2.4f s", $totalTime); - $this->debugTimer = false; - return $totalTime; - } - - public function setOption($key,$value) { - $this->config[$key] = $value; - } - public function setOptions($array) { - foreach ($array as $k => $v) { - $this->setOption($k,$v); - } - } -} \ No newline at end of file +/** + * Class FormIt + */ +class FormIt extends Sterc\FormIt {} diff --git a/core/components/formit/model/formit/formitform.class.php b/core/components/formit/model/formit/formitform.class.php new file mode 100644 index 00000000..d43916e3 --- /dev/null +++ b/core/components/formit/model/formit/formitform.class.php @@ -0,0 +1,371 @@ +setSecretKeys(); + } + + + public function encrypt($value) + { + if (!function_exists('openssl_encrypt')) { + $this->xpdo->log(MODx::LOG_LEVEL_ERROR, '[FormIt] openssl_encrypt is not available. Please install OpenSSL. See http://www.php.net/manual/en/openssl.requirements.php for more information.'); + + return false; + } + $value = base64_encode(openssl_encrypt($value, $this->method, $this->encryptKey, 0, $this->ivKey)); + + return $value; + } + + + public function decrypt($value, $type = 2) + { + /* Check for encryption type; 1 = old mcrypt method */ + if ($type === 1) { + if (!function_exists('mcrypt_decrypt')) { + $this->xpdo->log(MODx::LOG_LEVEL_ERROR, '[FormIt] mcrypt_decrypt is not available. See http://php.net/manual/en/mcrypt.requirements.php for more information.'); + + return false; + } + + return rtrim( + mcrypt_decrypt( + MCRYPT_RIJNDAEL_256, + md5($this->oldEncryptKey), + base64_decode($value), + MCRYPT_MODE_CBC, + md5(md5($this->oldEncryptKey)) + ), + "\0" + ); + } + if (!function_exists('openssl_decrypt')) { + $this->xpdo->log(MODx::LOG_LEVEL_ERROR, '[FormIt] openssl_decrypt is not available. Please install OpenSSL. See http://www.php.net/manual/en/openssl.requirements.php for more information.'); + + return false; + } + + /* Return default openssl decrypted values */ + + return openssl_decrypt(base64_decode($value), $this->method, $this->encryptKey, 0, $this->ivKey); + } + + + public function generatePseudoRandomHash($bytes = 16) + { + $hash = bin2hex(openssl_random_pseudo_bytes($bytes, $strong)); + if (!$strong) { + $hash = $this->generatePseudoRandomHash($bytes); + } + + return $hash; + } + + + public function setSecretKeys() + { + $encryptkey = $this->xpdo->getOption('formit.form_encryptkey', null, null, false); + if (!$encryptkey) { + $encryptkey = $this->xpdo->site_id; + $setting = $this->xpdo->getObject( + 'modSystemSetting', + ['key' => 'formit.form_encryptkey', 'namespace' => 'formit'] + ); + if (!$setting) { + $setting = $this->xpdo->newObject('modSystemSetting'); + $setting->set('key', 'formit.form_encryptkey'); + $setting->set('namespace', 'formit'); + } + $setting->set('value', $encryptkey); + $setting->save(); + } + $this->oldEncryptKey = $encryptkey; + $this->encryptKey = hash('sha256', $encryptkey); + $this->ivKey = substr(hash('sha256', md5($encryptkey)), 0, 16); + } + + + public function validateStoreAttachment($config) + { + + $error = ''; + $mediasourceId = $this->xpdo->getOption('formit.attachment.mediasource'); + $mediasource = $this->xpdo->getObject('modMediaSource', $mediasourceId); + if (!$mediasource) { + $error = $this->xpdo->lexicon('formit.storeAttachment_mediasource_error') . $mediasourceId; + } else { + $prop = $mediasource->get('properties'); + $path = $prop['basePath']['value'] . $this->xpdo->getOption('formit.attachment.path'); + if (!is_dir(MODX_BASE_PATH . $path)) { + mkdir(MODX_BASE_PATH . $path); + } + if (!is_writable(MODX_BASE_PATH . $path)) { + $error = $this->xpdo->lexicon('formit.storeAttachment_access_error') . ' ' . $path; + } else { + $this->xpdo->setPlaceholder($config['placeholderPrefix'] . 'storeAttachment_path', $path); + } + } + if(!empty($error)){ + $this->xpdo->log(MODx::LOG_LEVEL_ERROR, '[FormIt] ' . $error); + } + + $this->xpdo->setPlaceholder($config['placeholderPrefix'] . 'error.storeAttachment', $error); + $this->path = $path; + + return $error; + } + + + public function storeAttachments($config) + { + if ($config['fieldNames']) { + $formFieldNames = explode(',', $config['fieldNames']); + foreach ($formFieldNames as $formFieldName) { + $parts = explode('==', $formFieldName); + $fieldLabels[trim($parts[0])] = trim($parts[1]); + } + } + + if ($this->xpdo->getPlaceholder($config['placeholderPrefix'] . 'error.storeAttachment') == '') { + $path = $this->xpdo->getPlaceholder($config['placeholderPrefix'] . 'storeAttachment_path'); + $encrypted = $this->encrypted; + if ($encrypted) { + $old_data = $this->xpdo->fromJSON($this->decrypt($this->values)); + } else { + $old_data = $this->xpdo->fromJSON($this->values); + } + + + $action = $this->xpdo->getObject('modAction', ['namespace' => 'formit']); + if ($action) { + $actionId = $action->id; + } + + $url = $this->xpdo->getOption('manager_url') . '?a=' . $actionId . '&formid=' . $this->id; + + foreach ($_FILES as $key => $value) { + $data_key = []; + if (is_array($value['name'])) { + foreach ($value['name'] as $fKey => $fValue) { + $enc_name = $this->encrypt($value['name'][$fKey]); + $resp = $this->saveFile( + $enc_name, + $value['name'][$fKey], + $value['tmp_name'][$fKey], + $value['error'][$fKey], + $path + ); + if ($resp) { + $data_key[] = "" . $value['name'][$fKey] . '
    '; + } + } + } else { + $enc_name = $this->encrypt($value['name']); + $resp = $this->saveFile( + $enc_name, + $value['name'], + $value['tmp_name'], + $value['error'], + $path + ); + if ($resp) { + $data_key[] ="" . $value['name'] . '
    '; + } + } + + if ($fieldLabels && $fieldLabels[$key]) { + $key = $fieldLabels[$key]; + } + + $old_data[$key] = implode('', $data_key); + $new_data = $this->xpdo->toJSON($old_data); + + if ($encrypted) { + $new_data = $this->encrypt($new_data); + } + $this->set('values', $new_data); + $this->save(); + } + } + } + + + public function saveFile($enc_name, $name, $tmp_name, $error, $path) + { + $info = pathinfo($name); + $ext = $info['extension']; + $ext = strtolower($ext); + if ($error !== 0) { + $this->xpdo->log(MODx::LOG_LEVEL_ERROR, '[FormItSaveForm] ' . $this->xpdo->lexicon('formit.storeAttachment_file_upload_error')); + + return; + } + $allowedFileTypes = array_merge( + explode(',', $this->xpdo->getOption('upload_images')), + explode(',', $this->xpdo->getOption('upload_media')), + explode(',', $this->xpdo->getOption('upload_flash')), + explode(',', $this->xpdo->getOption('upload_files', null, '')) + ); + $allowedFileTypes = array_unique($allowedFileTypes); + /* Make sure that dangerous file types are not allowed */ + unset( + $allowedFileTypes['php'], + $allowedFileTypes['php4'], + $allowedFileTypes['php5'], + $allowedFileTypes['htm'], + $allowedFileTypes['html'], + $allowedFileTypes['phtml'], + $allowedFileTypes['js'], + $allowedFileTypes['bin'], + $allowedFileTypes['csh'], + $allowedFileTypes['out'], + $allowedFileTypes['run'], + $allowedFileTypes['sh'], + $allowedFileTypes['htaccess'] + ); + /* Check file extension */ + if (empty($ext) || !in_array($ext, $allowedFileTypes)) { + $this->xpdo->log(MODx::LOG_LEVEL_ERROR, '[FormItSaveForm] ' . $this->xpdo->lexicon('formit.storeAttachment_file_ext_error')); + + return; + } + /* Check filesize */ + $maxFileSize = $this->xpdo->getOption('upload_maxsize', null, 1048576); + $size = filesize($tmp_name); + if ($size > $maxFileSize) { + $this->xpdo->log( + MODx::LOG_LEVEL_ERROR, + '[FormItSaveForm] ' . $this->xpdo->lexicon('formit.storeAttachment_file_size_error') + ); + + return; + } + if (empty($path)) { + $standardPath = $this->xpdo->getOption( + 'formit.assets_path', + null, + $this->xpdo->getOption('assets_path', null, MODX_CORE_PATH) . 'components/formit/attachments/' + ); + if (!is_dir($standardPath)) { + mkdir($standardPath); + } + $basePath = $standardPath . $this->id . '/'; + } else { + $basePath = MODX_BASE_PATH . $path . $this->id . '/'; + } + if (!is_dir($basePath)) { + mkdir($basePath); + } + $target = $basePath . $enc_name; + + return $this->encryptFile($tmp_name, $target); + /*$_FILES[$key]['tmp_name'] = $target; + $_SESSION['formit']['tmp_files'][] = $target;*/ + } + + + public function downloadFile($fileget) + { + $config['placeholderPrefix'] = 'pl.'; + $val = $this->validateStoreAttachment($config); + + if (!empty($val)) { + return $val; + } + if ($this->path == '') { + $file = $this->xpdo->getOption( + 'formit.assets_path', + null, + $this->xpdo->getOption('assets_path', null, MODX_CORE_PATH)) . 'components/formit/attachments/' . $this->get('id') . '/' . $fileget; + + } else { + $file = MODX_BASE_PATH . $this->path . $this->get('id') . '/' . $fileget; + } + + $fd = fopen($file, 'r'); + if (!$fd) { + return 'Cant read file! ' . $file; + } + + return $this->decryptFile($file); + + } + + + function encryptFile($source, $dest) + { + if (!function_exists('openssl_encrypt')) { + $error = '[FormIt] openssl_encrypt is not available. Please install OpenSSL. See http://www.php.net/manual/en/openssl.requirements.php for more information.'; + $this->xpdo->log(MODx::LOG_LEVEL_ERROR, $error); + + return $error; + } + + $key = $this->encryptKey; + $iv = $this->ivKey; + if ($fpOut = fopen($dest, 'w')) { + fwrite($fpOut, $iv); + if ($fpIn = fopen($source, 'rb')) { + while (!feof($fpIn)) { + $plaintext = fread($fpIn, 16 * $this->encBlocks); + $ciphertext = openssl_encrypt($plaintext, $this->method, $key, OPENSSL_RAW_DATA, $iv); + $iv = substr($ciphertext, 0, 16); + fwrite($fpOut, $ciphertext); + } + fclose($fpIn); + } else { + return 'Cant read file!'; + } + fclose($fpOut); + } else { + return 'Cant save file!'; + } + + return true; + } + + + function decryptFile($source) + { + $key = $this->encryptKey; + $output = ''; + if ($fpIn = fopen($source, 'rb')) { + $iv = fread($fpIn, 16); + while (!feof($fpIn)) { + $ciphertext = fread($fpIn, 16 * ($this->encBlocks + 1)); + $plaintext = openssl_decrypt($ciphertext, $this->method, $key, OPENSSL_RAW_DATA, $iv); + $iv = substr($ciphertext, 0, 16); + $output .= $plaintext; + } + fclose($fpIn); + } else { + return 'Cant read file!'; + } + $basename = $this->decrypt(end(explode('/', $source))); + + header("HTTP/1.1 200 OK"); + header("Connection: close"); + header("Content-Type: application/octet-stream"); + header("Content-type: application/force-download"); + header("Accept-Ranges: bytes"); + header("Content-Disposition: Attachment; filename=" . $basename); + echo $output; + exit(); + } + +} diff --git a/core/components/formit/model/formit/metadata.mysql.php b/core/components/formit/model/formit/metadata.mysql.php new file mode 100644 index 00000000..000db9b3 --- /dev/null +++ b/core/components/formit/model/formit/metadata.mysql.php @@ -0,0 +1,8 @@ + + array ( + 0 => 'FormItForm', + ), +); \ No newline at end of file diff --git a/core/components/formit/model/formit/module/ficountryoptions.class.php b/core/components/formit/model/formit/module/ficountryoptions.class.php index 889c3e53..0f61126a 100644 --- a/core/components/formit/model/formit/module/ficountryoptions.class.php +++ b/core/components/formit/model/formit/module/ficountryoptions.class.php @@ -19,134 +19,14 @@ * * @package formit */ -require_once dirname(__FILE__).'/fimodule.class.php'; +require_once dirname(dirname(dirname(__DIR__))) . '/src/FormIt/Module/CountryOptions.php'; /** * Loads a option list of countries - * + * * @package formit * @subpackage modules */ -class fiCountryOptions extends fiModule { - /** @var array $countries */ - public $countries = array(); - /** @var array $prioritizedCountries */ - public $prioritizedCountries = array(); - /** @var array $list */ - public $list = array(); - /** @var array $prioritizedList */ - public $prioritizedList = array(); - - /** - * @return void - */ - public function initialize() { - $this->setDefaultOptions(array( - 'tpl' => 'option', - 'selected' => '', - 'useIsoCode' => true, - 'selectedAttribute' => ' selected="selected"', - 'optGroupTpl' => 'optGroup', - 'prioritized' => '', - 'prioritizedGroupText' => '', - 'allGroupText' => '', - 'outputSeparator' => "\n", - 'toPlaceholder' => '', - 'country' => $this->modx->getOption('cultureKey', array(), 'us', true), - )); - $this->setOption('selectedKey',$this->getOption('useIsoCode',true,'isset') ? 'countryKey' : 'countryName'); - } - - /** - * Load the country list - * @return array - */ - public function getData() { - $country = $this->getOption('country','us'); - $countriesFile = $this->getOption('countriesDirectory',$this->formit->config['includesPath']).$country.'.countries.inc.php'; - if (file_exists($countriesFile)) { - $this->countries = include $countriesFile; - } else { - $this->countries = include $this->formit->config['includesPath'].'us.countries.inc.php'; - } - return $this->countries; - } - - /** - * Check for prioritized countries, and load those - * @return array - */ - public function loadPrioritized() { - /* handle prioritized countries */ - $this->prioritizedCountries = array(); - $prioritized = $this->getOption('prioritized',''); - if (!empty($prioritized)) { - $prioritized = explode(',',$prioritized); - foreach ($this->countries as $countryKey => $countryName) { - if (in_array($countryKey,$prioritized)) { - $this->prioritizedCountries[] = $countryKey; - } - } - } - return $this->prioritizedCountries; - } - - /** - * iterate over lists - * @return void - */ - public function iterate() { - $this->list = array(); - $this->prioritizedList = array(); - $selected = $this->getOption('selected',''); - $selectedAttribute = $this->getOption('selectedAttribute',' selected="selected"'); - $useIsoCode = $this->getOption('useIsoCode',true,'isset'); - $tpl = $this->getOption('tpl','option'); - $selectedKey = $this->getOption('selectedKey','countryKey'); - - foreach ($this->countries as $countryKey => $countryName) { - $countryArray = array( - 'text' => $countryName, - 'value' => $useIsoCode ? $countryKey : $countryName, - 'selected' => '', - ); - if ($selected == $$selectedKey) { - $countryArray['selected'] = $selectedAttribute; - } - $o = $this->formit->getChunk($tpl,$countryArray); - if (in_array($countryKey,$this->prioritizedCountries)) { - $this->prioritizedList[] = $o; - } else { - $this->list[] = $o; - } - } - } - - /** - * Handle output generation - * @return string - */ - public function output() { - $outputSeparator = $this->getOption('outputSeparator',"\n"); - if (!empty($this->prioritizedList)) { - $optGroupTpl = $this->getOption('optGroupTpl','optGroup'); - $output = $this->formit->getChunk($optGroupTpl,array( - 'text' => $this->getOption('prioritizedGroupText',$this->modx->lexicon('formit.prioritized_group_text')), - 'options' => implode($outputSeparator,$this->prioritizedList), - )); - $output .= $this->formit->getChunk($optGroupTpl,array( - 'text' => $this->getOption('allGroupText',$this->modx->lexicon('formit.all_group_text')), - 'options' => implode($outputSeparator,$this->list), - )); - } else { - $output = implode($outputSeparator,$this->list); - } +class fiCountryOptions extends Sterc\FormIt\Module\CountryOptions +{ - /* set to placeholder or output */ - $toPlaceholder = $this->getOption('toPlaceholder',''); - if (!empty($toPlaceholder)) { - $this->modx->setPlaceholder($toPlaceholder,$output); - $output = ''; - } - return $output; - } } diff --git a/core/components/formit/model/formit/module/fimodule.class.php b/core/components/formit/model/formit/module/fimodule.class.php index 417b5ff3..48567900 100644 --- a/core/components/formit/model/formit/module/fimodule.class.php +++ b/core/components/formit/model/formit/module/fimodule.class.php @@ -21,93 +21,14 @@ */ /** * Abstract class for all FormIt modules - * + * * @package formit * @subpackage modules */ -abstract class fiModule { - /** @var modX $modx */ - public $modx; - /** @var FormIt $formit */ - public $formit; - /** @var array $config */ - public $config = array(); - - /** - * @param FormIt $formit - * @param array $config - */ - function __construct(FormIt $formit,array $config = array()) { - $this->formit =& $formit; - $this->modx =& $formit->modx; - $this->config = array_merge($this->config,$config); - } - - /** - * Runs after instantiation of the module - * @abstract - * @return void - */ - abstract public function initialize(); - /** - * Returns the output of the module - * @abstract - * @return void - */ - abstract public function output(); - - /** - * Set the default options for this module - * @param array $defaults - * @return void - */ - protected function setDefaultOptions(array $defaults = array()) { - $this->config = array_merge($defaults,$this->config); - } - /** - * Set an option for this module - * @param string $key - * @param mixed $value - * @return void - */ - public function setOption($key,$value) { - $this->config[$key] = $value; - } - /** - * Set an array of options - * @param array $array - * @return void - */ - public function setOptions($array) { - foreach ($array as $k => $v) { - $this->setOption($k,$v); - } - } +require_once dirname(dirname(dirname(__DIR__))) . '/src/FormIt/Module/Module.php'; - /** - * @param string $key - * @param mixed $default - * @param string $method - * @return null - */ - public function getOption($key,$default = null,$method = '!empty') { - $v = $default; +abstract class fiModule extends Sterc\FormIt\Module\Module +{ - switch ($method) { - case 'empty': - case '!empty': - if (!empty($this->config[$key])) { - $v = $this->config[$key]; - } - break; - case 'isset': - default: - if (isset($this->config[$key])) { - $v = $this->config[$key]; - } - break; - } - return $v; - } } \ No newline at end of file diff --git a/core/components/formit/model/formit/module/fistateoptions.class.php b/core/components/formit/model/formit/module/fistateoptions.class.php index 225bf6b2..f178a0ac 100644 --- a/core/components/formit/model/formit/module/fistateoptions.class.php +++ b/core/components/formit/model/formit/module/fistateoptions.class.php @@ -19,86 +19,14 @@ * * @package formit */ -require_once dirname(__FILE__).'/fimodule.class.php'; +require_once dirname(dirname(dirname(__DIR__))) . '/src/FormIt/Module/StateOptions.php'; /** * Loads a option list of states - * + * * @package formit * @subpackage modules */ -class fiStateOptions extends fiModule { - /** @var array $states */ - public $states = array(); - /** @var array $list */ - public $list = array(); - - /** - * @return void - */ - public function initialize() { - $this->setDefaultOptions(array( - 'tpl' => 'option', - 'selected' => '', - 'useAbbr' => true, - 'selectedAttribute' => ' selected="selected"', - 'outputSeparator' => "\n", - 'toPlaceholder' => '', - 'country' => $this->modx->getOption('cultureKey', array(), 'us', true), - )); - $this->setOption('selectedKey',$this->getOption('useAbbr',true) ? 'stateKey' : 'stateName'); - } - - /** - * Load the country list - * @return array - */ - public function getData() { - $country = $this->getOption('country','us'); - $statesFile = $this->getOption('statesDirectory',$this->formit->config['includesPath']).$country.'.states.inc.php'; - if (file_exists($statesFile)) { - $this->states = include $statesFile; - } else { - $this->states = include $this->formit->config['includesPath'].'us.states.inc.php'; - } - return $this->states; - } - - /** - * iterate over lists - * @return void - */ - public function iterate() { - $selected = $this->getOption('selected',''); - $selectedAttribute = $this->getOption('selectedAttribute',' selected="selected"'); - $tpl = $this->getOption('tpl','option'); - $selectedKey = $this->getOption('selectedKey','stateKey'); - foreach ($this->states as $stateKey => $stateName) { - $stateArray = array( - 'text' => $stateName, - 'value' => $$selectedKey, - 'selected' => '', - ); - if ($selected == $$selectedKey) { - $stateArray['selected'] = $selectedAttribute; - } - $this->list[] = $this->formit->getChunk($tpl,$stateArray); - } - } - - /** - * Handle output generation - * @return string - */ - public function output() { - $outputSeparator = $this->getOption('outputSeparator',"\n"); - $output = implode($outputSeparator,$this->list); +class fiStateOptions extends Sterc\FormIt\Module\StateOptions +{ - /* set to placeholder or output */ - $toPlaceholder = $this->getOption('toPlaceholder',''); - if (!empty($toPlaceholder)) { - $this->modx->setPlaceholder($toPlaceholder,$output); - $output = ''; - } - return $output; - } -} \ No newline at end of file +} diff --git a/core/components/formit/model/formit/mysql/formitform.class.php b/core/components/formit/model/formit/mysql/formitform.class.php new file mode 100644 index 00000000..4988c2c4 --- /dev/null +++ b/core/components/formit/model/formit/mysql/formitform.class.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/core/components/formit/model/formit/mysql/formitform.map.inc.php b/core/components/formit/model/formit/mysql/formitform.map.inc.php new file mode 100644 index 00000000..ce4b107e --- /dev/null +++ b/core/components/formit/model/formit/mysql/formitform.map.inc.php @@ -0,0 +1,91 @@ + 'formit', + 'version' => NULL, + 'table' => 'formit_forms', + 'extends' => 'xPDOSimpleObject', + 'tableMeta' => + array ( + 'engine' => 'InnoDB', + ), + 'fields' => + array ( + 'form' => '', + 'context_key' => '', + 'values' => '', + 'ip' => '', + 'date' => 0, + 'encrypted' => 0, + 'encryption_type' => 1, + 'hash' => '', + ), + 'fieldMeta' => + array ( + 'form' => + array ( + 'dbtype' => 'varchar', + 'precision' => '255', + 'phptype' => 'string', + 'null' => false, + 'default' => '', + ), + 'context_key' => + array ( + 'dbtype' => 'varchar', + 'precision' => '100', + 'phptype' => 'string', + 'null' => false, + 'default' => '', + ), + 'values' => + array ( + 'dbtype' => 'text', + 'phptype' => 'string', + 'null' => false, + 'default' => '', + ), + 'ip' => + array ( + 'dbtype' => 'varchar', + 'precision' => '100', + 'phptype' => 'string', + 'null' => false, + 'default' => '', + ), + 'date' => + array ( + 'dbtype' => 'int', + 'precision' => '11', + 'phptype' => 'integer', + 'null' => false, + 'default' => 0, + ), + 'encrypted' => + array ( + 'dbtype' => 'tinyint', + 'precision' => '1', + 'phptype' => 'boolean', + 'null' => false, + 'default' => 0, + ), + 'encryption_type' => + array ( + 'dbtype' => 'int', + 'precision' => '2', + 'phptype' => 'integer', + 'null' => false, + 'default' => 1, + ), + 'hash' => + array ( + 'dbtype' => 'varchar', + 'precision' => '255', + 'phptype' => 'string', + 'null' => false, + 'default' => '', + ), + ), +); diff --git a/core/components/formit/model/recaptcha/formitrecaptcha.class.php b/core/components/formit/model/recaptcha/formitrecaptcha.class.php index 0c55e577..989d90bc 100644 --- a/core/components/formit/model/recaptcha/formitrecaptcha.class.php +++ b/core/components/formit/model/recaptcha/formitrecaptcha.class.php @@ -27,271 +27,11 @@ * @package formit * @subpackage recaptcha */ -if (!class_exists('FormItReCaptcha')) { -class FormItReCaptcha { - const API_SERVER = 'http://www.google.com/recaptcha/api/'; - const API_SECURE_SERVER = 'https://www.google.com/recaptcha/api/'; - const VERIFY_SERVER = 'www.google.com'; - const OPT_PRIVATE_KEY = 'privateKey'; - const OPT_PUBLIC_KEY = 'publicKey'; - const OPT_USE_SSL = 'use_ssl'; +require_once dirname(dirname(__DIR__)) . '/src/FormIt/Service/RecaptchaService.php'; - /** @var modX $modX */ - public $modx; - /** @var FormIt $formit */ - public $formit; +class FormItReCaptcha extends Sterc\FormIt\Service\RecaptchaService +{ - function __construct(FormIt &$formit,array $config = array()) { - $this->formit =& $formit; - $this->modx =& $formit->modx; - $this->modx->lexicon->load('formit:recaptcha'); - $this->config = array_merge(array( - FormItReCaptcha::OPT_PRIVATE_KEY => $this->modx->getOption('formit.recaptcha_private_key',$config,''), - FormItReCaptcha::OPT_PUBLIC_KEY => $this->modx->getOption('formit.recaptcha_public_key',$config,''), - FormItReCaptcha::OPT_USE_SSL => $this->modx->getOption('formit.recaptcha_use_ssl',$config,false), - ),$config); - } - - /** - * Encodes the given data into a query string format - * @param $data - array of string elements to be encoded - * @return string - encoded request - */ - protected function qsencode($data) { - $req = ''; - foreach ($data as $key => $value) { - $req .= $key . '=' . urlencode( stripslashes($value) ) . '&'; - } - - // Cut the last '&' - $req=substr($req,0,strlen($req)-1); - return $req; - } - - /** - * Submits an HTTP POST to a reCAPTCHA server - * @param string $host - * @param string $path - * @param array $data - * @param int $port - * @return array response - */ - protected function httpPost($host, $path, array $data = array(), $port = 80) { - $data['privatekey'] = $this->config[FormItReCaptcha::OPT_PRIVATE_KEY]; - $req = $this->qsencode($data); - - $http_request = "POST $path HTTP/1.0\r\n"; - $http_request .= "Host: $host\r\n"; - $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n"; - $http_request .= "Content-Length: " . strlen($req) . "\r\n"; - $http_request .= "User-Agent: reCAPTCHA/PHP\r\n"; - $http_request .= "\r\n"; - $http_request .= $req; - - $response = ''; - if(false == ($fs = @fsockopen($host, $port, $errno, $errstr, 10))) { - return 'Could not open socket'; - } - - fwrite($fs, $http_request); - while (!feof($fs)) { - $response .= fgets($fs, 1160); // One TCP-IP packet - } - fclose($fs); - $response = explode("\r\n\r\n", $response, 2); - - return $response; - } - - /** - * Gets the challenge HTML (javascript and non-javascript version). - * This is called from the browser, and the resulting reCAPTCHA HTML widget - * is embedded within the HTML form it was called from. - * - * @param array $scriptProperties - * @return string - The HTML to be embedded in the user's form. - */ - public function render($scriptProperties = array()) { - if (empty($this->config[FormItReCaptcha::OPT_PUBLIC_KEY])) { - return $this->error($this->modx->lexicon('recaptcha.no_api_key')); - } - - /* use ssl or not */ - $server = !empty($this->config[FormItReCaptcha::OPT_USE_SSL]) ? FormItReCaptcha::API_SECURE_SERVER : FormItReCaptcha::API_SERVER; - - $opt = $this->getOptions($scriptProperties); - $html = ' -'; - $this->modx->setPlaceholder('formit.recaptcha_html',$html); - $this->modx->setPlaceholder($scriptProperties['placeholderPrefix'].'recaptcha_html',$html); - return $html; - } - - /** - * Get options for reCaptcha from snippet - * - * @param array $scriptProperties - * @return array|void - */ - public function getOptions(array $scriptProperties = array()) { - $opt = $this->modx->getOption('recaptchaJs',$scriptProperties,'{}'); - $opt = $this->modx->fromJSON($opt); - if (empty($opt)) $opt = array(); - - /* backwards compat */ - $backwardOpt = array( - 'theme' => $this->modx->getOption('recaptchaTheme',$scriptProperties,'clean'), - 'width' => $this->modx->getOption('recaptchaWidth',$scriptProperties,500), - 'height' => $this->modx->getOption('recaptchaHeight',$scriptProperties,300), - 'lang' => $this->modx->getOption('cultureKey',null,'en'), - ); - $opt = array_merge($backwardOpt,$opt); - - return $opt; - } - - /** - * State there is an error with reCaptcha - * @param string $message - * @return string - */ - protected function error($message = '') { - $response = new FormItReCaptchaResponse(); - $response->is_valid = false; - $response->error = $message; - return $message; - } - - /** - * Calls an HTTP POST function to verify if the user's guess was correct - * @param string $remoteIp - * @param string $challenge - * @param string $responseField - * @param array $extraParams An array of extra variables to post to the server - * @return FormItReCaptchaResponse - */ - public function checkAnswer ($remoteIp, $challenge, $responseField, $extraParams = array()) { - if (empty($this->config[FormItReCaptcha::OPT_PRIVATE_KEY])) { - return $this->error($this->modx->lexicon('recaptcha.no_api_key')); - } - - if (empty($remoteIp)) { - return $this->error($this->modx->lexicon('recaptcha.no_remote_ip')); - } - - //discard spam submissions - if (empty($challenge) || empty($responseField)) { - return $this->error($this->modx->lexicon('recaptcha.empty_answer')); - } - - $response = $this->httpPost(FormItReCaptcha::VERIFY_SERVER,"/recaptcha/api/verify",array ( - 'remoteip' => $remoteIp, - 'challenge' => $challenge, - 'response' => $responseField, - ) + $extraParams); - - $answers = explode("\n",$response[1]); - $response = new FormItReCaptchaResponse(); - - if (trim($answers[0]) == 'true') { - $response->is_valid = true; - } else { - $response->is_valid = false; - $response->error = $answers [1]; - } - return $response; - } - - /** - * Gets a URL where the user can sign up for reCAPTCHA. If your application - * has a configuration page where you enter a key, you should provide a link - * using this function. - * - * @param string $domain The domain where the page is hosted - * @param string $appname The name of your application - * @return string - */ - public function getSignupUrl($domain = null,$appname = null) { - return "http://recaptcha.net/api/getkey?" . $this->qsencode(array ('domain' => $domain, 'app' => $appname)); - } - - protected function aesPad($val) { - $block_size = 16; - $numpad = $block_size - (strlen ($val) % $block_size); - return str_pad($val, strlen ($val) + $numpad, chr($numpad)); - } - - /* Mailhide related code */ - protected function aesEncrypt($val,$ky) { - if (!function_exists("mcrypt_encrypt")) { - return $this->error($this->modx->lexicon('recaptcha.mailhide_no_mcrypt')); - } - $mode=MCRYPT_MODE_CBC; - $enc=MCRYPT_RIJNDAEL_128; - $val= $this->aesPad($val); - return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); - } - - - protected function mailhideUrlbase64($x) { - return strtr(base64_encode ($x), '+/', '-_'); - } - - /* gets the reCAPTCHA Mailhide url for a given email, public key and private key */ - public function mailhideUrl($email) { - if (empty($this->config[FormItReCaptcha::OPT_PUBLIC_KEY]) || empty($this->config[FormItReCaptcha::OPT_PRIVATE_KEY])) { - return $this->error($this->modx->lexicon('recaptcha.mailhide_no_api_key')); - } - - $ky = pack('H*',$this->config[FormItReCaptcha::OPT_PRIVATE_KEY]); - $cryptmail = $this->aesEncrypt($email, $ky); - return 'http://mailhide.recaptcha.net/d?k=' - . $this->config[FormItReCaptcha::OPT_PUBLIC_KEY] - . '&c=' . $this->mailhideUrlbase64($cryptmail); - } - - /** - * Gets the parts of the email to expose to the user. - * eg, given johndoe@example,com return ["john", "example.com"]. - * the email is then displayed as john...@example.com - * - * @param string $email - * @return array|string - */ - public function mailhideEmailParts ($email) { - $arr = preg_split("/@/", $email); - - if (strlen($arr[0]) <= 4) { - $arr[0] = substr($arr[0], 0, 1); - } else if (strlen ($arr[0]) <= 6) { - $arr[0] = substr($arr[0], 0, 3); - } else { - $arr[0] = substr($arr[0], 0, 4); - } - return $arr; - } - - /** - * Gets html to display an email address given a public an private key. - * to get a key, go to: - * - * http://mailhide.recaptcha.net/apikey - * - * @param $email - * @return string - */ - public function mailhideHtml($email) { - $emailparts = $this->mailhideEmailParts($email); - $url = $this->mailhideUrl($email); - - $str = htmlentities($emailparts[0]) . "...@" . htmlentities($emailparts [1]); - return $str; - } } /** @@ -300,10 +40,9 @@ public function mailhideHtml($email) { * @package formit * @subpackage recaptcha */ -class FormItReCaptchaResponse { - /** @var boolean $is_valid */ - public $is_valid; - /** @var string $error */ - public $error; +require_once dirname(dirname(__DIR__)) . '/src/FormIt/Service/RecaptchaResponse.php'; + +class FormItReCaptchaResponse extends Sterc\FormIt\Service\RecaptchaResponse +{ + } -} \ No newline at end of file diff --git a/core/components/formit/model/schema/formit.mysql.schema.xml b/core/components/formit/model/schema/formit.mysql.schema.xml new file mode 100644 index 00000000..f78b7a1d --- /dev/null +++ b/core/components/formit/model/schema/formit.mysql.schema.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/components/formit/model/stopforumspam/stopforumspam.class.php b/core/components/formit/model/stopforumspam/stopforumspam.class.php index f9b7a3cf..86c99d52 100644 --- a/core/components/formit/model/stopforumspam/stopforumspam.class.php +++ b/core/components/formit/model/stopforumspam/stopforumspam.class.php @@ -19,85 +19,17 @@ * * @package formit */ + +require_once dirname(dirname(__DIR__)) . '/src/FormIt/Service/StopForumSpam.php'; + /** * StopForumSpam service class - * + * * @package formit * @subpackage stopforumspam */ -class StopForumSpam { - - function __construct(modX &$modx, array $config = array()) { - $this->modx =& $modx; - - $this->config = array_merge(array( - 'host' => 'http://www.stopforumspam.com/', - 'path' => 'api', - 'method' => 'GET', - ),$config); - } - - /** - * Check for spammer - * - * @access public - * @param string $ip - * @param string $email - * @param string $username - * @return array An array of errors - */ - public function check($ip = '',$email = '',$username = '') { - $params = array(); - if (!empty($ip)) { - if (in_array($ip,array('127.0.0.1','::1','0.0.0.0'))) $ip = '72.179.10.158'; - $params['ip'] = $ip; - } - if (!empty($email)) $params['email'] = $email; - if (!empty($username)) $params['username'] = $username; - - $xml = $this->request($params); - $i = 0; - $errors = array(); - foreach ($xml->appears as $result) { - if ($result == 'yes') { - $errors[] = ucfirst($xml->type[$i]); - } - $i++; - } - return $errors; - } - - /** - * Make a request to stopforumspam.com - * - * @access public - * @param array $params An array of parameters to send - * @return mixed The return SimpleXML object, or false if none - */ - public function request($params = array()) { - $loaded = $this->_getClient(); - if (!$loaded) { - $this->modx->log(modX::LOG_LEVEL_ERROR,'[StopForumSpam] Could not load REST client.'); - return true; - } - $response = $this->modx->rest->request($this->config['host'],$this->config['path'],$this->config['method'],$params); - $responseXml = $response->toXml(); - return $responseXml; - } +class StopForumSpam extends Sterc\FormIt\Service\StopForumSpam +{ - /** - * Get the REST Client - * - * @access private - * @return modRestClient/boolean - */ - private function _getClient() { - if (empty($this->modx->rest)) { - $this->modx->getService('rest','rest.modRestClient'); - $loaded = $this->modx->rest->getConnection(); - if (!$loaded) return false; - } - return $this->modx->rest; - } -} \ No newline at end of file +} diff --git a/core/components/formit/processors/mgr/encryption/decrypt.class.php b/core/components/formit/processors/mgr/encryption/decrypt.class.php new file mode 100644 index 00000000..a0157c63 --- /dev/null +++ b/core/components/formit/processors/mgr/encryption/decrypt.class.php @@ -0,0 +1,85 @@ + + */ + +class FormItDecryptProcessor extends modProcessor +{ + /** + * @access public. + * @var String. + */ + public $classKey = 'FormItForm'; + + /** + * @access public. + * @var Array. + */ + public $languageTopics = ['formit:default']; + + /** + * @access public. + * @var String. + */ + public $objectType = 'formit.form'; + + /** + * @access public. + * @return Mixed. + */ + public function initialize() + { + $this->modx->getService('formit', 'FormIt', $this->modx->getOption('formit.core_path', null, $this->modx->getOption('core_path') . 'components/formit/') . 'model/formit/'); + + return parent::initialize(); + } + + /** + * @access public. + * @return Mixed. + */ + public function process() + { + $amount = 0; + + $criteria = [ + 'form' => $this->getProperty('form'), + 'context_key:IN' => $this->getAvailableContexts(), + 'encrypted' => 1 + ]; + + foreach ($this->modx->getCollection($this->classKey, $criteria) as $object) { + $object->set('values', $object->decrypt($object->get('values'), $object->get('type'))); + $object->set('encrypted', 0); + $object->set('encryption_type', 0); + + if ($object->save()) { + $amount++; + } + } + + return $this->success($this->modx->lexicon('formit.decrypt_success', [ + 'amount' => $amount + ])); + } + + /** + * @access public. + * @return Array. + */ + public function getAvailableContexts() + { + $contexts = ['-']; + + foreach ($this->modx->getCollection('modContext') as $context) { + $contexts[] = $context->get('key'); + } + + return $contexts; + } +} + +return 'FormItDecryptProcessor'; diff --git a/core/components/formit/processors/mgr/encryption/encrypt.class.php b/core/components/formit/processors/mgr/encryption/encrypt.class.php new file mode 100644 index 00000000..a67abfc0 --- /dev/null +++ b/core/components/formit/processors/mgr/encryption/encrypt.class.php @@ -0,0 +1,85 @@ + + */ + +class FormItEncryptProcessor extends modProcessor +{ + /** + * @access public. + * @var String. + */ + public $classKey = 'FormItForm'; + + /** + * @access public. + * @var Array. + */ + public $languageTopics = ['formit:default']; + + /** + * @access public. + * @var String. + */ + public $objectType = 'formit.form'; + + /** + * @access public. + * @return Mixed. + */ + public function initialize() + { + $this->modx->getService('formit', 'FormIt', $this->modx->getOption('formit.core_path', null, $this->modx->getOption('core_path') . 'components/formit/') . 'model/formit/'); + + return parent::initialize(); + } + + /** + * @access public. + * @return Mixed. + */ + public function process() + { + $amount = 0; + + $criteria = [ + 'form' => $this->getProperty('form'), + 'context_key:IN' => $this->getAvailableContexts(), + 'encrypted' => 0 + ]; + + foreach ($this->modx->getCollection($this->classKey, $criteria) as $object) { + $object->set('values', $object->encrypt($object->get('values'))); + $object->set('encrypted', 1); + $object->set('encryption_type', 2); + + if ($object->save()) { + $amount++; + } + } + + return $this->success($this->modx->lexicon('formit.encrypt_success', [ + 'amount' => $amount + ])); + } + + /** + * @access public. + * @return Array. + */ + public function getAvailableContexts() + { + $contexts = ['-']; + + foreach ($this->modx->getCollection('modContext') as $context) { + $contexts[] = $context->get('key'); + } + + return $contexts; + } +} + +return 'FormItEncryptProcessor'; diff --git a/core/components/formit/processors/mgr/encryption/getlist.class.php b/core/components/formit/processors/mgr/encryption/getlist.class.php new file mode 100644 index 00000000..a4c7df96 --- /dev/null +++ b/core/components/formit/processors/mgr/encryption/getlist.class.php @@ -0,0 +1,125 @@ + + */ + +class FormItGetListProcessor extends modObjectGetListProcessor +{ + /** + * @access public. + * @var String. + */ + public $classKey = 'FormItForm'; + + /** + * @access public. + * @var Array. + */ + public $languageTopics = ['formit:default']; + + /** + * @access public. + * @var String. + */ + public $defaultSortField = 'form'; + + /** + * @access public. + * @var String. + */ + public $defaultSortDirection = 'ASC'; + + /** + * @access public. + * @var String. + */ + public $objectType = 'formit.form'; + + /** + * @access public. + * @return Mixed. + */ + public function initialize() + { + $this->modx->getService('formit', 'FormIt', $this->modx->getOption('formit.core_path', null, $this->modx->getOption('core_path') . 'components/formit/') . 'model/formit/'); + + return parent::initialize(); + } + + /** + * @access public. + * @param xPDOQuery $criteria. + * @return xPDOQuery. + */ + public function prepareQueryBeforeCount(xPDOQuery $criteria) + { + $criteria->where( + [ + 'context_key:IN' => $this->getAvailableContexts(), + ] + ); + + $query = $this->getProperty('query'); + + if (!empty($query)) { + $criteria->where( + [ + 'form:LIKE' => '%' . $query . '%' + ] + ); + } + + $criteria->groupby('form'); + $criteria->groupby('context_key'); + $criteria->groupby('id'); + + return $criteria; + } + + /** + * @access public. + * @param xPDOObject $object. + * @return Array. + */ + public function prepareRow(xPDOObject $object) + { + return array_merge( + $object->toArray(), [ + 'encrypted' => $this->modx->getCount( + $this->classKey, [ + 'form' => $object->get('form'), + 'context_key' => $object->get('context_key'), + 'encrypted' => 1 + ] + ), + 'decrypted' => $this->modx->getCount( + $this->classKey, [ + 'form' => $object->get('form'), + 'context_key' => $object->get('context_key'), + 'encrypted' => 0 + ] + ) + ] + ); + } + + /** + * @access public. + * @return Array. + */ + public function getAvailableContexts() + { + $contexts = ['-']; + + foreach ($this->modx->getCollection('modContext') as $context) { + $contexts[] = $context->get('key'); + } + + return $contexts; + } +} + +return 'FormItGetListProcessor'; diff --git a/core/components/formit/processors/mgr/forms/clean.class.php b/core/components/formit/processors/mgr/forms/clean.class.php new file mode 100644 index 00000000..2f2ff3bc --- /dev/null +++ b/core/components/formit/processors/mgr/forms/clean.class.php @@ -0,0 +1,80 @@ + + */ + +class FormItFormCleanProcessor extends modProcessor +{ + /** + * @access public. + * @var String. + */ + public $classKey = 'FormItForm'; + + /** + * @access public. + * @var Array. + */ + public $languageTopics = ['formit:default']; + + /** + * @access public. + * @var String. + */ + public $objectType = 'formit.form'; + + /** + * @access public. + * @return Mixed. + */ + public function initialize() + { + $this->modx->getService('formit', 'FormIt', $this->modx->getOption('formit.core_path', null, $this->modx->getOption('core_path') . 'components/formit/') . 'model/formit/'); + + return parent::initialize(); + } + + /** + * @access public. + * @return Mixed. + */ + public function process() + { + $amount = 0; + + $criteria = [ + 'context_key:IN' => $this->getAvailableContexts(), + 'date:<' => strtotime('-' . $this->getProperty('days', $this->modx->getOption('formit.cleanform.days')) .' days') + ]; + + foreach ($this->modx->getCollection($this->classKey, $criteria) as $object) { + if ($object->remove()) { + $amount++; + } + } + + return $this->success($this->modx->lexicon('formit.forms_clean_success', [ + 'amount' => $amount + ])); + } + + /** + * @access public. + * @return Array. + */ + public function getAvailableContexts() + { + $contexts = ['-']; + + foreach ($this->modx->getCollection('modContext') as $context) { + $contexts[] = $context->get('key'); + } + + return $contexts; + } +} + +return 'FormItFormCleanProcessor'; diff --git a/core/components/formit/processors/mgr/forms/export.class.php b/core/components/formit/processors/mgr/forms/export.class.php new file mode 100644 index 00000000..036b763f --- /dev/null +++ b/core/components/formit/processors/mgr/forms/export.class.php @@ -0,0 +1,275 @@ + + */ + +class FormItFormExportProcessor extends modProcessor +{ + /** + * @access public. + * @var String. + */ + public $classKey = 'FormItForm'; + + /** + * @access public. + * @var Array. + */ + public $languageTopics = ['formit:default']; + + /** + * @access public. + * @var String. + */ + public $defaultSortField = 'date'; + + /** + * @access public. + * @var String. + */ + public $defaultSortDirection = 'DESC'; + + /** + * @access public. + * @var String. + */ + public $objectType = 'formit.form'; + + /** + * @access public. + * @return Mixed. + */ + public function initialize() + { + $this->modx->getService('formit', 'FormIt', $this->modx->getOption('formit.core_path', null, $this->modx->getOption('core_path') . 'components/formit/') . 'model/formit/'); + + $this->setDefaultProperties([ + 'columns' => 'ID,Form,Date,IP', + 'filename' => $this->objectType . '.csv', + 'directory' => $this->modx->getOption('core_path') . 'cache/export/formit/', + 'dateFormat' => $this->modx->getOption('manager_date_format') . ', ' . $this->modx->getOption('manager_time_format') + ]); + + if ($this->getProperty('download') === null) { + $this->setProperty('download', 0); + } + + return parent::initialize(); + } + + /** + * @access public. + * @return Array. + */ + public function getData() + { + $criteria = $this->modx->newQuery($this->classKey); + + $criteria->where([ + 'context_key:IN' => $this->getAvailableContexts() + ]); + + $form = $this->getProperty('form'); + + if (!empty($form)) { + $criteria->where([ + 'form' => $form + ]); + } + + $context = $this->getProperty('context'); + + if (!empty($context)) { + $criteria->where([ + 'context_key' => $context + ]); + } + + $query = $this->getProperty('query'); + + if (!empty($query)) { + $criteria->where([ + 'form:LIKE' => '%' . $query . '%' + ]); + } + + $startDate = $this->getProperty('start_date'); + + if (!empty($startDate)) { + $criteria->where([ + 'date:>=' => strtotime(date('Y-m-d', strtotime($startDate)) . ' 00:00:00') + ]); + } + + $endDate = $this->getProperty('end_date'); + + if (!empty($endDate)) { + $criteria->where([ + 'date:<=' => strtotime(date('Y-m-d', strtotime($endDate)) . ' 23:59:59') + ]); + } + + $data = []; + + foreach ($this->modx->getCollection($this->classKey, $criteria) as $object) { + $array = array_merge($object->toArray(), [ + 'date' => date($this->getProperty('dateFormat'), $object->get('date')) + ]); + + $values = $object->get('values'); + + if ((int) $object->get('encrypted') === 1) { + $values = $object->decrypt($object->get('values'), $object->get('type')); + } + + $values = json_decode($values, true); + + if ($values) { + $array['values'] = $values; + } else { + $array['values'] = []; + } + + $data[] = $array; + } + + return $data; + } + + /** + * @access public. + * @return Array. + */ + public function getAvailableContexts() + { + $contexts = ['-']; + + foreach ($this->modx->getCollection('modContext') as $context) { + $contexts[] = $context->get('key'); + } + + return $contexts; + } + + /** + * @access public. + * @param Array $data. + * @param Array $columns. + * @return Array. + */ + public function getColumns(array $data = [], array $columns = []) + { + foreach ($data as $value) { + if (isset($value['values'])) { + foreach ((array) array_keys($value['values']) as $key) { + if (!in_array($key, $columns, true)) { + $columns[] = $key; + } + } + } + + } + + return $columns; + } + + /** + * @access public. + * @return mixed. + */ + public function process() + { + if (!is_dir($this->getProperty('directory'))) { + if (!mkdir($this->getProperty('directory'), 0777, true)) { + return $this->failure($this->modx->lexicon('formit.export_dir_failed')); + } + } + + $file = $this->getProperty('download'); + + if (empty($file)) { + return $this->setFile(); + } + + return $this->getFile(); + } + + /** + * @access public. + * @return mixed. + */ + public function setFile() + { + $fopen = fopen($this->getProperty('directory') . $this->getProperty('filename'), 'wb'); + + if ($fopen) { + $data = $this->getData(); + $columns = $this->getColumns($data, explode(',', $this->getProperty('columns'))); + $defaultColumns = array_map('strtolower', explode(',', $this->getProperty('columns'))); + + if ($columns) { + fputcsv($fopen, $columns, $this->getProperty('delimiter')); + + foreach ($data as $row) { + $value = []; + $row = array_change_key_case($row, CASE_LOWER); + + foreach ($columns as $column) { + if (in_array(strtolower($column), $defaultColumns, true)) { + if (isset($row[strtolower($column)])) { + $value[] = is_array($row[strtolower($column)]) ? implode(',', $row[strtolower($column)]) : $row[strtolower($column)]; + } else { + $value[] = ''; + } + } else { + if (isset($row['values'][$column])) { + $value[] = is_array($row['values'][$column]) ? implode(',', $row['values'][$column]) : $row['values'][$column]; + } else { + $value[] = ''; + } + } + } + + fputcsv($fopen, $value, $this->getProperty('delimiter')); + } + } + + fclose($fopen); + + return $this->success($this->modx->lexicon('success')); + } + + return $this->failure($this->modx->lexicon('formit.export_failed')); + } + + /** + * @access public. + * @return mixed. + */ + public function getFile() + { + $file = $this->getProperty('directory') . $this->getProperty('filename'); + + if (is_file($file)) { + $content = file_get_contents($file); + + if ($content) { + header('Content-Encoding: UTF-8'); + header('Content-Type: application/force-download'); + header('Content-Disposition: attachment; filename="' . $this->getProperty('filename') . '"'); + header("Pragma: no-cache"); + header("Expires: 0"); + echo "\xEF\xBB\xBF"; // UTF-8 BOM + + return $content; + } + } + + return $this->failure($this->modx->lexicon('formit.export_failed')); + } +} + +return 'FormItFormExportProcessor'; diff --git a/core/components/formit/processors/mgr/forms/getforms.class.php b/core/components/formit/processors/mgr/forms/getforms.class.php new file mode 100644 index 00000000..c30f095d --- /dev/null +++ b/core/components/formit/processors/mgr/forms/getforms.class.php @@ -0,0 +1,98 @@ + + */ + +class FormItFormsGetListProcessor extends modObjectGetListProcessor +{ + /** + * @access public. + * @var String. + */ + public $classKey = 'FormItForm'; + + /** + * @access public. + * @var Array. + */ + public $languageTopics = ['formit:default']; + + /** + * @access public. + * @var String. + */ + public $defaultSortField = 'form'; + + /** + * @access public. + * @var String. + */ + public $defaultSortDirection = 'DESC'; + + /** + * @access public. + * @var String. + */ + public $objectType = 'formit.form'; + + /** + * @access public. + * @return Mixed. + */ + public function initialize() + { + $this->modx->getService('formit', 'FormIt', $this->modx->getOption('formit.core_path', null, $this->modx->getOption('core_path') . 'components/formit/') . 'model/formit/'); + + $this->setDefaultProperties([ + 'limit' => 0 + ]); + + return parent::initialize(); + } + + /** + * @access public. + * @param xPDOQuery $criteria. + * @return xPDOQuery. + */ + public function prepareQueryBeforeCount(xPDOQuery $criteria) + { + $criteria->where([ + 'context_key:IN' => $this->getAvailableContexts() + ]); + + $criteria->groupby('form'); + + return $criteria; + } + + /** + * @access public. + * @param xPDOObject $object. + * @return Array. + */ + public function prepareRow(xPDOObject $object) + { + return $object->toArray(); + } + + /** + * @access public. + * @return Array. + */ + public function getAvailableContexts() + { + $contexts = ['-']; + + foreach ($this->modx->getCollection('modContext') as $context) { + $contexts[] = $context->get('key'); + } + + return $contexts; + } +} + +return 'FormItFormsGetListProcessor'; diff --git a/core/components/formit/processors/mgr/forms/getlist.class.php b/core/components/formit/processors/mgr/forms/getlist.class.php new file mode 100644 index 00000000..f2a2fbb9 --- /dev/null +++ b/core/components/formit/processors/mgr/forms/getlist.class.php @@ -0,0 +1,156 @@ + + */ + +class FormItFormsGetListProcessor extends modObjectGetListProcessor +{ + /** + * @access public. + * @var String. + */ + public $classKey = 'FormItForm'; + + /** + * @access public. + * @var Array. + */ + public $languageTopics = ['formit:default']; + + /** + * @access public. + * @var String. + */ + public $defaultSortField = 'date'; + + /** + * @access public. + * @var String. + */ + public $defaultSortDirection = 'DESC'; + + /** + * @access public. + * @var String. + */ + public $objectType = 'formit.form'; + + /** + * @access public. + * @return Mixed. + */ + public function initialize() + { + $this->modx->getService('formit', 'FormIt', $this->modx->getOption('formit.core_path', null, $this->modx->getOption('core_path') . 'components/formit/') . 'model/formit/'); + + $this->setDefaultProperties([ + 'dateFormat' => $this->modx->getOption('manager_date_format') . ', ' . $this->modx->getOption('manager_time_format') + ]); + + return parent::initialize(); + } + + /** + * @access public. + * @param xPDOQuery $criteria. + * @return xPDOQuery. + */ + public function prepareQueryBeforeCount(xPDOQuery $criteria) + { + $criteria->where([ + 'context_key:IN' => $this->getAvailableContexts() + ]); + + $form = $this->getProperty('form'); + + if (!empty($form)) { + $criteria->where([ + 'form' => $form + ]); + } + + $context = $this->getProperty('context'); + + if (!empty($context)) { + $criteria->where([ + 'context_key' => $context + ]); + } + + $query = $this->getProperty('query'); + + if (!empty($query)) { + $criteria->where([ + 'form:LIKE' => '%' . $query . '%', + 'OR:ip:LIKE' => '%' . $query . '%' + ]); + } + + $startDate = $this->getProperty('start_date'); + + if (!empty($startDate)) { + $criteria->where([ + 'date:>=' => strtotime(date('Y-m-d', strtotime($startDate)) . ' 00:00:00') + ]); + } + + $endDate = $this->getProperty('end_date'); + + if (!empty($endDate)) { + $criteria->where([ + 'date:<=' => strtotime(date('Y-m-d', strtotime($endDate)) . ' 23:59:59') + ]); + } + + return $criteria; + } + + /** + * @access public. + * @param xPDOObject $object. + * @return Array. + */ + public function prepareRow(xPDOObject $object) + { + $server_offset_time= floatval($this->modx->getOption('server_offset_time', null, 0)) * 3600; + $array = array_merge($object->toArray(), [ + 'date' => date($this->getProperty('dateFormat'), $object->get('date') + $server_offset_time) + ]); + + $values = $object->get('values'); + + if ((int) $object->get('encrypted') === 1) { + $values = $object->decrypt($object->get('values'), $object->get('type')); + } + + $values = json_decode($values, true); + + if ($values) { + $array['values'] = $values; + } else { + $array['values'] = []; + } + + return $array; + } + + /** + * @access public. + * @return Array. + */ + public function getAvailableContexts() + { + $contexts = ['-']; + + foreach ($this->modx->getCollection('modContext') as $context) { + $contexts[] = $context->get('key'); + } + + return $contexts; + } +} + +return 'FormItFormsGetListProcessor'; diff --git a/core/components/formit/processors/mgr/forms/migrate.class.php b/core/components/formit/processors/mgr/forms/migrate.class.php new file mode 100644 index 00000000..67cf4f65 --- /dev/null +++ b/core/components/formit/processors/mgr/forms/migrate.class.php @@ -0,0 +1,77 @@ +log($this->modx->lexicon('formit.encryption_unavailable')); + return $this->outputArray(array(), 0); + } + $count = 0; + $limit = 500; + + /* Search for all encrypted forms which are encrypted with old mcrypt method (encryption_type = 1) */ + $c = $this->modx->newQuery('FormItForm'); + $c->where(array( + 'encrypted' => 1, + 'encryption_type' => 1 + )); + $c->limit($limit); + $collection = $this->modx->getIterator('FormItForm', $c); + + foreach ($collection as $form) { + $oldValues = $form->get('values'); + $oldValues = $form->decrypt($oldValues, 1); + /* Fix for when forms are encrypted with openssl, but encryption_type field is not set to 2 */ + if (!is_array(json_decode($oldValues, true))) { + $newValues = $form->get('values'); + } else { + $newValues = $form->encrypt($oldValues); + } + if ($newValues) { + $this->modx->exec("UPDATE {$this->modx->getTableName('FormItForm')} + SET {$this->modx->escape('encryption_type')} = {$this->modx->quote(2)}, + {$this->modx->escape('values')} = {$this->modx->quote($newValues)} + WHERE {$this->modx->escape('id')} = {$this->modx->quote($form->get('id'))}"); + $count++; + } + } + + if ($count === 0) { + $this->log('No mcrypt encrypted forms found.'); + } else { + $this->log('-------------------------------------------------------------'); + $this->log('Successfully completed migration.'); + $this->log('A total of '.$count.' encrypted forms are migrated.'); + } + + return $this->outputArray(array(), $count); + } + + private function log($message) + { + // Decrease log level to enable INFO level logging + // First get the current log level + $logLevel = $this->modx->getOption('log_level'); + $this->modx->setLogLevel(MODx::LOG_LEVEL_INFO); + $logTarget = array( + 'target' => 'FILE', + 'options' => array( + 'filepath' => $this->modx->formit->config['assets_path'], + 'filename' => 'migration.log' + ) + ); + $this->modx->log(MODx::LOG_LEVEL_INFO, $message, $logTarget); + // Set log level back to original + $this->modx->setLogLevel($logLevel); + } +} +return 'FormItMigrateProcessor'; diff --git a/core/components/formit/processors/mgr/forms/remove.class.php b/core/components/formit/processors/mgr/forms/remove.class.php new file mode 100644 index 00000000..8e4cc29c --- /dev/null +++ b/core/components/formit/processors/mgr/forms/remove.class.php @@ -0,0 +1,41 @@ + + */ + +class FormItFormRemoveProcessor extends modObjectRemoveProcessor +{ + /** + * @access public. + * @var String. + */ + public $classKey = 'FormItForm'; + + /** + * @access public. + * @var Array. + */ + public $languageTopics = ['formit:default']; + + /** + * @access public. + * @var String. + */ + public $objectType = 'formit.form'; + + /** + * @access public. + * @return Mixed. + */ + public function initialize() + { + $this->modx->getService('formit', 'FormIt', $this->modx->getOption('formit.core_path', null, $this->modx->getOption('core_path') . 'components/formit/') . 'model/formit/'); + + return parent::initialize(); + } +} + +return 'FormItFormRemoveProcessor'; diff --git a/core/components/formit/processors/mgr/forms/removeselected.class.php b/core/components/formit/processors/mgr/forms/removeselected.class.php new file mode 100644 index 00000000..71346c00 --- /dev/null +++ b/core/components/formit/processors/mgr/forms/removeselected.class.php @@ -0,0 +1,58 @@ + + */ + +class FormItFormRemoveSelectedProcessor extends modProcessor +{ + /** + * @access public. + * @var String. + */ + public $classKey = 'FormItForm'; + + /** + * @access public. + * @var Array. + */ + public $languageTopics = ['formit:default']; + + /** + * @access public. + * @var String. + */ + public $objectType = 'formit.form'; + + /** + * @access public. + * @return Mixed. + */ + public function initialize() + { + $this->modx->getService('formit', 'FormIt', $this->modx->getOption('formit.core_path', null, $this->modx->getOption('core_path') . 'components/formit/') . 'model/formit/'); + + return parent::initialize(); + } + + /** + * @access public. + * @return Mixed. + */ + public function process() + { + $criteria = $this->modx->newQuery($this->classKey, [ + 'id:IN' => explode(',', $this->getProperty('ids')) + ]); + + foreach ($this->modx->getCollection($this->classKey, $criteria) as $object) { + $object->remove(); + } + + return $this->success(); + } +} + +return 'FormItFormRemoveSelectedProcessor'; diff --git a/core/components/formit/src/FormIt.php b/core/components/formit/src/FormIt.php new file mode 100644 index 00000000..430e7ff9 --- /dev/null +++ b/core/components/formit/src/FormIt.php @@ -0,0 +1,1139 @@ + + */ + +class FormIt +{ + /** + * @access public. + * @var \modX. + */ + public $modx; + + /** + * @access public. + * @var Array. + */ + public $config = []; + + /** + * In debug mode, will monitor execution time. + * @var int $debugTimer + */ + public $debugTimer = 0; + + /** + * True if the class has been initialized or not. + * @var bool $_initialized + */ + private $_initialized = false; + + /** + * The fiHooks instance for processing preHooks + * @var Hook $preHooks + */ + public $preHooks; + + /** + * The fiHooks instance for processing postHooks + * @var Hook $postHooks + */ + public $postHooks; + + /** + * The request handling class + * @var Request $request + */ + public $request; + + /** + * An array of cached chunk templates for processing + * @var array $chunks + */ + public $chunks = []; + + /** + * Used when running unit tests to prevent emails/headers from being sent + * @var bool $inTestMode + */ + public $inTestMode = false; + + /** + * A collection of all the errors (from prehooks/posthooks/validator). + * @var array $errors + */ + public $errors = []; + + /** + * Determine if FormIt returns the output, or handle the form normally + * @var bool $returnOutput + */ + public $returnOutput = false; + + /** + * @access public. + * @param \modX $modx. + * @param Array $config. + */ + public function __construct(\modX &$modx, array $config = []) + { + $this->modx =& $modx; + + $corePath = $this->modx->getOption('formit.core_path', $config, $this->modx->getOption('core_path') . 'components/formit/'); + $assetsUrl = $this->modx->getOption('formit.assets_url', $config, $this->modx->getOption('assets_url') . 'components/formit/'); + $assetsPath = $this->modx->getOption('formit.assets_path', $config, $this->modx->getOption('assets_path') . 'components/formit/'); + + $this->config = array_merge([ + 'namespace' => 'formit', + 'lexicons' => ['formit:default'], + 'base_path' => $corePath, + 'core_path' => $corePath, + 'model_path' => $corePath . 'model/', + 'processors_path' => $corePath . 'processors/', + 'elements_path' => $corePath . 'elements/', + 'chunks_path' => $corePath . 'elements/chunks/', + 'plugins_path' => $corePath . 'elements/plugins/', + 'snippets_path' => $corePath . 'elements/snippets/', + 'templates_path' => $corePath . 'templates/', + 'includes_path' => $corePath . 'includes/', + 'assets_path' => $assetsPath, + 'js_url' => $assetsUrl . 'js/', + 'css_url' => $assetsUrl . 'css/', + 'assets_url' => $assetsUrl, + 'connector_url' => $assetsUrl . 'connector.php', + 'version' => '4.2.1', + 'placeholderPrefix' => 'fi.', + 'debug' => (bool) $this->modx->getOption('formit.debug', null, false), + 'use_multibyte' => (bool) $this->modx->getOption('use_multibyte', null, false), + 'encoding' => $this->modx->getOption('modx_charset', null, 'UTF-8'), + 'max_chars' => (int) $this->modx->getOption('formit.max_chars_textfield', null, 125), + 'mcrypt' => function_exists('mcrypt_encrypt'), + 'openssl' => function_exists('openssl_encrypt'), + 'permissions' => [ + 'encryptions' => $this->modx->hasPermission('formit_encryptions') + ] + ], $config); + + $this->modx->addPackage('formit', $this->config['model_path']); + + if (is_array($this->config['lexicons'])) { + foreach ($this->config['lexicons'] as $lexicon) { + $this->modx->lexicon->load($lexicon); + } + } else { + $this->modx->lexicon->load($this->config['lexicons']); + } + + if ($this->config['debug']) { + $this->startDebugTimer(); + } + } + + /** + * @access public. + * @return String|Boolean. + */ + public function getHelpUrl() + { + $url = $this->getOption('branding_url_help'); + + if (!empty($url)) { + return $url . '?v=' . $this->config['version']; + } + + return false; + } + + /** + * @access public. + * @return String|Boolean. + */ + public function getBrandingUrl() + { + $url = $this->getOption('branding_url'); + + if (!empty($url)) { + return $url; + } + + return false; + } + + /** + * Initialize the component into a context and provide context-specific + * handling actions. + * + * @param string $context The context to initialize FormIt into + * + * @return mixed + */ + public function initialize($context = 'web') + { + switch ($context) { + case 'mgr': + break; + case 'web': + default: + $language = isset($this->config['language']) ? $this->config['language'] . ':' : ''; + $this->modx->lexicon->load($language . 'formit:default'); + $this->_initialized = true; + break; + } + + return $this->_initialized; + } + + /** + * Sees if the FormIt class has been initialized already + * + * @return boolean + */ + public function isInitialized() + { + return $this->_initialized; + } + + /** + * Load the fiRequest class + * + * @return Request + */ + public function loadRequest() + { + $className = $this->modx->getOption('request_class', $this->config, 'fiRequest'); + $classPath = $this->modx->getOption('request_class_path', $this->config, ''); + + if (empty($classPath)) { + $classPath = $this->config['model_path'].'formit/'; + } + + if ($this->modx->loadClass($className, $classPath, true, true)) { + $this->request = new \fiRequest($this, $this->config); + } else { + $this->modx->log(\modX::LOG_LEVEL_ERROR, '[FormIt] Could not load fiRequest class.'); + } + + return $this->request; + } + + /** + * @param string $className + * @param string $serviceName + * @param array $config + * + * @return Module + */ + public function loadModule($className, $serviceName, array $config = array()) + { + if (empty($this->$serviceName)) { + $classPath = $this->modx->getOption( + 'formit.modules_path', + null, + $this->config['model_path'].'formit/module/' + ); + + if ($this->modx->loadClass($className, $classPath, true, true)) { + $this->$serviceName = new $className($this, $config); + } else { + $this->modx->log( + \modX::LOG_LEVEL_ERROR, + '[FormIt] Could not load module: '.$className.' from '.$classPath + ); + } + } + return $this->$serviceName; + } + + /** + * Loads the Hooks class. + * + * @access public + * @param $type string The type of hook to load. + * @param $config array An array of configuration parameters for the + * hooks class + * + * @return false|Hook An instance of the fiHooks class. + */ + public function loadHooks($type = 'post', $config = []) + { + if (!$this->modx->loadClass('formit.fiHooks', $this->config['model_path'], true, true)) { + $this->modx->log(\modX::LOG_LEVEL_ERROR, '[FormIt] Could not load Hooks class.'); + + return false; + } + + $typeVar = $type . 'Hooks'; + $this->$typeVar = new \fiHooks($this, $config, $type); + + return $this->$typeVar; + } + + /** + * Process the form and return response array + * Does not execute redirect, but add redirect_url to response + * + * @return array + */ + public function processForm() + { + $this->returnOutput = true; + $this->loadRequest(); + $this->request->prepare(); + $this->request->handle(); + + // By default form is successfull + $response = [ + 'success' => true, + 'message' => $this->request->config['successMessage'] + ]; + + // Check for errors + if ($this->hasErrors()) { + $response['success'] = false; + $response['error_count'] = count($this->errors); + $errorMessage = $this->modx->getPlaceholder( + $this->modx->getOption('placeholderPrefix', $this->request->config, null).'validation_error_message' + ); + $response['message'] = $errorMessage; + $response['errors'] = $this->getErrors(); + } + + // Add the form fields to output + $response['fields'] = $this->request->dictionary->fields; + + // Check for redirect + if ($this->postHooks && $this->hasHook('redirect')) { + $url = $this->postHooks->getRedirectUrl(); + $response['redirect_url'] = $url; + } + + return $response; + } + + /** + * Gets a unique session-based store key for storing form submissions. + * + * @return string + */ + public function getStoreKey() + { + return $this->modx->context->get('key') . '/elements/formit/submission/' . md5(session_id()); + } + + /** + * Gets a Chunk and caches it; also falls back to file-based templates + * for easier debugging. + * + * Will always use the file-based chunk if $debug is set to true. + * + * @access public + * @param string $name The name of the Chunk + * @param array $properties The properties for the Chunk + * @return string The processed content of the Chunk + */ + public function getChunk($name, $properties = array()) + { + if (class_exists('ModxPro\PdoTools\Fetch') && $pdo = $this->modx->getService('pdoTools')) { + return $pdo->getChunk($name, $properties); + } + + $chunk = null; + + 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); + } + + if (empty($chunk)) { + $chunk = $this->_getTplChunk($name); + if ($chunk === false) { + return false; + } + } + + $this->chunks[$name] = $chunk->getContent(); + } else { + $content = $this->chunks[$name]; + $chunk = $this->modx->newObject('modChunk'); + $chunk->setContent($content); + } + + $chunk->setCacheable(false); + + return $chunk->process($properties); + } + + /** + * Returns a modChunk object from a template file. + * + * @access private + * @param string $name The name of the Chunk. Will parse to name.chunk.tpl + * + * @return \modChunk|boolean Returns the modChunk object if found, otherwise + * false. + */ + public function _getTplChunk($name) + { + $chunk = false; + if (file_exists($name)) { + $file = $name; + } else { + $lowerCaseName = $this->config['use_multibyte'] ? mb_strtolower($name, $this->config['encoding']) : strtolower($name); + $file = $this->config['chunks_path'] . $lowerCaseName . '.chunk.tpl'; + } + + if (file_exists($file)) { + $content = file_get_contents($file); + /** @var \modChunk $chunk */ + $chunk = $this->modx->newObject('modChunk'); + $chunk->set('name', $name); + $chunk->setContent($content); + } + + return $chunk; + } + + /** + * Output the final output and wrap in the wrapper chunk. Optional, but + * recommended for debugging as it outputs the execution time to the output. + * + * Also, it is good to output your snippet code with wrappers for easier + * CSS isolation and styling. + * + * @param string $output The output to process + * + * @return string The final wrapped output + */ + public function output($output) + { + if ($this->debugTimer !== false) { + $output .= "
    \nExecution time: " . $this->endDebugTimer() . "\n"; + } + + return $output; + } + + /** + * Starts the debug timer. + * + * @return int The start time. + */ + protected function startDebugTimer() + { + $mtime = microtime(); + $mtime = explode(' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; + $tstart = $mtime; + + $this->debugTimer = $tstart; + + return $this->debugTimer; + } + + /** + * Ends the debug timer and returns the total number of seconds script took + * to run. + * + * @access protected + * @return int The end total time to execute the script. + */ + protected function endDebugTimer() + { + $mtime = microtime(); + $mtime = explode(" ", $mtime); + $mtime = $mtime[1] + $mtime[0]; + $tend = $mtime; + + $totalTime = ($tend - $this->debugTimer); + $totalTime = sprintf("%2.4f s", $totalTime); + + $this->debugTimer = false; + + return $totalTime; + } + + public function setOption($key, $value) + { + $this->config[$key] = $value; + } + + public function setOptions($options) + { + foreach ($options as $key => $value) { + $this->setOption($key, $value); + } + } + + public function encryptionMigrationStatus() + { + $migrationStatus = true; + if ($this->modx->getCount('FormItForm', array('encrypted' => 1, 'encryption_type' => 1))) { + $migrationStatus = false; + } + + return $migrationStatus; + } + + /** + * Check to see if a hook has been passed + * + * @param string $hook + * + * @return bool + */ + public function hasHook($hook) + { + $hook = $this->getHookName($hook); + return !!preg_match('#\\b' . preg_quote($hook, '#') . '\\b#i', $this->config['hooks']); + } + + /** + * Helper for returning the correct hookname + * Ensures backwards compatibility with older (<3.0.4) versions + * + * @param string $name The name of the hook + * + * @return string The correct name + */ + public function getHookName($name) + { + if ($name === 'FormItAutoResponder') { + $name = 'autoresponder'; + } + if ($name === 'FormItSaveForm') { + $name = 'saveform'; + } + return $name; + } + + /** + * Helper function for creating hooks + * This will overwrite all previously set hooks, + * and set the 'hooks' formit property. + * + * @param $hooks array An array of hooks + */ + public function setHooks(array $hooks) + { + if (is_array($hooks)) { + $this->setOption('hooks', implode(',', $hooks)); + } + } + + /** + * Helper function for creating preHooks + * This will overwrite all previously set preHooks, + * and set the 'preHooks' formit property. + * + * @param $preHooks array An array of hooks + */ + public function setPreHooks(array $preHooks) + { + if (is_array($preHooks)) { + $this->setOption('preHooks', implode(',', $preHooks)); + } + } + + /** + * Helper function for setting the 'submitVar' property + * + * @param $value string the submitVar value + */ + public function setSubmitVar($value) + { + $this->setOption('submitVar', $value); + } + + /** + * Helper function for setting the 'validationErrorMessage' property + * + * @param $value string the validationErrorMessage value + */ + public function setValidationErrorMessage($value) + { + $this->setOption('validationErrorMessage', $value); + } + + /** + * Helper function for setting the 'validationErrorBulkTpl' property + * + * @param $value string the validationErrorBulkTpl value + */ + public function setValidationErrorBulkTpl($value) + { + $this->setOption('validationErrorBulkTpl', $value); + } + + /** + * Helper function for setting the 'errTpl' property + * + * @param $value string the errTpl value + */ + public function setErrTpl($value) + { + $this->setOption('errTpl', $value); + } + + /** + * Helper function for setting the 'customValidators' property + * + * @param $validators array an array with custom validators + */ + public function setCustomValidators(array $validators) + { + if (is_array($validators)) { + $this->setOption('customValidators', implode(',', $validators)); + } + } + + /** + * Helper function for setting the 'clearFieldsOnSuccess' property + * + * @param $value boolean the clearFieldsOnSuccess value + */ + public function setClearFieldsOnSuccess($value) + { + $this->setOption('clearFieldsOnSuccess', $value); + } + + /** + * Helper function for setting the 'store' property + * + * @param $value boolean the store value + */ + public function setStore($value) + { + $this->setOption('store', $value); + } + + /** + * Helper function for setting the 'storeTime' property + * + * @param $value int the storeTime value + */ + public function setStoreTime($value) + { + $this->setOption('storeTime', $value); + } + + /** + * Helper function for setting the 'storeLocation' property + * + * @param $value string the storeLocation value + */ + public function setStoreLocation($value) + { + $this->setOption('storeLocation', $value); + } + + /** + * Helper function for setting the 'placeholderPrefix' property + * + * @param $value string the placeholderPrefix value + */ + public function setPlaceholderPrefix($value) + { + $this->setOption('placeholderPrefix', $value); + } + + /** + * Helper function for setting the 'successMessage' property + * + * @param $value string the successMessage value + */ + public function setSuccessMessage($value) + { + $this->setOption('successMessage', $value); + } + + /** + * Helper function for setting the 'redirectTo' property + * + * @param $value int the redirectTo value + */ + public function setRedirectTo($value) + { + $this->setOption('redirectTo', $value); + } + + /** + * Helper function for setting the 'redirectParams' property + * + * @param $params array the redirectParams array + */ + public function setRedirectParams(array $params) + { + if (is_array($params)) { + $this->setOption('redirectParams', json_encode($params)); + } + } + + /** + * Helper function for setting the 'allowFiles' property + * + * @param $value boolean the allowFiles value + */ + public function setAllowFiles($value) + { + $this->setOption('allowFiles', $value); + } + + /** + * Helper function for setting the 'validate' property + * + * @param $validate array the validate array + */ + public function setValidate(array $validate) + { + if (is_array($validate)) { + $this->setOption('validate', implode(',', $validate)); + } + } + + /** + * Helper function for setting the 'emailTpl' property + * + * @param $value string the emailTpl value + */ + public function setEmailTpl($value) + { + $this->setOption('emailTpl', $value); + } + + /** + * Helper function for setting the 'emailSubject' property + * + * @param $value string the emailSubject value + */ + public function setEmailSubject($value) + { + $this->setOption('emailSubject', $value); + } + + /** + * Helper function for setting the 'emailUseFieldForSubject' property + * + * @param $value bool the emailUseFieldForSubject value + */ + public function setEmailUseFieldForSubject($value) + { + $this->setOption('emailUseFieldForSubject', $value); + } + + /** + * Helper function for setting the 'emailTo' property + * + * @param $addresses array An array with emailaddresses + */ + public function setEmailTo(array $addresses) + { + if (is_array($addresses)) { + $this->setOption('emailTo', implode(',', $addresses)); + } + } + + /** + * Helper function for setting the 'emailToName' property + * + * @param $names array An array with email names + */ + public function setEmailToName(array $names) + { + if (is_array($names)) { + $this->setOption('emailToName', implode(',', $names)); + } + } + + /** + * Helper function for setting the 'emailFrom' property + * + * @param $value string the emailFrom value + */ + public function setEmailFrom($value) + { + $this->setOption('emailFrom', $value); + } + + /** + * Helper function for setting the 'emailFromName' property + * + * @param $value string the emailFromName value + */ + public function setEmailFromName($value) + { + $this->setOption('emailFromName', $value); + } + + /** + * Helper function for setting the 'emailHtml' property + * + * @param $value bool the emailHtml value + */ + public function setEmailHtml($value) + { + $this->setOption('emailHtml', $value); + } + + /** + * Helper function for setting the 'emailConvertNewlines' property + * + * @param $value bool the emailConvertNewlines value + */ + public function setEmailConvertNewlines($value) + { + $this->setOption('emailConvertNewlines', $value); + } + + /** + * Helper function for setting the 'emailReplyTo' property + * + * @param $value string the emailReplyTo value + */ + public function setEmailReplyTo($value) + { + $this->setOption('emailReplyTo', $value); + } + + /** + * Helper function for setting the 'emailReplyToName' property + * + * @param $value string the emailReplyToName value + */ + public function setEmailReplyToName($value) + { + $this->setOption('emailReplyToName', $value); + } + + /** + * Helper function for setting the 'emailCC' property + * + * @param $addresses array the emailCC addresses + */ + public function setEmailCC($addresses) + { + if (is_array($addresses)) { + $this->setOption('emailCC', implode(',', $addresses)); + } + } + + /** + * Helper function for setting the 'emailCCName' property + * + * @param $names array the emailCCName email names + */ + public function setEmailCCName($names) + { + if (is_array($names)) { + $this->setOption('emailCCName', implode(',', $names)); + } + } + + /** + * Helper function for setting the 'emailBCC' property + * + * @param $addresses array the emailBCC addresses + */ + public function setEmailBCC($addresses) + { + if (is_array($addresses)) { + $this->setOption('emailBCC', implode(',', $addresses)); + } + } + + /** + * Helper function for setting the 'emailBCCName' property + * + * @param $names array the emailBCCName email names array + */ + public function setEmailBCCName($names) + { + if (is_array($names)) { + $this->setOption('emailBCCName', implode(',', $names)); + } + } + + /** + * Helper function for setting the 'emailMultiWrapper' property + * + * @param $value string the emailMultiWrapper value + */ + public function setEmailMultiWrapper($value) + { + $this->setOption('emailMultiWrapper', $value); + } + + /** + * Helper function for setting the 'emailMultiSeparator' property + * + * @param $value string the emailMultiSeparator value + */ + public function setEmailMultiSeparator($value) + { + $this->setOption('emailMultiSeparator', $value); + } + + /** + * Helper function for setting the 'fiarTpl' property + * + * @param $value string the fiarTpl value + */ + public function setFiarTpl($value) + { + $this->setOption('fiarTpl', $value); + } + + /** + * Helper function for setting the 'fiarSubject' property + * + * @param $value string the fiarSubject value + */ + public function setFiarSubject($value) + { + $this->setOption('fiarSubject', $value); + } + + /** + * Helper function for setting the 'fiarToField' property + * + * @param $value string the fiarToField value + */ + public function setFiarToField($value) + { + $this->setOption('fiarToField', $value); + } + + /** + * Helper function for setting the 'fiarFrom' property + * + * @param $value string the fiarFrom value + */ + public function setFiarFrom($value) + { + $this->setOption('fiarFrom', $value); + } + + /** + * Helper function for setting the 'fiarFromName' property + * + * @param $value string the fiarFromName value + */ + public function setFiarFromName($value) + { + $this->setOption('fiarFromName', $value); + } + + /** + * Helper function for setting the 'fiarSender' property + * + * @param $value string the fiarSender value + */ + public function setFiarSender($value) + { + $this->setOption('fiarSender', $value); + } + + /** + * Helper function for setting the 'fiarHtml' property + * + * @param $value string the fiarHtml value + */ + public function setFiarHtml($value) + { + $this->setOption('fiarHtml', $value); + } + + /** + * Helper function for setting the 'fiarReplyTo' property + * + * @param $value string the fiarReplyTo value + */ + public function setFiarReplyTo($value) + { + $this->setOption('fiarReplyTo', $value); + } + + /** + * Helper function for setting the 'fiarReplyToName' property + * + * @param $value string the fiarReplyToName value + */ + public function setFiarReplyToName($value) + { + $this->setOption('fiarReplyToName', $value); + } + + /** + * Helper function for setting the 'fiarCC' property + * + * @param $value string the fiarCC value + */ + public function setFiarCC($value) + { + $this->setOption('fiarCC', $value); + } + + /** + * Helper function for setting the 'fiarCCName' property + * + * @param $value string the fiarCCName value + */ + public function setFiarCCName($value) + { + $this->setOption('fiarCCName', $value); + } + + /** + * Helper function for setting the 'fiarBCC' property + * + * @param $value string the fiarBCC value + */ + public function setFiarBCC($value) + { + $this->setOption('fiarBCC', $value); + } + + /** + * Helper function for setting the 'fiarBCCName' property + * + * @param $value string the fiarBCCName value + */ + public function setFiarBCCName($value) + { + $this->setOption('fiarBCCName', $value); + } + + /** + * Helper function for setting the 'fiarMultiWrapper' property + * + * @param $value string the fiarMultiWrapper value + */ + public function setFiarMultiWrapper($value) + { + $this->setOption('fiarMultiWrapper', $value); + } + + /** + * Helper function for setting the 'fiarMultiSeparator' property + * + * @param $value string the fiarMultiSeparator value + */ + public function setFiarMultiSeparator($value) + { + $this->setOption('fiarMultiSeparator', $value); + } + + /** + * Helper function for setting the 'fiarFiles' property + * + * @param $value string the fiarFiles value + */ + public function setFiarFiles($value) + { + $this->setOption('fiarFiles', $value); + } + + /** + * Helper function for setting the 'fiarRequired' property + * + * @param $value string the fiarRequired value + */ + public function setFiarRequired($value) + { + $this->setOption('fiarRequired', $value); + } + + /** + * Helper function for setting the Saveform 'formName' property + * + * @param $value string the formName value + */ + public function setFormName($value) + { + $this->setOption('formName', $value); + } + + /** + * Helper function for setting the 'formEncrypt' property + * + * @param $value bool the formEncrypt value + */ + public function setFormEncrypt($value) + { + $this->setOption('formEncrypt', $value); + } + + /** + * Helper function for setting the 'formFields' property + * + * @param $fields array an array of formfields to add to Formsave + */ + public function setFormFields($fields) + { + if (is_array($fields)) { + $this->setOption('formFields', implode(',', $fields)); + } + } + + /** + * Helper function for setting the 'fieldNames' property + * + * @param $names array the fieldNames array + */ + public function setFieldNames($names) + { + if (is_array($names)) { + $this->setOption('fieldNames', implode(',', $names)); + } + } + + + /** + * Check for errors in prehooks, posthooks or validator + */ + public function hasErrors() + { + $hasErrors = false; + if ($this->preHooks && $this->preHooks->hasErrors()) { + $this->errors['preHooks'][] = $this->preHooks->getErrors(); + $hasErrors = true; + } + + if ($this->postHooks && $this->postHooks->hasErrors()) { + $this->errors['hooks'][] = $this->postHooks->getErrors(); + $hasErrors = true; + } + + if ($this->request->validator && $this->request->validator->hasErrors()) { + $this->errors['validate'][] = $this->request->validator->getErrors(); + $hasErrors = true; + } + return $hasErrors; + } + + /** + * Check for errors in prehooks, posthooks or validator + */ + public function getErrors() + { + return $this->errors; + } + + public function __call($name, $arguments) + { + // TODO: redirect all the set** methods to some Helper class + } +} diff --git a/core/components/formit/src/FormIt/Dictionary.php b/core/components/formit/src/FormIt/Dictionary.php new file mode 100644 index 00000000..2d095ed7 --- /dev/null +++ b/core/components/formit/src/FormIt/Dictionary.php @@ -0,0 +1,288 @@ +name pairs storing the fields passed + * @var array $fields + */ + public $fields = []; + + /** + * @param \Sterc\FormIt $formit + * @param array $config + */ + function __construct($formit, $config = []) + { + $this->formit = $formit; + $this->modx = $formit->modx; + $this->config = array_merge($this->config, $config); + } + + /** + * Get the fields from POST + * + * @param array $fields A default set of fields to load + */ + public function gather($fields = []) + { + if (empty($fields)) { + $fields = []; + } + + $this->fields = array_merge($fields, $_POST); + + /* Check for files and save to tmp folder */ + if (!empty($_FILES)) { + /* Only save files if these properties are true */ + if ($this->modx->getOption('allowFiles', $this->config, false) && + $this->modx->getOption('saveTmpFiles', $this->config, false) + ) { + foreach ($_FILES as $key => $value) { + if (is_array($value['name'])) { + foreach ($value['name'] as $fKey => $fValue) { + $this->saveFile( + $key . '_' . $fKey, + $value['name'][$fKey], + $value['tmp_name'][$fKey], + $value['error'][$fKey] + ); + } + } else { + $this->saveFile( + $key, + $value['name'], + $value['tmp_name'], + $value['error'] + ); + } + + } + } + + $this->fields = array_merge($this->fields, $_FILES); + } + } + + /** + * Save file. + * + * @param string $key + * @param string $name + * @param string $tmp_name + * @param int $error + */ + public function saveFile($key, $name, $tmp_name, $error) + { + $info = pathinfo($name); + $ext = $info['extension']; + $ext = strtolower($ext); + + if ($error !== 0) { + return; + } + + $allowedFileTypes = array_merge( + explode(',', $this->modx->getOption('upload_images')), + explode(',', $this->modx->getOption('upload_media')), + explode(',', $this->modx->getOption('upload_flash')), + explode(',', $this->modx->getOption('upload_files', null, '')) + ); + $allowedFileTypes = array_unique($allowedFileTypes); + + /* Make sure that dangerous file types are not allowed */ + unset( + $allowedFileTypes['php'], + $allowedFileTypes['php4'], + $allowedFileTypes['php5'], + $allowedFileTypes['htm'], + $allowedFileTypes['html'], + $allowedFileTypes['phtml'], + $allowedFileTypes['js'], + $allowedFileTypes['bin'], + $allowedFileTypes['csh'], + $allowedFileTypes['out'], + $allowedFileTypes['run'], + $allowedFileTypes['sh'], + $allowedFileTypes['htaccess'] + ); + + /* Check file extension */ + if (empty($ext) || !in_array($ext, $allowedFileTypes)) { + return; + } + + /* Check filesize */ + $maxFileSize = $this->modx->getOption('upload_maxsize', null, 1048576); + $size = filesize($tmp_name); + if ($size > $maxFileSize) { + return; + } + + $basePath = $this->formit->config['assets_path'].'tmp/'; + if (!is_dir($basePath)) { + mkdir($basePath); + } + + $tmpFileName = md5(session_id().$key.mt_rand(100, 999)).'-'.$info['basename']; + $target = $basePath.$tmpFileName; + + move_uploaded_file($tmp_name, $target); + + $_FILES[$key]['tmp_name'] = $target; + $_SESSION['formit']['tmp_files'][] = $target; + } + + /** + * Set a value + * + * @param string $field + * @param mixed $value + */ + public function set($field, $value) + { + $this->fields[$field] = $value; + } + + /** + * Get a field value + * + * @param string $field + * + * @return mixed + */ + public function get($field) + { + return $this->fields[$field]; + } + + /** + * Return all field values in an array of key->name pairs + * + * @return array + */ + public function toArray() + { + return $this->fields; + } + + /** + * Set a variable number of fields by passing in a key->name pair array + * + * @param array $data + */ + public function fromArray($data) + { + foreach ($data as $key => $value) { + $this->fields[$key] = $value; + } + } + + /** + * Remove a field from the stack + * + * @param string $key + */ + public function remove($key) + { + unset($this->fields[$key]); + } + + /** + * Stash the fields into the cache + */ + public function store() + { + /* default to store data for 5 minutes */ + $storeTime = $this->modx->getOption('storeTime', $this->config, 300); + $data = $this->toArray(); + + if ($this->modx->getOption('storeLocation', $this->config, 'cache') == 'session') { + /* store it in the session */ + $_SESSION['formitStore'] = array( + /* default to store data for 5 minutes */ + 'valid' => time() + $storeTime, + 'data' => $data + ); + } else { + /* create the hash to store it in the MODX cache */ + $cacheKey = $this->formit->getStoreKey(); + $this->modx->cacheManager->set($cacheKey, $data, $storeTime); + } + + unset($data); + } + + /** + * Retrieve the fields from the cache + * + * @return mixed + */ + public function retrieve() + { + if ($this->modx->getOption('storeLocation', $this->config, 'cache') == 'session') { + if (isset($_SESSION['formitStore']) && time() <= $_SESSION['formitStore']['valid']) { + return $_SESSION['formitStore']['data']; + } + + return false; + } + + $cacheKey = $this->formit->getStoreKey(); + + return $this->modx->cacheManager->get($cacheKey); + } + + /** + * Erase the stored fields + * + * @return bool + */ + public function erase() + { + if ($this->modx->getOption('storeLocation', $this->config, 'cache') == 'session') { + if (isset($_SESSION['formitStore'])) { + unset($_SESSION['formitStore']); + } + + return true; + } + + $cacheKey = $this->formit->getStoreKey(); + + return $this->modx->cacheManager->delete($cacheKey); + } + + /** + * Reset fields. + */ + public function reset() + { + $this->fields = []; + } +} diff --git a/core/components/formit/src/FormIt/Form.php b/core/components/formit/src/FormIt/Form.php new file mode 100644 index 00000000..34777737 --- /dev/null +++ b/core/components/formit/src/FormIt/Form.php @@ -0,0 +1,8 @@ +formit =& $formit; + $this->modx = $formit->modx; + $this->config = array_merge([ + 'errTpl' => '[[+error]]', + 'mathField' => 'math', + 'mathOp1Field' => 'op1', + 'mathOp2Field' => 'op2', + 'mathOperatorField' => 'operator', + 'hookErrorJsonOutputPlaceholder' => '' + ], $config); + + $this->type = $type; + } + + /** + * Loads an array of hooks. If one fails, will not proceed. + * + * @param array $hooks The hooks to run. + * @param array $fields The fields and values of the form + * @param array $errors The errors of the form. + * @param array $customProperties An array of extra properties to send to the hook + * + * @return array An array of field name => value pairs. + */ + public function loadMultiple($hooks, $fields = [], $errors = [], $customProperties = []) + { + if (empty($hooks)) { + return []; + } + + if (is_string($hooks)) { + $hooks = explode(',', $hooks); + } + + $this->hooks = array(); + $this->fields =& $fields; + + foreach ($hooks as $hook) { + $hook = trim($hook); + $success = $this->load($hook, $this->fields, $customProperties); + + if (!$success) { + return $this->hooks; + } + /* dont proceed if hook fails */ + } + + return $this->hooks; + } + + /** + * Load a hook. Stores any errors for the hook to $this->errors. + * + * @param string $hookName The name of the hook. May be a Snippet name. + * @param array $fields The fields and values of the form. + * @param array $errors The errors of the form. + * @param array $customProperties Any other custom properties to load into a custom hook. + * + * @return bool True if hook was successful. + */ + public function load($hookName, $fields = [], $errors = [], $customProperties = []) + { + $success = false; + if (!empty($fields)) { + $this->fields =& $fields; + } + $hookName = $this->formit->getHookName($hookName); + $this->hooks[] = $hookName; + + $className = 'Sterc\FormIt\Hook\\'.ucfirst($hookName); + $reserved = array('load','_process','__construct','getErrorMessage'); + if (class_exists($className) && !in_array($hookName, $reserved)) { + $class = new $className($this, $this->config); + $success = $class->process($fields); + } elseif ($snippet = $this->modx->getObject('modSnippet', array('name' => $hookName))) { + /* custom snippet hook */ + $properties = array_merge($this->formit->config, $customProperties); + $properties['formit'] =& $this->formit; + $properties['hook'] =& $this; + $properties['fields'] = $this->fields; + $properties['errors'] = array_merge($errors, $this->errors); + $success = $snippet->process($properties); + } else { + /* search for a file-based hook */ + $this->modx->parser->processElementTags('', $hookName, true, true); + if (file_exists($hookName)) { + $success = $this->_loadFileBasedHook($hookName, $customProperties); + } else { + /* no hook found */ + $this->modx->log(\modX::LOG_LEVEL_ERROR, '[FormIt] Could not find hook "'.$hookName.'".'); + $success = true; + } + } + + if (is_array($success) && !empty($success)) { + $this->errors = array_merge($this->errors, $success); + $success = false; + } elseif ($success != true) { + if (!isset($this->errors[$hookName])) { + $this->errors[$hookName] = ''; + } + $this->errors[$hookName] .= ' '.$success; + $success = false; + } + + return $success; + } + + /** + * Attempt to load a file-based hook given a name + * + * @param string $path The absolute path of the hook file + * @param array $customProperties An array of custom properties to run with the hook + * + * @return bool True if the hook succeeded + */ + private function _loadFileBasedHook($path, $customProperties = []) + { + $success = false; + + try { + $success = include $path; + } catch (\Exception $e) { + $this->modx->log(\modX::LOG_LEVEL_ERROR,'[FormIt] '.$e->getMessage()); + } + + return $success; + } + + /** + * Gets the error messages compiled into a single string. + * + * @param string $delim The delimiter between each message. + * + * @return string The concatenated error message + */ + public function getErrorMessage($delim = "\n") + { + return implode($delim,$this->errors); + } + + /** + * Adds an error to the stack. + * + * @param string $key The field to add the error to. + * @param string $value The error message. + * + * @return string The added error message with the error wrapper. + */ + public function addError($key, $value) + { + if (!isset($this->errors[$key])) { + $this->errors[$key] = ''; + } + + $this->errors[$key] .= $value; + + return $this->errors[$key]; + } + + /** + * See if there are any errors in the stack. + * + * @return bool + */ + public function hasErrors() + { + return !empty($this->errors); + } + + /** + * Get all errors for this current request + * + * @return array + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Sets the value of a field. + * + * @param string $key The field name to set. + * @param mixed $value The value to set to the field. + * + * @return mixed The set value. + */ + public function setValue($key, $value) + { + $this->fields[$key] = $value; + + return $this->fields[$key]; + } + + /** + * Sets an associative array of field name and values. + * + * @param array $values A key/name pair of fields and values to set. + */ + public function setValues(array $values) + { + foreach ($values as $key => $value) { + $this->setValue($key, $value); + } + } + + /** + * Gets the value of a field. + * + * @param string $key The field name to get. + * @return mixed The value of the key, or null if non-existent. + */ + public function getValue($key) + { + if (array_key_exists($key, $this->fields)) { + return $this->fields[$key]; + } + + return null; + } + + /** + * Gets an associative array of field name and values. + * + * @return array $values A key/name pair of fields and values. + */ + public function getValues() + { + return $this->fields; + } + + /** + * Processes string and sets placeholders + * + * @param string $str The string to process + * @param array $placeholders An array of placeholders to replace with values + * + * @return string The parsed string + */ + public function _process($str, $placeholders = []) + { + if (is_string($str)) { + foreach ($placeholders as $k => $v) { + if (is_scalar($k) && is_scalar($v)) { + $str = str_replace('[[+'.$k.']]',$v,$str); + } + } + } + + $this->modx->parser->processElementTags('',$str,true,false); + + return $str; + } + + /** + * Set a URL to redirect to after all hooks run successfully. + * + * @param string $url The URL to redirect to after all hooks execute + */ + public function setRedirectUrl($url) + { + $this->redirectUrl = $url; + } + + /** + * Get the specified redirection url + * + * @return null|string + */ + public function getRedirectUrl() + { + return $this->redirectUrl; + } + + /** + * Process any errors returned by the hooks and set them to placeholders + */ + public function processErrors() + { + $errors = array(); + $jsonerrors = array(); + $jsonOutputPlaceholder = $this->config['hookErrorJsonOutputPlaceholder']; + + if (!empty($jsonOutputPlaceholder)) { + $jsonerrors = array( + 'errors' => array(), + 'success' => false, + 'message' => '', + ); + } + + $placeholderErrors = $this->getErrors(); + foreach ($placeholderErrors as $key => $error) { + $errors[$key] = str_replace('[[+error]]', $error, $this->config['errTpl']); + if (!empty($jsonOutputPlaceholder)) { + $jsonerrors['errors'][$key] = $errors[$key]; + } + } + + $this->modx->toPlaceholders($errors, $this->config['placeholderPrefix'].'error'); + + $errorMsg = $this->getErrorMessage(); + if (!empty($errorMsg)) { + $this->modx->setPlaceholder($this->config['placeholderPrefix'].'error_message', $errorMsg); + if (!empty($jsonOutputPlaceholder)) { + $jsonerrors['message'] = $errorMsg; + } + } + + if (!empty($jsonOutputPlaceholder)) { + $jsonoutput = $this->modx->toJSON($jsonerrors); + $this->modx->setPlaceholder($jsonOutputPlaceholder, $jsonoutput); + } + } + + /** + * Gather fields and set them into placeholders for pre-fetching + * + * @return array + */ + public function gatherFields() + { + if (empty($this->fields)) { + return []; + } + + $fs = $this->getValues(); + + /* better handling of checkbox values when input name is an array[] */ + foreach ($fs as $f => $v) { + if (is_array($v)) { $v = implode(',',$v); } + $fs[$f] = $v; + } + + $this->modx->toPlaceholders($fs,$this->config['placeholderPrefix'], ''); + + return $this->getValues(); + } +} diff --git a/core/components/formit/src/FormIt/Hook/Autoresponder.php b/core/components/formit/src/FormIt/Hook/Autoresponder.php new file mode 100644 index 00000000..77409a9d --- /dev/null +++ b/core/components/formit/src/FormIt/Hook/Autoresponder.php @@ -0,0 +1,208 @@ +hook =& $hook; + $this->formit =& $hook->formit; + $this->modx = $hook->formit->modx; + $this->config = array_merge($this->config, $config); + } + + /** + * Send an autoresponder email of the form. + * + * Properties: + * fiarTpl Required. Tpl chunk for auto-response message. + * fiarSubject The subject of the email. + * fiarToField The name of the form field to use as the submitter's email. Defaults to "email". + * fiarFrom Optional. If set, will specify the From: address for the email. + * Defaults to the `emailsender` system setting. + * fiarFromName Optional. If set, will specify the From: name for the email. + * fiarSender Optional. Specify the email Sender header. Defaults to the `emailsender` system setting. + * fiarHtml Optional. Whether or not the email should be in HTML-format. Defaults to true. + * fiarReplyTo Required.An email to set as the reply-to. + * fiarReplyToName Optional. The name for the Reply-To field. + * fiarCC A comma-separated list of emails to send via cc. + * fiarCCName Optional. A comma-separated list of names to pair with the fiarCC values. + * fiarBCC A comma-separated list of emails to send via bcc. + * fiarBCCName Optional. A comma-separated list of names to pair with the fiarBCC values. + * fiarMultiWrapper Wraps values submitted by checkboxes/multi-selects with this value. + * Defaults to just the value. + * fiarMultiSeparator Separates checkboxes/multi-selects with this value. Defaults to a newline. ("\n") + * fiarFiles Optional. Comma separated list of files to add as attachment to the email. + * You cannot use a url here, only a local filesystem path. + * fiarRequired Optional. If set to false, the FormItAutoResponder hook doesn't stop + * when the field defined in 'fiarToField' is left empty. Defaults to true. + * + * @param array $fields An array of cleaned POST fields + * + * @return bool True if email was successfully sent. + */ + public function process($fields = []) + { + $tpl = $this->modx->getOption('fiarTpl', $this->formit->config, 'fiDefaultFiarTpl', true); + $mailFrom = $this->modx->getOption('fiarFrom', $this->formit->config, $this->modx->getOption('emailsender')); + $mailFromName = $this->modx->getOption('fiarFromName', $this->formit->config, $this->modx->getOption('site_name')); + $mailSender = $this->modx->getOption('fiarSender', $this->formit->config, $this->modx->getOption('emailsender')); + $mailSubject = $this->modx->getOption('fiarSubject', $this->formit->config, '[[++site_name]] Auto-Responder'); + $mailSubject = str_replace( + array('[[++site_name]]', '[[++emailsender]]'), + array($this->modx->getOption('site_name'), $this->modx->getOption('emailsender')), + $mailSubject + ); + $fiarFiles = $this->modx->getOption('fiarFiles', $this->formit->config, false); + $isHtml = $this->modx->getOption('fiarHtml', $this->formit->config, true); + $toField = $this->modx->getOption('fiarToField', $this->formit->config, 'email'); + $multiSeparator = $this->modx->getOption('fiarMultiSeparator', $this->formit->config, "\n"); + $multiWrapper = $this->modx->getOption('fiarMultiWrapper', $this->formit->config, '[[+value]]'); + $required = $this->modx->getOption('fiarRequired', $this->formit->config, true); + if (empty($fields[$toField])) { + if ($required) { + $this->modx->log( + \modX::LOG_LEVEL_ERROR, + '[FormIt] Auto-responder could not find field `'.$toField.'` in form submission.' + ); + return false; + } else { + return true; + } + } + + /* handle checkbox and array fields */ + foreach ($fields as $k => $v) { + if (is_array($v) && !empty($v['name']) && isset($v['error']) && $v['error'] == UPLOAD_ERR_OK) { + $fields[$k] = $v['name']; + } elseif (is_array($v)) { + $vOpts = array(); + foreach ($v as $vKey => $vValue) { + if (is_string($vKey) && !empty($vKey)) { + $vKey = $k.'.'.$vKey; + $fields[$vKey] = $vValue; + } else { + $vOpts[] = str_replace('[[+value]]', $vValue, $multiWrapper); + } + } + $newValue = implode($multiSeparator, $vOpts); + if (!empty($vOpts)) { + $fields[$k] = $newValue; + } + } + } + + /* setup placeholders */ + $placeholders = $fields; + $mailTo= $fields[$toField]; + + $message = $this->formit->getChunk($tpl, $fields); + $message = $this->hook->_process($message, $this->config); + + $this->modx->getService('mail', 'mail.modPHPMailer'); + $this->modx->mail->set(\modMail::MAIL_BODY, $message); + $this->modx->mail->set(\modMail::MAIL_FROM, $this->hook->_process($mailFrom, $placeholders)); + $this->modx->mail->set(\modMail::MAIL_FROM_NAME, $this->hook->_process($mailFromName, $placeholders)); + $this->modx->mail->set(\modMail::MAIL_SENDER, $this->hook->_process($mailSender, $placeholders)); + $this->modx->mail->set(\modMail::MAIL_SUBJECT, $this->hook->_process($mailSubject, $placeholders)); + $this->modx->mail->address('to', $mailTo); + $this->modx->mail->setHTML($isHtml); + + /* add attachments */ + if ($fiarFiles) { + $fiarFiles = explode(',', $fiarFiles); + foreach ($fiarFiles as $file) { + $this->modx->mail->mailer->AddAttachment($file); + } + } + + /* reply to */ + $emailReplyTo = $this->modx->getOption('fiarReplyTo', $this->formit->config, $mailFrom); + $emailReplyTo = $this->hook->_process($emailReplyTo, $fields); + $emailReplyToName = $this->modx->getOption('fiarReplyToName', $this->formit->config, $mailFromName); + $emailReplyToName = $this->hook->_process($emailReplyToName, $fields); + if (!empty($emailReplyTo)) { + $this->modx->mail->address('reply-to', $emailReplyTo, $emailReplyToName); + } + + /* cc */ + $emailCC = $this->modx->getOption('fiarCC', $this->formit->config, ''); + if (!empty($emailCC)) { + $emailCCName = $this->modx->getOption('fiarCCName', $this->formit->config, ''); + $emailCC = explode(',', $emailCC); + $emailCCName = explode(',', $emailCCName); + $numAddresses = count($emailCC); + for ($i=0; $i < $numAddresses; $i++) { + $etn = !empty($emailCCName[$i]) ? $emailCCName[$i] : ''; + if (!empty($etn)) { + $etn = $this->hook->_process($etn, $fields); + } + $emailCC[$i] = $this->hook->_process($emailCC[$i], $fields); + if (!empty($emailCC[$i])) { + $this->modx->mail->address('cc', $emailCC[$i], $etn); + } + } + } + + /* bcc */ + $emailBCC = $this->modx->getOption('fiarBCC', $this->formit->config, ''); + if (!empty($emailBCC)) { + $emailBCCName = $this->modx->getOption('fiarBCCName', $this->formit->config, ''); + $emailBCC = explode(',', $emailBCC); + $emailBCCName = explode(',', $emailBCCName); + $numAddresses = count($emailBCC); + for ($i=0; $i < $numAddresses; $i++) { + $etn = !empty($emailBCCName[$i]) ? $emailBCCName[$i] : ''; + if (!empty($etn)) { + $etn = $this->hook->_process($etn, $fields); + } + $emailBCC[$i] = $this->hook->_process($emailBCC[$i], $fields); + if (!empty($emailBCC[$i])) { + $this->modx->mail->address('bcc', $emailBCC[$i], $etn); + } + } + } + + if (!$this->formit->inTestMode) { + if (!$this->modx->mail->send()) { + $this->modx->log( + \modX::LOG_LEVEL_ERROR, + '[FormIt] An error occurred while trying to send + the auto-responder email: '.$this->modx->mail->mailer->ErrorInfo + ); + return false; + } + } + $this->modx->mail->reset(); + return true; + } +} diff --git a/core/components/formit/src/FormIt/Hook/Email.php b/core/components/formit/src/FormIt/Hook/Email.php new file mode 100644 index 00000000..593d77b1 --- /dev/null +++ b/core/components/formit/src/FormIt/Hook/Email.php @@ -0,0 +1,327 @@ +hook =& $hook; + $this->formit =& $hook->formit; + $this->modx = $hook->formit->modx; + $this->config = array_merge($this->config, $config); + } + + /** + * Send an email of the form. + * + * Properties: + * emailTpl - The chunk name of the chunk that will be the email template. + * This will send the values of the form as placeholders. + * emailTo - A comma separated list of email addresses to send to + * 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. + * emailFromName - The name of the From: user. + * emailSubject - The subject of the email. + * emailHtml - Boolean, if true, email will be in HTML mode. + * emailSelectField - The name of the form field, that selects the email addresses to send to. + * emailSelectTo - A semicolon separated list of comma separated email addresses to send to. + * emailSelectToName - A semicolon separated list of comma separated email names to send to. + * + * @param array $fields An array of cleaned POST fields + * + * @return bool True if email was successfully sent. + */ + public function process($fields = []) + { + $tpl = $this->modx->getOption('emailTpl', $this->formit->config, ''); + $emailHtml = (bool) $this->modx->getOption('emailHtml', $this->formit->config, true); + $emailConvertNewlines = (bool) $this->modx->getOption('emailConvertNewlines', $this->formit->config, false); + + /* get from name */ + $emailFrom = $this->modx->getOption('emailFrom', $this->formit->config, ''); + if (empty($emailFrom)) { + $emailFrom = !empty($fields['email']) ? $fields['email'] : $this->modx->getOption('emailsender'); + } + $emailFrom = $this->hook->_process($emailFrom, $fields); + $emailFromName = $this->modx->getOption('emailFromName', $this->formit->config, $this->modx->getOption('site_name', null, $emailFrom)); + $emailFromName = $this->hook->_process($emailFromName, $fields); + + /* get returnPath */ + $emailReturnPath = $this->modx->getOption('emailReturnPath', $this->formit->config, ''); + if (empty($emailReturnPath)) { + $emailReturnPath = $emailFrom; + } + $emailReturnPath = $this->hook->_process($emailReturnPath, $fields); + + /* get subject */ + $useEmailFieldForSubject = $this->modx->getOption('emailUseFieldForSubject', $this->formit->config, true); + if (!empty($fields['subject']) && $useEmailFieldForSubject) { + $subject = $fields['subject']; + } else { + $subject = $this->modx->getOption('emailSubject', $this->formit->config, ''); + } + $subject = $this->hook->_process($subject, $fields); + + /* select email to */ + $emailSelectTo = $this->modx->getOption('emailSelectTo', $this->formit->config, ''); + $emailSelectToName = $this->modx->getOption('emailSelectToName', $this->formit->config, $emailSelectTo); + $emailSelectTo = ($emailSelectTo) ? explode(';', $emailSelectTo) : array(); + $emailSelectToName = ($emailSelectToName) ? explode(';', $emailSelectToName) : array(); + $emailSelectField = $this->modx->getOption('emailSelectField', $this->formit->config, ''); + if ($emailSelectField && isset($fields[$emailSelectField])) { + $selected = intval($fields[$emailSelectField]); + if ($selected && isset($emailSelectTo[$selected - 1])) { + $this->formit->config['emailTo'] = $emailSelectTo[$selected - 1]; + } + if ($selected && isset($emailSelectToName[$selected - 1])) { + $this->formit->config['emailToName'] = $emailSelectToName[$selected - 1]; + } + } + + /* check email to */ + $emailTo = $this->modx->getOption('emailTo', $this->formit->config, ''); + $emailToName = $this->modx->getOption('emailToName', $this->formit->config, $emailTo); + if (empty($emailTo)) { + $this->hook->errors['emailTo'] = $this->modx->lexicon('formit.email_no_recipient'); + $this->modx->log(\modX::LOG_LEVEL_ERROR, '[FormIt] '.$this->modx->lexicon('formit.email_no_recipient')); + return false; + } + + /* compile message */ + $origFields = $fields; + if (empty($tpl)) { + $tpl = 'fiDefaultEmailTpl'; + $f = []; + $multiSeparator = $this->modx->getOption('emailMultiSeparator', $this->formit->config, "\n"); + $multiWrapper = $this->modx->getOption('emailMultiWrapper', $this->formit->config, "[[+value]]"); + + foreach ($fields as $k => $v) { + if ($k == 'nospam') { + continue; + } + if (is_array($v) && !empty($v['name']) && isset($v['error']) && $v['error'] == UPLOAD_ERR_OK) { + $v = $v['name']; + $f[$k] = ''.$k.': '.$v.'
    '; + } elseif (is_array($v)) { + $vOpts = array(); + foreach ($v as $vKey => $vValue) { + if (is_string($vKey) && !empty($vKey)) { + $vKey = $k.'.'.$vKey; + $f[$vKey] = ''.$vKey.': '.$vValue.'
    '; + } else { + $vOpts[] = str_replace('[[+value]]', $vValue, $multiWrapper); + } + } + $newValue = implode($multiSeparator, $vOpts); + if (!empty($vOpts)) { + $f[$k] = ''.$k.':'.$newValue.'
    '; + } + } else { + $f[$k] = ''.$k.': '.$v.'
    '; + } + } + $fields['fields'] = implode("\n", $f); + } else { + /* handle file/checkboxes in email tpl */ + $multiSeparator = $this->modx->getOption('emailMultiSeparator', $this->formit->config, "\n"); + if (empty($multiSeparator)) { + $multiSeparator = "\n"; + } + if ($multiSeparator == '\n') { + $multiSeparator = "\n"; /* allow for inputted newlines */ + } + $multiWrapper = $this->modx->getOption('emailMultiWrapper', $this->formit->config, "[[+value]]"); + if (empty($multiWrapper)) { + $multiWrapper = '[[+value]]'; + } + + foreach ($fields as $k => &$v) { + if (is_array($v) && !empty($v['name']) && isset($v['error']) && $v['error'] == UPLOAD_ERR_OK) { + $v = $v['name']; + } elseif (is_array($v)) { + $vOpts = array(); + foreach ($v as $vKey => $vValue) { + if (is_string($vKey) && !empty($vKey)) { + $vKey = $k.'.'.$vKey; + $fields[$vKey] = $vValue; + unset($fields[$k]); + } else { + $vOpts[] = str_replace('[[+value]]', $vValue, $multiWrapper); + } + } + $v = implode($multiSeparator, $vOpts); + if (!empty($vOpts)) { + $fields[$k] = $v; + } + } + } + } + + $message = $this->formit->getChunk($tpl, $fields); + $message = $this->hook->_process($message, $this->config); + + /* load mail service */ + $this->modx->getService('mail', 'mail.modPHPMailer'); + + /* set HTML */ + $this->modx->mail->setHTML($emailHtml); + + /* set email main properties */ + $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, $emailReturnPath); + $this->modx->mail->set(\modMail::MAIL_SUBJECT, $subject); + + /* handle file fields */ + if ($this->modx->getOption('attachFilesToEmail', $this->config, true)) { + $attachmentIndex = 0; + foreach ($origFields as $k => $v) { + if (is_array($v) && !empty($v['tmp_name'])) { + if (is_array($v['name'])) { + for ($i = 0; $i < count($v['name']); ++$i) { + if (isset($v['error'][$i]) && $v['error'][$i] == UPLOAD_ERR_OK) { + if (empty($v['name'][$i])) { + $v['name'][$i] = 'attachment' . $attachmentIndex; + } + $this->modx->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++; + } + } + } + } + } + + /* add to: with support for multiple addresses */ + $emailTo = explode(',', $emailTo); + $emailToName = explode(',', $emailToName); + $numAddresses = count($emailTo); + for ($i = 0; $i < $numAddresses; $i++) { + $etn = !empty($emailToName[$i]) ? $emailToName[$i] : ''; + if (!empty($etn)) { + $etn = $this->hook->_process($etn, $fields); + } + $emailTo[$i] = $this->hook->_process($emailTo[$i], $fields); + if (!empty($emailTo[$i])) { + $this->modx->mail->address('to', $emailTo[$i], $etn); + } + } + + /* reply to */ + $emailReplyTo = $this->modx->getOption('emailReplyTo', $this->formit->config, ''); + if (empty($emailReplyTo)) { + $emailReplyTo = !empty($fields['email']) ? $fields['email'] : $emailFrom; + } + $emailReplyTo = $this->hook->_process($emailReplyTo, $fields); + $emailReplyToName = $this->modx->getOption('emailReplyToName', $this->formit->config, $emailFromName); + $emailReplyToName = $this->hook->_process($emailReplyToName, $fields); + if (!empty($emailReplyTo)) { + $this->modx->mail->address('reply-to', $emailReplyTo, $emailReplyToName); + } + + /* cc */ + $emailCC = $this->modx->getOption('emailCC', $this->formit->config, ''); + if (!empty($emailCC)) { + $emailCCName = $this->modx->getOption('emailCCName', $this->formit->config, ''); + $emailCC = explode(',', $emailCC); + $emailCCName = explode(',', $emailCCName); + $numAddresses = count($emailCC); + for ($i = 0; $i < $numAddresses; $i++) { + $etn = !empty($emailCCName[$i]) ? $emailCCName[$i] : ''; + if (!empty($etn)) { + $etn = $this->hook->_process($etn, $fields); + } + $emailCC[$i] = $this->hook->_process($emailCC[$i], $fields); + if (!empty($emailCC[$i])) { + $this->modx->mail->address('cc', $emailCC[$i], $etn); + } + } + } + + /* bcc */ + $emailBCC = $this->modx->getOption('emailBCC', $this->formit->config, ''); + if (!empty($emailBCC)) { + $emailBCCName = $this->modx->getOption('emailBCCName', $this->formit->config, ''); + $emailBCC = explode(',', $emailBCC); + $emailBCCName = explode(',', $emailBCCName); + $numAddresses = count($emailBCC); + for ($i = 0; $i < $numAddresses; $i++) { + $etn = !empty($emailBCCName[$i]) ? $emailBCCName[$i] : ''; + if (!empty($etn)) { + $etn = $this->hook->_process($etn, $fields); + } + $emailBCC[$i] = $this->hook->_process($emailBCC[$i], $fields); + if (!empty($emailBCC[$i])) { + $this->modx->mail->address('bcc', $emailBCC[$i], $etn); + } + } + } + + /* send email */ + if (!$this->formit->inTestMode) { + $sent = $this->modx->mail->send(); + } else { + $sent = true; + } + $this->modx->mail->reset(array( + \modMail::MAIL_CHARSET => $this->modx->getOption('mail_charset', null, 'UTF-8'), + \modMail::MAIL_ENCODING => $this->modx->getOption('mail_encoding', null, '8bit'), + )); + + if (!$sent) { + $this->hook->errors[] = $this->modx->lexicon('formit.email_not_sent').' '.print_r($this->modx->mail->mailer->ErrorInfo, true); + $this->modx->log(\modX::LOG_LEVEL_ERROR, '[FormIt] '.$this->modx->lexicon('formit.email_not_sent').' '.print_r($this->modx->mail->mailer->ErrorInfo, true)); + } + + return $sent; + } +} diff --git a/core/components/formit/src/FormIt/Hook/Math.php b/core/components/formit/src/FormIt/Hook/Math.php new file mode 100644 index 00000000..9863230e --- /dev/null +++ b/core/components/formit/src/FormIt/Hook/Math.php @@ -0,0 +1,100 @@ +hook =& $hook; + $this->formit =& $hook->formit; + $this->modx = $hook->formit->modx; + $this->config = array_merge($this->config, $config); + } + + /** + * Math field hook for anti-spam math input field. + * + * @param array $fields An array of cleaned POST fields + * + * @return bool True if email was successfully sent. + */ + public function process($fields = []) + { + $mathField = $this->modx->getOption('mathField', $this->config, 'math'); + if (!isset($fields[$mathField])) { + $this->hook->errors[$mathField] = $this->modx->lexicon( + 'formit.math_field_nf', + array('field' => $mathField) + ); + return false; + } + + if (empty($fields[$mathField])) { + $this->hook->errors[$mathField] = $this->modx->lexicon( + 'formit.field_required', + array('field' => $mathField) + ); + return false; + } + + $passed = false; + if (isset( + $_SESSION['formitMath']['op1'], + $_SESSION['formitMath']['op2'], + $_SESSION['formitMath']['operator'] + )) { + $answer = false; + $op1 = $_SESSION['formitMath']['op1']; + $op2 = $_SESSION['formitMath']['op2']; + + switch ($_SESSION['formitMath']['operator']) { + case '+': + $answer = $op1 + $op2; + break; + case '-': + $answer = $op1 - $op2; + break; + case '*': + $answer = $op1 * $op2; + break; + } + $guess = (int) $fields[$mathField]; + $passed = ($guess === $answer); + } + + if (!$passed) { + $this->hook->addError($mathField, $this->modx->lexicon('formit.math_incorrect')); + } + + return $passed; + } +} diff --git a/core/components/formit/src/FormIt/Hook/Recaptcha.php b/core/components/formit/src/FormIt/Hook/Recaptcha.php new file mode 100644 index 00000000..480131d4 --- /dev/null +++ b/core/components/formit/src/FormIt/Hook/Recaptcha.php @@ -0,0 +1,77 @@ +hook =& $hook; + $this->formit =& $hook->formit; + $this->modx = $hook->formit->modx; + $this->config = array_merge($this->config, $config); + } + + /** + * Adds in reCaptcha support to FormIt + * + * + * @return bool True if recaptcha has passed + */ + public function process() + { + $passed = false; + /** @var RecaptchaService $reCaptcha */ + $reCaptcha = $this->formit->request->loadReCaptcha(); + if (empty($reCaptcha->config[RecaptchaService::OPT_PRIVATE_KEY])) { + $this->hook->addError('recaptcha', $this->modx->lexicon('recaptcha.no_api_key')); + return false; + } + + $response = $reCaptcha->checkAnswer( + $_SERVER['REMOTE_ADDR'], + $_POST['recaptcha_challenge_field'], + $_POST['recaptcha_response_field'] + ); + + if (!$response->is_valid) { + $this->hook->addError('recaptcha', $this->modx->lexicon('recaptcha.incorrect', array( + 'error' => $response->error != 'incorrect-captcha-sol' ? $response->error : '', + ))); + } else { + $passed = true; + } + + return $passed; + } +} diff --git a/core/components/formit/src/FormIt/Hook/Redirect.php b/core/components/formit/src/FormIt/Hook/Redirect.php new file mode 100644 index 00000000..8068b1a9 --- /dev/null +++ b/core/components/formit/src/FormIt/Hook/Redirect.php @@ -0,0 +1,126 @@ +hook =& $hook; + $this->formit =& $hook->formit; + $this->modx = $hook->formit->modx; + $this->config = array_merge($this->config, $config); + } + + /** + * Redirect to a specified URL. + * + * Properties needed: + * - redirectTo - Required. The ID of the resource to to redirect the user to on a successful submission. + * - redirectParams - A JSON object of parameters to pass in the redirect URL. + * + * @param array $fields An array of cleaned POST fields + * + * @return bool False if unsuccessful. + */ + public function process($fields = []) + { + if (empty($this->formit->config['redirectTo']) && empty($this->formit->config['formAction'])) { + return false; + } + + /** Allow external handling of the post. */ + if ($this->formit->config['formAction']) { + $this->externalPost($fields); + } + + $redirectParams = !empty($this->formit->config['redirectParams']) + ? $this->formit->config['redirectParams'] + : ''; + if (!empty($redirectParams)) { + $prefix = $this->modx->getOption('placeholderPrefix', $this->formit->config, 'fi.'); + $this->modx->setPlaceholders($fields, $prefix); + $this->modx->parser->processElementTags('', $redirectParams, true, true); + $redirectParams = $this->modx->fromJSON($redirectParams); + if (empty($redirectParams)) { + $redirectParams = ''; + } + } + $contextKey = $this->modx->context->get('key'); + $resource = $this->modx->getObject('modResource', $this->formit->config['redirectTo']); + if ($resource) { + $contextKey = $resource->get('context_key'); + } + 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' + ); + } 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'); + } + + $this->hook->setRedirectUrl($url); + + return true; + } + + protected function externalPost($fields = []) + { + $url = $this->formit->config['formAction']; + $fields_string = http_build_query($fields); + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_POST, count($fields)); + curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + $result = curl_exec($ch); + + if (curl_errno($ch)) { + $this->modx->log(MODx::LOG_LEVEL_ERROR, '[FormIt] failed call to external action:' . curl_error($ch)); + } + + curl_close($ch); + + return $result; + } +} diff --git a/core/components/formit/src/FormIt/Hook/Saveform.php b/core/components/formit/src/FormIt/Hook/Saveform.php new file mode 100644 index 00000000..2b6d4417 --- /dev/null +++ b/core/components/formit/src/FormIt/Hook/Saveform.php @@ -0,0 +1,210 @@ +hook =& $hook; + $this->formit =& $hook->formit; + $this->modx = $hook->formit->modx; + $this->config = array_merge($this->config, $config); + } + + /** + * Send an autoresponder email of the form. + * + * Properties: + * formName The name of the form. Defaults to "form-{resourceid}". + * formEncrypt If is set to '1' (true) the submitted form will be encrypted before saving inside the DB. + * formFields A comma-separated list of fields that will be saved. + * Defaults will save all fields including the submit button. + * fieldNames Change the name of the field inside the CMP. + * So if the field name is email2 you could change the name to "secondary email". + * Ex: &fieldnames=`fieldname==newfieldname, anotherone==anothernewname`. + * + * @param array $fields An array of cleaned POST fields + * + * @return bool True if form was successfully saved + */ + public function process($fields = []) + { + /* setup default properties */ + $values = $this->hook->getValues(); + $identifier = basename($_SERVER['REQUEST_URI']); + $contextKey = '-'; + if ($this->modx->resource) { + $identifier = $this->modx->resource->get('id'); + $contextKey = $this->modx->resource->get('context_key'); + } + $formName = $this->modx->getOption('formName', $this->formit->config, 'form-'.$identifier); + // process formName. Pick a value from the form + // Inspired from the email's hook of formit (fihooks.class.php) + if (is_string($formName)) { + foreach ($fields as $k => $v) { + if (is_scalar($k) && is_scalar($v)) { + $formName = str_replace('[[+'.$k.']]',$v,$formName); + } + } + } + + $formEncrypt = $this->modx->getOption('formEncrypt', $this->formit->config, false); + $formFields = $this->modx->getOption('formFields', $this->formit->config, false); + $fieldNames = $this->modx->getOption('fieldNames', $this->formit->config, false); + $updateSavedForm = $this->modx->getOption('updateSavedForm', $this->formit->config, false); // true, false, '1', '0', or 'values' + // In order to use update process, you need to provide the hash key to the user somehow + // Usually with [[!FormItRetriever]] to populate this form field: + $formHashKeyField = $this->modx->getOption('savedFormHashKeyField', $this->formit->config, 'savedFormHashKey'); + // Disable if you want to use the session_id() in your hash, like FormIt does + // WARNING: this can cause potential hash key collisions and overwriting of the wrong form record!! + $formHashKeyRandom = $this->modx->getOption('formHashKeyRandom', $this->formit->config, true); + // process formHashKeyField into variable for later use + $formHashKey = (isset($values[$formHashKeyField])) ? (string) $values[$formHashKeyField] : ''; + // our hashing methods return 32 chars + if (strlen($formHashKey) !== 32) $formHashKey = ''; + unset($values[$formHashKeyField]); + + if ($formFields) { + $formFields = explode(',', $formFields); + foreach($formFields as $k => $v) { + $formFields[$k] = trim($v); + } + } + // Build the data array + $dataArray = array(); + if ($formFields) { + foreach ($formFields as $field) { + $fieldValue = isset($values[$field]) ? $values[$field] : ''; + // When field is file field, value is an array + if (is_array($fieldValue) && isset($fieldValue['tmp_name'], $fieldValue['name'])) { + $fieldValue = $fieldValue['name']; + } + $dataArray[$field] = $fieldValue; + } + } else { + $dataArray = $values; + } + // Change the fieldnames + if ($fieldNames) { + $newDataArray = array(); + $fieldLabels = array(); + $formFieldNames = explode(',', $fieldNames); + foreach ($formFieldNames as $formFieldName) { + $parts = explode('==', $formFieldName); + $fieldLabels[trim($parts[0])] = trim($parts[1]); + } + foreach ($dataArray as $key => $value) { + if ($fieldLabels[$key] ?? null) { + $labelKey = $fieldLabels[$key]; + if (array_key_exists($labelKey, $newDataArray)) { + $labelKey .= ' ('.$key.')'; + } + $newDataArray[$labelKey] = $value; + } else { + $newDataArray[$key] = $value; + } + } + $dataArray = $newDataArray; + } + // We only enter update mode if we already have a valid formHashKey (tested above) + // AND the updateSavedForm param was set to a truth-y value. + $mode = ($updateSavedForm && $formHashKey) ? 'update' : 'create'; + // Create/get obj + $newForm = null; + if ($mode === 'update') { + $newForm = $this->modx->getObject('FormItForm', array('hash' => $formHashKey)); + } + if ($newForm === null) { + $newForm = $this->modx->newObject('FormItForm'); + } + + // Array from which to populate form record + $newFormArray = array(); + + // Handle encryption + $encryptionType = 1; + if ($formEncrypt) { + $dataArray = $newForm->encrypt($this->modx->toJSON($dataArray)); + // Only set encryption type if encryption is successful + if ($dataArray) { + // Set encryption type to 2 (openssl) + $encryptionType = 2; + } + } else { + $dataArray = $this->modx->toJSON($dataArray); + } + + // Create new hash key on create mode, and handle invalid hash keys. + if ($mode === 'create') { + $formHashKey = ($formHashKeyRandom) ? $newForm->generatePseudoRandomHash() : pathinfo($this->formit->getStoreKey(), PATHINFO_BASENAME); + } + + // Special case: if updateSavedForm has the flag 'values' we only merge in + // the form values, not the other stuff + if ($mode === 'update' && $updateSavedForm === 'values') { + $newFormArray = $newForm->toArray(); + $newFormArray = array_merge($newFormArray, array( + 'values' => $dataArray, + 'encryption_type' => $encryptionType, + )); + } else { + // In all other cases, we overwrite the record completely! + // In create mode we must save the hash. In update mode, the + // formHashKey will be valid so we can also save it, again. + $newFormArray = array( + 'form' => $formName, + 'date' => time(), + 'values' => $dataArray, + 'ip' => $this->modx->getOption('REMOTE_ADDR', $_SERVER, ''), + 'context_key' => $contextKey, + 'encrypted' => $formEncrypt, + 'encryption_type' => $encryptionType, + 'hash' => $formHashKey, + ); + } + // Convert to object + $newForm->fromArray($newFormArray); + // Attempt to save + if (!$newForm->save()) { + $this->modx->log(\modX::LOG_LEVEL_ERROR, '[FormItSaveForm] An error occurred while trying to save the submitted form: ' . print_r($newForm->toArray(), true)); + return false; + } + $storeAttachments = $this->modx->getOption('storeAttachments', $this->config, false); + if ($storeAttachments) { + $newForm->storeAttachments($this->formit->config); + } + // Pass the hash and form data back to the user + $this->hook->setValue('savedForm', $newForm->toArray()); + $this->hook->setValue($formHashKeyField, $newForm->get('hash')); + return true; + } +} diff --git a/core/components/formit/src/FormIt/Hook/Spam.php b/core/components/formit/src/FormIt/Hook/Spam.php new file mode 100644 index 00000000..c7fa0a5b --- /dev/null +++ b/core/components/formit/src/FormIt/Hook/Spam.php @@ -0,0 +1,82 @@ +hook =& $hook; + $this->formit =& $hook->formit; + $this->modx = $hook->formit->modx; + $this->config = array_merge($this->config, $config); + } + + /** + * Ensure the a field passes a spam filter. + * + * Properties: + * - spamEmailFields - The email fields to check. A comma-delimited list. + * + * @param array $fields An array of cleaned POST fields + * + * @return bool True if email was successfully sent. + */ + public function process($fields = []) + { + $spamFields = ''; + $passed = true; + $spamEmailFields = $this->modx->getOption('spamEmailFields', $this->formit->config, 'email'); + $emails = explode(',', $spamEmailFields); + + $sfspam = new StopForumSpam($this->modx); + $checkIp = $this->modx->getOption('spamCheckIp', $this->formit->config, false); + $ip = $checkIp ? $_SERVER['REMOTE_ADDR'] : ''; + + foreach ($emails as $email) { + $spamResult = $sfspam->check($ip, $fields[$email]); + if (!empty($spamResult)) { + foreach ($spamResult as $value) { + $spamFields .= $value . $this->modx->lexicon('formit.spam_marked')."\n
    "; + } + $this->hook->addError( + $email, + $this->modx->lexicon('formit.spam_blocked', array('fields' => $spamFields)) + ); + $passed = false; + } + } + + return $passed; + } +} diff --git a/core/components/formit/src/FormIt/Module/CountryOptions.php b/core/components/formit/src/FormIt/Module/CountryOptions.php new file mode 100644 index 00000000..f19337b2 --- /dev/null +++ b/core/components/formit/src/FormIt/Module/CountryOptions.php @@ -0,0 +1,144 @@ +setDefaultOptions(array( + 'tpl' => 'fiDefaultOptionTpl', + 'selected' => '', + 'useIsoCode' => true, + 'selectedAttribute' => ' selected="selected"', + 'optGroupTpl' => 'fiDefaultOptGroupTpl', + 'limited' => '', + 'prioritized' => '', + 'prioritizedGroupText' => '', + 'allGroupText' => '', + 'outputSeparator' => "\n", + 'toPlaceholder' => '', + 'country' => $this->modx->getOption('cultureKey', array(), 'us', true), + )); + $this->setOption('selectedKey',$this->getOption('useIsoCode',true,'isset') ? 'countryKey' : 'countryName'); + $this->modx->lexicon->load('formit:default'); + } + + /** + * Load the country list + * @return array + */ + public function getData() { + $country = $this->getOption('country','us'); + $countriesFile = $this->getOption('countriesDirectory',$this->formit->config['includes_path']).$country.'.countries.inc.php'; + if (file_exists($countriesFile)) { + $this->countries = include $countriesFile; + } else { + $this->countries = include $this->formit->config['includes_path'].'us.countries.inc.php'; + } + + /* reduce list to limited countries if option is set */ + $limited = $this->getOption('limited',''); + if (!empty($limited)) { + $limitedCountries = array(); + $limitedList = explode(',',$limited); + foreach ($limitedList as $key) { + $limitedCountries[$key] = $this->countries[$key]; + } + /* order list by country names */ + asort($limitedCountries, SORT_STRING | SORT_FLAG_CASE); + $this->countries = $limitedCountries; + } + return $this->countries; + } + + /** + * Check for prioritized countries, and load those + * @return array + */ + public function loadPrioritized() { + /* handle prioritized countries */ + $this->prioritizedCountries = array(); + $prioritized = $this->getOption('prioritized',''); + if (!empty($prioritized)) { + $prioritized = explode(',',$prioritized); + foreach ($this->countries as $countryKey => $countryName) { + if (in_array($countryKey,$prioritized)) { + $this->prioritizedCountries[] = $countryKey; + } + } + } + return $this->prioritizedCountries; + } + + /** + * iterate over lists + * @return void + */ + public function iterate() { + $this->list = array(); + $this->prioritizedList = array(); + $selected = $this->getOption('selected',''); + $selectedAttribute = $this->getOption('selectedAttribute',' selected="selected"'); + $useIsoCode = $this->getOption('useIsoCode',true,'isset'); + $tpl = $this->getOption('tpl','fiDefaultOptionTpl'); + $selectedKey = $this->getOption('selectedKey','countryKey'); + + foreach ($this->countries as $countryKey => $countryName) { + $countryArray = array( + 'text' => $countryName, + 'value' => $useIsoCode ? $countryKey : $countryName, + 'selected' => '', + ); + if ($selected == $$selectedKey) { + $countryArray['selected'] = $selectedAttribute; + } + $o = $this->formit->getChunk($tpl,$countryArray); + if (in_array($countryKey,$this->prioritizedCountries)) { + $this->prioritizedList[] = $o; + } else { + $this->list[] = $o; + } + } + } + + /** + * Handle output generation + * @return string + */ + public function output() { + $outputSeparator = $this->getOption('outputSeparator',"\n"); + if (!empty($this->prioritizedList)) { + $optGroupTpl = $this->getOption('optGroupTpl','fiDefaultOptGroupTpl'); + $output = $this->formit->getChunk($optGroupTpl,array( + 'text' => $this->getOption('prioritizedGroupText',$this->modx->lexicon('formit.prioritized_group_text')), + 'options' => implode($outputSeparator,$this->prioritizedList), + )); + $output .= $this->formit->getChunk($optGroupTpl,array( + 'text' => $this->getOption('allGroupText',$this->modx->lexicon('formit.all_group_text')), + 'options' => implode($outputSeparator,$this->list), + )); + } else { + $output = implode($outputSeparator,$this->list); + } + + /* set to placeholder or output */ + $toPlaceholder = $this->getOption('toPlaceholder',''); + if (!empty($toPlaceholder)) { + $this->modx->setPlaceholder($toPlaceholder,$output); + $output = ''; + } + return $output; + } +} diff --git a/core/components/formit/src/FormIt/Module/Module.php b/core/components/formit/src/FormIt/Module/Module.php new file mode 100644 index 00000000..4e0755a2 --- /dev/null +++ b/core/components/formit/src/FormIt/Module/Module.php @@ -0,0 +1,92 @@ +formit =& $formit; + $this->modx = $formit->modx; + $this->config = array_merge($this->config, $config); + } + + /** + * Runs after instantiation of the module + * @abstract + * @return void + */ + abstract public function initialize(); + /** + * Returns the output of the module + * @abstract + * @return void + */ + abstract public function output(); + + /** + * Set the default options for this module + * @param array $defaults + * @return void + */ + protected function setDefaultOptions(array $defaults = array()) { + $this->config = array_merge($defaults,$this->config); + } + + /** + * Set an option for this module + * @param string $key + * @param mixed $value + * @return void + */ + public function setOption($key,$value) { + $this->config[$key] = $value; + } + /** + * Set an array of options + * @param array $array + * @return void + */ + public function setOptions($array) { + foreach ($array as $k => $v) { + $this->setOption($k,$v); + } + } + + /** + * @param string $key + * @param mixed $default + * @param string $method + * @return null + */ + public function getOption($key,$default = null,$method = '!empty') { + $v = $default; + + switch ($method) { + case 'empty': + case '!empty': + if (!empty($this->config[$key])) { + $v = $this->config[$key]; + } + break; + case 'isset': + default: + if (isset($this->config[$key])) { + $v = $this->config[$key]; + } + break; + } + return $v; + } +} diff --git a/core/components/formit/src/FormIt/Module/StateOptions.php b/core/components/formit/src/FormIt/Module/StateOptions.php new file mode 100644 index 00000000..b5251d79 --- /dev/null +++ b/core/components/formit/src/FormIt/Module/StateOptions.php @@ -0,0 +1,82 @@ +setDefaultOptions(array( + 'tpl' => 'fiDefaultOptionTpl', + 'selected' => '', + 'useAbbr' => true, + 'selectedAttribute' => ' selected="selected"', + 'outputSeparator' => "\n", + 'toPlaceholder' => '', + 'country' => $this->modx->getOption('cultureKey', array(), 'us', true), + )); + $this->setOption('selectedKey',$this->getOption('useAbbr',true) ? 'stateKey' : 'stateName'); + } + + /** + * Load the country list + * @return array + */ + public function getData() { + $country = strtolower( $this->getOption('country','us') ); + $statesFile = $this->getOption('statesDirectory',$this->formit->config['includes_path']).$country.'.states.inc.php'; + if (file_exists($statesFile)) { + $this->states = include $statesFile; + } else { + $this->states = include $this->formit->config['includes_path'].'us.states.inc.php'; + } + return $this->states; + } + + /** + * iterate over lists + * @return void + */ + public function iterate() { + $selected = $this->getOption('selected', ''); + $selectedAttribute = $this->getOption('selectedAttribute', ' selected="selected"'); + $tpl = $this->getOption('tpl', 'fiDefaultOptionTpl'); + $selectedKey = $this->getOption('selectedKey', 'stateKey'); + foreach ($this->states as $stateKey => $stateName) { + $stateArray = array( + 'text' => $stateName, + 'value' => $$selectedKey, + 'selected' => '', + ); + if ($selected == $$selectedKey) { + $stateArray['selected'] = $selectedAttribute; + } + $this->list[] = $this->formit->getChunk($tpl, $stateArray); + } + } + + /** + * Handle output generation + * @return string + */ + public function output() + { + $outputSeparator = $this->getOption('outputSeparator', "\n"); + $output = implode($outputSeparator, $this->list); + + /* set to placeholder or output */ + $toPlaceholder = $this->getOption('toPlaceholder', ''); + if (!empty($toPlaceholder)) { + $this->modx->setPlaceholder($toPlaceholder, $output); + $output = ''; + } + return $output; + } +} diff --git a/core/components/formit/src/FormIt/Request.php b/core/components/formit/src/FormIt/Request.php new file mode 100644 index 00000000..6fcc0355 --- /dev/null +++ b/core/components/formit/src/FormIt/Request.php @@ -0,0 +1,514 @@ +formit = $formit; + $this->modx = $formit->modx; + $this->config = array_merge([ + 'clearFieldsOnSuccess' => true, + 'hooks' => '', + 'placeholderPrefix' => 'fi.', + 'preHooks' => '', + 'store' => false, + 'submitVar' => '', + 'validate' => '', + 'validateSeparator' => ',', + 'renderHooks' => '' + ], $config); + } + + /** + * Handle all pre-request data, including loading of preHooks, reCaptcha preparation, and the math hook. + * + * @return array An array of pre-fetched fields and their data, possibly set by preHooks + */ + public function prepare() + { + /* if using recaptcha, load recaptcha html */ + if ($this->formit->hasHook('recaptcha')) { + $this->loadReCaptcha($this->config); + if (!empty($this->reCaptcha) && $this->reCaptcha instanceof Recaptcha) { + $this->reCaptcha->render($this->config); + } else { + $this->modx->log(\modX::LOG_LEVEL_ERROR,'[FormIt] '.$this->modx->lexicon('formit.recaptcha_err_load')); + } + } + + /* if using math hook, load default placeholders */ + if ($this->formit->hasHook('math')) { + $operators = array('+', '-'); + $operator = rand(0, 1); + + if (!$this->hasSubmission()) { + $mathMaxRange = $this->modx->getOption('mathMaxRange', $this->config, 100); + $mathMinRange = $this->modx->getOption('mathMinRange', $this->config, 10); + $op1 = rand($mathMinRange, $mathMaxRange); + $op2 = rand($mathMinRange, $mathMaxRange); + + /* prevent numbers from being equal */ + while ($op2 == $op1) { + $op2 = rand($mathMinRange, $mathMaxRange); + } + + /* swap so we always get positive #s */ + if ($op2 > $op1) { + $t = $op2; + $op2 = $op1; + $op1 = $t; + } + + /* Store in session so math fields are not required for math hook */ + $_SESSION['formitMath'] = array( + 'op1' => $op1, + 'op2' => $op2, + 'operator' => $operators[$operator] + ); + } else { + $op1 = $_SESSION['formitMath']['op1']; + $op2 = $_SESSION['formitMath']['op2']; + $operators[$operator] = $_SESSION['formitMath']['operator']; + } + + $this->modx->setPlaceholders(array( + $this->modx->getOption('mathOp1Field', $this->config, 'op1') => $op1, + $this->modx->getOption('mathOp2Field', $this->config, 'op2') => $op2, + $this->modx->getOption('mathOperatorField', $this->config, 'operator') => $operators[$operator], + ), $this->config['placeholderPrefix']); + + } + + if ($this->modx->getOption('storeAttachments', $this->config, false) && + ($this->formit->hasHook('FormItSaveForm') || $this->formit->hasHook('saveform')) + ) { + $newForm = $this->modx->newObject('FormItForm'); + $newForm->validateStoreAttachment($this->config); + } + + return $this->runPreHooks(); + } + + /** + * Load and run preHooks, setting any fields passed. + * + * @return array + */ + public function runPreHooks() + { + $fields = array(); + + $this->formit->loadHooks('pre', $this->config); + + $this->formit->preHooks->loadMultiple($this->config['preHooks'], array(), array( + 'submitVar' => $this->config['submitVar'], + 'hooks' => $this->config['preHooks'] + )); + + /* if a prehook sets a field, do so here, but only if POST isnt submitted */ + if (!$this->hasSubmission()) { + $fields = $this->formit->preHooks->gatherFields(); + } + + /* if any errors in preHooks */ + if ($this->formit->preHooks->hasErrors()) { + $this->formit->preHooks->processErrors(); + } + + return $fields; + } + + /** + * Load and run renderHooks. + */ + public function runRenderHooks() + { + $this->formit->loadHooks('render', $this->config); + + $fields = array(); + $errors = array(); + + if ($this->dictionary) { + $fields = $this->dictionary->toArray(); + } + + if ($this->validator) { + $errors = $this->validator->getErrors(); + } + + $this->formit->renderHooks->loadMultiple($this->config['renderHooks'], $fields, array(), $errors); + } + + /** + * Checks to see if a POST submission for this form has occurred + * + * @return boolean + */ + public function hasSubmission() + { + $inPost = false; + if (!empty($_POST)) { + $inPost = true; + /* + Changed to provide means to allow multiple submit buttons in one form. The primary use case is multi-step/page forms, + where buttons used to navigate the form should post the current page data before moving to the specified step. + Each button of type submit should have a unique name that includes the value of the submitVar parameter, as well as + a value that differetiates the button's functionality. For example, in a chunk template the basic form navigation might be: + + + + + where the value is the step index to redirect to after submission (which would be optional for the regular submit button, + which is shown here as "Next"). + + This change should not require users to make changes to their existing forms. + */ + if (!empty($this->config['submitVar'])) { + $keys = array_keys($_POST); + $inPost = false; + foreach ($keys as $key) { + if (strpos($key, $this->config['submitVar']) !== false) { + $inPost = true; + break; + } + } + } + + } + + return $inPost; + } + + /** + * Load the reCaptcha service class + * + * @param array $config An array of configuration parameters for the reCaptcha class + * + * @return Recaptcha An instance of the reCaptcha class + */ + public function loadReCaptcha(array $config = array()) + { + if (empty($this->reCaptcha)) { + if ($this->modx->loadClass('recaptcha.FormItReCaptcha', $this->config['model_path'], true, true)) { + $this->reCaptcha = new RecaptchaService($this->formit, $config); + } else { + $this->modx->log(\modX::LOG_LEVEL_ERROR, '[FormIt] '.$this->modx->lexicon('formit.recaptcha_err_load')); + return null; + } + } + + return $this->reCaptcha; + } + + /** + * Handle the POST request + * + * @param array $fields + * + * @return string + */ + public function handle(array $fields = array()) + { + if ($this->hasSubmission()) { + $this->loadDictionary(); + $this->dictionary->gather($fields); + + /* validate fields */ + $this->loadValidator(); + $this->validator->reset(); + $validated = $this->validate($this->config['validate'], $this->config['validateSeparator']); + + if ($validated) { + $this->postProcess(); + } + + if (!$this->clearFieldsAtEnd) { + $this->setFieldsAsPlaceholders(); + } + } + + $this->runRenderHooks(); + + return ''; + } + + /** + * Removes files if allowFiles is set to 0 + * + * @return void + */ + public function checkForFiles() + { + if (!$this->modx->getOption('allowFiles',$this->config,true)) { + $fields = $this->dictionary->toArray(); + foreach ($fields as $key => $value) { + if (is_array($value) && !empty($value['tmp_name'])) { + $this->dictionary->remove($key); + } + } + } + } + + /** + * Loads the Validator class. + * + * @return Validator An instance of the fiValidator class. + */ + public function loadValidator() + { + if ($this->modx->loadClass('formit.fiValidator',$this->formit->config['model_path'],true,true)) { + $this->validator = new Validator($this->formit, $this->config); + } else { + $this->modx->log(\modX::LOG_LEVEL_ERROR,'[FormIt] Could not load Validator class.'); + } + + return $this->validator; + } + + /** + * Load the dictionary storage mechanism + * + * @return null|Dictionary + */ + public function loadDictionary() + { + if ($this->modx->loadClass('formit.fiDictionary',$this->formit->config['model_path'],true,true)) { + $this->dictionary = new Dictionary($this->formit,$this->config); + } else { + $this->modx->log(\modX::LOG_LEVEL_ERROR,'[FormIt] Could not load Dictionary class.'); + } + + return $this->dictionary; + + } + + /** + * Validate all fields prior to post processing + * + * @param string $validationString + * @param string $validationSeparator + * + * @return bool + */ + public function validate($validationString, $validationSeparator) + { + $success = true; + $this->validator->validateFields($this->dictionary,$validationString,$validationSeparator); + + if ($this->validator->hasErrors()) { + $success = false; + $this->validator->processErrors(); + } + + return $success; + } + + /** + * Handle post-processing through postHooks + * + * @return bool + */ + public function postProcess() + { + $success = $this->runPostHooks(); + if ($success) { + /* if store is set for FormItRetriever, store fields here */ + $store = $this->modx->getOption('store', $this->config, false); + if (!empty($store)) { + $this->dictionary->store(); + } + + /* Remove files older than 1 day uploaded by fiDictionary->gather() */ + $tmpFileLifetime = $this->modx->getOption('formit.attachment.lifeline', $this->config, 86400); + if (isset($_SESSION['formit']['tmp_files']) && + is_array($_SESSION['formit']['tmp_files']) && + count($_SESSION['formit']['tmp_files']) + ) { + foreach ($_SESSION['formit']['tmp_files'] as $key => $file) { + if (file_exists($file) && (time() - filemtime($file) >= $tmpFileLifetime)) { + unlink($file); + unset($_SESSION['formit']['tmp_files'][$key]); + } + } + } + + /* Also do a glob for removing files that are left behind by not-completed form submissions */ + if (function_exists('glob')) { + $tmpPath = $this->formit->config['assets_path'].'tmp/'; + foreach (glob($tmpPath.'*') as $file) { + if (file_exists($file) && (time() - filemtime($file) >= $tmpFileLifetime)) { + unlink($file); + } + } + } + + /* if the redirect URL was set, redirect */ + $this->checkForRedirect(); + + /* set success placeholder */ + $this->setSuccessMessage(); + + /* if clearing fields on success, just end here */ + if ($this->modx->getOption('clearFieldsOnSuccess', $this->config, true)) { + $this->clearFieldsAtEnd = true; + } + } + + return $success; + } + + /** + * Run any postHooks that were specified. + * + * @return boolean True if all hooks executed successfully. + */ + public function runPostHooks() + { + $success = true; + /* load posthooks */ + $this->formit->loadHooks('post',$this->config); + $this->formit->postHooks->loadMultiple($this->config['hooks'],$this->dictionary->toArray()); + + /* process form */ + if ($this->formit->preHooks->hasErrors() && $this->modx->getOption('preventPostHooksIfPreHooksErrors',$this->config,true)) { + /* prevent scripts from running with prehook errors */ + $success = false; + $this->formit->preHooks->processErrors(); + } elseif ($this->formit->postHooks->hasErrors()) { + $success = false; + $this->formit->postHooks->processErrors(); + } else { + /* assign new values from postHooks */ + $this->dictionary->fromArray($this->formit->postHooks->fields); + } + + return $success; + } + + /** + * Check to see if the redirect URL was set; if so, redirect + * Does not redirect when inTestMode is true, or when returnOutput is true. + * + * @return void + */ + public function checkForRedirect() + { + $url = $this->formit->postHooks->getRedirectUrl(); + if (!empty($url) && !$this->formit->inTestMode && !$this->formit->returnOutput) { + $this->modx->sendRedirect($url); + } + } + + /** + * Sets the success message placeholders + * + * @param string $message + * + * @return void + */ + public function setSuccessMessage($message = '') + { + $successMsg = $this->modx->getOption('successMessage',$this->config,$message); + + $this->modx->setPlaceholder($this->config['placeholderPrefix'].'success',true); + if (!empty($successMsg)) { + $smPlaceholder = $this->modx->getOption('successMessagePlaceholder',$this->config,$this->config['placeholderPrefix'].'successMessage'); + $this->modx->setPlaceholder($smPlaceholder,$successMsg); + } + } + + /** + * Sets the fields to MODX placeholders + * + * @return void + */ + public function setFieldsAsPlaceholders() + { + $fields = $this->dictionary->toArray(); + + /* better handling of checkbox values when input name is an array[] */ + $fs = array(); + + /** @var mixed $v */ + foreach ($fields as $k => $v) { + if (is_array($v)) { + foreach ($v as $sk => $sv) { + $fs[$k.'.'.$sk] = $this->convertMODXTags($sv); + } + + $v = $this->modx->toJSON($v); + } + + /* str_replace to prevent showing of placeholders */ + $fs[$k] = $this->convertMODXTags($v); + } + + $this->modx->setPlaceholders($fs, $this->config['placeholderPrefix']); + } + + /** + * Convert MODX tags. + * + * @param string $value + * + * @return string + */ + public function convertMODXTags($value) + { + return str_replace(['[[', ']]'], ['[[', ']]'], $value); + } +} diff --git a/core/components/formit/src/FormIt/Service/RecaptchaResponse.php b/core/components/formit/src/FormIt/Service/RecaptchaResponse.php new file mode 100644 index 00000000..fad65ff8 --- /dev/null +++ b/core/components/formit/src/FormIt/Service/RecaptchaResponse.php @@ -0,0 +1,11 @@ +formit = $formit; + $this->modx = $formit->modx; + $this->modx->lexicon->load('formit:recaptcha'); + $this->config = array_merge(array( + self::OPT_PRIVATE_KEY => $this->modx->getOption('formit.recaptcha_private_key', $config, ''), + self::OPT_PUBLIC_KEY => $this->modx->getOption('formit.recaptcha_public_key', $config, ''), + self::OPT_USE_SSL => $this->modx->getOption('formit.recaptcha_use_ssl', $config, false), + ), $config); + } + + /** + * Encodes the given data into a query string format + * @param $data - array of string elements to be encoded + * @return string - encoded request + */ + protected function qsencode($data) { + $req = ''; + foreach ($data as $key => $value) { + $req .= $key . '=' . urlencode( stripslashes($value) ) . '&'; + } + + // Cut the last '&' + $req=substr($req,0,strlen($req)-1); + return $req; + } + + /** + * Submits an HTTP POST to a reCAPTCHA server + * @param string $host + * @param string $path + * @param array $data + * @param int $port + * @return array response + */ + protected function httpPost($host, $path, array $data = array(), $port = 80) { + $data['privatekey'] = $this->config[self::OPT_PRIVATE_KEY]; + $req = $this->qsencode($data); + + $http_request = "POST $path HTTP/1.0\r\n"; + $http_request .= "Host: $host\r\n"; + $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n"; + $http_request .= "Content-Length: " . strlen($req) . "\r\n"; + $http_request .= "User-Agent: reCAPTCHA/PHP\r\n"; + $http_request .= "\r\n"; + $http_request .= $req; + + $response = ''; + if(false == ($fs = @fsockopen($host, $port, $errno, $errstr, 10))) { + return 'Could not open socket'; + } + + fwrite($fs, $http_request); + while (!feof($fs)) { + $response .= fgets($fs, 1160); // One TCP-IP packet + } + fclose($fs); + $response = explode("\r\n\r\n", $response, 2); + + return $response; + } + + /** + * Gets the challenge HTML (javascript and non-javascript version). + * This is called from the browser, and the resulting reCAPTCHA HTML widget + * is embedded within the HTML form it was called from. + * + * @param array $scriptProperties + * @return string - The HTML to be embedded in the user's form. + */ + public function render($scriptProperties = array()) { + if (empty($this->config[self::OPT_PUBLIC_KEY])) { + return $this->error($this->modx->lexicon('recaptcha.no_api_key')); + } + + /* use ssl or not */ + $server = !empty($this->config[self::OPT_USE_SSL]) ? self::API_SECURE_SERVER : self::API_SERVER; + + $opt = $this->getOptions($scriptProperties); + $html = ' +'; + $this->modx->setPlaceholder('formit.recaptcha_html',$html); + $this->modx->setPlaceholder($scriptProperties['placeholderPrefix'].'recaptcha_html',$html); + return $html; + } + + /** + * Get options for reCaptcha from snippet + * + * @param array $scriptProperties + * @return array|void + */ + public function getOptions(array $scriptProperties = array()) { + $opt = $this->modx->getOption('recaptchaJs',$scriptProperties,'{}'); + $opt = $this->modx->fromJSON($opt); + if (empty($opt)) $opt = array(); + + /* backwards compat */ + $backwardOpt = array( + 'theme' => $this->modx->getOption('recaptchaTheme',$scriptProperties,'clean'), + 'width' => $this->modx->getOption('recaptchaWidth',$scriptProperties,500), + 'height' => $this->modx->getOption('recaptchaHeight',$scriptProperties,300), + 'lang' => $this->modx->getOption('cultureKey',null,'en'), + ); + $opt = array_merge($backwardOpt,$opt); + + return $opt; + } + + /** + * State there is an error with reCaptcha + * @param string $message + * @return string + */ + protected function error($message = '') { + $response = new \Sterc\FormIt\Service\RecaptchaResponse(); + $response->is_valid = false; + $response->error = $message; + return $message; + } + + /** + * Calls an HTTP POST function to verify if the user's guess was correct + * @param string $remoteIp + * @param string $challenge + * @param string $responseField + * @param array $extraParams An array of extra variables to post to the server + * @return \Sterc\FormIt\Service\RecaptchaResponse + */ + public function checkAnswer ($remoteIp, $challenge, $responseField, $extraParams = array()) { + if (empty($this->config[self::OPT_PRIVATE_KEY])) { + return $this->error($this->modx->lexicon('recaptcha.no_api_key')); + } + + if (empty($remoteIp)) { + return $this->error($this->modx->lexicon('recaptcha.no_remote_ip')); + } + + //discard spam submissions + if (empty($challenge) || empty($responseField)) { + return $this->error($this->modx->lexicon('recaptcha.empty_answer')); + } + + $response = $this->httpPost(self::VERIFY_SERVER, "/recaptcha/api/verify", array ( + 'remoteip' => $remoteIp, + 'challenge' => $challenge, + 'response' => $responseField, + ) + $extraParams); + + $answers = explode("\n", $response[1]); + $response = new \Sterc\FormIt\Service\RecaptchaResponse(); + + if (trim($answers[0]) == 'true') { + $response->is_valid = true; + } else { + $response->is_valid = false; + $response->error = $answers [1]; + } + return $response; + } + + /** + * Gets a URL where the user can sign up for reCAPTCHA. If your application + * has a configuration page where you enter a key, you should provide a link + * using this function. + * + * @param string $domain The domain where the page is hosted + * @param string $appname The name of your application + * @return string + */ + public function getSignupUrl($domain = null,$appname = null) { + return "http://recaptcha.net/api/getkey?" . $this->qsencode(array ('domain' => $domain, 'app' => $appname)); + } + + protected function aesPad($val) { + $block_size = 16; + $numpad = $block_size - (strlen ($val) % $block_size); + return str_pad($val, strlen ($val) + $numpad, chr($numpad)); + } + + /* Mailhide related code */ + protected function aesEncrypt($val,$ky) { + if (!function_exists("mcrypt_encrypt")) { + return $this->error($this->modx->lexicon('recaptcha.mailhide_no_mcrypt')); + } + $mode=MCRYPT_MODE_CBC; + $enc=MCRYPT_RIJNDAEL_128; + $val= $this->aesPad($val); + return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); + } + + + protected function mailhideUrlbase64($x) { + return strtr(base64_encode ($x), '+/', '-_'); + } + + /* gets the reCAPTCHA Mailhide url for a given email, public key and private key */ + public function mailhideUrl($email) { + if (empty($this->config[self::OPT_PUBLIC_KEY]) || empty($this->config[self::OPT_PRIVATE_KEY])) { + return $this->error($this->modx->lexicon('recaptcha.mailhide_no_api_key')); + } + + $ky = pack('H*',$this->config[self::OPT_PRIVATE_KEY]); + $cryptmail = $this->aesEncrypt($email, $ky); + return 'http://mailhide.recaptcha.net/d?k=' + . $this->config[self::OPT_PUBLIC_KEY] + . '&c=' . $this->mailhideUrlbase64($cryptmail); + } + + /** + * Gets the parts of the email to expose to the user. + * eg, given johndoe@example,com return ["john", "example.com"]. + * the email is then displayed as john...@example.com + * + * @param string $email + * @return array|string + */ + public function mailhideEmailParts ($email) { + $arr = preg_split("/@/", $email); + + if (strlen($arr[0]) <= 4) { + $arr[0] = substr($arr[0], 0, 1); + } else if (strlen ($arr[0]) <= 6) { + $arr[0] = substr($arr[0], 0, 3); + } else { + $arr[0] = substr($arr[0], 0, 4); + } + return $arr; + } + + /** + * Gets html to display an email address given a public an private key. + * to get a key, go to: + * + * http://mailhide.recaptcha.net/apikey + * + * @param $email + * @return string + */ + public function mailhideHtml($email) { + $emailparts = $this->mailhideEmailParts($email); + $url = $this->mailhideUrl($email); + + $str = htmlentities($emailparts[0]) . "...@" . htmlentities($emailparts [1]); + return $str; + } +} diff --git a/core/components/formit/src/FormIt/Service/StopForumSpam.php b/core/components/formit/src/FormIt/Service/StopForumSpam.php new file mode 100644 index 00000000..675a868a --- /dev/null +++ b/core/components/formit/src/FormIt/Service/StopForumSpam.php @@ -0,0 +1,144 @@ +modx = $modx; + $this->config = array_merge([ + 'host' => 'https://api.stopforumspam.com/', + 'path' => 'api', + 'method' => 'GET', + ], $config); + } + + /** + * Check for spammer + * + * @param string $ip + * @param string $email + * @param string $username + * + * @return array An array of errors + */ + public function check($ip = '', $email = '', $username = '') + { + $params = []; + if (!empty($ip)) { + if (in_array($ip, ['127.0.0.1', '::1', '0.0.0.0'])) { + $ip = '72.179.10.158'; + } + + $params['ip'] = $ip; + } + + if (!empty($email)) { + $params['email'] = $email; + } + + if (!empty($username)) { + $params['username'] = $username; + } + + if (empty($params)) { + return; + } + + $xml = $this->request($params); + $i = 0; + $errors = []; + + foreach ($xml->appears as $result) { + if ((string)$result === 'yes') { + $errors[] = ucfirst($xml->type[$i]); + } + + $i++; + } + + return $errors; + } + + /** + * Make a request to stopforumspam.com + * + * @param array $params An array of parameters to send + * + * @return mixed The return SimpleXML object, or false if none + */ + public function request($params = []) + { + $client = $this->modx->services->get(ClientInterface::class); + $factory = $this->modx->services->get(RequestFactoryInterface::class); + + $uri = $this->config['host'] . $this->config['path']; + if (strtoupper($this->config['method']) == 'GET') { + $uri .= (strpos($uri, '?') > 0) ? '&' : '?'; + $uri .= http_build_query($params); + } + + $request = $factory->createRequest($this->config['method'], $uri); + + if (strtoupper($this->config['method']) == 'POST') { + $request->getBody()->write(json_encode($params)); + } + + try { + $response = $client->sendRequest($request)->withHeader('Accept', 'text/xml'); + } catch (ClientExceptionInterface $e) { + $this->modx->log(modX::LOG_LEVEL_ERROR, '[StopForumSpam] Could not load response from: ' . $this->config['host']); + $this->modx->log(modX::LOG_LEVEL_ERROR, '[StopForumSpam] Error: ' . $e->getMessage()); + return true; + } + + $responseXml = $this->toXml($response->getBody()->getContents()); + + return $responseXml; + } + + /** + * Interprets the response string of XML into an object + * + * @return SimpleXMLElement + */ + private function toXml($response) + { + $xml = null; + + try { + $xml = simplexml_load_string($response); + } catch (Exception $e) { + $this->modx->log(xPDO::LOG_LEVEL_ERROR, 'Could not parse XML response from provider: ' . $response); + } + if (!$xml) { + $xml = new SimpleXMLElement('' . $this->modx->lexicon('provider_err_blank_response') . ''); + } + return $xml; + } +} diff --git a/core/components/formit/src/FormIt/Validator.php b/core/components/formit/src/FormIt/Validator.php new file mode 100644 index 00000000..3cfed7cb --- /dev/null +++ b/core/components/formit/src/FormIt/Validator.php @@ -0,0 +1,776 @@ +formit =& $formit; + $this->modx = $formit->modx; + $this->config = array_merge(array( + 'placeholderPrefix' => 'fi.', + 'validationErrorBulkTpl' => '
  • [[+error]]
  • ', + 'validationErrorBulkSeparator' => "\n", + 'validationErrorBulkFormatJson' => false, + 'validationErrorMessage' => '

    A form validation error occurred. Please check the values you have entered.

    ', + 'use_multibyte' => (boolean)$this->modx->getOption('use_multibyte',null,false), + 'trimValuesBeforeValidation' => (boolean)$this->modx->getOption('trimValuesBeforeValidation',$this->formit->config,true), + 'encoding' => $this->modx->getOption('modx_charset',null,'UTF-8'), + 'customValidators' => !empty($this->formit->config['customValidators']) ? explode(',',$this->formit->config['customValidators']) : array(), + ), $config); + } + + /** + * Get an option passed in from parameters + * + * @param string $key + * @param mixed $default + * @param string $method + * @return null + */ + public function getOption($key, $default = null, $method = '!empty') + { + $v = $default; + + switch ($method) { + case 'empty': + case '!empty': + if (!empty($this->config[$key])) { + $v = $this->config[$key]; + } + break; + case 'isset': + default: + if (isset($this->config[$key])) { + $v = $this->config[$key]; + } + break; + } + return $v; + } + + /** + * Validates an array of fields. Returns the field names and values, with + * the field names stripped of their validators. + * + * The key names can be in this format: + * + * name:validator=param:anotherValidator:oneMoreValidator=`param` + * + * @access public + * @param Dictionary $dictionary + * @param string $validationFields + * @param string $validationSeparator + * @return array An array of field name => value pairs. + */ + public function validateFields(Dictionary $dictionary, $validationFields = '', $validationSeparator = ',') + { + $keys = $dictionary->toArray(); + $this->fields = $keys; + + /* process the list of fields that will be validated */ + $validationFields = explode($validationSeparator, $validationFields); + $fieldValidators = array(); + foreach ($validationFields as $idx => $v) { + $v = trim(ltrim($v),' '); /* allow multi-line definitions */ + $key = explode(':',$v); /* explode into list separated by : */ + if (!empty($key[0])) { + $field = $key[0]; + array_splice($key,0,1); /* remove the field name from validator list */ + $fieldValidators[$field] = $key; + if (!isset($this->fields[$field]) && strpos($field,'.') === false) { /* prevent someone from bypassing a required field by removing it from the form */ + $keys[$field] = !empty($this->fields[$v]) ? $this->fields[$v] : ''; + } + } + } + + /** @var string|array $v */ + foreach ($keys as $k => $v) { + /* is a array field, ie contact[name] */ + if (is_array($v) && !isset($_FILES[$k]) && is_string($k) && (int)$k === 0 && $k !== 0) { + $isCheckbox = false; + foreach ($v as $key => $val) { + if (!is_string($key)) { + $isCheckbox = true; + continue; + } + $subKey = $k.'.'.$key; + $this->_validate($subKey, $val, $fieldValidators); + } + if ($isCheckbox) { + $this->_validate($k, $v, $fieldValidators); + } + } else { + $this->_validate($k, $v, $fieldValidators); + } + } + /* remove fields that have . in name */ + foreach ($this->fields as $field => $v) { + if (strpos($field, '.') !== false || strpos($field, ':')) { + unset($this->fields[$field]); + } + } + + /* add fields back into dictionary */ + foreach ($this->fields as $k => $v) { + $dictionary->set($k, $v); + } + + return $this->fields; + } + + /** + * Helper method for validating fields + * @param string $k + * @param string $v + * @param array $fieldValidators + * @return void + */ + private function _validate($k, $v, array $fieldValidators = array()) + { + $key = explode(':', $k); + + $stripTags = strpos($k, 'allowTags') === false; + if (isset($fieldValidators[$k])) { + foreach ($fieldValidators[$k] as $fv) { + if (strpos($fv, 'allowTags') !== false) { + $stripTags = false; + } + } + } + + /* strip tags by default */ + if ($stripTags && !is_array($v)) { + $v = strip_tags($v); + } + + $replaceSpecialChars = strpos($k, 'allowSpecialChars') === false; + if (isset($fieldValidators[$k])) { + foreach ($fieldValidators[$k] as $fv) { + if (strpos($fv, 'allowSpecialChars') !== false) { + $replaceSpecialChars = false; + } + } + } + + /* htmlspecialchars by default */ + if ($replaceSpecialChars && !is_array($v)) { + $v = htmlspecialchars($v, ENT_QUOTES, $this->modx->getOption('modx_charset', null, 'UTF-8')); + } + + /* handle checkboxes/radios with empty hiddens before that are field[] names */ + if (is_array($v) && !isset($_FILES[$key[0]]) && empty($v[0])) { + array_splice($v, 0, 1); + } + + /* loop through validators and execute the old way, for backwards compatibility */ + $validators = count($key); + if ($validators > 1) { + $this->fields[$key[0]] = $v; + for ($i=1; $i<$validators; $i++) { + $this->validate($key[0], $v, $key[$i]); + } + } else { + $this->fields[$k] = $v; + } + + /* do new way of validation, which is more secure */ + if (!empty($fieldValidators[$k])) { + foreach ($fieldValidators[$k] as $validator) { + $this->validate($k, $v, $validator); + } + } + } + + /** + * Validates a field based on a custom rule, if specified + * + * @access public + * @param string $key The key of the field + * @param mixed $value The value of the field + * @param string $type Optional. The type of the validator to apply. Can + * either be a method name of fiValidator or a Snippet name. + * @return boolean True if validation was successful. If not, will store + * error messages to $this->errors. + */ + public function validate($key, $value, $type = '') + { + /** @var boolean|array $validated */ + $validated = false; + + /** @var mixed $value Trim spaces from the value before validating **/ + if (!empty($this->config['trim_values_before_validation'])) { + $value = trim($value); + } + + /** @var boolean $hasParams */ + $hasParams = $this->config['use_multibyte'] ? mb_strpos($type,'=',0,$this->config['encoding']) : strpos($type,'='); + /** @var string|null $param The parameter value, if one is set */ + $param = null; + if ($hasParams !== false) { + $len = $this->config['use_multibyte'] ? mb_strlen($type,$this->config['encoding']) : strlen($type); + $s = $this->config['use_multibyte'] ? mb_substr($type,$hasParams+1,$len,$this->config['encoding']) : substr($type,$hasParams+1,$len); + $param = str_replace(array('`','^'),'',$s); + $type = $this->config['use_multibyte'] ? mb_substr($type,0,$hasParams,$this->config['encoding']) : substr($type,0,$hasParams); + } + + /** @var array $invNames An array of invalid hook names to skip */ + $invNames = array('validate','validateFields','addError','__construct'); + $customValidators = !empty($this->config['customValidators']) ? $this->config['customValidators'] : ''; + $customValidators = explode(',',$customValidators); + if (method_exists($this,$type) && !in_array($type,$invNames)) { + /* built-in validator */ + $validated = $this->$type($key,$value,$param); + + /* only allow specified validators to prevent brute force execution of unwanted snippets */ + } else if (in_array($type,$customValidators)) { + /* attempt to grab custom validator */ + /** @var modSnippet|null $snippet */ + $snippet = $this->modx->getObject('modSnippet',array('name' => $type)); + if ($snippet) { + /* custom snippet validator */ + $props = array_merge($this->formit->config,array( + 'key' => $key, + 'value' => $value, + 'param' => $param, + 'type' => $type, + 'validator' => &$this, + 'errors' => &$this->errors, + )); + $validated = $snippet->process($props); + } else { + /* no validator found */ + $this->modx->log(\modX::LOG_LEVEL_ERROR,'[FormIt] Could not find validator "'.$type.'" for field "'.$key.'".'); + $validated = true; + } + } else { + $this->modx->log(\modX::LOG_LEVEL_INFO,'[FormIt] Validator "'.$type.'" for field "'.$key.'" was not specified in the customValidators property.'); + $validated = true; + } + + /** handle return value errors */ + if (!empty($validated)) { + if (is_array($validated)) { + foreach ($validated as $key => $errMsg) { + $this->addError($key,$errMsg); + } + $validated = false; + } elseif ($validated !== '1' && $validated !== 1 && $validated !== true) { + $this->addError($key,$validated); + $validated = false; + } + } + + return $validated; + } + + /** + * Adds an error to the stack. + * + * @access private + * @param string $key The field to add the error to. + * @param string $value The error message. + * @return string The added error message with the error wrapper. + */ + public function addError($key, $value) + { + $errTpl = $this->modx->getOption('errTpl', $this->formit->config, '[[+error]]'); + $this->errorsRaw[$key] = $value; + if (!isset($this->errors[$key])) { + $this->errors[$key] = ''; + } + $this->errors[$key] .= ' '.str_replace('[[+error]]', $value, $errTpl); + return $this->errors[$key]; + } + + /** + * Check to see if there are any validator errors in the stack + * + * @return boolean + */ + public function hasErrors() + { + return !empty($this->errors); + } + + /** + * Get all errors in the stack + * + * @return array + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Get all raw errors in the stack (errors without the wrapper) + * @return array + */ + public function getRawErrors() + { + return $this->errorsRaw; + } + + /** + * Checks to see if field is required. + * @param string $key The name of the field + * @param string $value The value of the field + * @return boolean + */ + public function required($key, $value) + { + $success = false; + 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 { + $v = (is_array($value)) ? $value : trim($value, ' '); + $success = (!empty($v) || is_numeric($v)) ? true : false; + } + return $success ? true : $this->_getErrorMessage($key, 'vTextRequired', 'formit.field_required', array( + 'field' => $key, + 'value' => is_array($value) ? implode(',', $value) : $value, + )); + } + + /** + * Checks to see if field is blank. + * @param string $key The name of the field + * @param string $value The value of the field + * @return boolean + */ + public function blank($key, $value) + { + return empty($value) ? true : $this->_getErrorMessage($key, 'vTextBlank', 'formit.field_not_empty', array( + 'field' => $key, + 'value' => $value, + )); + } + + /** + * Checks to see if passwords match. + * @param string $key The name of the field + * @param string $value The value of the field + * @param string $param The parameter passed into the validator that contains the field to check the password against + * @return boolean + */ + public function password_confirm($key, $value, $param = 'password_confirm') + { + if (empty($value) || $this->fields[$param] != $value) { + return $this->_getErrorMessage($key, 'vTextPasswordConfirm', 'formit.password_dont_match', array( + 'field' => $key, + 'password' => $value, + 'password_confirm' => $this->fields[$param], + )); + } + return true; + } + + /** + * Checks to see if field value is an actual email address. + * @param string $key The name of the field + * @param string $value The value of the field + * @return boolean + */ + public function email($key, $value) + { + /* allow empty emails, :required should be used to prevent blank field */ + if (empty($value)) { + return true; + } + + /* validate length and @ */ + $pattern = "^[^@]{1,64}\@[^\@]{1,255}$"; + $condition = $this->config['use_multibyte'] ? @mb_ereg($pattern, $value) : @preg_match('/'.$pattern.'/', $value); + if (!$condition) { + return $this->_getErrorMessage($key, 'vTextEmailInvalid', 'formit.email_invalid', array( + 'field' => $key, + 'value' => $value, + )); + } + + $email_array = explode("@", $value); + $local_array = explode(".", $email_array[0]); + for ($i = 0; $i < sizeof($local_array); $i++) { + $pattern = "^(([A-Za-z0-9!#$%&'*+\/=?^_`{|}~-][A-Za-z0-9!#$%&'*+\/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$"; + $condition = $this->config['use_multibyte'] ? @mb_ereg($pattern,$local_array[$i]) : @preg_match('/'.$pattern.'/',$local_array[$i]); + if (!$condition) { + return $this->_getErrorMessage($key,'vTextEmailInvalid','formit.email_invalid',array( + 'field' => $key, + 'value' => $value, + )); + } + } + /* validate domain */ + $pattern = "^\[?[0-9\.]+\]?$"; + $condition = $this->config['use_multibyte'] ? @mb_ereg($pattern, $email_array[1]) : @preg_match('/'.$pattern.'/', $email_array[1]); + if (!$condition) { + $domain_array = explode(".", $email_array[1]); + if (sizeof($domain_array) < 2) { + return $this->_getErrorMessage($key,'vTextEmailInvalidDomain','formit.email_invalid_domain',array( + 'field' => $key, + 'value' => $value, + )); + } + for ($i = 0; $i < sizeof($domain_array); $i++) { + $pattern = "^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$"; + $condition = $this->config['use_multibyte'] ? @mb_ereg($pattern,$domain_array[$i]) : @preg_match('/'.$pattern.'/',$domain_array[$i]); + if (!$condition) { + return $this->_getErrorMessage($key,'vTextEmailInvalidDomain','formit.email_invalid_domain',array( + 'field' => $key, + 'value' => $value, + )); + } + } + } + return true; + } + + /** + * Checks to see if field value is shorter than $param. + * @param string $key The name of the field + * @param string $value The value of the field + * @param int $param The minimum length the field can be + * @return boolean + */ + public function minLength($key, $value, $param = 0) + { + $v = $this->config['use_multibyte'] ? mb_strlen($value,$this->config['encoding']) : strlen($value); + if ($v < $param) { + return $this->_getErrorMessage($key,'vTextMinLength','formit.min_length',array( + 'length' => $param, + 'field' => $key, + 'value' => $value, + )); + } + return true; + } + + /** + * Checks to see if field value is longer than $param. + * @param string $key The name of the field + * @param string $value The value of the field + * @param int $param The maximum length the field can be + * @return boolean + */ + public function maxLength($key, $value, $param = 999) + { + $v = $this->config['use_multibyte'] ? mb_strlen($value,$this->config['encoding']) : strlen($value); + if ($v > $param) { + return $this->_getErrorMessage($key,'vTextMaxLength','formit.max_length',array( + 'length' => $param, + 'field' => $key, + 'value' => $value, + )); + } + return true; + } + + /** + * Checks to see if field value is less than $param. + * @param string $key The name of the field + * @param string $value The value of the field + * @param int $param The minimum value the field can be + * @return boolean + */ + public function minValue($key, $value, $param = 0) + { + if ((float)$value < (float)$param) { + return $this->_getErrorMessage($key,'vTextMinValue','formit.min_value',array( + 'field' => $key, + 'passedValue' => $value, + 'value' => $param, + )); + } + return true; + } + + /** + * Checks to see if field value is greater than $param. + * @param string $key The name of the field + * @param string $value The value of the field + * @param int $param The maximum value the field can be + * @return boolean + */ + public function maxValue($key, $value, $param = 0) + { + if ((float)$value > (float)$param) { + return $this->_getErrorMessage($key,'vTextMaxValue','formit.max_value',array( + 'field' => $key, + 'passedValue' => $value, + 'value' => $param, + )); + } + return true; + } + + /** + * See if field contains a certain value. + * @param string $key The name of the field + * @param string $value The value of the field + * @param string $expr The regular expression to check against the field + * @return boolean + */ + public function contains($key, $value, $expr = '') + { + if (!preg_match('/'.$expr.'/i',$value)) { + return $this->_getErrorMessage($key,'vTextContains','formit.contains',array( + 'field' => $key, + 'passedValue' => $value, + 'value' => $expr, + )); + } + return true; + } + + /** + * Strip a string from the value. + * @param string $key The name of the field + * @param string $value The value of the field + * @param string $param The value to strip from the field + */ + public function strip($key, $value, $param = '') { + $this->fields[$key] = str_replace($param,'',$value); + } + + /** + * Strip all tags in the field. The parameter can be a string of allowed + * tags. + * @param string $key The name of the field + * @param string $value The value of the field + * @param string $allowedTags A comma-separated list of tags to allow in the field's value + * @return boolean + */ + public function stripTags($key, $value, $allowedTags = '') + { + $this->fields[$key] = strip_tags($value,$allowedTags); + return true; + } + + /** + * Strip all tags in the field. The parameter can be a string of allowed + * tags. + * @param string $key The name of the field + * @param string $value The value of the field + * @param string $allowedTags A comma-separated list of tags to allow in the field's value. Leave blank to allow all. + * @return boolean + */ + public function allowTags($key, $value, $allowedTags = '') { + if (empty($allowedTags)) { + return true; + } + $this->fields[$key] = strip_tags($value,$allowedTags); + return true; + } + + /** + * Validates value between a range, specified by min-max. + * @param string $key The name of the field + * @param string $value The value of the field + * @param string $ranges The range the value should reside in + * @return boolean + */ + public function range($key, $value, $ranges = '0-1') + { + $range = explode('-',$ranges); + if (count($range) < 2) { + return $this->modx->lexicon('formit.range_invalid'); + } + + if ($value < $range[0] || $value > $range[1]) { + return $this->_getErrorMessage($key,'vTextRange','formit.range',array( + 'min' => $range[0], + 'max' => $range[1], + 'field' => $key, + 'value' => $value, + 'ranges' => $ranges, + )); + } + return true; + } + + /** + * Checks to see if the field is a number. + * @param string $key The name of the field + * @param string $value The value of the field + * @return boolean + */ + public function isNumber($key, $value) + { + if (!empty($value) && !is_numeric(trim($value))) { + return $this->_getErrorMessage($key,'vTextIsNumber','formit.not_number',array( + 'field' => $key, + 'value' => $value, + )); + } + return true; + } + + /** + * Checks to see if the field is a valid date. Allows for date formatting as + * well. + * @param string $key The name of the field + * @param string $value The value of the field + * @param string $format The format of the date + * @return boolean + */ + public function isDate($key, $value, $format = '%m/%d/%Y') + { + /* allow empty isDate, :required should be used to prevent blank field */ + if (empty($value)) { + return true; + } + $ts = strtotime($value); + if ($ts === false) { + return $this->_getErrorMessage($key,'vTextIsDate','formit.not_date',array( + 'format' => $format, + 'field' => $key, + 'value' => $value, + )); + } + if (!empty($format)) { + $this->fields[$key] = strftime($format,$ts); + } + return true; + } + + /** + * Checks to see if a string is all lowercase + * @param string $key The name of the field + * @param string $value The value of the field + * @return boolean + */ + public function islowercase($key, $value) + { + $v = $this->config['use_multibyte'] ? mb_strtolower($value,$this->config['encoding']) : strtolower($value); + return strcmp($v, $value) == 0 ? true : $this->_getErrorMessage($key,'vTextIsLowerCase','formit.not_lowercase',array( + 'field' => $key, + 'value' => $value, + )); + } + + /** + * Checks to see if a string is all uppercase + * @param string $key The name of the field + * @param string $value The value of the field + * @return boolean + */ + public function isuppercase($key, $value) + { + $v = $this->config['use_multibyte'] ? mb_strtoupper($value,$this->config['encoding']) : strtoupper($value); + return strcmp($v,$value) == 0 ? true : $this->_getErrorMessage($key,'vTextIsUpperCase','formit.not_lowercase',array( + 'field' => $key, + 'value' => $value, + )); + } + + /** + * @param string $key The name of the field + * @param string $value The value of the field + * @param string $expression The regexp to use + * @return boolean + */ + public function regexp($key, $value, $expression) + { + preg_match($expression,$value,$matches); + return !empty($matches) && !empty($matches[0]) == true ? true : $this->_getErrorMessage($key,'vTextRegexp','formit.not_regexp',array( + 'field' => $key, + 'value' => $value, + 'regexp' => $expression, + )); + } + + /** + * Check for a custom error message, otherwise use a lexicon entry. + * @param string $field + * @param string $parameter + * @param string $lexiconKey + * @param array $properties + * @return null|string + */ + public function _getErrorMessage($field, $parameter, $lexiconKey, array $properties = array()) + { + if (!empty($this->formit->config[$field.'.'.$parameter])) { + $message = $this->formit->config[$field.'.'.$parameter]; + $this->modx->lexicon->set($lexiconKey,$message); + $this->modx->lexicon($lexiconKey,$properties); + } else if (!empty($this->formit->config[$parameter])) { + $message = $this->formit->config[$parameter]; + $this->modx->lexicon->set($lexiconKey,$message); + $this->modx->lexicon($lexiconKey,$properties); + } else { + $message = $this->modx->lexicon($lexiconKey,$properties); + } + return $message; + } + + /** + * Process the errors that have occurred and setup the appropriate placeholders + * @return void + */ + public function processErrors() + { + $this->modx->toPlaceholders($this->getErrors(),$this->config['placeholderPrefix'].'error'); + $bulkErrTpl = $this->getOption('validationErrorBulkTpl'); + $rawErrs = $this->getRawErrors(); + $errs = array(); + $formatJson = $this->getOption('validationErrorBulkFormatJson'); + if ($formatJson) { + $errs = ''; + $errs = $this->modx->toJSON($rawErrs); + } else { + foreach ($rawErrs as $field => $err) { + $errs[] = str_replace(array('[[+field]]','[[+error]]'),array($field,$err),$bulkErrTpl); + } + $errs = implode($this->getOption('validationErrorBulkSeparator'),$errs); + } + $validationErrorMessage = str_replace('[[+errors]]',$errs,$this->getOption('validationErrorMessage')); + $this->modx->setPlaceholder($this->getOption('placeholderPrefix').'validation_error',true); + $this->modx->setPlaceholder($this->getOption('placeholderPrefix').'validation_error_message',$validationErrorMessage); + } + + /** + * Resets the validator + * @return void + */ + public function reset() + { + $this->errors = array(); + $this->errorsRaw = array(); + } +} diff --git a/core/components/formit/templates/home.tpl b/core/components/formit/templates/home.tpl new file mode 100644 index 00000000..9212954e --- /dev/null +++ b/core/components/formit/templates/home.tpl @@ -0,0 +1 @@ +
    \ No newline at end of file diff --git a/core/components/formit/templates/migrate.tpl b/core/components/formit/templates/migrate.tpl new file mode 100644 index 00000000..f7183e89 --- /dev/null +++ b/core/components/formit/templates/migrate.tpl @@ -0,0 +1 @@ +
    \ No newline at end of file diff --git a/core/components/formit/vendor/autoload.php b/core/components/formit/vendor/autoload.php new file mode 100644 index 00000000..cbc6ee9a --- /dev/null +++ b/core/components/formit/vendor/autoload.php @@ -0,0 +1,7 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see http://www.php-fig.org/psr/psr-0/ + * @see http://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + // PSR-4 + private $prefixLengthsPsr4 = array(); + private $prefixDirsPsr4 = array(); + private $fallbackDirsPsr4 = array(); + + // PSR-0 + private $prefixesPsr0 = array(); + private $fallbackDirsPsr0 = array(); + + private $useIncludePath = false; + private $classMap = array(); + private $classMapAuthoritative = false; + private $missingClasses = array(); + private $apcuPrefix; + + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); + } + + return array(); + } + + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + */ + public function add($prefix, $paths, $prepend = false) + { + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + (array) $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + (array) $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + (array) $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + (array) $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + (array) $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + (array) $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 base directories + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + } + + /** + * Unregisters this instance as an autoloader. + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return bool|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + includeFile($file); + + return true; + } + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + */ +function includeFile($file) +{ + include $file; +} diff --git a/core/components/formit/vendor/composer/LICENSE b/core/components/formit/vendor/composer/LICENSE new file mode 100644 index 00000000..f27399a0 --- /dev/null +++ b/core/components/formit/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/core/components/formit/vendor/composer/autoload_classmap.php b/core/components/formit/vendor/composer/autoload_classmap.php new file mode 100644 index 00000000..7a91153b --- /dev/null +++ b/core/components/formit/vendor/composer/autoload_classmap.php @@ -0,0 +1,9 @@ + array($baseDir . '/src'), +); diff --git a/core/components/formit/vendor/composer/autoload_real.php b/core/components/formit/vendor/composer/autoload_real.php new file mode 100644 index 00000000..04988975 --- /dev/null +++ b/core/components/formit/vendor/composer/autoload_real.php @@ -0,0 +1,55 @@ += 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); + if ($useStaticLoader) { + require_once __DIR__ . '/autoload_static.php'; + + call_user_func(\Composer\Autoload\ComposerStaticInitf04f5acd9d2ed29ec2c783dd1c99d56e::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + } + + $loader->register(true); + + return $loader; + } +} diff --git a/core/components/formit/vendor/composer/autoload_static.php b/core/components/formit/vendor/composer/autoload_static.php new file mode 100644 index 00000000..1a6783c1 --- /dev/null +++ b/core/components/formit/vendor/composer/autoload_static.php @@ -0,0 +1,31 @@ + + array ( + 'Sterc\\' => 6, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'Sterc\\' => + array ( + 0 => __DIR__ . '/../..' . '/src', + ), + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInitf04f5acd9d2ed29ec2c783dd1c99d56e::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitf04f5acd9d2ed29ec2c783dd1c99d56e::$prefixDirsPsr4; + + }, null, ClassLoader::class); + } +} diff --git a/core/components/formit/vendor/composer/installed.json b/core/components/formit/vendor/composer/installed.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/core/components/formit/vendor/composer/installed.json @@ -0,0 +1 @@ +[] diff --git a/readme.md b/readme.md index f5b71347..daecc1f1 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,20 @@ -# FormIt +[![Contributors](https://img.shields.io/github/contributors/Sterc/FormIt.svg?style=flat-square)](https://github.com/Sterc/FormIt/graphs/contributors) +[![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg?style=flat-square)](https://www.gnu.org/licenses/gpl-2.0) -FormIt is currently maintained at [modxcms/FormIt](http://github.com/modxcms/FormIt). Please [go there](http://github.com/modxcms/FormIt). +# FormIt for MODX + +FormIt is a dynamic form processing snippet for MODX Revolution developers. It handles form submission, validation and followup actions like sending an email or storing encrypted versions of these mails for later reference. + +Screenshots and more information can be found on the [Sterc website](https://www.sterc.com/modx/extras/formit). + +## Upgrading to FormIt 3.0.0? It involves a migration + +We've released FormIt 3.0 in order to avoid issues with Mcrypt in the near future, since it will be [deprecated in PHP 7.2](http://php.net/manual/en/migration71.deprecated.php). Mcrypt has therefore been replaced by OpenSSL encryption. + +After updating to 3.0.0, you should refresh the page and notice a red bar on the top of your manager. From there, you can initiate the migration process, which will unencrypt your saved forms using Mcrypt and immediately encrypt it using OpenSSL. + +## Free Extra + +This is a free extra and the code is publicly available for you to change. The extra is being actively maintained and you're free to put in pull requests which match our roadmap. Please create an issue if the pull request differs from the roadmap so we can make sure we're on the same page. + +Need help? [Approach our support desk for paid premium support](mailto:service@sterc.com).