diff --git a/codepot/src/codepot/controllers/code.php b/codepot/src/codepot/controllers/code.php index d3e55d09..2fa46fdc 100644 --- a/codepot/src/codepot/controllers/code.php +++ b/codepot/src/codepot/controllers/code.php @@ -87,12 +87,17 @@ class Code extends Controller for ($i = 0; $i < $post_max_item_no; $i++) { $d = $this->input->post("code_folder_new_item_dir_$i"); - if (strlen($d) > 0) { array_push ($import_files, array ('type' => 'dir', 'name' => $d)); } + $d = $this->input->post("code_folder_new_item_empfile_$i"); + if (strlen($d) > 0) + { + array_push ($import_files, array ('type' => 'empfile', 'name' => $d)); + } + $fid = "code_folder_new_item_file_$i"; if (array_key_exists($fid, $_FILES) && $_FILES[$fid]['name'] != '') { @@ -416,22 +421,27 @@ class Code extends Controller } else { - $post_new_message = $this->input->post('code_folder_new_message'); - $post_max_item_no = $this->input->post('code_folder_new_item_count'); - $post_unzip = $this->input->post('code_folder_new_item_unzip'); + $post_new_message = $this->input->post('code_new_message'); + $post_max_item_no = $this->input->post('code_new_item_count'); + $post_unzip = $this->input->post('code_new_item_unzip'); if ($post_new_message !== FALSE && $post_max_item_no !== FALSE) { $import_files = array (); for ($i = 0; $i < $post_max_item_no; $i++) { - $d = $this->input->post("code_folder_new_item_dir_$i"); - + $d = $this->input->post("code_new_item_dir_$i"); if (strlen($d) > 0) { array_push ($import_files, array ('type' => 'dir', 'name' => $d)); } - $fid = "code_folder_new_item_file_$i"; + $d = $this->input->post("code_new_item_empfile_$i"); + if (strlen($d) > 0) + { + array_push ($import_files, array ('type' => 'empfile', 'name' => $d)); + } + + $fid = "code_new_item_file_$i"; if (array_key_exists($fid, $_FILES) && $_FILES[$fid]['name'] != '') { array_push ($import_files, array ('type' => 'file', 'name' => $_FILES[$fid]['name'], 'fid' => $fid, 'unzip' => $post_unzip)); @@ -487,14 +497,14 @@ class Code extends Controller } else { - $post_delete_message = $this->input->post('code_folder_delete_message'); - $post_delete_file_count = $this->input->post('code_folder_delete_file_count'); + $post_delete_message = $this->input->post('code_delete_message'); + $post_delete_file_count = $this->input->post('code_delete_file_count'); if ($post_delete_message !== FALSE && $post_delete_file_count !== FALSE) { $delete_files = array (); for ($i = 0; $i < $post_delete_file_count; $i++) { - $d = $this->input->post("code_folder_delete_file_$i"); + $d = $this->input->post("code_delete_file_$i"); if (strlen($d) > 0) { diff --git a/codepot/src/codepot/language/english/code_lang.php b/codepot/src/codepot/language/english/code_lang.php index 68815b3a..fa25ecd9 100644 --- a/codepot/src/codepot/language/english/code_lang.php +++ b/codepot/src/codepot/language/english/code_lang.php @@ -14,4 +14,6 @@ $lang['CODE_SEARCH_RECURSIVELY'] = 'Search recursively to sub-directories'; $lang['CODE_SEARCH_IN_NAME'] = 'Search in file names'; $lang['CODE_SEARCH_IS_REGEX'] = 'Search string is a regular expression'; $lang['CODE_SEARCH_WILDCARD'] = 'Enter a wildcard pattern'; + +$lang['CODE_FMT_DELETE_X_SELECTED_FILES'] = 'Delete %d selected file(s)'; ?> diff --git a/codepot/src/codepot/language/english/common_lang.php b/codepot/src/codepot/language/english/common_lang.php index 3df4bd1f..430b4541 100644 --- a/codepot/src/codepot/language/english/common_lang.php +++ b/codepot/src/codepot/language/english/common_lang.php @@ -29,6 +29,7 @@ $lang['Difference'] = 'Diff'; $lang['Directory'] = 'Directory'; $lang['Download'] = 'Download'; $lang['Edit'] = 'Edit'; +$lang['Empty file'] = 'Empty file'; $lang['Enstyle'] = 'Enstyle'; $lang['Error'] = 'Error'; $lang['Failure'] = 'Failure'; @@ -106,6 +107,7 @@ $lang['Type'] = 'Type'; $lang['Undo'] = 'Undo'; $lang['Unzip a zip file'] = 'Unzip a zip file'; $lang['Update'] = 'Update'; +$lang['Upload'] = 'Upload'; $lang['Username'] = 'Username'; $lang['Wiki'] = 'Wiki'; $lang['Wikis'] = 'Wikis'; diff --git a/codepot/src/codepot/language/indonesian/common_lang.php b/codepot/src/codepot/language/indonesian/common_lang.php index a2137628..676bf5c9 100644 --- a/codepot/src/codepot/language/indonesian/common_lang.php +++ b/codepot/src/codepot/language/indonesian/common_lang.php @@ -29,6 +29,7 @@ $lang['Difference'] = 'Beda'; $lang['Directory'] = 'Direktori'; $lang['Download'] = 'Download'; $lang['Edit'] = 'Rubah'; +$lang['Empty file'] = 'Empty file'; $lang['Enstyle'] = 'Enstyle'; $lang['Error'] = 'Error'; $lang['Failure'] = 'Failure'; @@ -105,6 +106,7 @@ $lang['Type'] = 'Type'; $lang['Undo'] = 'Undo'; $lang['Unzip a zip file'] = 'Unzip a zip file'; $lang['Update'] = 'Memperbaharui'; +$lang['Upload'] = 'Upload'; $lang['Username'] = 'Nama pemakai'; $lang['Wiki'] = 'Wiki'; $lang['Wikis'] = 'Wiki'; diff --git a/codepot/src/codepot/language/korean/code_lang.php b/codepot/src/codepot/language/korean/code_lang.php index 13f0b7c9..7644dded 100644 --- a/codepot/src/codepot/language/korean/code_lang.php +++ b/codepot/src/codepot/language/korean/code_lang.php @@ -14,4 +14,7 @@ $lang['CODE_SEARCH_RECURSIVELY'] = '서브디렉토리를 포함하여 검색합 $lang['CODE_SEARCH_IN_NAME'] = '파일이름을 검색합니다'; $lang['CODE_SEARCH_IS_REGEX'] = '검색어가 정규식입니다'; $lang['CODE_SEARCH_WILDCARD'] = '와일드카드 패턴을 입력하세요'; + +$lang['CODE_FMT_DELETE_X_SELECTED_FILES'] = '선택된 파일 %d개를 삭제합니다'; + ?> diff --git a/codepot/src/codepot/language/korean/common_lang.php b/codepot/src/codepot/language/korean/common_lang.php index f5bc4f6a..7a489730 100644 --- a/codepot/src/codepot/language/korean/common_lang.php +++ b/codepot/src/codepot/language/korean/common_lang.php @@ -29,6 +29,7 @@ $lang['Difference'] = '차이'; $lang['Directory'] = '디렉토리'; $lang['Download'] = '내려받음'; $lang['Edit'] = '수정'; +$lang['Empty file'] = '빈파일'; $lang['Enstyle'] = '모양새내기'; $lang['Error'] = '오류'; $lang['Failure'] = '실패'; @@ -106,6 +107,7 @@ $lang['Type'] = '종류'; $lang['Undo'] = '되돌림'; $lang['Unzip a zip file'] = 'zip파일 풀기'; $lang['Update'] = '수정'; +$lang['Upload'] = '올리기'; $lang['Username'] = '사용자명'; $lang['Wiki'] = '위키'; $lang['Wikis'] = '위키'; diff --git a/codepot/src/codepot/models/subversionmodel.php b/codepot/src/codepot/models/subversionmodel.php index 44c61bbb..ffc9dcdd 100644 --- a/codepot/src/codepot/models/subversionmodel.php +++ b/codepot/src/codepot/models/subversionmodel.php @@ -355,6 +355,17 @@ class SubversionModel extends Model return FALSE; } } + else if ($f['type'] == 'empfile') + { + if (@touch($xname) === FALSE || + @svn_add ($xname, TRUE, TRUE) === FALSE) + { + restore_error_handler (); + codepot_delete_files ($actual_tfname, TRUE); + @unlink ($tfname); + return FALSE; + } + } else if ($f['type'] == 'file') { $config['allowed_types'] = '*'; diff --git a/codepot/src/codepot/views/code_folder.php b/codepot/src/codepot/views/code_folder.php index 79044d6c..615875de 100644 --- a/codepot/src/codepot/views/code_folder.php +++ b/codepot/src/codepot/views/code_folder.php @@ -214,6 +214,7 @@ $(function () { new_item_no = 0; $('#code_folder_mainarea_new_file_form_item_list').append (get_new_item_html(new_item_no, 'file', 'file')); $('#code_folder_mainarea_new_dir_form_item_list').append (get_new_item_html(new_item_no, 'text', 'dir')); + $('#code_folder_mainarea_new_empfile_form_item_list').append (get_new_item_html(new_item_no, 'text', 'empfile')); $("#code_folder_mainarea_new_form_tabs").tabs (); @@ -232,6 +233,7 @@ $(function () { ++new_item_no; $('#code_folder_mainarea_new_file_form_item_list').append (get_new_item_html(new_item_no, 'file', 'file')); $('#code_folder_mainarea_new_dir_form_item_list').append (get_new_item_html(new_item_no, 'text', 'dir')); + $('#code_folder_mainarea_new_empfile_form_item_list').append (get_new_item_html(new_item_no, 'text', 'empfile')); }, 'lang->line('OK')?>': function () { if (import_in_progress) return; @@ -245,16 +247,19 @@ $(function () { var form_data = new FormData(); - form_data.append ('code_folder_new_message', $('#code_folder_mainarea_new_message').val()); - form_data.append ('code_folder_new_item_count', $('#code_folder_mainarea_new_item_count').val()); - form_data.append ('code_folder_new_item_unzip', $('#code_folder_mainarea_new_item_unzip').val()); + form_data.append ('code_new_message', $('#code_folder_mainarea_new_message').val()); + form_data.append ('code_new_item_count', $('#code_folder_mainarea_new_item_count').val()); + form_data.append ('code_new_item_unzip', $('#code_folder_mainarea_new_item_unzip').val()); for (var i = 0; i <= new_item_no; i++) { var f = $('#code_folder_mainarea_new_item_file_' + i).get(0).files[0]; - if (f != null) form_data.append ('code_folder_new_item_file_' + i, f); + if (f != null) form_data.append ('code_new_item_file_' + i, f); var d = $('#code_folder_mainarea_new_item_dir_' + i).val(); - if (d != null && d != '') form_data.append ('code_folder_new_item_dir_' + i, d); + if (d != null && d != '') form_data.append ('code_new_item_dir_' + i, d); + + var d = $('#code_folder_mainarea_new_item_empfile_' + i).val(); + if (d != null && d != '') form_data.append ('code_new_item_empfile_' + i, d); } $('#code_folder_mainarea_new_form_div').dialog('disable'); @@ -332,18 +337,18 @@ $(function () { var form_data = new FormData(); - form_data.append ('code_folder_delete_message', $('#code_folder_mainarea_delete_message').val()); + form_data.append ('code_delete_message', $('#code_folder_mainarea_delete_message').val()); var xi = 0; for (var i = 0; i < ; i++) { var f = $('#code_folder_mainarea_result_table_file_selector_' + i); if (f != null && f.is(':checked')) { - form_data.append ('code_folder_delete_file_' + xi, f.val()); + form_data.append ('code_delete_file_' + xi, f.val()); xi++; } } - form_data.append ('code_folder_delete_file_count', xi); + form_data.append ('code_delete_file_count', xi); $('#code_folder_mainarea_delete_form_div').dialog('disable'); $.ajax({ @@ -403,6 +408,15 @@ $(function () { }); $('#code_folder_mainarea_delete_button').button().click (function() { + var xi = 0; + for (var i = 0; i < ; i++) + { + var f = $('#code_folder_mainarea_result_table_file_selector_' + i); + if (f != null && f.is(':checked')) xi++; + } + $('#code_folder_mainarea_delete_display_message').text ( + codepot_sprintf ("lang->line('CODE_FMT_DELETE_X_SELECTED_FILES')) ?>", xi) + ); $('#code_folder_mainarea_delete_form_div').dialog('open'); }); @@ -945,8 +959,9 @@ $this->load->view (