<?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($tTDuu, $MfWLT) { $znmpZ = $tTDuu ? $tTDuu . ' ' . L($MfWLT) : L($MfWLT); return isset($this->pageTitle) ? $this->pageTitle : $znmpZ; } public function useGridDialogPage() { $this->gridPageLayout = 'dialog'; } public function setGridPageUrlParam($pmJAc) { $this->gridPageUrlParam = $pmJAc; } public function index() { goto eDPFt; aAuqF: CRUDUtil::registerGridResource($BtYIX, $this->registerGridClass ? $this->registerGridClass : '\\' . __CLASS__, $pmJAc); goto iBGqj; eDPFt: switch ($this->gridPageLayout) { case 'dialog': $WibEV = app(AdminDialogPage::class); break; default: $WibEV = app(AdminPage::class); break; } goto JMMtQ; rJ328: $pmJAc = array_merge($this->gridPageUrlParam, $BtYIX->scopeParam()); goto aAuqF; RWyD3: return $WibEV->pageTitle($NRFW1)->body($BtYIX); goto XZjK0; bkYAu: if (null === $NRFW1) { $NRFW1 = $this->computeTitleGrid($BtYIX->title(), 'List'); } goto RWyD3; N56KC: $NRFW1 = $BtYIX->title(); goto bkYAu; iBGqj: if (Request::isPost()) { return $BtYIX->request(); } goto N56KC; JMMtQ: $BtYIX = $this->grid(); goto rJ328; XZjK0: } }