Commit Graph

2418 Commits

Author SHA1 Message Date
Ingo Schommer
55f12939bb Defined $schemaDataType constant, added to FormField subclasses 2016-03-30 23:00:00 +13:00
Ingo Schommer
3862a7a0a7 Moved FormFieldSchemaTrait into FormField
The RFC requires a FormField implementation to override $schemaDataType,
but its defined on the trait - which can't be redefined by a field subclass.

In the end, the trait was never designed to be reuseable on classes other than FormField.
We need to admit that architecturally, we'll have to add all that API weight to the base FormField
class because of the way forms are structured in SilverStripe (mainly due to a missing layer
of indirection in getCMSFields implementations).

Also implemented the $schemaDataType on fields where its known.

See https://github.com/silverstripe/silverstripe-framework/issues/4938
See http://php.net/manual/en/language.oop5.traits.php#language.oop5.traits.properties.example
2016-03-28 21:54:42 +13:00
Ingo Schommer
adbcddee80 Only iterate through dataFields() in FormSchema
Temporary measure until we implement nested fields
2016-03-28 21:54:27 +13:00
Ingo Schommer
8ae2894890 Fix form schema ID getter
Also moved keys of higher importance to start of array,
easier to review this way
2016-03-28 21:54:24 +13:00
David Craig
5d88950735 Adds schemaDataType to FormFieldSchema 2016-03-28 21:14:06 +13:00
Sam Minnee
aeccb8b8e0 API: Move DBField subclasses into SilverStripe\Model\FieldType namespace
API: Deprecate SS_Datetime.

The DBField subclasses are have all been renamed to start with “DB” and
be in the SilverStripe\Model\FieldType namespace. To keep DataObject
definitions concise, the original short variations of their names are
preserved as service definitions. Most of the field generation code
doesn’t need to change, but where field classes are referenced directly,
changes will be needed.

SS_Datetime, which is commonly referenced outside the model system
itself, has been preserved as a subclass of DBDatetime. This has been
marked as deprecated and can be removed in SilverStripe 5.

A few places that referred to $db and $casting values weren’t using
the Injector to instantiate the relevant classes. This meant that the
remapping we have created as part of moving classes into a namespace
didn’t work.
2016-03-22 18:09:30 +13:00
Ingo Schommer
8ae794ee99 API TinyMCE Image shortcodes 2016-03-21 09:23:40 +13:00
Damian Mooyman
3dada00905 Cleanup trailing whitespace 2016-03-09 10:20:31 +13:00
Damian Mooyman
6d88caa9b3 Merge pull request #5132 from open-sausages/features/form-schema
API Form schema
2016-03-07 14:08:36 +13:00
Ingo Schommer
627fbf9051 Fixed merge regression 2016-03-07 10:17:15 +13:00
Ingo Schommer
3b11d73c46 Merge remote-tracking branch 'origin/3'
# Conflicts:
#	forms/gridfield/GridFieldDetailForm.php
#	javascript/GridField.js
2016-03-07 09:26:35 +13:00
Ingo Schommer
61a8529d76 More reuseable FormSchema logic, return on save 2016-03-03 13:36:51 +13:00
Ingo Schommer
e1fcc64c41 Form field schema state
See https://github.com/silverstripe/silverstripe-framework/issues/4938
2016-03-03 13:36:48 +13:00
Ingo Schommer
746322a9f1 Replace CMSForm use with new setValidationResponseCallback() API
Preparing for form schema API, see https://github.com/silverstripe/silverstripe-framework/issues/4938
2016-03-03 08:20:55 +13:00
David Craig
404ac4ae43 Initial schemaState implementation 2016-03-03 08:20:54 +13:00
David Craig
afccef718c Initial Form Field Schema implementation
- Adds FormSchema class
- Adds FormSchema dependency to LeftAndMain via Injector
- Adds schema allowed_action method to LeftAndMain for generating Form schemas
- Adds FormFieldSchemaTrait to for schema getters and setters on FormFields
2016-03-03 08:20:54 +13:00
Matthew Hailwood
5810ecf7b9 Populate foreign key before getting CMS fields
In it's current state you need to revert to something like `Session::get('CMSMain.currentPage')` to get the foreign key of what the item you are creating relates to (e.g. a Book => has_many Author) - if you create a new Author you may need to reference the owning Book in the `getCMSFields` function.

