<?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($u5SPM, $BY2Re) { $Cq64_ = $u5SPM ? $u5SPM . ' ' . L($BY2Re) : L($BY2Re); return isset($this->pageTitle) ? $this->pageTitle : $Cq64_; } public function useGridDialogPage() { $this->gridPageLayout = 'dialog'; } public function setGridPageUrlParam($AXgEz) { $this->gridPageUrlParam = $AXgEz; } public function index() { goto p88nU; zVQKz: $cRz_h = $this->grid(); goto w62rA; PIK7a: if (Request::isPost()) { return $cRz_h->request(); } goto h0Wfi; JFTLm: if (null === $ZZCu3) { $ZZCu3 = $this->computeTitleGrid($cRz_h->title(), 'List'); } goto FtV8V; h0Wfi: $ZZCu3 = $cRz_h->title(); goto JFTLm; FtV8V: return $l8Zr8->pageTitle($ZZCu3)->body($cRz_h); goto R447m; w62rA: $AXgEz = array_merge($this->gridPageUrlParam, $cRz_h->scopeParam()); goto iba_w; iba_w: CRUDUtil::registerGridResource($cRz_h, $this->registerGridClass ? $this->registerGridClass : '\\' . __CLASS__, $AXgEz); goto PIK7a; p88nU: switch ($this->gridPageLayout) { case 'dialog': $l8Zr8 = app(AdminDialogPage::class); break; default: $l8Zr8 = app(AdminPage::class); break; } goto zVQKz; R447m: } }