<?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($n02gs, $cAQuR) { $sEiap = $n02gs ? $n02gs . ' ' . L($cAQuR) : L($cAQuR); return isset($this->pageTitle) ? $this->pageTitle : $sEiap; } public function useGridDialogPage() { $this->gridPageLayout = 'dialog'; } public function setGridPageUrlParam($mattM) { $this->gridPageUrlParam = $mattM; } public function index() { goto caRES; z3JpS: $tPNKp = $H0Ja4->title(); goto tg28_; tg28_: if (null === $tPNKp) { $tPNKp = $this->computeTitleGrid($H0Ja4->title(), 'List'); } goto BJB5q; sVmbJ: $mattM = array_merge($this->gridPageUrlParam, $H0Ja4->scopeParam()); goto Cs0t1; Zvkh_: if (Request::isPost()) { return $H0Ja4->request(); } goto z3JpS; Cs0t1: CRUDUtil::registerGridResource($H0Ja4, $this->registerGridClass ? $this->registerGridClass : '\\' . __CLASS__, $mattM); goto Zvkh_; ovLaE: $H0Ja4 = $this->grid(); goto sVmbJ; BJB5q: return $DbaB3->pageTitle($tPNKp)->body($H0Ja4); goto ct8Nk; caRES: switch ($this->gridPageLayout) { case 'dialog': $DbaB3 = app(AdminDialogPage::class); break; default: $DbaB3 = app(AdminPage::class); break; } goto ovLaE; ct8Nk: } }