<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Admin\Concern; use ModStart\Admin\Auth\AdminPermission; use ModStart\Admin\Layout\AdminDialogPage; use ModStart\Core\Input\Request; use ModStart\Core\Util\CRUDUtil; use ModStart\Form\Form; trait HasAdminForm { private function computeTitleForm($jUmSm, $ft1ag) { $WtBPF = $jUmSm ? $jUmSm . ' ' . L($ft1ag) : L($ft1ag); return isset($this->pageTitle) ? $this->pageTitle : $WtBPF; } private function getForm() { goto UajU6; PCE7o: $SKFwZ->showSubmit(false)->showReset(false); goto jTSR3; jTSR3: return $SKFwZ; goto qneCL; UajU6: $SKFwZ = $this->form(); goto PCE7o; qneCL: } public function add(AdminDialogPage $ho3D1) { goto vzpem; vzpem: $SKFwZ = $this->getForm(); goto Er4D7; t4l8d: return $ho3D1->pageTitle($this->computeTitleForm($SKFwZ->title(), 'Add'))->body($SKFwZ->add()); goto Bp2c9; Er4D7: if (Request::isPost()) { AdminPermission::demoCheck(); return $SKFwZ->addRequest(); } goto t4l8d; Bp2c9: } public function edit(AdminDialogPage $ho3D1) { goto HgxOi; oD1BG: return $ho3D1->pageTitle($this->computeTitleForm($SKFwZ->title(), 'Edit'))->body($SKFwZ->edit(CRUDUtil::id())); goto gahFK; HgxOi: $SKFwZ = $this->getForm(); goto isgYe; isgYe: if (Request::isPost()) { AdminPermission::demoCheck(); return $SKFwZ->editRequest(CRUDUtil::id()); } goto oD1BG; gahFK: } public function delete() { AdminPermission::demoCheck(); return $this->getForm()->deleteRequest(CRUDUtil::ids()); } public function sort() { AdminPermission::demoCheck(); return $this->getForm()->sortRequest(CRUDUtil::id()); } }