handle = function() { DB::query("insert into problems (title, is_hidden, submission_requirement) values ('New Problem', 1, '{}')"); $id = DB::insert_id(); DB::query("insert into problems_contents (id, statement, statement_md) values ($id, '', '')"); dataNewProblem($id); }; $new_problem_form->submit_button_config['align'] = 'right'; $new_problem_form->submit_button_config['class_str'] = 'btn btn-primary'; $new_problem_form->submit_button_config['text'] = UOJLocale::get('problems::add new'); $new_problem_form->submit_button_config['smart_confirm'] = ''; $new_problem_form->runAtServer(); $new_luogu_problem_form = new UOJForm('new_luogu_problem'); $new_luogu_problem_form->addVInput('luogu_pid', 'text', '洛谷题号', '', function($id) { if (!validateLuoguProblemId($id)) { return '题目 ID 不合法'; } return ''; }, null); $new_luogu_problem_form->handle = function() { try { newLuoguRemoteProblem($_POST['luogu_pid']); } catch (Exception $e) { becomeMsgPage('
' . $e->getMessage() . ''); } }; // $new_luogu_problem_form->submit_button_config['align'] = 'right'; $new_luogu_problem_form->submit_button_config['class_str'] = 'btn btn-primary'; $new_luogu_problem_form->submit_button_config['text'] = UOJLocale::get('problems::add new'); $new_luogu_problem_form->submit_button_config['confirm'] = '新增来自洛谷的题目'; $new_luogu_problem_form->runAtServer(); } function echoProblem($problem) { global $myUser; if (isProblemVisibleToUser($problem, $myUser)) { echo '
'.UOJLocale::get('none').' |