mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-20 03:39:56 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1791 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
7e130936a9
commit
e0e99b1b46
5 changed files with 90 additions and 22 deletions
|
|
@ -1,30 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout version="0.1">
|
||||
<title xml:lang="ko">견본 레이아웃 (PHP 메뉴) </title>
|
||||
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
|
||||
<name xml:lang="ko">제로</name>
|
||||
<title xml:lang="ko">zb5beta 사이트 레이아웃</title>
|
||||
<author email_address="styx@zeroboard.com" link="http://bystyx.com" date="2007. 2. 28">
|
||||
<name xml:lang="ko">styx</name>
|
||||
<description xml:lang="ko">
|
||||
가장 기본적인 기능으로 이루어진 견본 레이아웃입니다.
|
||||
main_menu, bottom_menu 2개의 메뉴로 구성되어 있으며 각 메뉴의 출력은 php 코드로 하게 됩니다.
|
||||
레이아웃을 만들때 js menu 보다는 복잡하지만 자유도가 높습니다.
|
||||
zb5beta에서 사용되던 사이트 레이아웃입니다.
|
||||
</description>
|
||||
</author>
|
||||
<extra_vars>
|
||||
<var name="colorset" type="select">
|
||||
<title xml:lang="ko">컬러셋</title>
|
||||
<description xml:lang="ko">원하시는 컬러셋을 선택해주세요.</description>
|
||||
<options name="red">
|
||||
<title xml:lang="ko">적색</title>
|
||||
<value>red</value>
|
||||
</options>
|
||||
<options name="blue">
|
||||
<title xml:lang="ko">청색</title>
|
||||
<title xml:lang="ko">파란색 </title>
|
||||
<value>blue</value>
|
||||
</options>
|
||||
</var>
|
||||
<var name="top_title" type="text">
|
||||
<title xml:lang="ko">상단 제목</title>
|
||||
<description xml:lang="ko">레이아웃의 상단에 표시할 제목을 입력하세요.</description>
|
||||
<var name="logo_image" type="image">
|
||||
<title xml:lang="ko">로고이미지</title>
|
||||
<description xml:lang="ko">레이아웃의 상단에 표시될 로고이미지를 입력하세요.</description>
|
||||
</var>
|
||||
<var name="index_url" type="text">
|
||||
<title xml:lang="ko">홈 페이지 URL</title>
|
||||
|
|
@ -33,12 +27,8 @@
|
|||
</extra_vars>
|
||||
<menus>
|
||||
<menu name="main_menu" default="true">
|
||||
<title xml:lang="ko">주 메뉴</title>
|
||||
<maxdepth>2</maxdepth>
|
||||
</menu>
|
||||
<menu name="bottom_menu">
|
||||
<title xml:lang="ko">하단 메뉴 </title>
|
||||
<maxdepth>1</maxdepth>
|
||||
<title xml:lang="ko">상단 메뉴</title>
|
||||
<maxdepth>3</maxdepth>
|
||||
</menu>
|
||||
</menus>
|
||||
</layout>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
<script type="text/javascript">
|
||||
alert("{$lang->success_updated}");
|
||||
top.location.href = top.location.href;
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -70,6 +70,59 @@
|
|||
$oModuleController->updateModuleLayout($args->layout_srl, $menu_srl_list);
|
||||
}
|
||||
}
|
||||
|
||||
// extra_vars의 type이 image일 경우 별도 처리를 해줌
|
||||
if($extra_vars) {
|
||||
foreach($extra_vars as $vars) {
|
||||
if($vars->type!='image') continue;
|
||||
|
||||
$image_obj = $obj->{$vars->name};
|
||||
|
||||
// 삭제 요청에 대한 변수를 구함
|
||||
$del_var = $obj->{"del_".$vars->name};
|
||||
unset($obj->{"del_".$vars->name});
|
||||
if($del_var == 'Y') {
|
||||
@unlink($module_info->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 업로드 되지 않았다면 이전 데이터를 그대로 사용
|
||||
if(!$image_obj['tmp_name']) {
|
||||
$obj->{$vars->name} = $module_info->{$vars->name};
|
||||
continue;
|
||||
}
|
||||
|
||||
// 정상적으로 업로드된 파일이 아니면 무시
|
||||
if(!is_uploaded_file($image_obj['tmp_name'])) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 이미지 파일이 아니어도 무시
|
||||
if(!eregi("\.(jpg|jpeg|gif|png)$", $image_obj['name'])) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 경로를 정해서 업로드
|
||||
$path = sprintf("./files/attach/images/%s/", $args->layout_srl);
|
||||
|
||||
// 디렉토리 생성
|
||||
if(!FileHandler::makeDir($path)) return false;
|
||||
|
||||
$filename = $path.$image_obj['name'];
|
||||
|
||||
// 파일 이동
|
||||
if(!move_uploaded_file($image_obj['tmp_name'], $filename)) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 변수를 바꿈
|
||||
unset($obj->{$vars->name});
|
||||
$obj->{$vars->name} = $filename;
|
||||
}
|
||||
}
|
||||
|
||||
// DB에 입력하기 위한 변수 설정
|
||||
$args->extra_vars = serialize($extra_vars);
|
||||
|
|
@ -77,7 +130,10 @@
|
|||
$output = $this->updateLayout($args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
$this->setLayoutPath('./common/tpl');
|
||||
$this->setLayoutFile('default_layout.html');
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile("top_refresh.html");
|
||||
}
|
||||
|
||||
function updateLayout($args) {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,10 @@
|
|||
<!--@end-->
|
||||
</table>
|
||||
|
||||
<form id="fo_layout" action="./" method="get" onsubmit="return procFilter(this, update_layout_info)">
|
||||
<!--<form id="fo_layout" action="./" method="post" onsubmit="return procFilter(this, update_layout_info)" enctype="multipart/form-data" target="hidden_iframe">-->
|
||||
<form id="fo_layout" action="./" method="post" enctype="multipart/form-data" target="hidden_iframe">
|
||||
<input type="hidden" name="module" value="layout" />
|
||||
<input type="hidden" name="act" value="procLayoutAdminUpdate" />
|
||||
<input type="hidden" name="layout_srl" value="{$layout_srl}" />
|
||||
<input type="hidden" name="layout" value="{$selected_layout->layout}" />
|
||||
|
||||
|
|
@ -52,6 +55,18 @@
|
|||
<!--@elseif($var->type == "textarea")-->
|
||||
<textarea name="{$name}" class="inputTypeTextArea w100">{htmlspecialchars($var->value)}</textarea>
|
||||
|
||||
<!--@elseif($var->type=="image")-->
|
||||
|
||||
<!--@if($var->value)-->
|
||||
<div>
|
||||
<img src="{$var->value}" /><br />
|
||||
<input type="checkbox" name="del_{$name}" value="Y" id="del_{$name}" class="checkbox" />
|
||||
<label for="del_{$name}">{$lang->cmd_delete}</label>
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
<input type="file" name="{$name}" value="" />
|
||||
|
||||
<!--@elseif($var->type == "select")-->
|
||||
<select name="{$name}">
|
||||
<!--@foreach($var->options as $key => $val)-->
|
||||
|
|
@ -92,3 +107,5 @@
|
|||
<!--@end-->
|
||||
</ul>
|
||||
</form>
|
||||
|
||||
<iframe name="hidden_iframe" frameborder="0" style="display:none"></iframe>
|
||||
|
|
|
|||
4
modules/layout/tpl/top_refresh.html
Normal file
4
modules/layout/tpl/top_refresh.html
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<script type="text/javascript">
|
||||
alert("{$lang->success_updated}");
|
||||
top.location.href = top.location.href;
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue