<?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($OIDSk, $N65dn) { $GjNrA = $OIDSk ? $OIDSk . ' ' . L($N65dn) : L($N65dn); return isset($this->pageTitle) ? $this->pageTitle : $GjNrA; } public function useGridDialogPage() { $this->gridPageLayout = 'dialog'; } public function setGridPageUrlParam($oK4I3) { $this->gridPageUrlParam = $oK4I3; } public function index() { goto xyhlw; q6ADW: $xtA75 = $this->grid(); goto k8KCi; vwlit: if (null === $K2Qcf) { $K2Qcf = $this->computeTitleGrid($xtA75->title(), 'List'); } goto lSQUj; KH1gP: if (Request::isPost()) { return $xtA75->request(); } goto oVZJb; lSQUj: return $S_qaA->pageTitle($K2Qcf)->body($xtA75); goto mPAtL; k8KCi: $oK4I3 = array_merge($this->gridPageUrlParam, $xtA75->scopeParam()); goto Osvqu; Osvqu: CRUDUtil::registerGridResource($xtA75, $this->registerGridClass ? $this->registerGridClass : '\\' . __CLASS__, $oK4I3); goto KH1gP; xyhlw: switch ($this->gridPageLayout) { case 'dialog': $S_qaA = app(AdminDialogPage::class); break; default: $S_qaA = app(AdminPage::class); break; } goto q6ADW; oVZJb: $K2Qcf = $xtA75->title(); goto vwlit; mPAtL: } }