mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
Merge pull request #74 from briceburg/multiclass-setItemRequestClass
allow specification of GridFieldAddNewMultiClass handler
This commit is contained in:
commit
187fa61d7a
@ -17,6 +17,11 @@ class GridFieldAddNewMultiClass implements GridField_HTMLProvider, GridField_URL
|
|||||||
|
|
||||||
private $classes;
|
private $classes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var String
|
||||||
|
*/
|
||||||
|
protected $itemRequestClass = 'GridFieldAddNewMultiClassHandler';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $fragment the fragment to render the button in
|
* @param string $fragment the fragment to render the button in
|
||||||
*/
|
*/
|
||||||
@ -129,7 +134,7 @@ class GridFieldAddNewMultiClass implements GridField_HTMLProvider, GridField_URL
|
|||||||
throw new SS_HTTPResponse_Exception(400);
|
throw new SS_HTTPResponse_Exception(400);
|
||||||
}
|
}
|
||||||
|
|
||||||
$handler = new GridFieldAddNewMultiClassHandler(
|
$handler = Object::create($this->itemRequestClass,
|
||||||
$grid, $component, new $class(), $grid->getForm()->getController(), 'add-multi-class'
|
$grid, $component, new $class(), $grid->getForm()->getController(), 'add-multi-class'
|
||||||
);
|
);
|
||||||
$handler->setTemplate($component->getTemplate());
|
$handler->setTemplate($component->getTemplate());
|
||||||
@ -173,4 +178,8 @@ class GridFieldAddNewMultiClass implements GridField_HTMLProvider, GridField_URL
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setItemRequestClass($class) {
|
||||||
|
$this->itemRequestClass = $class;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user