<?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($e7jXr, $LrPO5) { $sVLvF = $e7jXr ? $e7jXr . ' ' . L($LrPO5) : L($LrPO5); return isset($this->pageTitle) ? $this->pageTitle : $sVLvF; } public function useGridDialogPage() { $this->gridPageLayout = 'dialog'; } public function setGridPageUrlParam($pFM9U) { $this->gridPageUrlParam = $pFM9U; } public function index() { goto gm_wC; B_SHR: if (Request::isPost()) { return $jfjOt->request(); } goto QGBkr; jw6Pj: $pFM9U = array_merge($this->gridPageUrlParam, $jfjOt->scopeParam()); goto q5TSg; q5TSg: CRUDUtil::registerGridResource($jfjOt, $this->registerGridClass ? $this->registerGridClass : '\\' . __CLASS__, $pFM9U); goto B_SHR; AWKxT: return $FzbRC->pageTitle($nh64r)->body($jfjOt); goto SjUIj; QGBkr: $nh64r = $jfjOt->title(); goto kUhid; SUtnv: $jfjOt = $this->grid(); goto jw6Pj; kUhid: if (null === $nh64r) { $nh64r = $this->computeTitleGrid($jfjOt->title(), 'List'); } goto AWKxT; gm_wC: switch ($this->gridPageLayout) { case 'dialog': $FzbRC = app(AdminDialogPage::class); break; default: $FzbRC = app(AdminPage::class); break; } goto SUtnv; SjUIj: } }