mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1318 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
19b9fd314f
commit
e1ecee7484
12 changed files with 147 additions and 16 deletions
|
|
@ -4,6 +4,7 @@
|
|||
<action name="dispLayoutAdminContent" type="view" admin_index="true" standalone="true" />
|
||||
<action name="dispLayoutAdminInsert" type="view" standalone="true" />
|
||||
<action name="dispLayoutAdminModify" type="view" standalone="true" />
|
||||
<action name="dispLayoutAdminEdit" type="view" standalone="true" />
|
||||
<action name="dispLayoutAdminDownloadedList" type="view" standalone="true" />
|
||||
|
||||
<action name="dispLayoutAdminInfo" type="view" standalone="true" />
|
||||
|
|
@ -11,5 +12,6 @@
|
|||
<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" />
|
||||
</actions>
|
||||
</module>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
**/
|
||||
|
||||
$lang->cmd_layout_management = '레이아웃 설정';
|
||||
$lang->cmd_layout_edit = '레이아웃 편집';
|
||||
$lang->cmd_preview = '미리 보기';
|
||||
$lang->cmd_load_source = '원본 불러오기';
|
||||
|
||||
$lang->layout_name = '레이아웃 이름';
|
||||
$lang->layout_maker = "레이아웃 제작자";
|
||||
|
|
@ -21,4 +24,8 @@
|
|||
$lang->about_title = '모듈에 연결시 쉽게 구분할 수 있는 제목을 입력해주세요';
|
||||
|
||||
$lang->about_layout = "레이아웃 모듈은 사이트의 레이아웃을 쉽게 만들 수 있도록 도와줍니다.\n레이아웃 설정과 메뉴의 연결을 통해서 다양한 모듈이 완성된 사이트의 모습으로 보여줄 수 있도록 합니다.\n* 삭제나 수정이 불가능한 레이아웃은 블로그나 기타 모듈의 자체 레이아웃이므로 해당 모듈로 가서 설정하셔야 합니다.";
|
||||
$lang->about_layout_code =
|
||||
"아래 레이아웃의 코드를 직접 수정후 저장하시면 서비스에 반영이 됩니다.
|
||||
꼭 미리보기를 하신 후에 저장을 하세요.
|
||||
제로보드XE의 템플릿 문법은 <a href=\"#\">[제로보드XE 템플릿]</a> 을 참고하시면 됩니다.";
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminContent');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminInsert');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminModify');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminEdit');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminDownloadedList');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminInfo');
|
||||
|
||||
|
|
|
|||
|
|
@ -115,5 +115,19 @@
|
|||
$output = executeQuery("layout.deleteLayout", $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 코드 추가
|
||||
**/
|
||||
function procLayoutAdminCodeUpdate() {
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
$code = Context::get('code');
|
||||
if(!$layout_srl || !$code) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
$layout_file = sprintf('./files/cache/layout/%d.html', $layout_srl);
|
||||
FileHandler::writeFile($layout_file, $code);
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -62,6 +62,36 @@
|
|||
$this->setTemplateFile('layout_modify');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 코드 편집
|
||||
**/
|
||||
function dispLayoutAdminEdit() {
|
||||
// 선택된 레이아웃의 정보르 구해서 세팅
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
|
||||
// 레이아웃의 정보를 가져옴
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayout($layout_srl);
|
||||
|
||||
// 등록된 레이아웃이 없으면 오류 표시
|
||||
if(!$layout_info) return $this->dispLayoutAdminContent();
|
||||
Context::set('layout_info', $layout_info);
|
||||
|
||||
// 레이아웃 코드 가져오기
|
||||
$layout_file = sprintf('./files/cache/layout/%d.html', $layout_info->layout_srl);
|
||||
if(!file_exists($layout_file)) $layout_file = sprintf('%s%s', $layout_info->path, 'layout.html');
|
||||
|
||||
$layout_code = FileHandler::readFile($layout_file);
|
||||
Context::set('layout_code', $layout_code);
|
||||
|
||||
// 플러그인 목록을 세팅
|
||||
$oPluginModel = &getModel('plugin');
|
||||
$plugin_list = $oPluginModel->getDownloadedPluginList();
|
||||
Context::set('plugin_list', $plugin_list);
|
||||
|
||||
$this->setTemplateFile('layout_edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 목록을 보여줌
|
||||
**/
|
||||
|
|
|
|||
10
modules/layout/tpl/filter/update_layout_code.xml
Normal file
10
modules/layout/tpl/filter/update_layout_code.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<filter name="update_layout_code" module="layout" act="procLayoutAdminCodeUpdate" confirm_msg_code="confirm_submit">
|
||||
<form>
|
||||
<node target="layout_srl" required="true" />
|
||||
<node target="code" required="true" />
|
||||
</form>
|
||||
<response>
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
|
|
@ -1,8 +1,17 @@
|
|||
<!--%import("js/layout_admin.js")-->
|
||||
|
||||
<!-- 관리자 페이지용 메뉴 -->
|
||||
<!--@if($module == 'admin')-->
|
||||
<div style="margin-bottom:20px;">
|
||||
<span <!--@if($act=='dispLayoutAdminContent')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispLayoutAdminContent')}">{$lang->layout_list}</a>]</span>
|
||||
<span <!--@if($act=='dispLayoutAdminDownloadedList')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispLayoutAdminDownloadedList')}">{$lang->downloaded_list}</a>]</span>
|
||||
</div>
|
||||
<div style="margin-bottom:20px;">
|
||||
<span <!--@if($act=='dispLayoutAdminContent')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispLayoutAdminContent')}">{$lang->layout_list}</a>]</span>
|
||||
<span <!--@if($act=='dispLayoutAdminDownloadedList')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispLayoutAdminDownloadedList')}">{$lang->downloaded_list}</a>]</span>
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
<!-- 레이아웃 수정 메뉴 -->
|
||||
<!--@if($layout_info)-->
|
||||
<div style="margin-bottom:20px;">
|
||||
<span <!--@if($act=='dispLayoutAdminModify')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispLayoutAdminModify')}">{$lang->cmd_layout_management}</a>]</span>
|
||||
<span <!--@if($act=='dispLayoutAdminEdit')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispLayoutAdminEdit')}">{$lang->cmd_layout_edit}</a>]</span>
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
|
|
|||
37
modules/layout/tpl/layout_edit.html
Normal file
37
modules/layout/tpl/layout_edit.html
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<!--%import("filter/update_layout_code.xml")-->
|
||||
|
||||
<!--#include("header.html")-->
|
||||
|
||||
<div style="margin-bottom:10px;border:4px solid #DDDDDD;padding:5px;font-weight:bold;">
|
||||
{$layout_info->title} ver {$layout_info->version} ({$layout_info->layout})
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom:10px;border:1px solid #DDDDDD;padding:5px;">
|
||||
{nl2br($lang->about_layout_code)}
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom:10px;border:1px solid #DDDDDD;padding:5px;">
|
||||
<div style="font-weight:bold">{$lang->plugin}</div>
|
||||
<div>
|
||||
<!--@foreach($plugin_list as $plugin)-->
|
||||
[<a href="#" onclick="popopen('./?module=plugin&act=dispPluginGenerateCode&selected_plugin={$plugin->plugin}&module_srl={$module_srl}','GenerateCodeInPage');return false;">{$plugin->title}</a>]
|
||||
<!--@end-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom:10px;">
|
||||
<form id="fo_layout" action="./" method="get" onsubmit="return procFilter(this, update_layout_code)">
|
||||
<input type="hidden" name="layout_srl" value="{$layout_srl}" />
|
||||
|
||||
<div>
|
||||
<textarea name="code" style="width:99%;height:400px;border:2px solid #DDDDDD;">{htmlspecialchars($layout_code)}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<input type="submit" value="{$lang->cmd_save}" />
|
||||
<input type="button" value="{$lang->cmd_preview}" onclick="doPreviewLayoutCode('{$layout_srl}');return false" />
|
||||
<input type="button" value="{$lang->cmd_load_source}" onclick="doResetLayoutCode('{$layout_srl}');return false" />
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue