Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
zhblue authored Apr 6, 2024
1 parent 111a7d3 commit 363cd78
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions trunk/web/admin/phpfm.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ function et($tag){
$en['Random-data'] = 'Random-data generator';
$en['GenerateOut'] = 'Generate Out files';
$en['Ans2out'] = '*.ans -> *.out';
$cn['IOFilename'] = 'Generate input.name/output.name ';

// chinese
$cn['Version'] = '版本';
Expand Down Expand Up @@ -464,6 +465,7 @@ function et($tag){
$cn['Random-data'] = '随机测试数据生成器';
$cn['GenerateOut'] = '用标程Main.c/Main.cc覆盖生成Out文件';
$cn['Ans2out'] = '.ans改名.out';
$cn['IOFilename'] = '指定输入输出文件名';

// Portuguese by - Fabricio Seger Kolling
$pt['Version'] = 'Versão';
Expand Down Expand Up @@ -3371,6 +3373,8 @@ function test_prompt(arg){
document.form_action.cmd_arg.value = prompt('".et('TypeDir').".');
} else if (arg == 2){
document.form_action.cmd_arg.value = prompt('".et('TypeArq').".');
} else if (arg == 21){
document.form_action.cmd_arg.value = prompt('".et('IOFilename').".');
} else if (arg == 71){
if (!is_anything_selected()) erro = '".et('NoSel').".';
else document.form_action.cmd_arg.value = prompt('".et('TypeArqComp')."');
Expand Down Expand Up @@ -3461,6 +3465,7 @@ function test(arg){
<input type=button onclick=\"upload()\" value=\"".et('Upload')."\">";
if(!$OJ_SaaS_ENABLE)$out.="<input type=button onclick=\"generate()\" value=\"".et('GenerateOut')."\">";
$out.="<input type=button onclick=\"ans2out()\" value=\"".et('Ans2out')."\">";
$out.="<input type=button onclick=\"test_prompt(21)\" value=\"".et('IOFilename')."\">";
if(isset($_GET['pid'])){
$pid=intval($_GET['pid']);
$_SESSION[$OJ_NAME."_PID"]=$pid;
Expand Down Expand Up @@ -4467,6 +4472,22 @@ function frame3(){
} else alert(et('FileDirExists').".");
}
break;
case 21: // create IOFilename
if (strlen($cmd_arg)){
$filename = $current_dir."input.name";
if ($fh = @fopen($filename, "w")){
fprintf($fh,"%s.in\n",$cmd_arg);
@fclose($fh);
}
@chmod($filename,0644);
$filename = $current_dir."output.name";
if ($fh = @fopen($filename, "w")){
fprintf($fh,"%s.out\n",$cmd_arg);
@fclose($fh);
}
@chmod($filename,0644);
}
break;
case 3: // rename arq ou dir
if ((strlen($old_name))&&(strlen($new_name))){
rename($current_dir.$old_name,$current_dir.$new_name);
Expand Down

0 comments on commit 363cd78

Please sign in to comment.