mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-17 02:10:02 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1255 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
1d28f14c5f
commit
efbf4988bc
5 changed files with 68 additions and 49 deletions
|
|
@ -303,11 +303,22 @@
|
|||
}
|
||||
|
||||
// serialize하여 저장
|
||||
$obj->category_xml_file = sprintf("./files/cache/blog_category/%s.xml.php", $module_srl);
|
||||
$skin_vars = serialize($obj);
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->updateModuleSkinVars($module_srl, $skin_vars);
|
||||
|
||||
// 레이아웃 확장변수 수정
|
||||
$layout_args->extra_vars = $skin_vars;
|
||||
$layout_args->layout_srl = $module_srl;
|
||||
$oLayoutController = &getController('layout');
|
||||
$output = $oLayoutController->updateLayout($layout_args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile("top_refresh.html");
|
||||
}
|
||||
|
|
@ -378,8 +389,8 @@
|
|||
// 레이아웃 등록
|
||||
$layout_args->layout_srl = $layout_args->module_srl = $module_srl;
|
||||
$layout_args->layout = 'blog';
|
||||
$layout_args->title = sprintf('%s (%s)',$args->browser_title, $args->mid);
|
||||
$layout_args->layout_path = sprintf('./modules/blog/skin/%s/layout.html', $args->skin);
|
||||
$layout_args->title = sprintf('%s - %s',$args->browser_title, $args->mid);
|
||||
$layout_args->layout_path = sprintf('./modules/blog/skins/%s/layout.html', $args->skin);
|
||||
|
||||
$oLayoutController = &getController('layout');
|
||||
$output = $oLayoutController->insertLayout($layout_args);
|
||||
|
|
@ -400,8 +411,7 @@
|
|||
// 레이아웃 수정
|
||||
$layout_args->layout_srl = $layout_args->module_srl = $module_srl;
|
||||
$layout_args->title = $args->browser_title;
|
||||
$layout_args->extra_vars = $args->extra_vars;
|
||||
$layout_args->layout_path = sprintf('./modules/blog/skin/%s/layout.html', $args->skin);
|
||||
$layout_args->layout_path = sprintf('./modules/blog/skins/%s/layout.html', $args->skin);
|
||||
|
||||
$oLayoutController = &getController('layout');
|
||||
$output = $oLayoutController->updateLayout($layout_args);
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@
|
|||
function init() {
|
||||
if(substr_count($this->act, 'Admin')) $this->initAdmin();
|
||||
else $this->initNormal();
|
||||
|
||||
// 카테고리 xml 파일 위치 지정
|
||||
$this->module_info->category_xml_file = sprintf('./files/cache/blog_category/%d.xml.php', $this->module_info->module_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -37,10 +34,7 @@
|
|||
// module_srl이 넘어오면 해당 모듈의 정보를 미리 구해 놓음
|
||||
if($module_srl) {
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if(!$module_info) {
|
||||
Context::set('module_srl','');
|
||||
$this->act = 'list';
|
||||
} else {
|
||||
if($module_info->module_srl == $module_srl) {
|
||||
$this->module_info = $module_info;
|
||||
Context::set('module_info',$module_info);
|
||||
}
|
||||
|
|
@ -50,14 +44,8 @@
|
|||
$module_category = $oModuleModel->getModuleCategories();
|
||||
Context::set('module_category', $module_category);
|
||||
|
||||
// 만약 블로그 서비스 페이지에서 관리자 기능 호출시 레이아웃을 지정
|
||||
if($this->mid) {
|
||||
$layout_path = sprintf("%sskins/%s/",$this->module_path, $this->skin);
|
||||
|
||||
// 레이아웃 지정
|
||||
$this->setLayoutPath($layout_path);
|
||||
$this->setLayoutFile("layout");
|
||||
}
|
||||
// 만약 블로그 서비스 페이지에서 관리자 기능 호출시 관련 정보를 위해서 initNoraml() method 호출
|
||||
if($this->mid) $this->initNormal();
|
||||
|
||||
// 템플릿 경로 지정 (blog의 경우 tpl에 관리자용 템플릿 모아놓음)
|
||||
$this->setTemplatePath($this->module_path."tpl");
|
||||
|
|
@ -77,28 +65,37 @@
|
|||
// 스킨 경로 구함
|
||||
$template_path = sprintf("%sskins/%s/",$this->module_path, $this->skin);
|
||||
|
||||
// 레이아웃 지정
|
||||
// 레이아웃 경로와 파일 지정 (블로그는 자체 레이아웃을 가지고 있음)
|
||||
$this->setLayoutPath($template_path);
|
||||
$this->setLayoutFile("layout");
|
||||
|
||||
// 템플릿 지정
|
||||
$this->setTemplatePath($template_path);
|
||||
|
||||
// rss url
|
||||
if($this->grant->list) Context::set('rss_url', getUrl('','mid',$this->mid,'act','dispBlogRss'));
|
||||
|
||||
// 카테고리 목록을 가져오고 선택된 카테고리의 값을 설정
|
||||
$oDocumentModel = &getModel('document');
|
||||
$this->category_list = $oDocumentModel->getCategoryList($this->module_srl);
|
||||
Context::set('category_list', $this->category_list);
|
||||
|
||||
// 선택된 카테고리 목록이 있으면 zbxe_url을 변경하여 트리메뉴에서 카테고리까지 참조할 수 있도록 함
|
||||
$category_srl = Context::get('category');
|
||||
if($this->category_list[$category_srl]) {
|
||||
$this->category_srl = $category_srl;
|
||||
Context::set('zbxe_url', sprintf("mid=%s&category=%d", $this->module_info->mid, $this->category_srl));
|
||||
}
|
||||
|
||||
// 카테고리 xml 파일 위치 지정
|
||||
$this->module_info->category_xml_file = sprintf('./files/cache/blog_category/%d.xml.php', $this->module_info->module_srl);
|
||||
|
||||
// 레이아웃의 정보를 속이기 위해서 layout_srl을 현 블로그의 module_srl로 입력
|
||||
$this->module_info->layout_srl = $this->module_info->module_srl;
|
||||
|
||||
// 모듈정보와 레이아웃에서 사용하기 위한 레이아웃 정보를 세팅
|
||||
Context::set('module_info',$this->module_info);
|
||||
Context::set('layout_info',$this->module_info);
|
||||
|
||||
// rss url 만듬
|
||||
if($this->grant->list) Context::set('rss_url', getUrl('','mid',$this->mid,'act','dispBlogRss'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -553,9 +550,12 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 메뉴 출력
|
||||
* @brief 메뉴 정보
|
||||
**/
|
||||
function dispBlogAdminMenuInfo() {
|
||||
// module_srl을 구함
|
||||
$module_srl = $this->module_info->module_srl;
|
||||
|
||||
$this->setTemplateFile('category_list');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
<!-- 레이아웃과 연동될 css 파일 import -->
|
||||
<!--%import("css/layout.css")-->
|
||||
|
||||
<!-- 블로그 메뉴를 common/js/tree_menu.js를 이용해서 표시 -->
|
||||
<script type="text/javascript">
|
||||
loadTreeMenu("{$module_info->category_xml_file}", "blog_category", "blog_category", "{$module_info->category_name?$module_info->category_name:'category'}", "./?mid={$mid}");
|
||||
loadTreeMenu("./files/cache/blog_category/{$layout_info->layout_srl}.xml.php", "blog_category", "blog_category", "{$layout_info->category_name?$layout_info->category_name:'category'}", "./?mid={$mid}");
|
||||
</script>
|
||||
|
||||
|
||||
|
|
@ -11,12 +10,12 @@
|
|||
<div class="layout_top">
|
||||
|
||||
<div class="layout_logo">
|
||||
<!--@if($module_info->logo_image)-->
|
||||
<a href="./?mid={$mid}"><img src="{$module_info->logo_image}" border="0" alt="{$module_info->browser_title}"/></a>
|
||||
<!--@if($layout_info->logo_image)-->
|
||||
<a href="./?mid={$mid}"><img src="{$layout_info->logo_image}" border="0" alt="{$layout_info->browser_title}"/></a>
|
||||
<!--@end-->
|
||||
|
||||
<!--@if($module_info->top_title)-->
|
||||
<a href="./?mid={$mid}">{$module_info->top_title}</a>
|
||||
<!--@if($layout_info->top_title)-->
|
||||
<a href="./?mid={$mid}">{$layout_info->top_title}</a>
|
||||
<!--@end-->
|
||||
</div>
|
||||
|
||||
|
|
@ -43,25 +42,25 @@
|
|||
|
||||
<!-- 왼쪽 분류 출력 -->
|
||||
<div class="layout_left">
|
||||
<!--@if($module_info->profile || $module_info->profile_image)-->
|
||||
<!--@if($layout_info->profile || $layout_info->profile_image)-->
|
||||
<!-- 프로필 -->
|
||||
<div class="layout_profile">
|
||||
<!--@if($module_info->profile_image)-->
|
||||
<!--@if($layout_info->profile_image)-->
|
||||
<div class="profile_image">
|
||||
<img src="{$module_info->profile_image}" border="0" alt="profile image" />
|
||||
<img src="{$layout_info->profile_image}" border="0" alt="profile image" />
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
<!--@if($module_info->profile)-->
|
||||
<!--@if($layout_info->profile)-->
|
||||
<div class="profile">
|
||||
{$module_info->profile}
|
||||
{$layout_info->profile}
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
<!--@if($logged_info->is_admin == 'Y')-->
|
||||
<!-- 관리자일 경우 블로그 관리 메뉴 -->
|
||||
<div class="layout_admin">
|
||||
<a href="#" onclick="location.href='{getUrl('act','dispBlogAdminBlogInfo','layout_srl',$module_info->layout_srl)}';return false;">{$lang->cmd_management}</a>
|
||||
<a href="#" onclick="location.href='{getUrl('act','dispBlogAdminBlogInfo','layout_srl',$layout_info->layout_srl)}';return false;">{$lang->cmd_management}</a>
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
|
|
|
|||
|
|
@ -35,14 +35,10 @@
|
|||
$args->layout_srl = $layout_srl;
|
||||
$output = executeQuery('layout.getLayout', $args);
|
||||
if(!$output->data) return;
|
||||
|
||||
// layout, extra_vars를 정리한 후 xml 파일 정보를 불러옴 (불러올때 결합)
|
||||
$info = $output->data;
|
||||
$layout_title = $info->title;
|
||||
$layout = $info->layout;
|
||||
$vars = unserialize($info->extra_vars);
|
||||
|
||||
return $this->getLayoutInfo($layout, $layout_srl, $layout_title, $vars);
|
||||
// layout, extra_vars를 정리한 후 xml 파일 정보를 정리해서 return
|
||||
$layout_info = $this->getLayoutInfo($layout, $output->data);
|
||||
return $layout_info;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -82,13 +78,25 @@
|
|||
* @brief 모듈의 conf/info.xml 을 읽어서 정보를 구함
|
||||
* 이것 역시 캐싱을 통해서 xml parsing 시간을 줄인다..
|
||||
**/
|
||||
function getLayoutInfo($layout, $layout_srl = 0, $layout_title = "", $vars = null) {
|
||||
function getLayoutInfo($layout, $info = null) {
|
||||
if($info) {
|
||||
$layout_title = $info->title;
|
||||
$layout = $info->layout;
|
||||
$layout_srl = $info->layout_srl;
|
||||
$vars = unserialize($info->extra_vars);
|
||||
|
||||
if($info->module_srl) {
|
||||
$layout_path = preg_replace('/([a-zA-Z0-9\_\.]+)(\.html)$/','',$info->layout_path);
|
||||
$xml_file = sprintf('%sskin.xml', $layout_path);
|
||||
}
|
||||
}
|
||||
|
||||
// 요청된 모듈의 경로를 구한다. 없으면 return
|
||||
$layout_path = $this->getLayoutPath($layout);
|
||||
if(!$layout_path) return;
|
||||
if(!$layout_path) $layout_path = $this->getLayoutPath($layout);
|
||||
if(!is_dir($layout_path)) return;
|
||||
|
||||
// 현재 선택된 모듈의 스킨의 정보 xml 파일을 읽음
|
||||
$xml_file = sprintf("%sconf/info.xml", $layout_path);
|
||||
if(!$xml_file) $xml_file = sprintf("%sconf/info.xml", $layout_path);
|
||||
if(!file_exists($xml_file)) return;
|
||||
|
||||
// cache 파일을 비교하여 문제 없으면 include하고 $layout_info 변수를 return
|
||||
|
|
@ -101,7 +109,9 @@
|
|||
// cache 파일이 없으면 xml parsing하고 변수화 한 후에 캐시 파일에 쓰고 변수 바로 return
|
||||
$oXmlParser = new XmlParser();
|
||||
$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
|
||||
$xml_obj = $tmp_xml_obj->layout;
|
||||
if($tmp_xml_obj->layout) $xml_obj = $tmp_xml_obj->layout;
|
||||
elseif($tmp_xml_obj->skin) $xml_obj = $tmp_xml_obj->skin;
|
||||
|
||||
if(!$xml_obj) return;
|
||||
|
||||
$buff = '';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<table name="layouts" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="title" var="title" notnull="notnull" />
|
||||
<column name="title" var="title" />
|
||||
<column name="extra_vars" var="extra_vars" />
|
||||
<column name="layout_path" var="layout_path" />
|
||||
</columns>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue