mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 20:12:14 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1792 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e0e99b1b46
commit
ac4276bb10
2 changed files with 14 additions and 28 deletions
|
|
@ -86,6 +86,7 @@
|
||||||
$path_list = explode('/', $path_string);
|
$path_list = explode('/', $path_string);
|
||||||
|
|
||||||
for($i=0;$i<count($path_list);$i++) {
|
for($i=0;$i<count($path_list);$i++) {
|
||||||
|
if(!$path_list[$i]) continue;
|
||||||
$path .= $path_list[$i].'/';
|
$path .= $path_list[$i].'/';
|
||||||
if(!is_dir($path)) {
|
if(!is_dir($path)) {
|
||||||
@mkdir($path, 0707);
|
@mkdir($path, 0707);
|
||||||
|
|
|
||||||
|
|
@ -72,55 +72,40 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// extra_vars의 type이 image일 경우 별도 처리를 해줌
|
// extra_vars의 type이 image일 경우 별도 처리를 해줌
|
||||||
if($extra_vars) {
|
if($layout_info->extra_var) {
|
||||||
foreach($extra_vars as $vars) {
|
foreach($layout_info->extra_var as $name => $vars) {
|
||||||
if($vars->type!='image') continue;
|
if($vars->type!='image') continue;
|
||||||
|
|
||||||
$image_obj = $obj->{$vars->name};
|
$image_obj = $extra_vars->{$name};
|
||||||
|
$extra_vars->{$name} = $layout_info->extra_var->{$name}->value;
|
||||||
|
|
||||||
// 삭제 요청에 대한 변수를 구함
|
// 삭제 요청에 대한 변수를 구함
|
||||||
$del_var = $obj->{"del_".$vars->name};
|
$del_var = $extra_vars->{"del_".$name};
|
||||||
unset($obj->{"del_".$vars->name});
|
unset($extra_vars->{"del_".$name});
|
||||||
if($del_var == 'Y') {
|
if($del_var == 'Y') {
|
||||||
@unlink($module_info->{$vars->name});
|
$extra_vars->{$name} = '';
|
||||||
continue;
|
@unlink($extra_vars->{$name});
|
||||||
}
|
|
||||||
|
|
||||||
// 업로드 되지 않았다면 이전 데이터를 그대로 사용
|
|
||||||
if(!$image_obj['tmp_name']) {
|
|
||||||
$obj->{$vars->name} = $module_info->{$vars->name};
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 정상적으로 업로드된 파일이 아니면 무시
|
// 정상적으로 업로드된 파일이 아니면 무시
|
||||||
if(!is_uploaded_file($image_obj['tmp_name'])) {
|
if(!$image_obj['tmp_name'] || !is_uploaded_file($image_obj['tmp_name'])) continue;
|
||||||
unset($obj->{$vars->name});
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 이미지 파일이 아니어도 무시
|
// 이미지 파일이 아니어도 무시
|
||||||
if(!eregi("\.(jpg|jpeg|gif|png)$", $image_obj['name'])) {
|
if(!eregi("\.(jpg|jpeg|gif|png)$", $image_obj['name'])) continue;
|
||||||
unset($obj->{$vars->name});
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 경로를 정해서 업로드
|
// 경로를 정해서 업로드
|
||||||
$path = sprintf("./files/attach/images/%s/", $args->layout_srl);
|
$path = sprintf("./files/attach/images/%s/", $args->layout_srl);
|
||||||
|
|
||||||
// 디렉토리 생성
|
// 디렉토리 생성
|
||||||
if(!FileHandler::makeDir($path)) return false;
|
if(!FileHandler::makeDir($path)) continue;
|
||||||
|
|
||||||
$filename = $path.$image_obj['name'];
|
$filename = $path.$image_obj['name'];
|
||||||
|
|
||||||
// 파일 이동
|
// 파일 이동
|
||||||
if(!move_uploaded_file($image_obj['tmp_name'], $filename)) {
|
if(!move_uploaded_file($image_obj['tmp_name'], $filename)) continue;
|
||||||
unset($obj->{$vars->name});
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 변수를 바꿈
|
$extra_vars->{$name} = $filename;
|
||||||
unset($obj->{$vars->name});
|
|
||||||
$obj->{$vars->name} = $filename;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue