From 1b450a54559ce82050c0cf3d5a57173fb7f476e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thierry=20Fran=C3=A7ois?= Date: Mon, 12 Feb 2018 15:32:28 +0200 Subject: [PATCH] Readme update for bulk manager --- README.md | 6 +++--- docs/en/BULK_MANAGER.md | 13 +++---------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e354c3a..357c168 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Set of SilverStripe 4 GridField components to facilitate bulk file upload & reco [More screenshots here.](screenshots) ## Requirements -* SilverStripe 4.0 (version master / 3.+) +* SilverStripe 4.0 (3.+) * SilverStripe 3.1 (version 2.+ / 1.+) * Silverstripe 3.0 (version [0.5](https://github.com/colymba/GridFieldBulkEditingTools/tree/0.5)) @@ -44,7 +44,7 @@ Upload multiple images or files at once into DataObjects. Perfect for galleries $config->addComponent(new \Colymba\BulkUpload\BulkUploader()); ``` -See [BULK_UPLOAD.md](bulkUpload/BULK_UPLOAD.md) for detailed configuration. +See [BULK_UPLOAD.md](docs/en/BULK_UPLOAD.md) for detailed configuration. ## Bulk Manager Perform actions on multiple records straight from the GridField @@ -53,7 +53,7 @@ Perform actions on multiple records straight from the GridField $config->addComponent(new \Colymba\BulkManager\BulkManager()); ``` -See [BULK_MANAGER.md](bulkManager/BULK_MANAGER.md) for detailed configuration. +See [BULK_MANAGER.md](docs/en//BULK_MANAGER.md) for detailed configuration. ## Interdependencies The `BulkUploader` component makes use of `BulkManager` to allow quick editing of the newly uploaded files. Although not nescessary for the component to work, adding `Colymba\BulkManager\BulkManager` too to your `GridFieldConfig` will give you this advantage. diff --git a/docs/en/BULK_MANAGER.md b/docs/en/BULK_MANAGER.md index 061e939..3838016 100644 --- a/docs/en/BULK_MANAGER.md +++ b/docs/en/BULK_MANAGER.md @@ -28,20 +28,13 @@ To add a custom bulk action to the list use: ```php $config ->getComponentByType('Colymba\\BulkManager\\BulkManager') - ->addBulkAction('actionName', 'Dropdown label', 'ActionHandlerClassName', $frontEndConfig) + ->addBulkAction('Namespace\\ClassName') ``` -You can omit the handler's class name and the front-end config array, those will default to: -* `'GridFieldBulkAction'.ucfirst($name).'Handler'` -* `$config = array( 'isAjax' => true, 'icon' => 'accept', 'isDestructive' => false )` - #### Custom action handler When creating your own bulk action `RequestHandler`, you should extend `Colymba\BulkManager\BulkAction\Handler` which will expose 2 useful functions `getRecordIDList()` and `getRecords()` returning either an array with the selected records IDs or a `DataList` of the selected records. -Make sure to define your `$allowed_actions` and `$url_handlers` on your custom bulk action handler. See `Handler`, `DeleteHandler` and `UnlinkHandler` for examples. +Make sure to define the handler's `$url_segment`, from which the handler will be called and its relating `$allowed_actions` and `$url_handlers`. See `Handler`, `DeleteHandler` and `UnlinkHandler` for examples. #### Front-end config -The last `addBulkAction()` parameter lets you pass an array with configuration options for the UI/UX: -* `isAjax`: if true the action will be called via XHR request otherwise the browser will be redirected to the action's URL -* `icon`: lets you define which icon to use on the button when the action is selected (SilverStripe button icon name only) -* `isDestructive`: if true, a confirmation dialog will be shown before the action is processed +Bulk action handler's front-end configuration is set via class properties `label`, `icon`, `buttonClasses`, `xhr` and `destructive`. See `Handler`, `DeleteHandler` and `UnlinkHandler` for reference and examples.