<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Auth\AdminPermission; use ModStart\Admin\Concern\HasAdminCRUD; use ModStart\Admin\Model\AdminLog; use ModStart\Admin\Type\AdminLogType; use ModStart\Detail\Detail; use ModStart\Field\AbstractField; use ModStart\Form\Form; use ModStart\Grid\Grid; use ModStart\Grid\GridFilter; class AdminLogController extends Controller { use HasAdminCRUD; protected function grid() { goto y7kqQ; X_N68: $QnI0I->canMultiSelectItem(true)->canBatchDelete(true); goto UuvZx; GJY8M: $QnI0I->canAdd(false)->canEdit(false); goto OuMcC; OuMcC: $QnI0I->canDelete(AdminPermission::permit('AdminLogManage')); goto X_N68; UuvZx: $QnI0I->title(L('Admin Log')); goto n10Qr; n10Qr: return $QnI0I; goto PsFjI; y7kqQ: $QnI0I = new Grid(AdminLog::class, function (Grid $QnI0I) { $QnI0I->display('id', L('ID'))->width(80); $QnI0I->display('created_at', L('Created At'))->width(160); $QnI0I->type('type', L('Type'))->type(AdminLogType::class)->width(100); $QnI0I->display('summary', L('Title')); $QnI0I->code('data', L('Data'))->hookValueUnserialize(function ($tzAUI, AbstractField $Q2vn5) { if (!$tzAUI) { return ''; } return @json_encode(json_decode($tzAUI->content, true), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); }); $QnI0I->filter(function (GridFilter $cF9SB) { $cF9SB->eq('id', L('ID')); $cF9SB->like('summary', L('Title')); $cF9SB->eq('type', L('Type'))->radio(AdminLogType::class); }); }); goto GJY8M; PsFjI: } protected function form() { $Pl0Cf = new Form(AdminLog::class, function (Form $Pl0Cf) { $Pl0Cf->display('id', L('ID'))->editable(true); }); return $Pl0Cf; } protected function detail() { goto J4Bjf; J4Bjf: $z3x5T = new Detail(AdminLog::class, function (Detail $z3x5T) { $z3x5T->display('id', L('ID')); $z3x5T->display('created_at', L('Created At')); $z3x5T->type('type', L('Type'))->type(AdminLogType::class); $z3x5T->display('summary', L('Title')); $z3x5T->code('data', L('Data'))->hookValueUnserialize(function ($tzAUI, AbstractField $Q2vn5) { if (!$tzAUI) { return ''; } return json_encode(json_decode($tzAUI->content, true), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); }); }); goto BF8wC; OZOeQ: return $z3x5T; goto a5CSO; BF8wC: $z3x5T->title(L('Admin Log')); goto OZOeQ; a5CSO: } }