#18965740 : apply mobile layout and mobile view option to all connected menu items

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7548 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
haneul 2010-06-24 07:50:39 +00:00
parent 220743afea
commit f29f234ddb
5 changed files with 46 additions and 5 deletions

View file

@ -113,4 +113,7 @@
$lang->mobile_layout_list = "모바일 레이아웃 목록";
$lang->mobile_downloaded_list = "모바일 다운로드 목록";
$lang->apply_mobile_view = "모바일 뷰 일괄 적용";
$lang->about_apply_mobile_view = "체크하시면 연결된 모든 메뉴에서 모바일 뷰를 사용합니다.";
?>

View file

@ -70,6 +70,7 @@
unset($extra_vars->layout);
unset($extra_vars->title);
unset($extra_vars->apply_layout);
unset($extra_vars->apply_mobile_view);
$args = Context::gets('layout_srl','title');
@ -87,7 +88,10 @@
$menu_srl_list[] = $menu_srl;
$menu_name_list[$menu_srl] = $output->title;
if(Context::get('apply_layout')=='Y') {
$apply_layout = Context::get('apply_layout');
$apply_mobile_view = Context::get('apply_mobile_view');
if($apply_layout=='Y' || $apply_mobile_view=='Y') {
$menu_args = null;
$menu_args->menu_srl = $menu_srl;
$menu_args->site_srl = $layout_info->site_srl;
@ -100,8 +104,21 @@
if(count($modules)) {
$update_args->module_srls = implode(',',$modules);
$update_args->layout_srl = $args->layout_srl;
$output = executeQuery('layout.updateModuleLayout', $update_args);
if($apply_layout == "Y") {
$update_args->layout_srl = $args->layout_srl;
}
if($layout_info->layout_type == "M")
{
if(Context::get('apply_mobile_view') == "Y")
{
$update_args->use_mobile = "Y";
}
$output = executeQuery('layout.updateModuleMLayout', $update_args);
}
else
{
$output = executeQuery('layout.updateModuleLayout', $update_args);
}
}
}
}

View file

@ -124,6 +124,8 @@
$layout_info->layout = $layout;
$layout_info->path = $layout_path;
$layout_info->layout_title = $layout_title;
if(!$layout_info->layout_type)
$layout_info->layout_type = $layout_type;
return $layout_info;
}
@ -133,7 +135,6 @@
}else{
$cache_file = $this->getUserLayoutCache($layout_srl, Context::getLangType());
}
if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file)) {
@include($cache_file);
@ -174,6 +175,7 @@
$buff .= sprintf('$layout_info->layout_title = $layout_title;');
$buff .= sprintf('$layout_info->license = "%s";', $xml_obj->license->body);
$buff .= sprintf('$layout_info->license_link = "%s";', $xml_obj->license->attrs->link);
$buff .= sprintf('$layout_info->layout_type = "%s";', $layout_type);
// 작성자 정보
if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;

View file

@ -0,0 +1,12 @@
<query id="updateModuleMLayout" action="update">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="mlayout_srl" var="layout_srl" />
<column name="use_mobile" var="use_mobile" />
</columns>
<conditions>
<condition operation="in" column="module_srl" var="module_srls" notnull="notnull" />
</conditions>
</query>

View file

@ -3,7 +3,6 @@
<!--#include("header.html")-->
<h3 class="xeAdmin">{$selected_layout->layout_title}</h3>
<div class="header4">
<ul class="localNavigation">
<li class="on"><a href="#" onclick="return false;">{$lang->cmd_layout_management}</a></li>
@ -124,6 +123,14 @@
{$lang->about_not_apply_menu}
</td>
</tr>
<tr>
<th scope="row"><div>{$lang->apply_mobile_view}</div></th>
<td>
<input type="checkbox" name="apply_mobile_view" value="Y" />
{$lang->about_apply_mobile_view}
</td>
</tr>
<tr class="row2">
<th colspan="2" class="button">