diff --git a/src/Grid/Displayers/Actions.php b/src/Grid/Displayers/Actions.php index 0c0e034..f1e2ab3 100644 --- a/src/Grid/Displayers/Actions.php +++ b/src/Grid/Displayers/Actions.php @@ -144,12 +144,12 @@ class Actions extends AbstractDisplayer $actions = $this->prepends; foreach ($this->actions as $action) { - $method = 'render'.ucfirst($action); + $method = 'render' . ucfirst($action); array_push($actions, $this->{$method}()); } $actions = array_merge($actions, $this->appends); - $actions_str=implode('', $actions); + $actions_str = implode('', $actions); return << $actions_str @@ -193,6 +193,7 @@ EOT; $resume_checkout = ""; return $resume_checkout; } + /** * Render delete action. * @@ -201,21 +202,22 @@ EOT; protected function renderDelete() { $title = ''; - $url_pams = ''; - if(strstr($this->getResource(),'firm/company') && !(strstr($this->getResource(),'firm/companyimg'))&& !(strstr($this->getResource(),'firm/companysetmeal'))) { + $url_pams = []; + if (strstr($this->getResource(), 'firm/company') && !(strstr($this->getResource(), 'firm/companyimg')) && !(strstr($this->getResource(), 'firm/companysetmeal'))) { $deleteConfirm = trans('admin.delete_company_confirm'); - }elseif (strstr($this->getResource(),'personal/members')) { + } elseif (strstr($this->getResource(), 'personal/members')) { $deleteConfirm = trans('admin.delete_person_confirm'); - } elseif (strstr($this->getResource(),'recycle/index')){ - $scope = array_get(request()->all(),'scope',1); - $url_pams='?scope='.$scope; + } elseif (strstr($this->getResource(), 'recycle/index')) { + $scope = array_get(request()->all(), 'scope', 1); + $url_pams['scope'] = $scope; $deleteConfirm = trans('admin.delete_confirm'); - }elseif (strstr($this->getResource(),'personal/resume')){ + } elseif (strstr($this->getResource(), 'personal/resume')) { $deleteConfirm = trans('admin.delete_confirm'); $title = $this->resume_checkout(); } else { $deleteConfirm = trans('admin.delete_confirm'); } + $url_pams = empty(http_build_query($url_pams)) ? '' : '&' . http_build_query($url_pams); $confirm = trans('admin.confirm'); $cancel = trans('admin.cancel'); $script = <<