Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow item removal to be disabed.

  • Loading branch information...
commit 226d5d5780969055b7e165b12c04d4cb6ca3e021 1 parent b593153
@ajshort ajshort authored
Showing with 7 additions and 3 deletions.
  1. +5 −3 code/HasManyPickerField.php
  2. +2 −0  docs/en/index.md
View
8 code/HasManyPickerField.php
@@ -130,9 +130,11 @@ public function ItemActions($item) {
));
}
- $actions->push(new ItemSetField_Action(
- $this, 'Remove', 'Remove', true
- ));
+ if ($this->getOption('AllowRemove')) {
+ $actions->push(new ItemSetField_Action(
+ $this, 'Remove', 'Remove', true
+ ));
+ }
return $actions;
}
View
2  docs/en/index.md
@@ -83,6 +83,8 @@ Below is a listing of options available one each class:
this field. Defaults to FALSE.
* **AllowEdit** (`bool`) - Allow selected objects to be edited. Defaults to
FALSE.
+* **AllowRemove** (`bool`) - Allow objects to be removed from the relationship
+ without being deleted. Defaults to TRUE.
* **FieldsMethod** (`string`) - The method name on the object being managed
which is called to a return a `FieldSet` used to manage the object. This
defaults to `getFrontEndFields` so that the tabbed interface is not loaded.
Please sign in to comment.
Something went wrong with that request. Please try again.