<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\View; use ModStart\Core\Input\InputPackage; use ModStart\Grid\Grid; use ModStart\Grid\Type\GridEngine; class CRUDUtil { public static function copyId() { $TG2we = InputPackage::buildFromInput(); return $TG2we->getInteger('_copyId'); } public static function id() { goto re5uy; re5uy: $TG2we = InputPackage::buildFromInput(); goto LBY2_; TjTEL: if (!$PMDE9) { $PMDE9 = $TG2we->getInteger('id'); } goto fskm2; fskm2: return $PMDE9; goto TVC3h; LBY2_: $PMDE9 = $TG2we->getInteger('_id'); goto TjTEL; TVC3h: } public static function ids() { goto FeGAi; hvxX1: if (!$PMDE9) { $PMDE9 = $TG2we->getTrimString('id'); if (empty($PMDE9)) { $PMDE9 = $TG2we->getTrimString('ids'); } } goto Bta9F; Bta9F: $gjLDn = array(); goto rZ25p; rZ25p: foreach (explode(',', $PMDE9) as $Xn_Rr) { $gjLDn[] = intval($Xn_Rr); } goto Xgcse; Xgcse: return $gjLDn; goto GLmWF; R3bWb: $PMDE9 = $TG2we->getTrimString('_id'); goto hvxX1; FeGAi: $TG2we = InputPackage::buildFromInput(); goto R3bWb; GLmWF: } public static function registerRouteResource($bD3WW, $GgiJ8) { goto Dqp5p; XNjOS: Route::match(array('get', 'post'), "{$bD3WW}/edit", "{$GgiJ8}@edit"); goto CXwu_; kZ3kh: Route::match(array('get', 'post'), "{$bD3WW}/add", "{$GgiJ8}@add"); goto XNjOS; k0zwr: Route::match(array('post'), "{$bD3WW}/sort", "{$GgiJ8}@sort"); goto Rt_fp; CXwu_: Route::match(array('post'), "{$bD3WW}/delete", "{$GgiJ8}@delete"); goto B_QNz; B_QNz: Route::match(array('get'), "{$bD3WW}/show", "{$GgiJ8}@show"); goto k0zwr; Dqp5p: Route::match(array('get', 'post'), "{$bD3WW}", "{$GgiJ8}@index"); goto kZ3kh; Rt_fp: } public static function registerGridResource(Grid $jfjOt, $GgiJ8, $pFM9U = array()) { goto TJnAf; bs7UD: if ($jfjOt->canImport() && ($iERFh = action($GgiJ8 . '@import', $pFM9U))) { $jfjOt->urlImport($iERFh); } goto vjM5u; xm5T4: if ($jfjOt->canEdit() && ($iERFh = action($GgiJ8 . '@edit', $pFM9U))) { $jfjOt->urlEdit($iERFh); } goto dtk24; TJnAf: if ($jfjOt->canAdd() && ($iERFh = action($GgiJ8 . '@add', $pFM9U))) { switch ($jfjOt->engine()) { case GridEngine::TREE_MASS: goto slj6W; p4t69: $jfjOt->urlAdd($iERFh . (strpos($iERFh, '?') > 0 ? '&' : '?') . http_build_query($qeoqS)); goto vyRJ8; vyRJ8: break; goto BWiuh; u2UUW: $qeoqS = array(); goto T6uY9; slj6W: $TG2we = InputPackage::buildFromInput(); goto u2UUW; T6uY9: $qeoqS['_pid'] = $TG2we->get('_pid', $jfjOt->treeRootPid()); goto p4t69; BWiuh: default: $jfjOt->urlAdd($iERFh); break; } } goto xm5T4; mR4MP: if ($jfjOt->canSort() && ($iERFh = action($GgiJ8 . '@sort', $pFM9U))) { $jfjOt->urlSort($iERFh); } goto VlzK0; ArBck: if ($jfjOt->canShow() && ($iERFh = action($GgiJ8 . '@show', $pFM9U))) { $jfjOt->urlShow($iERFh); } goto mR4MP; dtk24: if ($jfjOt->canDelete() && ($iERFh = action($GgiJ8 . '@delete', $pFM9U))) { $jfjOt->urlDelete($iERFh); } goto ArBck; VlzK0: if ($jfjOt->canExport() && ($iERFh = action($GgiJ8 . '@export', $pFM9U))) { $jfjOt->urlExport($iERFh); } goto bs7UD; vjM5u: } public static function jsGridRefresh($dtpXv = 0) { return "[js]window.__grids.get({$dtpXv}).lister.refresh();"; } public static function jsDialogCloseAndParentGridRefresh($dtpXv = 0) { return "[js]parent.__grids.get({$dtpXv}).lister.refresh();__dialogClose();"; } public static function jsDialogClose() { return '[js]__dialogClose();'; } public static function jsDialogCloseAndParentRefresh() { return '[js]parent.location.reload();'; } public static function adminRedirectOrTabClose($iERFh) { goto o_swT; UzvZ9: if (View::shared('_isTab')) { $Pcm2A = '[tab-close]'; } goto LGasS; LGasS: return $Pcm2A; goto fRxsd; o_swT: $Pcm2A = modstart_admin_url($iERFh); goto UzvZ9; fRxsd: } public static function adminUrlWithTab($iERFh, $qeoqS = array()) { if (View::shared('_isTab')) { $qeoqS['_is_tab'] = 1; } return modstart_admin_url($iERFh, $qeoqS); } }