<?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($e7jXr, $LrPO5) { $sVLvF = $e7jXr ? $e7jXr . ' ' . L($LrPO5) : L($LrPO5); return isset($this->pageTitle) ? $this->pageTitle : $sVLvF; } private function getForm() { goto ghsuH; ki9QE: $wDk8k->showSubmit(false)->showReset(false); goto PlG8I; PlG8I: return $wDk8k; goto QxrLI; ghsuH: $wDk8k = $this->form(); goto ki9QE; QxrLI: } public function add(AdminDialogPage $FzbRC) { goto ryW13; ryW13: $wDk8k = $this->getForm(); goto VAfiZ; VAfiZ: if (Request::isPost()) { AdminPermission::demoCheck(); return $wDk8k->addRequest(); } goto B59k3; B59k3: return $FzbRC->pageTitle($this->computeTitleForm($wDk8k->title(), 'Add'))->body($wDk8k->add()); goto FC1BI; FC1BI: } public function edit(AdminDialogPage $FzbRC) { goto TsR5H; pApvP: return $FzbRC->pageTitle($this->computeTitleForm($wDk8k->title(), 'Edit'))->body($wDk8k->edit(CRUDUtil::id())); goto NoC9J; GQBaG: if (Request::isPost()) { AdminPermission::demoCheck(); return $wDk8k->editRequest(CRUDUtil::id()); } goto pApvP; TsR5H: $wDk8k = $this->getForm(); goto GQBaG; NoC9J: } public function delete() { AdminPermission::demoCheck(); return $this->getForm()->deleteRequest(CRUDUtil::ids()); } public function sort() { AdminPermission::demoCheck(); return $this->getForm()->sortRequest(CRUDUtil::id()); } }