<?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($LgtSN, $Hg4AG) { $g3XgV = $LgtSN ? $LgtSN . ' ' . L($Hg4AG) : L($Hg4AG); return isset($this->pageTitle) ? $this->pageTitle : $g3XgV; } public function useGridDialogPage() { $this->gridPageLayout = 'dialog'; } public function setGridPageUrlParam($qHLCM) { $this->gridPageUrlParam = $qHLCM; } public function index() { goto lQLP0; GlxAf: $TzF5r = $this->grid(); goto RWSnX; GNAaH: CRUDUtil::registerGridResource($TzF5r, $this->registerGridClass ? $this->registerGridClass : '\\' . __CLASS__, $qHLCM); goto nW2Qb; H3hov: return $FGtwZ->pageTitle($Cu2PT)->body($TzF5r); goto sbMqU; lQLP0: switch ($this->gridPageLayout) { case 'dialog': $FGtwZ = app(AdminDialogPage::class); break; default: $FGtwZ = app(AdminPage::class); break; } goto GlxAf; nW2Qb: if (Request::isPost()) { return $TzF5r->request(); } goto lcqtd; Vq0lG: if (null === $Cu2PT) { $Cu2PT = $this->computeTitleGrid($TzF5r->title(), 'List'); } goto H3hov; lcqtd: $Cu2PT = $TzF5r->title(); goto Vq0lG; RWSnX: $qHLCM = array_merge($this->gridPageUrlParam, $TzF5r->scopeParam()); goto GNAaH; sbMqU: } }