<?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($UZN94 = null) { $HoUFw = InputPackage::buildFromInput(); return $HoUFw->getInteger('_copyId', $UZN94); } public static function scope($UZN94 = null) { $HoUFw = InputPackage::buildFromInput(); return $HoUFw->getTrimString('_scope', $UZN94); } public static function id() { goto hHiUa; it39W: return $mK69g; goto YQ7wv; CW56R: $mK69g = $HoUFw->getInteger('_id'); goto TOGgo; hHiUa: $HoUFw = InputPackage::buildFromInput(); goto CW56R; TOGgo: if (!$mK69g) { $mK69g = $HoUFw->getInteger('id'); } goto it39W; YQ7wv: } public static function ids() { goto etApL; D03h7: $OlORr = array(); goto gBwQo; gBwQo: foreach (explode(',', $mK69g) as $UCcmA) { $OlORr[] = intval($UCcmA); } goto sky0K; sky0K: return $OlORr; goto OvNO8; etApL: $HoUFw = InputPackage::buildFromInput(); goto SqI3U; GioA_: if (!$mK69g) { $mK69g = $HoUFw->getTrimString('id'); if (empty($mK69g)) { $mK69g = $HoUFw->getTrimString('ids'); } } goto D03h7; SqI3U: $mK69g = $HoUFw->getTrimString('_id'); goto GioA_; OvNO8: } public static function registerRouteResource($sGiaY, $MsA2r) { goto yqwsQ; o_osw: Route::match(array('post'), "{$sGiaY}/sort", "{$MsA2r}@sort"); goto ICfvJ; ECVb1: Route::match(array('get'), "{$sGiaY}/show", "{$MsA2r}@show"); goto o_osw; rG3hK: Route::match(array('get', 'post'), "{$sGiaY}/edit", "{$MsA2r}@edit"); goto rx1q6; rx1q6: Route::match(array('post'), "{$sGiaY}/delete", "{$MsA2r}@delete"); goto ECVb1; yqwsQ: Route::match(array('get', 'post'), "{$sGiaY}", "{$MsA2r}@index"); goto YQS0h; YQS0h: Route::match(array('get', 'post'), "{$sGiaY}/add", "{$MsA2r}@add"); goto rG3hK; ICfvJ: } public static function registerGridResource(Grid $xtA75, $MsA2r, $oK4I3 = array()) { goto inW0U; bS05Z: if ($xtA75->canSort() && ($VzVt9 = action($MsA2r . '@sort', $oK4I3))) { $xtA75->urlSort($VzVt9); } goto Ua9pC; DzWIg: if ($xtA75->canShow() && ($VzVt9 = action($MsA2r . '@show', $oK4I3))) { $xtA75->urlShow($VzVt9); } goto bS05Z; Ua9pC: if ($xtA75->canExport() && ($VzVt9 = action($MsA2r . '@export', $oK4I3))) { $xtA75->urlExport($VzVt9); } goto BWyor; s0qBl: if ($xtA75->canDelete() && ($VzVt9 = action($MsA2r . '@delete', $oK4I3))) { $xtA75->urlDelete($VzVt9); } goto DzWIg; r9Pmd: if ($xtA75->canEdit() && ($VzVt9 = action($MsA2r . '@edit', $oK4I3))) { $xtA75->urlEdit($VzVt9); } goto s0qBl; BWyor: if ($xtA75->canImport() && ($VzVt9 = action($MsA2r . '@import', $oK4I3))) { $xtA75->urlImport($VzVt9); } goto VUbBt; inW0U: if ($xtA75->canAdd() && ($VzVt9 = action($MsA2r . '@add', $oK4I3))) { switch ($xtA75->engine()) { case GridEngine::TREE_MASS: goto lusZS; vlSKL: break; goto JLMNu; aKNwZ: $hAzJ1 = array(); goto a3asx; a3asx: $hAzJ1['_pid'] = $HoUFw->get('_pid', $xtA75->treeRootPid()); goto Loa52; Loa52: $xtA75->urlAdd($VzVt9 . (strpos($VzVt9, '?') > 0 ? '&' : '?') . http_build_query($hAzJ1)); goto vlSKL; lusZS: $HoUFw = InputPackage::buildFromInput(); goto aKNwZ; JLMNu: default: $xtA75->urlAdd($VzVt9); break; } } goto r9Pmd; VUbBt: } public static function jsGridRefresh($ouMWs = 0) { return "[js]window.__grids.get({$ouMWs}).lister.refresh();"; } public static function jsDialogCloseAndParentGridRefresh($ouMWs = 0) { return "[js]parent.__grids.get({$ouMWs}).lister.refresh();__dialogClose();"; } public static function jsDialogClose() { return '[js]__dialogClose();'; } public static function jsDialogCloseAndParentRefresh() { return '[js]parent.location.reload();'; } public static function adminRedirectOrTabClose($VzVt9) { goto HUo_F; JtJf_: if (View::shared('_isTab')) { $XdXk8 = '[tab-close]'; } goto wWRXs; wWRXs: return $XdXk8; goto fdG6W; HUo_F: $XdXk8 = modstart_admin_url($VzVt9); goto JtJf_; fdG6W: } public static function adminUrlWithTab($VzVt9, $hAzJ1 = array()) { if (View::shared('_isTab')) { $hAzJ1['_is_tab'] = 1; } return modstart_admin_url($VzVt9, $hAzJ1); } }