git-svn-id: http://xe-core.googlecode.com/svn/trunk@1321 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-04-25 06:12:36 +00:00
parent 75e7e9bfc0
commit 66f34595e2
11 changed files with 99 additions and 4 deletions

View file

@ -6,12 +6,13 @@
<action name="dispLayoutAdminModify" type="view" standalone="true" />
<action name="dispLayoutAdminEdit" type="view" standalone="true" />
<action name="dispLayoutAdminDownloadedList" type="view" standalone="true" />
<action name="dispLayoutAdminPreview" type="view" standalone="true" />
<action name="dispLayoutAdminInfo" type="view" standalone="true" />
<action name="procLayoutAdminInsert" type="controller" standalone="true" />
<action name="procLayoutAdminUpdate" type="controller" standalone="true" />
<action name="procLayoutAdminDelete" type="controller" standalone="true" />
<action name="procLayoutAdminCodeUpdate" type="controller" standalone="true" />
<action name="procLayoutAdminCodeReset" type="controller" standalone="true" />
</actions>
</module>

View file

@ -8,7 +8,7 @@
$lang->cmd_layout_management = '레이아웃 설정';
$lang->cmd_layout_edit = '레이아웃 편집';
$lang->cmd_preview = '미리 보기';
$lang->cmd_load_source = '원본 불러오기';
$lang->cmd_reset = '초기화';
$lang->layout_name = '레이아웃 이름';
$lang->layout_maker = "레이아웃 제작자";
@ -17,6 +17,7 @@
$lang->layout_list = '레이아웃 목록';
$lang->menu_count = '메뉴수';
$lang->downloaded_list = '다운로드 목록';
$lang->layout_preview_content = '내용이 출력되는 부분입니다';
$lang->cmd_move_to_installed_list = "생성된 목록 보기";

View file

@ -102,6 +102,9 @@
}
}
$layout_file = sprintf('./files/cache/layout/%d.html', $layout_srl);
if(file_exists($layout_file)) @unlink($layout_file);
// 레이아웃 삭제
$args->layout_srl = $layout_srl;
@ -129,5 +132,18 @@
$this->setMessage('success_updated');
}
/**
* @brief 레이아웃 코드 초기화
**/
function procLayoutAdminCodeReset() {
$layout_srl = Context::get('layout_srl');
if(!$layout_srl) return new Object(-1, 'msg_invalid_request');
$layout_file = sprintf('./files/cache/layout/%d.html', $layout_srl);
@unlink($layout_file);
$this->setMessage('success_reset');
}
}
?>

View file

@ -104,6 +104,62 @@
$this->setTemplateFile('downloaded_layout_list');
}
/**
* @brief 레이아웃 미리 보기
**/
function dispLayoutAdminPreview() {
$layout_srl = Context::get('layout_srl');
$code = Context::get('code');
if(!$layout_srl || !$code) return new Object(-1, 'msg_invalid_request');
//$code = str_replace(array('&lt;','&gt;','&quot;'), array('<','>','"'), $code);
// 레이아웃 정보 가져오기
$oLayoutModel = &getModel('layout');
$layout_info = $oLayoutModel->getLayout($layout_srl);
if(!$layout_info) return new Object(-1, 'msg_invalid_request');
// 레이아웃 정보중 extra_vars의 이름과 값을 $layout_info에 입력
if($layout_info->extra_var_count) {
foreach($layout_info->extra_var as $var_id => $val) {
$layout_info->{$var_id} = $val->value;
}
}
// 레이아웃 정보중 menu를 Context::set
if($layout_info->menu_count) {
foreach($layout_info->menu as $menu_id => $menu) {
if(file_exists($menu->php_file)) @include($menu->php_file);
Context::set($menu_id, $menu);
}
}
Context::set('layout_info', $layout_info);
Context::set('content', Context::getLang('layout_preview_content'));
// 코드를 임시로 저장
$edited_layout_file = sprintf('./files/cache/layout/tmp.tpl');
FileHandler::writeFile($edited_layout_file, $code);
// 컴파일
$oTemplate = &TemplateHandler::getInstance();
$layout_path = $layout_info->path;
$layout_file = 'layout';
$layout_tpl = $oTemplate->compile($layout_path, $layout_file, $edited_layout_file);
// 플러그인등을 변환
$oContext = &Context::getInstance();
$layout_tpl = $oContext->transContent($layout_tpl);
Context::set('layout_tpl', $layout_tpl);
// 임시 파일 삭제
@unlink($edited_layout_file);
$this->setTemplateFile('layout_preview');
}
/**
* @brief 레이아웃의 상세 정보(conf/info.xml) 팝업 출력
**/

View file

@ -0,0 +1,10 @@
<filter name="reset_layout_code" module="layout" act="procLayoutAdminCodeReset" confirm_msg_code="confirm_reset">
<form>
<node target="layout_srl" required="true" />
<node target="code" required="true" />
</form>
<response>
<tag name="error" />
<tag name="message" />
</response>
</filter>

View file

@ -0,0 +1 @@
{$layout_tpl}