Skip to content

Commit

Permalink
Merge branch 'wax100-issue-154' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
joeke committed May 1, 2018
2 parents 2cb2f2e + 75b96c0 commit 233899a
Show file tree
Hide file tree
Showing 19 changed files with 411 additions and 53 deletions.
2 changes: 1 addition & 1 deletion _build/build.transport.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/* set package defines */
define('PKG_ABBR','formit');
define('PKG_NAME','FormIt');
define('PKG_VERSION','3.0.4');
define('PKG_VERSION','4.0.0');
define('PKG_RELEASE','pl');

/* override with your own defines here (see build.config.sample.php) */
Expand Down
20 changes: 18 additions & 2 deletions _build/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"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.0.0",
"version": "4.0.1",
"package": {
"actions": [{
"id": 1,
Expand Down Expand Up @@ -323,6 +323,11 @@
"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",
Expand Down Expand Up @@ -475,7 +480,18 @@
"type": "textfield",
"area": "system",
"value": ""
}]
},{
"key": "attachment.mediasource",
"type": "modx-combo-source",
"area": "system",
"value": 1
},{
"key": "attachment.path",
"type": "textfield",
"area": "system",
"value": ""
}
]
},
"database": {
"tables": [
Expand Down
18 changes: 18 additions & 0 deletions _build/data/transport.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,22 @@
'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);

return $settings;
2 changes: 2 additions & 0 deletions _build/gpm_resolvers/gpm.resolve.tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
$modx->addPackage('formit', $modelPath, null);



$manager = $modx->getManager();

$manager->createObjectContainer('FormItForm');


break;
}
}
Expand Down
Empty file modified _packages/formit-4.0-beta.transport.zip
100755 → 100644
Empty file.
Empty file modified _packages/formit-4.0-beta2.transport.zip
100755 → 100644
Empty file.
Empty file modified _packages/formit-4.0-beta3.transport.zip
100755 → 100644
Empty file.
Binary file modified _packages/formit-4.0.0-pl.transport.zip
Binary file not shown.
Binary file added _packages/formit-4.0.1-pl.transport.zip
Binary file not shown.
45 changes: 39 additions & 6 deletions core/components/formit/controllers/home.class.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
require_once dirname(dirname(__FILE__)) . '/index.class.php';

/**
* Loads the home page.
*
Expand All @@ -8,22 +9,54 @@
*/
class FormItHomeManagerController extends FormItBaseManagerController
{
public function process(array $scriptProperties = array()) {
/** @var bool Whether or not a failure message was sent by this controller. */
protected $isFailure = false;
/** @var string The failure message, if existent, for this controller. */
protected $failureMessage = '';


public function process(array $scriptProperties = [])
{

if (isset($_GET['file']) && isset($_GET['formid'])) {
$formid = (int)$_GET['formid'];
$form = $this->modx->getObject('FormItForm', $formid);
if (!$form) {
$this->failureMessage = 'Form not found!';
$this->isFailure = true;

return;
}
$response = $form->downloadFile($_GET['file']);
if ($response !== true) {
$this->failureMessage = $response;
$this->isFailure = true;

return;
}

}

}


public function getPageTitle()
{
return $this->modx->lexicon('formit');
}


public function loadCustomCssJs()
{
$this->addJavascript($this->formit->config['jsUrl'].'mgr/widgets/forms.grid.js');
$this->addJavascript($this->formit->config['jsUrl'].'mgr/widgets/forms-encryption.grid.js');
$this->addJavascript($this->formit->config['jsUrl'].'mgr/widgets/home.panel.js');
$this->addLastJavascript($this->formit->config['jsUrl'].'mgr/sections/home.js');
$this->addJavascript($this->formit->config['jsUrl'] . 'mgr/widgets/forms.grid.js');
$this->addJavascript($this->formit->config['jsUrl'] . 'mgr/widgets/forms-encryption.grid.js');
$this->addJavascript($this->formit->config['jsUrl'] . 'mgr/widgets/home.panel.js');
$this->addLastJavascript($this->formit->config['jsUrl'] . 'mgr/sections/home.js');
}


public function getTemplateFile()
{
return $this->formit->config['templatesPath'].'home.tpl';
return $this->formit->config['templatesPath'] . 'home.tpl';
}
}
3 changes: 2 additions & 1 deletion core/components/formit/lexicon/en/default.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@
$_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.storeAttachment_mediasource_error'] = 'Cant find MediaSource! Mediasource id is: ';
$_lang['formit.storeAttachment_access_error'] = 'Directory is not writable! Check the permissions for: ';
$_lang['area_recaptcha'] = 'reCaptcha';
2 changes: 2 additions & 0 deletions core/components/formit/lexicon/nl/default.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@
$_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.storeAttachment_mediasource_error'] = 'Kan MediaSource niet vinden! Mediasource-ID is: ';
$_lang['formit.storeAttachment_access_error'] = 'Directory is niet schrijfbaar! Controleer de machtigingen voor: ';
2 changes: 2 additions & 0 deletions core/components/formit/lexicon/ru/default.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@
$_lang['formit.spam_marked'] = ' - помечено как спам.';
$_lang['formit.username_taken'] = 'Имя пользователя уже занято. Пожалуйста, выберите другое.';
$_lang['formit.not_regexp'] = 'Ваше значение не совпадает с предполагаемым форматом.';
$_lang['formit.storeAttachment_mediasource_error'] = 'Источник медиа не найден! Id источник: ';
$_lang['formit.storeAttachment_access_error'] = 'Папка не доступна для загрузки! Проверьте права на папку: ';
Loading

0 comments on commit 233899a

Please sign in to comment.