<?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($OIDSk, $N65dn) { $GjNrA = $OIDSk ? $OIDSk . ' ' . L($N65dn) : L($N65dn); return isset($this->pageTitle) ? $this->pageTitle : $GjNrA; } private function getForm() { goto oa76Z; oa76Z: $LEyIF = $this->form(); goto yWqz8; S6uT9: return $LEyIF; goto N8p3t; yWqz8: $LEyIF->showSubmit(false)->showReset(false); goto S6uT9; N8p3t: } public function add(AdminDialogPage $S_qaA) { goto wLfa_; wLfa_: $LEyIF = $this->getForm(); goto jJ7bq; rCrkG: return $S_qaA->pageTitle($this->computeTitleForm($LEyIF->title(), 'Add'))->body($LEyIF->add()); goto Jo5Nv; jJ7bq: if (Request::isPost()) { AdminPermission::demoCheck(); return $LEyIF->addRequest(); } goto rCrkG; Jo5Nv: } public function edit(AdminDialogPage $S_qaA) { goto l4Nnq; hW6d1: if (Request::isPost()) { AdminPermission::demoCheck(); return $LEyIF->editRequest(CRUDUtil::id()); } goto yifFg; yifFg: return $S_qaA->pageTitle($this->computeTitleForm($LEyIF->title(), 'Edit'))->body($LEyIF->edit(CRUDUtil::id())); goto dYODg; l4Nnq: $LEyIF = $this->getForm(); goto hW6d1; dYODg: } public function delete() { AdminPermission::demoCheck(); return $this->getForm()->deleteRequest(CRUDUtil::ids()); } public function sort() { AdminPermission::demoCheck(); return $this->getForm()->sortRequest(CRUDUtil::id()); } }