<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Admin\Concern; use ModStart\Admin\Layout\AdminDialogPage; use ModStart\Admin\Layout\AdminPage; use ModStart\Core\Input\Request; use ModStart\Core\Util\CRUDUtil; use ModStart\Grid\Grid; trait HasAdminGrid { public $registerGridClass = null; public $gridPageLayout = 'default'; public $gridPageUrlParam = array(); private function computeTitleGrid($jUmSm, $ft1ag) { $WtBPF = $jUmSm ? $jUmSm . ' ' . L($ft1ag) : L($ft1ag); return isset($this->pageTitle) ? $this->pageTitle : $WtBPF; } public function useGridDialogPage() { $this->gridPageLayout = 'dialog'; } public function setGridPageUrlParam($ACVUe) { $this->gridPageUrlParam = $ACVUe; } public function index() { goto f8W0n; o8mN0: return $ho3D1->pageTitle($bCcG9)->body($FGotH); goto sZagq; Gq7xo: if (null === $bCcG9) { $bCcG9 = $this->computeTitleGrid($FGotH->title(), 'List'); } goto o8mN0; A14B_: $bCcG9 = $FGotH->title(); goto Gq7xo; nlW8C: $FGotH = $this->grid(); goto fiq_q; f8W0n: switch ($this->gridPageLayout) { case 'dialog': $ho3D1 = app(AdminDialogPage::class); break; default: $ho3D1 = app(AdminPage::class); break; } goto nlW8C; LqECM: CRUDUtil::registerGridResource($FGotH, $this->registerGridClass ? $this->registerGridClass : '\\' . __CLASS__, $ACVUe); goto dT3AS; fiq_q: $ACVUe = array_merge($this->gridPageUrlParam, $FGotH->scopeParam()); goto LqECM; dT3AS: if (Request::isPost()) { return $FGotH->request(); } goto A14B_; sZagq: } }