<?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($Yhs9S, $JRSxY) { $IJdfw = $Yhs9S ? $Yhs9S . ' ' . L($JRSxY) : L($JRSxY); return isset($this->pageTitle) ? $this->pageTitle : $IJdfw; } public function useGridDialogPage() { $this->gridPageLayout = 'dialog'; } public function setGridPageUrlParam($zlK8N) { $this->gridPageUrlParam = $zlK8N; } public function index() { goto s3Yqf; Log0g: $onAuN = $fvhtX->title(); goto I5aNA; I5aNA: if (null === $onAuN) { $onAuN = $this->computeTitleGrid($fvhtX->title(), 'List'); } goto lQQMs; UKSY9: $fvhtX = $this->grid(); goto EBCre; EBCre: $zlK8N = array_merge($this->gridPageUrlParam, $fvhtX->scopeParam()); goto WUbnG; lQQMs: return $z5B9p->pageTitle($onAuN)->body($fvhtX); goto dnKO4; WUbnG: CRUDUtil::registerGridResource($fvhtX, $this->registerGridClass ? $this->registerGridClass : '\\' . __CLASS__, $zlK8N); goto yw8uw; yw8uw: if (Request::isPost()) { return $fvhtX->request(); } goto Log0g; s3Yqf: switch ($this->gridPageLayout) { case 'dialog': $z5B9p = app(AdminDialogPage::class); break; default: $z5B9p = app(AdminPage::class); break; } goto UKSY9; dnKO4: } }