-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* created filepond component * register new component * added backend controller credits to: https://github.com/Sopamo/laravel-filepond/ * passing upload field name to backend * create temp file if needed * linting * show disabled uploads warning * storing files and relation * keep original upload filename * remove old ajax upload component * extract filepond code to shared partial * removed unused settings * code cleanup * code cleanup * refactoring email classes * refactored email classes * code cleanup * added new param to set sender name on autoresponse email * disable submit button while uploading file * added type hint to methods * upload file type validation * Migration to WinterCMS (#2) * update references to Winter * update Winter imports * update references to Winter * update references to Winter * fixed wrong import * added upload size check * tweaks related to uploads * new setting: upload file size * validate upload file size * bugfix: enable submit on upload error * move hardcoded strings to language file * use global file size limit * version bump * fix import * export download urls * added new setting to include attached files * upadted readme file * renamed package name
- Loading branch information
Showing
54 changed files
with
1,287 additions
and
5,022 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: Ask a question | ||
url: https://github.com/skydiver/october-plugin-forms/discussions | ||
about: Ask questions and discuss with other community members | ||
url: https://github.com/skydiver/wn-magic-forms/discussions | ||
about: Ask questions and discuss with other community members |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,107 +1,116 @@ | ||
<?php | ||
|
||
namespace Martin\Forms; | ||
namespace Martin\Forms; | ||
|
||
use Backend, Lang, Validator; | ||
use System\Classes\PluginBase; | ||
use System\Classes\SettingsManager; | ||
use Martin\Forms\Classes\BackendHelpers; | ||
use Martin\Forms\Classes\GDPR; | ||
use Martin\Forms\Classes\ReCaptchaValidator; | ||
use Martin\Forms\Classes\UnreadRecords; | ||
use Martin\Forms\Models\Settings; | ||
use Backend\Facades\Backend; | ||
use Martin\Forms\Classes\GDPR; | ||
use System\Classes\PluginBase; | ||
use Martin\Forms\Models\Settings; | ||
use System\Classes\SettingsManager; | ||
use Illuminate\Support\Facades\Lang; | ||
use Martin\Forms\Classes\UnreadRecords; | ||
use Martin\Forms\Classes\BackendHelpers; | ||
use Winter\Storm\Support\Facades\Validator; | ||
|
||
class Plugin extends PluginBase { | ||
|
||
public function pluginDetails() { | ||
return [ | ||
'name' => 'martin.forms::lang.plugin.name', | ||
'description' => 'martin.forms::lang.plugin.description', | ||
'author' => 'Martin M.', | ||
'icon' => 'icon-bolt', | ||
'homepage' => 'https://github.com/skydiver/' | ||
]; | ||
} | ||
class Plugin extends PluginBase | ||
{ | ||
public function pluginDetails() | ||
{ | ||
return [ | ||
'name' => 'martin.forms::lang.plugin.name', | ||
'description' => 'martin.forms::lang.plugin.description', | ||
'author' => 'Martin M.', | ||
'icon' => 'icon-bolt', | ||
'homepage' => 'https://github.com/skydiver/' | ||
]; | ||
} | ||
|
||
public function registerNavigation() { | ||
if(Settings::get('global_hide_button', false)) { return; } | ||
return [ | ||
'forms' => [ | ||
'label' => 'martin.forms::lang.menu.label', | ||
'icon' => 'icon-bolt', | ||
'iconSvg' => 'plugins/martin/forms/assets/imgs/icon.svg', | ||
'url' => BackendHelpers::getBackendURL(['martin.forms.access_records' => 'martin/forms/records', 'martin.forms.access_exports' => 'martin/forms/exports'], 'martin.forms.access_records'), | ||
'permissions' => ['martin.forms.*'], | ||
'sideMenu' => [ | ||
'records' => [ | ||
'label' => 'martin.forms::lang.menu.records.label', | ||
'icon' => 'icon-database', | ||
'url' => Backend::url('martin/forms/records'), | ||
'permissions' => ['martin.forms.access_records'], | ||
'counter' => UnreadRecords::getTotal(), | ||
'counterLabel' => 'Un-Read Messages' | ||
], | ||
'exports' => [ | ||
'label' => 'martin.forms::lang.menu.exports.label', | ||
'icon' => 'icon-download', | ||
'url' => Backend::url('martin/forms/exports'), | ||
'permissions' => ['martin.forms.access_exports'] | ||
], | ||
] | ||
] | ||
]; | ||
public function registerNavigation() | ||
{ | ||
if (Settings::get('global_hide_button', false)) { | ||
return; | ||
} | ||
|
||
public function registerSettings() { | ||
return [ | ||
'config' => [ | ||
'label' => 'martin.forms::lang.menu.label', | ||
'description' => 'martin.forms::lang.menu.settings', | ||
'category' => SettingsManager::CATEGORY_CMS, | ||
'icon' => 'icon-bolt', | ||
'class' => 'Martin\Forms\Models\Settings', | ||
'permissions' => ['martin.forms.access_settings'], | ||
'order' => 500 | ||
return [ | ||
'forms' => [ | ||
'label' => 'martin.forms::lang.menu.label', | ||
'icon' => 'icon-bolt', | ||
'iconSvg' => 'plugins/martin/forms/assets/imgs/icon.svg', | ||
'url' => BackendHelpers::getBackendURL(['martin.forms.access_records' => 'martin/forms/records', 'martin.forms.access_exports' => 'martin/forms/exports'], 'martin.forms.access_records'), | ||
'permissions' => ['martin.forms.*'], | ||
'sideMenu' => [ | ||
'records' => [ | ||
'label' => 'martin.forms::lang.menu.records.label', | ||
'icon' => 'icon-database', | ||
'url' => Backend::url('martin/forms/records'), | ||
'permissions' => ['martin.forms.access_records'], | ||
'counter' => UnreadRecords::getTotal(), | ||
'counterLabel' => 'Un-Read Messages' | ||
], | ||
'exports' => [ | ||
'label' => 'martin.forms::lang.menu.exports.label', | ||
'icon' => 'icon-download', | ||
'url' => Backend::url('martin/forms/exports'), | ||
'permissions' => ['martin.forms.access_exports'] | ||
], | ||
] | ||
]; | ||
} | ||
|
||
public function registerPermissions() { | ||
return [ | ||
'martin.forms.access_settings' => ['tab' => 'martin.forms::lang.permissions.tab', 'label' => 'martin.forms::lang.permissions.access_settings'], | ||
'martin.forms.access_records' => ['tab' => 'martin.forms::lang.permissions.tab', 'label' => 'martin.forms::lang.permissions.access_records'], | ||
'martin.forms.access_exports' => ['tab' => 'martin.forms::lang.permissions.tab', 'label' => 'martin.forms::lang.permissions.access_exports'], | ||
'martin.forms.gdpr_cleanup' => ['tab' => 'martin.forms::lang.permissions.tab', 'label' => 'martin.forms::lang.permissions.gdpr_cleanup'], | ||
]; | ||
} | ||
] | ||
]; | ||
} | ||
|
||
public function registerComponents() { | ||
return [ | ||
'Martin\Forms\Components\GenericForm' => 'genericForm', | ||
'Martin\Forms\Components\UploadForm' => 'uploadForm', | ||
'Martin\Forms\Components\EmptyForm' => 'emptyForm', | ||
]; | ||
} | ||
public function registerSettings() | ||
{ | ||
return [ | ||
'config' => [ | ||
'label' => 'martin.forms::lang.menu.label', | ||
'description' => 'martin.forms::lang.menu.settings', | ||
'category' => SettingsManager::CATEGORY_CMS, | ||
'icon' => 'icon-bolt', | ||
'class' => 'Martin\Forms\Models\Settings', | ||
'permissions' => ['martin.forms.access_settings'], | ||
'order' => 500 | ||
] | ||
]; | ||
} | ||
|
||
public function registerMailTemplates() { | ||
return [ | ||
'martin.forms::mail.notification' => Lang::get('martin.forms::lang.mails.form_notification.description'), | ||
'martin.forms::mail.autoresponse' => Lang::get('martin.forms::lang.mails.form_autoresponse.description'), | ||
]; | ||
} | ||
public function registerPermissions() | ||
{ | ||
return [ | ||
'martin.forms.access_settings' => ['tab' => 'martin.forms::lang.permissions.tab', 'label' => 'martin.forms::lang.permissions.access_settings'], | ||
'martin.forms.access_records' => ['tab' => 'martin.forms::lang.permissions.tab', 'label' => 'martin.forms::lang.permissions.access_records'], | ||
'martin.forms.access_exports' => ['tab' => 'martin.forms::lang.permissions.tab', 'label' => 'martin.forms::lang.permissions.access_exports'], | ||
'martin.forms.gdpr_cleanup' => ['tab' => 'martin.forms::lang.permissions.tab', 'label' => 'martin.forms::lang.permissions.gdpr_cleanup'], | ||
]; | ||
} | ||
|
||
public function register() { | ||
$this->app->resolving('validator', function($validator) { | ||
Validator::extend('recaptcha', 'Martin\Forms\Classes\ReCaptchaValidator@validateReCaptcha'); | ||
}); | ||
} | ||
public function registerComponents() | ||
{ | ||
return [ | ||
'Martin\Forms\Components\GenericForm' => 'genericForm', | ||
'Martin\Forms\Components\FilePondForm' => 'filepondForm', | ||
'Martin\Forms\Components\EmptyForm' => 'emptyForm', | ||
]; | ||
} | ||
|
||
public function registerSchedule($schedule) { | ||
$schedule->call(function () { | ||
$records = GDPR::cleanRecords(); | ||
})->daily(); | ||
} | ||
public function registerMailTemplates() | ||
{ | ||
return [ | ||
'martin.forms::mail.notification' => Lang::get('martin.forms::lang.mails.form_notification.description'), | ||
'martin.forms::mail.autoresponse' => Lang::get('martin.forms::lang.mails.form_autoresponse.description'), | ||
]; | ||
} | ||
|
||
public function register() | ||
{ | ||
$this->app->resolving('validator', function () { | ||
Validator::extend('recaptcha', 'Martin\Forms\Classes\ReCaptchaValidator@validateReCaptcha'); | ||
}); | ||
} | ||
|
||
?> | ||
public function registerSchedule($schedule) | ||
{ | ||
$schedule->call(function () { | ||
GDPR::cleanRecords(); | ||
})->daily(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.