<?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($u5SPM, $BY2Re) { $Cq64_ = $u5SPM ? $u5SPM . ' ' . L($BY2Re) : L($BY2Re); return isset($this->pageTitle) ? $this->pageTitle : $Cq64_; } private function getForm() { goto w013E; Z5GRZ: return $yfPYJ; goto cu10L; Lc4GT: $yfPYJ->showSubmit(false)->showReset(false); goto Z5GRZ; w013E: $yfPYJ = $this->form(); goto Lc4GT; cu10L: } public function add(AdminDialogPage $l8Zr8) { goto VMWpa; yODYg: return $l8Zr8->pageTitle($this->computeTitleForm($yfPYJ->title(), 'Add'))->body($yfPYJ->add()); goto K2h_t; tFVq2: if (Request::isPost()) { AdminPermission::demoCheck(); return $yfPYJ->addRequest(); } goto yODYg; VMWpa: $yfPYJ = $this->getForm(); goto tFVq2; K2h_t: } public function edit(AdminDialogPage $l8Zr8) { goto JQhsd; JQhsd: $yfPYJ = $this->getForm(); goto o0TOc; UbtWX: return $l8Zr8->pageTitle($this->computeTitleForm($yfPYJ->title(), 'Edit'))->body($yfPYJ->edit(CRUDUtil::id())); goto wW0FY; o0TOc: if (Request::isPost()) { AdminPermission::demoCheck(); return $yfPYJ->editRequest(CRUDUtil::id()); } goto UbtWX; wW0FY: } public function delete() { AdminPermission::demoCheck(); return $this->getForm()->deleteRequest(CRUDUtil::ids()); } public function sort() { AdminPermission::demoCheck(); return $this->getForm()->sortRequest(CRUDUtil::id()); } }