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

This commit is contained in:
zero 2007-03-08 05:54:13 +00:00
parent 79ac997400
commit 1a62c23c70
5 changed files with 42 additions and 9 deletions

View file

@ -33,7 +33,7 @@
require_once("./classes/template/TemplateHandler.class.php"); require_once("./classes/template/TemplateHandler.class.php");
$oTemplate = new TemplateHandler(); $oTemplate = new TemplateHandler();
$output = $oTemplate->compile($oModule->layout_path, $oModule->layout_file); $output = $oTemplate->compile($oModule->getLayoutPath(), $oModule->getLayoutFile());
} else { } else {
$output = $content; $output = $content;
} }

View file

@ -162,9 +162,19 @@
} }
} }
// 해당 모듈에 layout_srl이 있는지 확인
if($oModule->module_info->layout_srl) {
// layout_srl이 있으면 해당 레이아웃 정보를 가져와 layout_path/ layout_file 위치 변경
$oLayoutModel = &getModel('layout');
$layout_info = $oLayoutModel->getLayout($oModule->module_info->layout_srl);
Context::set('layout_info', $layout_info);
$oModule->setLayoutPath($layout_info->path);
$oModule->setLayoutFile('layout');
}
// 컨텐츠 출력 // 컨텐츠 출력
$oDisplayHandler = new DisplayHandler(); $oDisplayHandler = new DisplayHandler();
$oDisplayHandler->printContent($oModule); $oDisplayHandler->printContent($oModule);
// DB 및 기타 자원의 종결 처리 // DB 및 기타 자원의 종결 처리

View file

@ -0,0 +1,10 @@
<!--#include("./common/tpl/common_header.html")-->
<script type="text/javascript">
xAddEventListener(window,'load', function() { loadTreeMenu("{$layout_info->menu->main_menu->xml_file}", "main_menu", "menu", "haha"); });
</script>
<div id="menu" style="float:left;margin-right:20px;"></div>
<div id="content" style="float:left;">{$content}</div>
<!--#include("./common/tpl/common_footer.html")-->

View file

@ -242,6 +242,7 @@
$tree[$parent_srl][$menu_srl] = $node; $tree[$parent_srl][$menu_srl] = $node;
} }
// 파일 생성 // 파일 생성
$xml_buff = "<root>".$this->getXmlTree($tree[0], $tree)."</root>"; $xml_buff = "<root>".$this->getXmlTree($tree[0], $tree)."</root>";
@ -261,9 +262,21 @@
$child_buff = ""; $child_buff = "";
if($menu_srl&&$tree[$menu_srl]) $child_buff = $this->getXmlTree($tree[$menu_srl], $tree); if($menu_srl&&$tree[$menu_srl]) $child_buff = $this->getXmlTree($tree[$menu_srl], $tree);
$attribute = sprintf(
'node_srl="%s" text="%s" url="%s" open_window="%s" normal_btn="%s" hover_btn="%s" active_btn="%s" group_srls="%s"',
$node->menu_srl,
str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->name),
str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url),
$node->open_window,
str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn),
str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->hover_btn),
str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->active_btn),
$node->group_srls
);
if($child_buff) $buff .= sprintf('<node node_srl="%s" text="%s">%s</node>', $node->menu_srl, $node->name, $child_buff); if($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
else $buff .= sprintf('<node node_srl="%s" text="%s" />', $node->menu_srl, $node->name); else $buff .= sprintf('<node %s />', $attribute);
} }
return $buff; return $buff;
} }

View file

@ -12,14 +12,14 @@
<!--@end--> <!--@end-->
<tr> <tr>
<th rowspan="2">{$lang->menu_name}</th> <th rowspan="2">{$lang->menu_name}</th>
<td><input type="text" name="menu_name" value="{$menu_info->name}" /></td> <td><input type="text" name="menu_name" value="{htmlspecialchars($menu_info->name)}" /></td>
</tr> </tr>
<tr> <tr>
<td>{$lang->about_menu_name}</td> <td>{$lang->about_menu_name}</td>
</tr> </tr>
<tr> <tr>
<th rowspan="2">{$lang->menu_url}</th> <th rowspan="2">{$lang->menu_url}</th>
<td><input type="text" name="menu_url" value="{$menu_info->url}" /></td> <td><input type="text" name="menu_url" value="{htmlspecialchars($menu_info->url)}" /></td>
</tr> </tr>
<tr> <tr>
<td>{$lang->about_menu_url}</td> <td>{$lang->about_menu_url}</td>
@ -37,15 +37,15 @@
</tr> </tr>
<tr> <tr>
<td>{$lang->menu_normal_btn}</td> <td>{$lang->menu_normal_btn}</td>
<td><input type="text" name="menu_normal_btn" value="{$menu_info->normal_btn}" /></td> <td><input type="text" name="menu_normal_btn" value="{htmlspecialchars($menu_info->normal_btn)}" /></td>
</tr> </tr>
<tr> <tr>
<td>{$lang->menu_hover_btn}</td> <td>{$lang->menu_hover_btn}</td>
<td><input type="text" name="menu_hover_btn" value="{$menu_info->hover_btn}" /></td> <td><input type="text" name="menu_hover_btn" value="{htmlspecialchars($menu_info->hover_btn)}" /></td>
</tr> </tr>
<tr> <tr>
<td>{$lang->menu_active_btn}</td> <td>{$lang->menu_active_btn}</td>
<td><input type="text" name="menu_active_btn" value="{$menu_info->active_btn}" /></td> <td><input type="text" name="menu_active_btn" value="{htmlspecialchars($menu_info->active_btn)}" /></td>
</tr> </tr>
<tr> <tr>
<th rowspan="2">{$lang->menu_group_srls}</th> <th rowspan="2">{$lang->menu_group_srls}</th>