This is just a small quality of life buff that populates that foreign key before calling `getCMSFields()` rather than after.

This should not break backwards compatibility in any way and isn't exactly a new feature so could be considered a bug fix.
2016-02-28 20:56:10 +13:00
Damian Mooyman
3b0a9f4ba2 Merge remote-tracking branch 'origin/3'
# Conflicts:
#	admin/javascript/LeftAndMain.Menu.js
#	control/HTTPRequest.php
#	css/GridField.css
#	css/GridField.css.map
#	docs/en/02_Developer_Guides/03_Forms/Field_types/01_Common_Subclasses.md
#	docs/en/02_Developer_Guides/06_Testing/00_Unit_Testing.md
#	docs/en/02_Developer_Guides/06_Testing/index.md
#	docs/en/02_Developer_Guides/14_Files/01_File_Management.md
#	docs/en/02_Developer_Guides/14_Files/02_Images.md
#	filesystem/Upload.php
#	javascript/HtmlEditorField.js
#	model/Image.php
#	model/connect/MySQLDatabase.php
#	model/fieldtypes/Enum.php
#	model/versioning/Versioned.php
#	scss/GridField.scss
2016-02-25 14:51:59 +13:00
Damian Mooyman
9fed5561f4 Merge remote-tracking branch 'origin/3.3' into 3
# Conflicts:
#	core/Constants.php
#	dev/DevelopmentAdmin.php
2016-02-24 17:39:04 +13:00
Damian Mooyman
510c556739 API File has Versioned extension
API Improved support for versioned DataObject
API GridField extensions for versioned dataobjects
API De-couple File and ErrorPage
API File::handle_shortcode now respects canView()
API AssetControlExtension is now able to delete, publish, or protect files
API Upload now protects new assets by default
2016-02-23 13:46:28 +13:00
Damian Mooyman
f20ad434ce API Update TinyMCE to 4.x
API Allow HtmlEditorField to be individually configured
BUG Fix incorrect change detection
BUG Fix missing i18n files
2016-02-23 10:10:02 +13:00
vinnie watson
a66ecf3591 GridField export and print buttons updated to new style 2016-02-22 10:03:39 +13:00
Ben Manu
7e116aa908 Removing legacy TODO reference for data-urlviewfile on MediaForm once metadata dep is removed. 2016-02-19 14:33:20 +13:00
Damian Mooyman
56e92f5a32 [ss-2016-002] Ensure Gridfield actions respect CSRF 2016-02-18 17:28:54 +13:00
Damian Mooyman
230d017677 Merge remote-tracking branch 'origin/3'
# Conflicts:
#	admin/css/ie7.css.map
#	admin/css/screen.css
#	admin/css/screen.css.map
#	admin/font/icon-reference.html
#	admin/font/silverstripe.eot
#	admin/font/silverstripe.svg
#	admin/font/silverstripe.ttf
#	admin/font/silverstripe.woff
#	admin/scss/_forms.scss
#	admin/scss/_style.scss
2016-02-12 15:41:45 +13:00
Daniel Hensby
31a4e184f7 Merge pull request #5013 from Legin76/patch-2 2016-02-04 21:26:47 +00:00
Legin76
68433cc552 Update UploadField.php to allow configurable GridFieldPaginator
Changed $config->addComponent(new GridFieldPaginator(11)); to allow it to be configured from the config.yml
2016-02-04 17:23:32 +00:00
Damian Mooyman
6cebffd89b BUG Fix SSViewerTest not restoring old requirements
BUG Fix incorrect js path in UploadField.php
Restore changes missing from merge
2016-01-26 11:39:53 +13:00
David Craig
2140025c20 Implement RFC-7 JavaScript module loader
- Adds ES6 support via Babel
- Transforms existing JavaScript to UMD modules
- Adds module bundling via Browserify
- Existing JavaScript converted to UMD modules
- lib.js and leftandmain.js are bundled using browserify
- JavaScript minifying of bundles handed by gulp
2016-01-26 11:39:20 +13:00
Damian Mooyman
99de74d69e API Add isDisabledValue to SelectField
API Remove deprecated {comma} syntax for multi select string encoded values
API MemberDatetimeOptionsetField now has a fixed preview date
BUG fix inverted arguments in OptionSetField::getOptionClass
2016-01-21 15:40:19 +13:00
Damian Mooyman
bdb1a95758 API Cleanup and refactor of select fields
API Standardise Relation interface
2016-01-21 15:40:19 +13:00
Damian Mooyman
e6b877df27 Merge remote-tracking branch 'origin/3'
# Conflicts:
#	control/Director.php
#	control/HTTP.php
#	core/startup/ParameterConfirmationToken.php
#	docs/en/00_Getting_Started/01_Installation/05_Common_Problems.md
#	docs/en/00_Getting_Started/04_Directory_Structure.md
#	docs/en/00_Getting_Started/05_Coding_Conventions.md
#	docs/en/01_Tutorials/01_Building_A_Basic_Site.md
#	docs/en/01_Tutorials/02_Extending_A_Basic_Site.md
#	docs/en/01_Tutorials/03_Forms.md
#	docs/en/01_Tutorials/04_Site_Search.md
#	docs/en/01_Tutorials/05_Dataobject_Relationship_Management.md
#	docs/en/02_Developer_Guides/12_Search/01_Searchcontext.md
#	docs/en/02_Developer_Guides/13_i18n/index.md
#	docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/06_Javascript_Development.md
#	docs/en/03_Upgrading/index.md
#	docs/en/changelogs/index.md
#	docs/en/howto/customize-cms-menu.md
#	docs/en/howto/navigation-menu.md
#	docs/en/index.md
#	docs/en/installation/index.md
#	docs/en/installation/windows-manual-iis-6.md
#	docs/en/misc/contributing/code.md
#	docs/en/misc/contributing/issues.md
#	docs/en/misc/module-release-process.md
#	docs/en/reference/dataobject.md
#	docs/en/reference/execution-pipeline.md
#	docs/en/reference/grid-field.md
#	docs/en/reference/modeladmin.md
#	docs/en/reference/rssfeed.md
#	docs/en/reference/templates.md
#	docs/en/topics/commandline.md
#	docs/en/topics/debugging.md
#	docs/en/topics/email.md
#	docs/en/topics/forms.md
#	docs/en/topics/index.md
#	docs/en/topics/module-development.md
#	docs/en/topics/modules.md
#	docs/en/topics/page-type-templates.md
#	docs/en/topics/page-types.md
#	docs/en/topics/search.md
#	docs/en/topics/testing/index.md
#	docs/en/topics/testing/testing-guide-troubleshooting.md
#	docs/en/topics/theme-development.md
#	docs/en/tutorials/1-building-a-basic-site.md
#	docs/en/tutorials/2-extending-a-basic-site.md
#	docs/en/tutorials/3-forms.md
#	docs/en/tutorials/4-site-search.md
#	docs/en/tutorials/5-dataobject-relationship-management.md
#	docs/en/tutorials/building-a-basic-site.md
#	docs/en/tutorials/dataobject-relationship-management.md
#	docs/en/tutorials/extending-a-basic-site.md
#	docs/en/tutorials/forms.md
#	docs/en/tutorials/index.md
#	docs/en/tutorials/site-search.md
#	main.php
#	model/SQLQuery.php
#	security/ChangePasswordForm.php
#	security/MemberLoginForm.php
#	tests/control/ControllerTest.php
#	tests/core/startup/ParameterConfirmationTokenTest.php
#	tests/model/SQLQueryTest.php
#	tests/security/SecurityTest.php
#	tests/view/SSViewerTest.php
#	view/SSTemplateParser.php
#	view/SSTemplateParser.php.inc
#	view/SSViewer.php
2016-01-20 13:16:27 +13:00
Damian Mooyman
8e4db95f72 Fix merge regressions 2016-01-19 17:08:40 +13:00
Damian Mooyman
8c1cafd1a0 Merge remote-tracking branch 'origin/3.3' into 3
# Conflicts:
#	admin/scss/_forms.scss
#	admin/scss/_style.scss
#	admin/scss/_tree.scss
#	javascript/TreeDropdownField.js
2016-01-19 17:08:26 +13:00
Damian Mooyman
5d240feaec Merge remote-tracking branch 'origin/3.2' into 3.3 2016-01-19 15:08:24 +13:00
Damian Mooyman
46cbe809ac Merge remote-tracking branch 'origin/3.1' into 3.2
# Conflicts:
#	docs/en/02_Developer_Guides/09_Security/04_Secure_Coding.md
#	docs/en/02_Developer_Guides/14_Files/01_Image.md
#	docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/How_Tos/Customise_CMS_Menu.md
#	docs/en/03_Upgrading/index.md
#	docs/en/05_Contributing/01_Code.md
#	forms/TreeMultiselectField.php
#	security/Permission.php
2016-01-19 14:00:19 +13:00
Damian Mooyman
12612b4200 Merge pull request #4914 from torleif/patch-2
FIX OptionsetField returns valid HTML #4901
2016-01-13 13:06:51 +13:00
Daniel Hensby
2dd8d5e518 Fixing anchor selection 2016-01-12 17:35:06 +00:00
Torleif West
a7110bef70 FIX OptionsetField uses aria-required 2016-01-12 14:52:36 +13:00
torleif
288c8a8b27 FIX OptionsetField returns valid HTML #4901 2016-01-12 11:38:03 +13:00
Sam Minnee
4aa50534d5 FIX: Fixes needed to adapt to whitespace changes.
API: Whitespace trimmed from custom form field templates

