mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 15:05:39 +00:00
refactored to make code cleaner
This commit is contained in:
parent
2f67044ea9
commit
5af8f10869
@ -138,14 +138,15 @@ class GridFieldOrderableRows extends RequestHandler implements
|
|||||||
* Handles requests to reorder a set of IDs in a specific order.
|
* Handles requests to reorder a set of IDs in a specific order.
|
||||||
*/
|
*/
|
||||||
public function handleReorder($grid, $request) {
|
public function handleReorder($grid, $request) {
|
||||||
if (is_a($grid->getList(), 'ManyManyList') && !singleton($grid->getModelClass())->canView()) {
|
$list = $grid->getList();
|
||||||
|
$modelClass = $grid->getModelClass();
|
||||||
|
if ($list instanceof ManyManyList && !singleton($modelClass)->canView()) {
|
||||||
$this->httpError(403);
|
$this->httpError(403);
|
||||||
} else if(!is_a($grid->getList(), 'ManyManyList') && !singleton($grid->getModelClass())->canEdit()) {
|
} else if(!($list instanceof ManyManyList) && !singleton($modelClass)->canEdit()) {
|
||||||
$this->httpError(403);
|
$this->httpError(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
$ids = $request->postVar('order');
|
$ids = $request->postVar('order');
|
||||||
$list = $grid->getList();
|
|
||||||
$field = $this->getSortField();
|
$field = $this->getSortField();
|
||||||
|
|
||||||
if(!is_array($ids)) {
|
if(!is_array($ids)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user