From b65180a7f622adeea61dcd0098e1063fb82c5386 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 14 Dec 2012 01:53:36 +0100 Subject: [PATCH] Changelog update for grouped CMS buttons --- docs/en/changelogs/3.1.0.md | 44 ++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/docs/en/changelogs/3.1.0.md b/docs/en/changelogs/3.1.0.md index 95ebdc5dc..79acfc0d9 100644 --- a/docs/en/changelogs/3.1.0.md +++ b/docs/en/changelogs/3.1.0.md @@ -4,6 +4,48 @@ ## Upgrading +### Grouped CMS Buttons + +The CMS buttons are now grouped, in order to hide minor actions by default and declutter the interface. +This required changing the form field structure from a simple `FieldList` +to a `FieldList` which contains a `CompositeField` for all "major actions", +and a `TabSet` with a single tab for all "minor actions". +If you have previously added, removed or altered built-in CMS actions in any way, +you'll need to adjust your code. + + :::php + class MyPage extends Page { + function getCMSActions() { + $actions = parent::getCMSActions(); + + // Inserting a new toplevel action (old) + $actions->push(new FormAction('MyAction')); + + // Inserting a new toplevel action (new) + $actions->insertAfter(new FormAction('MyAction'), 'MajorActions'); + + // Removing an action, both toplevel and nested (no change required) + $actions->removeByName('action_unpublish'); + + // Inserting a new minor action (new) + $actions->addFieldToTab( + 'Root.ActionMenus.MoreOptions', + new FormAction('MyMinorAction') + ); + + // Finding a toplevel action (no change required) + $match = $actions->dataFieldByName('action_save'); + + // Finding a nested action (new) + $match = $actions->fieldByName('ActionMenus.MoreOptions') + ->fieldByName('action_MyMinorAction'); + + return $actions; + } + } + +### Other + * `TableListField`, `ComplexTableField`, `TableField`, `HasOneComplexTableField`, `HasManyComplexTableField` and `ManyManyComplexTableField` have been removed from the core and placed into a module called "legacytablefields" located at https://github.com/silverstripe-labs/legacytablefields * `prototype.js` and `behaviour.js` have been removed from the core, they are no longer used. If you have custom code relying on these two libraries, please update your code to include the files yourself * `Object::has_extension()` and `Object::add_extension()` deprecated in favour of using late static binding, please use `{class}::has_extension()` and `{class}::add_extension()` instead, where {class} is the class name of your DataObject class. @@ -45,4 +87,4 @@ - `DataList#find` - `DataList#byIDs` - `DataList#reverse` - * `DataList#dataQuery` has been changed to return a clone of the query, and so can't be used to modify the list's query directly. Use `DataList#alterDataQuery` instead to modify dataQuery in a safe manner. + * `DataList#dataQuery` has been changed to return a clone of the query, and so can't be used to modify the list's query directly. Use `DataList#alterDataQuery` instead to modify dataQuery in a safe manner. \ No newline at end of file