mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Added ->itemWriteMethod parameter, to adjust the way that CTFs write (for instance, to save and publish instead of just save)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2@64128 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
5ca5dd15ee
commit
09e787a6de
@ -117,6 +117,12 @@ class ComplexTableField extends TableListField {
|
||||
*/
|
||||
protected $relationAutoSetting = true;
|
||||
|
||||
/**
|
||||
* Set the method for saving changes to items in the detail pop-up.
|
||||
* By default, this is write, which just saves the changes to the database.
|
||||
*/
|
||||
public $itemWriteMethod = "write";
|
||||
|
||||
/**
|
||||
* See class comments
|
||||
*
|
||||
@ -766,7 +772,10 @@ class ComplexTableField_Popup extends Form {
|
||||
}
|
||||
|
||||
$this->saveInto($childObject);
|
||||
$childObject->write();
|
||||
|
||||
$funcName = $this->controller->itemWriteMethod;
|
||||
if(!$funcName) $funcName = "write";
|
||||
$childObject->$funcName();
|
||||
|
||||
// if ajax-call in an iframe, update window
|
||||
if(Director::is_ajax()) {
|
||||
|
Loading…
Reference in New Issue
Block a user