<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Facades\Route; use ModStart\Core\Input\InputPackage; use ModStart\Grid\Grid; use ModStart\Grid\Type\GridEngine; class CRUDUtil { public static function copyId() { $H2Do2 = InputPackage::buildFromInput(); return $H2Do2->getInteger('_copyId'); } public static function id() { goto t8YJO; doaS7: $sIQGl = $H2Do2->getInteger('_id'); goto dpsN3; t8YJO: $H2Do2 = InputPackage::buildFromInput(); goto doaS7; dpsN3: if (!$sIQGl) { $sIQGl = $H2Do2->getInteger('id'); } goto UdRGj; UdRGj: return $sIQGl; goto BHgHT; BHgHT: } public static function ids() { goto V6BTg; fME4P: if (!$sIQGl) { $sIQGl = $H2Do2->getTrimString('id'); if (empty($sIQGl)) { $sIQGl = $H2Do2->getTrimString('ids'); } } goto Fzb57; Fzb57: $S0vqg = array(); goto YnqMz; bgb4N: $sIQGl = $H2Do2->getTrimString('_id'); goto fME4P; V6BTg: $H2Do2 = InputPackage::buildFromInput(); goto bgb4N; YnqMz: foreach (explode(',', $sIQGl) as $eQWJY) { $S0vqg[] = intval($eQWJY); } goto UKil3; UKil3: return $S0vqg; goto Jyltr; Jyltr: } public static function registerRouteResource($b2156, $KrsM3) { goto s4E4E; s4E4E: Route::match(array('get', 'post'), "{$b2156}", "{$KrsM3}@index"); goto vGZD5; XiohV: Route::match(array('get', 'post'), "{$b2156}/edit", "{$KrsM3}@edit"); goto M9QDx; uzWQq: Route::match(array('post'), "{$b2156}/sort", "{$KrsM3}@sort"); goto nNlEa; M9QDx: Route::match(array('post'), "{$b2156}/delete", "{$KrsM3}@delete"); goto Lyk09; vGZD5: Route::match(array('get', 'post'), "{$b2156}/add", "{$KrsM3}@add"); goto XiohV; Lyk09: Route::match(array('get'), "{$b2156}/show", "{$KrsM3}@show"); goto uzWQq; nNlEa: } public static function registerGridResource(Grid $aGu71, $KrsM3, $Kp99R = array()) { goto bxhe3; DqBhE: if ($aGu71->canEdit() && ($xIfit = action($KrsM3 . '@edit', $Kp99R))) { $aGu71->urlEdit($xIfit); } goto J1quY; CByZj: if ($aGu71->canExport() && ($xIfit = action($KrsM3 . '@export', $Kp99R))) { $aGu71->urlExport($xIfit); } goto WoRDX; BUrqH: if ($aGu71->canShow() && ($xIfit = action($KrsM3 . '@show', $Kp99R))) { $aGu71->urlShow($xIfit); } goto o3p8w; J1quY: if ($aGu71->canDelete() && ($xIfit = action($KrsM3 . '@delete', $Kp99R))) { $aGu71->urlDelete($xIfit); } goto BUrqH; o3p8w: if ($aGu71->canSort() && ($xIfit = action($KrsM3 . '@sort', $Kp99R))) { $aGu71->urlSort($xIfit); } goto CByZj; WoRDX: if ($aGu71->canImport() && ($xIfit = action($KrsM3 . '@import', $Kp99R))) { $aGu71->urlImport($xIfit); } goto iIbTP; bxhe3: if ($aGu71->canAdd() && ($xIfit = action($KrsM3 . '@add', $Kp99R))) { switch ($aGu71->engine()) { case GridEngine::TREE_MASS: goto fbFuo; fbFuo: $H2Do2 = InputPackage::buildFromInput(); goto NYD5Z; NYD5Z: $AOBVZ = array(); goto ZAbRJ; epeKJ: break; goto YkIZo; ZAbRJ: $AOBVZ['_pid'] = $H2Do2->get('_pid', $aGu71->treeRootPid()); goto bi855; bi855: $aGu71->urlAdd($xIfit . (strpos($xIfit, '?') > 0 ? '&' : '?') . http_build_query($AOBVZ)); goto epeKJ; YkIZo: default: $aGu71->urlAdd($xIfit); break; } } goto DqBhE; iIbTP: } public static function jsGridRefresh($vTPD6 = 0) { return "[js]window.__grids.get({$vTPD6}).lister.refresh();"; } public static function jsDialogCloseAndParentGridRefresh($vTPD6 = 0) { return "[js]parent.__grids.get({$vTPD6}).lister.refresh();__dialogClose();"; } public static function jsDialogClose() { return '[js]__dialogClose();'; } public static function jsDialogCloseAndParentRefresh() { return '[js]parent.location.reload();'; } }