<?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; use ModStart\View\Constants; class CRUDUtil { public static function id() { goto fyoI2; QWefw: $UFOLC = $R4txz->getInteger('_id'); goto BnROp; BnROp: if (!$UFOLC) { $UFOLC = $R4txz->getInteger('id'); } goto dKFUJ; dKFUJ: return $UFOLC; goto CDE_O; fyoI2: $R4txz = InputPackage::buildFromInput(); goto QWefw; CDE_O: } public static function ids() { goto kSFxB; f5N7n: foreach (explode(',', $UFOLC) as $K3Ni_) { $a3gf2[] = intval($K3Ni_); } goto CqbJk; z16QG: if (!$UFOLC) { $UFOLC = $R4txz->getTrimString('id'); } goto X5opg; CqbJk: return $a3gf2; goto CnW4H; ZIjqU: $UFOLC = $R4txz->getTrimString('_id'); goto z16QG; X5opg: $a3gf2 = array(); goto f5N7n; kSFxB: $R4txz = InputPackage::buildFromInput(); goto ZIjqU; CnW4H: } public static function registerRouteResource($DRhsw, $StsmC) { goto hC_YS; PAV1l: Route::match(array('get', 'post'), "{$DRhsw}/add", "{$StsmC}@add"); goto yp8oc; hC_YS: Route::match(array('get', 'post'), "{$DRhsw}", "{$StsmC}@index"); goto PAV1l; qbfUm: Route::match(array('get', 'post'), "{$DRhsw}/delete", "{$StsmC}@delete"); goto qS5Xj; xEy0p: Route::match(array('get', 'post'), "{$DRhsw}/sort", "{$StsmC}@sort"); goto bW703; yp8oc: Route::match(array('get', 'post'), "{$DRhsw}/edit", "{$StsmC}@edit"); goto qbfUm; qS5Xj: Route::match(array('get', 'post'), "{$DRhsw}/show", "{$StsmC}@show"); goto xEy0p; bW703: } public static function registerGridResource(Grid $QnI0I, $StsmC) { goto D83rm; DORd8: if ($QnI0I->canShow() && ($BV17G = action($StsmC . '@show'))) { $QnI0I->urlShow($BV17G); } goto HsZpa; XnW0k: if ($QnI0I->canDelete() && ($BV17G = action($StsmC . '@delete'))) { $QnI0I->urlDelete($BV17G); } goto DORd8; ImKCo: if ($QnI0I->canEdit() && ($BV17G = action($StsmC . '@edit'))) { $QnI0I->urlEdit($BV17G); } goto XnW0k; D83rm: if ($QnI0I->canAdd() && ($BV17G = action($StsmC . '@add'))) { switch ($QnI0I->engine()) { case GridEngine::TREE_MASS: goto gNbbM; Z8TV5: $cnx4c = $R4txz->get('_pid', $QnI0I->treeRootPid()); goto yq4q3; tcjy6: break; goto SheQD; gNbbM: $R4txz = InputPackage::buildFromInput(); goto Z8TV5; yq4q3: $QnI0I->urlAdd($BV17G . '?' . http_build_query(array('_pid' => $cnx4c))); goto tcjy6; SheQD: default: $QnI0I->urlAdd($BV17G); break; } } goto ImKCo; HsZpa: if ($QnI0I->canSort() && ($BV17G = action($StsmC . '@sort'))) { $QnI0I->urlSort($BV17G); } goto Mdtxw; Mdtxw: } public static function jsGridRefresh($XIWRg = 0) { return "[js]window.__grids.get({$XIWRg}).lister.refresh();"; } public static function jsDialogCloseAndParentGridRefresh($XIWRg = 0) { return "[js]parent.__grids.get({$XIWRg}).lister.refresh();__dialogClose();"; } public static function jsDialogClose() { return '[js]__dialogClose();'; } public static function jsDialogCloseAndParentRefresh() { return '[js]parent.location.reload();'; } }