The introduction of trailing newlines on all template files introduced
some changes that needed to be made.

Notably, whitespace has been trimmed from rendered form field templates.
This is the minimal impact to SilverStripe developers, as it preserves
the behaviour of the default field types, but I’ve still noted as a
change.
2016-01-07 14:17:57 +13:00
Sam Minnee
3ee8f505b7 MINORE: Remove training whitespace.
The main benefit of this is so that authors who make use of
.editorconfig don't end up with whitespace changes in their PRs.

Spaces vs. tabs has been left alone, although that could do with a
tidy-up in SS4 after the switch to PSR-1/2.

The command used was this:

for match in '*.ss' '*.css' '*.scss' '*.html' '*.yml' '*.php' '*.js' '*.csv' '*.inc' '*.php5'; do
	find . -path ./thirdparty -not -prune -o -path ./admin/thirdparty -not -prune -o -type f -name "$match" -exec sed -E -i '' 's/[[:space:]]+$//' {} \+
	find . -path ./thirdparty -not -prune -o -path ./admin/thirdparty -not -prune -o -type f -name "$match" | xargs perl -pi -e 's/ +$//'
done
2016-01-07 10:15:54 +13:00
Peter Thaleikis
45dc510da7 fixing typo 2016-01-06 00:33:22 +13:00
Florian Thoma
e94c0fa221 FIX extraClass() method to match parent method 2015-12-23 21:06:00 +11:00
Damian Mooyman
b38f316a80 Merge pull request #4851 from SilbinaryWolf/remove-validation-from-lookupfield
BUG Resolve issue with readonly LookupField failing validation
2015-12-22 16:28:01 +13:00
Damian Mooyman
4e3d6f9118 Fix merge regressions from 3.2 -> 3 2015-12-22 14:35:05 +13:00
Damian Mooyman
48a30909f3 Merge remote-tracking branch 'origin/3.2' into 3
# Conflicts:
#	admin/javascript/LeftAndMain.BatchActions.js
#	css/UploadField.css
#	forms/HtmlEditorField.php
2015-12-22 14:07:52 +13:00
Russell
4d047e5cb7 Fix path to /thirdparty/jquery-ui-themes/smoothness/jquery-ui.css 2015-12-22 10:45:01 +13:00
Jake Bentvelzen
0bf55cff39 Stubbed saveInto for LookupField so that data can't be saved on a form accidentally 2015-12-16 09:42:14 +11:00
Daniel Hensby
e443a10a5e Fixing deselect failing to change field title 2015-12-15 11:31:55 +00:00