<?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($EJXfL, $fKa0c) { $yP7h6 = $EJXfL ? $EJXfL . ' ' . L($fKa0c) : L($fKa0c); return isset($this->pageTitle) ? $this->pageTitle : $yP7h6; } public function useGridDialogPage() { $this->gridPageLayout = 'dialog'; } public function setGridPageUrlParam($Kp99R) { $this->gridPageUrlParam = $Kp99R; } public function index() { goto UmRYh; vs2C4: if (null === $tqaeV) { $tqaeV = $this->computeTitleGrid($aGu71->title(), 'List'); } goto TW374; fBDrP: $tqaeV = $aGu71->title(); goto vs2C4; UmRYh: switch ($this->gridPageLayout) { case 'dialog': $BcS7S = app(AdminDialogPage::class); break; default: $BcS7S = app(AdminPage::class); break; } goto dzkbs; ofLTO: if (Request::isPost()) { return $aGu71->request(); } goto fBDrP; TW374: return $BcS7S->pageTitle($tqaeV)->body($aGu71); goto Qhbcz; IICst: CRUDUtil::registerGridResource($aGu71, $this->registerGridClass ? $this->registerGridClass : '\\' . __CLASS__, $Kp99R); goto ofLTO; dzkbs: $aGu71 = $this->grid(); goto BMXoZ; BMXoZ: $Kp99R = array_merge($this->gridPageUrlParam, $aGu71->scopeParam()); goto IICst; Qhbcz: } }