From 77f22ce40cdc2bb63b7750c593da952dea9b3cc8 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Mon, 16 Jan 2023 07:52:38 +0800 Subject: [PATCH] refactor(blog/delete): uoj_form_v2 --- web/app/controllers/subdomain/blog/blog_delete.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/web/app/controllers/subdomain/blog/blog_delete.php b/web/app/controllers/subdomain/blog/blog_delete.php index 702ea02..49e2b87 100644 --- a/web/app/controllers/subdomain/blog/blog_delete.php +++ b/web/app/controllers/subdomain/blog/blog_delete.php @@ -8,20 +8,19 @@ UOJBlog::init(UOJRequest::get('id')) || UOJResponse::page404(); UOJBlog::cur()->belongsToUserBlog() || UOJResponse::page404(); UOJBlog::cur()->userCanManage(Auth::user()) || UOJResponse::page403(); -$delete_form = new UOJBs4Form('delete'); +$delete_form = new UOJForm('delete'); $delete_form->handle = function () { UOJBlog::cur()->delete(); }; -$delete_form->submit_button_config['class_str'] = 'btn btn-danger'; -$delete_form->submit_button_config['text'] = '是的,我确定要删除'; +$delete_form->config['submit_button']['class'] = 'btn btn-danger'; +$delete_form->config['submit_button']['text'] = '是的,我确定要删除'; $delete_form->succ_href = HTML::blog_url(UOJBlog::info('poster'), '/archive'); - $delete_form->runAtServer(); ?>

- 您真的要删除博客 “(博客 ID:吗?该操作不可逆! + 您真的要删除博客 “(博客 ID: 吗?该操作不可逆!

printHTML(); ?>