mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 11:11:39 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1138 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e5701c611e
commit
45d551a776
5 changed files with 77 additions and 22 deletions
|
|
@ -83,7 +83,6 @@ div.editor_drag_down_area {
|
|||
border:0;
|
||||
padding:0px;
|
||||
clear:both;
|
||||
height:130px;
|
||||
}
|
||||
|
||||
.editor_preview_uploaded {
|
||||
|
|
@ -111,7 +110,7 @@ div.editor_drag_down_area {
|
|||
border:1px solid #AAAAAA;
|
||||
}
|
||||
|
||||
.editor_uploader_input_area {
|
||||
.editor_uploader_button_area {
|
||||
width:150px;
|
||||
float:left;
|
||||
clear:right;
|
||||
|
|
@ -125,13 +124,33 @@ div.editor_drag_down_area {
|
|||
position:relative;
|
||||
}
|
||||
|
||||
.editor_uploader_input {
|
||||
.editor_uploader_button {
|
||||
display:block;
|
||||
width:90px;
|
||||
width:92px;
|
||||
height:18px;
|
||||
border:1px solid #AAAAAA;
|
||||
background-color:#FFFFFF;
|
||||
margin-bottom:10px;
|
||||
margin-bottom:3px;
|
||||
}
|
||||
|
||||
.editor_uploader_status {
|
||||
margin:5px 0px 5px 0px;
|
||||
}
|
||||
|
||||
.editor_uploader_status .title {
|
||||
color:#999999;
|
||||
}
|
||||
|
||||
.editor_uploader_status .desc_attached {
|
||||
color:#000000;
|
||||
font-weight:bold;
|
||||
margin-right:3px;
|
||||
}
|
||||
|
||||
.editor_uploader_status .desc {
|
||||
color:#999999;
|
||||
font-weight:bold;
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
.component_setup_window {
|
||||
|
|
|
|||
|
|
@ -115,19 +115,22 @@
|
|||
<!-- 파일 업로드 영역 -->
|
||||
<div class="editor_uploader">
|
||||
<select id="uploaded_file_list_{$upload_target_srl}" size="9" class="uploaded_file_list" onclick="editor_preview(this, '{$upload_target_srl}');">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="editor_uploader_input_area">
|
||||
<input type="button" value="{$lang->edit->upload_file}" class="editor_uploader_input" onclick="editor_upload_file('{$upload_target_srl}');return false;" />
|
||||
<input type="button" value="{$lang->edit->delete_selected}" class="editor_uploader_input" onclick="editor_remove_file('{$upload_target_srl}');return false;" />
|
||||
<input type="button" value="{$lang->edit->link_file}" class="editor_uploader_input" onclick="editor_insert_file('{$upload_target_srl}');return false;" />
|
||||
<input type="file" name="file" id="file_uploader_{$upload_target_srl}" class="editor_uploader_file_input" onchange="editor_file_upload(this, '{$upload_target_srl}')" value="{$lang->edit->upload}" />
|
||||
<div class="editor_uploader_button_area">
|
||||
<input type="button" value="{$lang->edit->upload_file}" class="editor_uploader_button" onclick="editor_upload_file('{$upload_target_srl}');return false;" />
|
||||
<input type="button" value="{$lang->edit->delete_selected}" class="editor_uploader_button" onclick="editor_remove_file('{$upload_target_srl}');return false;" />
|
||||
<input type="button" value="{$lang->edit->link_file}" class="editor_uploader_button" onclick="editor_insert_file('{$upload_target_srl}');return false;" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<div class="editor_uploader_status" id="uploader_status_{$upload_target_srl}"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
|
|
|||
|
|
@ -74,7 +74,6 @@
|
|||
$attached_size = (int)$output->data->attached_size + filesize($file_info['tmp_name']);
|
||||
if($attached_size > $allowed_attach_size) return new Object(-1, 'msg_exceeds_limit_size');
|
||||
}
|
||||
return new Object(-1, 'msg_exceeds_limit_size');
|
||||
|
||||
// 이미지인지 기타 파일인지 체크하여 upload path 지정
|
||||
if(eregi("\.(jpg|jpeg|gif|png|wmv|mpg|mpeg|avi|swf|flv|mp3|asaf|wav|asx|midi)$", $file_info['name'])) {
|
||||
|
|
@ -249,22 +248,43 @@
|
|||
$oFileModel = &getModel('file');
|
||||
|
||||
// 첨부파일 목록을 구함
|
||||
$file_list = $oFileModel->getFiles($upload_target_srl);
|
||||
$file_count = count($file_list);
|
||||
$tmp_file_list = $oFileModel->getFiles($upload_target_srl);
|
||||
$file_count = count($tmp_file_list);
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin == 'Y') {
|
||||
$file_config->allowed_filesize = 1024;
|
||||
$file_config->allowed_attach_size = 1024;
|
||||
$file_config->allowed_filetypes = '*.*';
|
||||
} else {
|
||||
$file_config = $oFileModel->getFileConfig();
|
||||
}
|
||||
|
||||
// 루프를 돌면서 $buff 변수에 java script 코드를 생성
|
||||
$buff = "";
|
||||
for($i=0;$i<$file_count;$i++) {
|
||||
$file_info = $file_list[$i];
|
||||
$file_info = $tmp_file_list[$i];
|
||||
if(!$file_info->file_srl) continue;
|
||||
|
||||
$uploaded_filename = sprintf('%s%s', Context::getRequestUri(), str_replace('./', '', $file_info->uploaded_filename));
|
||||
|
||||
$buff .= sprintf("parent.editor_insert_uploaded_file(\"%d\", \"%d\",\"%s\", \"%d\", \"%s\", \"%s\", \"%s\");\n", $upload_target_srl, $file_info->file_srl, $file_info->source_filename, $file_info->file_size, FileHandler::filesize($file_info->file_size), $file_info->direct_download=='Y'?$uploaded_filename:'', $file_info->sid);
|
||||
if($file_info->direct_download == 'Y') $file_info->uploaded_filename = sprintf('%s%s', Context::getRequestUri(), str_replace('./', '', $file_info->uploaded_filename));
|
||||
$file_list[] = $file_info;
|
||||
$attached_size += $file_info->file_size;
|
||||
}
|
||||
|
||||
// 업로드 상태 표시 작성
|
||||
$upload_status = sprintf(
|
||||
'<span class="title">- %s : </span><span class="desc_attached">%s</span><span class="desc">/ %s</span><span class="title">- %s : </span><span class="desc">%s</span><span class="title">- %s : </span><span class="desc">%s</span>',
|
||||
Context::getLang('allowed_attach_size'),
|
||||
FileHandler::filesize($attached_size),
|
||||
FileHandler::filesize($file_config->allowed_attach_size*1024*1024),
|
||||
Context::getLang('allowed_filesize'),
|
||||
FileHandler::filesize($file_config->allowed_filesize*1024*1024),
|
||||
Context::getLang('allowed_filetypes'),
|
||||
$file_config->allowed_filetypes
|
||||
);
|
||||
|
||||
Context::set('upload_target_srl', $upload_target_srl);
|
||||
Context::set('buff', $buff);
|
||||
Context::set('file_list', $file_list);
|
||||
Context::set('upload_status', $upload_status);
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('print_uploaded_file_list');
|
||||
|
|
|
|||
11
modules/file/queries/getAttachedFileSize.xml
Normal file
11
modules/file/queries/getAttachedFileSize.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="getAttachedFileSize" action="select">
|
||||
<tables>
|
||||
<table name="files" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="sum(file_size)" alias="attached_size" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="upload_target_srl" var="upload_target_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
<script type="text/javascript">
|
||||
|
||||
parent.editor_upload_clear_list("{$upload_target_srl}");
|
||||
|
||||
{$buff}
|
||||
<!--@foreach($file_list as $key => $file_info)-->
|
||||
parent.editor_insert_uploaded_file({$upload_target_srl}, {$file_info->file_srl}, "{$file_info->source_filename}", "{$file_info->file_size}", "{FileHandler::filesize($file_info->file_size)}", "{$file_info->uploaded_filename}", "{$file_info->sid}");
|
||||
<!--@end-->
|
||||
|
||||
parent.xInnerHtml("uploader_status_{$upload_target_srl}", '{$upload_status}');
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue