mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Add option to change layout of entire menu #1186
This commit is contained in:
parent
0e9c234bc5
commit
830b77bb64
7 changed files with 119 additions and 6 deletions
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
<action name="procMenuAdminInsert" type="controller" ruleset="insertMenu" />
|
||||
<action name="procMenuAdminUpdate" type="controller" ruleset="updateMenuTitle" />
|
||||
<action name="procMenuAdminUpdateDesign" type="controller" ruleset="updateMenuDesign" />
|
||||
<action name="procMenuAdminDelete" type="controller" />
|
||||
<action name="procMenuAdminInsertItem" type="controller" ruleset="insertMenuItem" />
|
||||
<action name="procMenuAdminUpdateItem" type="controller" ruleset="updateMenuItem" />
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ $lang->collapsing = 'Collapse';
|
|||
$lang->expanding = 'Expand';
|
||||
$lang->edit_sitemap = 'Edit Sitemap';
|
||||
$lang->sitemap_name = 'Sitemap Name';
|
||||
$lang->sitemap_batch_design = 'Select Design';
|
||||
$lang->add_menu = 'Add Menu Item';
|
||||
$lang->edit_menu = 'Edit Menu';
|
||||
$lang->sitemap = 'Sitemap';
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ $lang->collapsing = '접기';
|
|||
$lang->expanding = '펼치기';
|
||||
$lang->edit_sitemap = '사이트맵 편집';
|
||||
$lang->sitemap_name = '사이트맵 이름';
|
||||
$lang->sitemap_batch_design = '디자인 일괄 적용';
|
||||
$lang->add_menu = '메뉴 추가';
|
||||
$lang->edit_menu = '메뉴 편집';
|
||||
$lang->sitemap = '사이트맵';
|
||||
|
|
|
|||
|
|
@ -240,6 +240,57 @@ class menuAdminController extends menu
|
|||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the menu design (layout)
|
||||
*/
|
||||
public function procMenuAdminUpdateDesign()
|
||||
{
|
||||
$vars = Context::getRequestVars();
|
||||
$menu_srl = intval($vars->menu_srl);
|
||||
$layout_P = intval($vars->layout_P);
|
||||
$layout_M = intval($vars->layout_M);
|
||||
if (!$layout_P && !$layout_M)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$args = new stdClass;
|
||||
$args->menu_srl = $menu_srl;
|
||||
$output = executeQueryArray('layout.getLayoutModules', $args);
|
||||
if ($output->data)
|
||||
{
|
||||
$module_srls = array_map(function($item) { return $item->module_srl; }, $output->data);
|
||||
if (count($module_srls))
|
||||
{
|
||||
$args = new stdClass;
|
||||
$args->module_srls = $module_srls;
|
||||
if ($layout_P)
|
||||
{
|
||||
$args->layout_srl = $layout_P;
|
||||
$output = executeQuery('layout.updateModuleLayout', $args);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
Rhymix\Framework\Cache::clearGroup('site_and_module');
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
if ($layout_M)
|
||||
{
|
||||
$args->layout_srl = $layout_M;
|
||||
$args->use_mobile = 'Y';
|
||||
$output = executeQuery('layout.updateModuleMLayout', $args);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
Rhymix\Framework\Cache::clearGroup('site_and_module');
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
Rhymix\Framework\Cache::clearGroup('site_and_module');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete menu process method
|
||||
* @return void|Object
|
||||
|
|
|
|||
|
|
@ -86,6 +86,13 @@ class menuAdminView extends menu
|
|||
}
|
||||
Context::set('group_list', $groupList);
|
||||
|
||||
// Get layout instance list
|
||||
$oLayoutModel = getModel('layout');
|
||||
$layouts_P = $oLayoutModel->getLayoutList(0, 'P') ?: [];
|
||||
$layouts_M = $oLayoutModel->getLayoutList(0, 'M') ?: [];
|
||||
Context::set('layouts_P', $layouts_P);
|
||||
Context::set('layouts_M', $layouts_M);
|
||||
|
||||
$this->setTemplateFile('sitemap');
|
||||
}
|
||||
|
||||
|
|
|
|||
10
modules/menu/ruleset/updateMenuDesign.xml
Normal file
10
modules/menu/ruleset/updateMenuDesign.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ruleset version="1.5.0">
|
||||
<customrules>
|
||||
</customrules>
|
||||
<fields>
|
||||
<field name="menu_srl" required="true" rule="number" />
|
||||
<field name="layout_P" required="true" />
|
||||
<field name="layout_M" required="true" />
|
||||
</fields>
|
||||
</ruleset>
|
||||
|
|
@ -82,6 +82,7 @@
|
|||
<ul class="nav">
|
||||
<li><a href="#sitemap_general" data-admin-show="#sitemap_general">{$lang->edit_sitemap} <i class="x_icon-circle-arrow-right"></i></a></li>
|
||||
<li><a href="#add" data-admin-show="#add">{$lang->add_menu} <i class="x_icon-circle-arrow-right"></i></a></li>
|
||||
<li><a href="#sitemap_batch_design" data-admin-show="#sitemap_batch_design">{$lang->sitemap_batch_design} <i class="x_icon-circle-arrow-right"></i></a></li>
|
||||
<li><button type="button" class="_edit_paste" disabled>{$lang->paste}</button></li>
|
||||
<li><button class="_delSiteMap" type="button">{$lang->cmd_delete}</button></li>
|
||||
<li><button class="_renameSiteMap" type="button">{$lang->change_name}</button></li>
|
||||
|
|
@ -131,6 +132,38 @@
|
|||
</section>
|
||||
<button type="button" class="x_close" data-admin-hide="#properties">×</button>
|
||||
</div>
|
||||
<div class="col" id="sitemap_batch_design" style="display:none">
|
||||
<section>
|
||||
<h1>{$lang->sitemap_batch_design}</h1>
|
||||
<div class="cnt">
|
||||
<ul class="_itemList">
|
||||
<li>
|
||||
<label for="layout_P">{$lang->pc} {$lang->layout}</label>
|
||||
<select name="layout_P" id="layout_P">
|
||||
<option value="0"></option>
|
||||
<!--@foreach($layouts_P as $layout_i)-->
|
||||
<option value="{$layout_i->layout_srl}">{$layout_i->title}</option>
|
||||
<!--@endforeach-->
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label for="layout_M">{$lang->mobile} {$lang->layout}</label>
|
||||
<select name="layout_M" id="layout_M">
|
||||
<option value="0"></option>
|
||||
<!--@foreach($layouts_M as $layout_i)-->
|
||||
<option value="{$layout_i->layout_srl}">{$layout_i->title}</option>
|
||||
<!--@endforeach-->
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="btnBoth">
|
||||
<button type="reset" class="x_btn x_pull-left" data-admin-hide="#sitemap_batch_design">{$lang->cmd_cancel}</button>
|
||||
<button type="button" class="x_btn x_btn-primary x_pull-right _save">{$lang->cmd_confirm}</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<button type="button" class="x_close" data-admin-hide="#sitemap_batch_design">×</button>
|
||||
</div>
|
||||
<div class="col" id="add" style="display:none">
|
||||
<section>
|
||||
<h1>{$lang->add_menu}</h1>
|
||||
|
|
@ -366,14 +399,14 @@
|
|||
<div class="x_tab-content">
|
||||
<div class="x_tab-pane x_active" id="pc">
|
||||
<div class="shadow">
|
||||
<iframe name="_pc_preview_ifr" src="about:_blank"></iframe><i class="mask"><span></span></i>
|
||||
<iframe name="_pc_preview_ifr" src=""></iframe><i class="mask"><span></span></i>
|
||||
<input type="submit" class="x_icon-zoom-in x_icon-white _pc_preview_open" value="{$lang->view_zoom}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_tab-pane" id="mobile">
|
||||
<label class="mvOption"><input type="checkbox" name="use_mobile" value="Y"> {$lang->use_mobile_view}</label>
|
||||
<div class="shadow">
|
||||
<iframe name="_mobile_preview_ifr" src="about:_blank"></iframe><i class="mask"><span></span></i>
|
||||
<iframe name="_mobile_preview_ifr" src=""></iframe><i class="mask"><span></span></i>
|
||||
<input type="submit" class="x_icon-zoom-in x_icon-white _mobile_preview_open" value="{$lang->view_zoom}" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -656,7 +689,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<iframe name="submitTarget" src="about:_blank" style="position:absolute; top:-10000px; left:-10000px; width:1025px;height:769px"></iframe>
|
||||
<iframe name="submitTarget" src="" style="position:absolute; top:-10000px; left:-10000px; width:1025px;height:769px"></iframe>
|
||||
|
||||
<script>
|
||||
xe.lang.shortcut = '{$lang->shortcut}';
|
||||
|
|
@ -1546,7 +1579,16 @@ jQuery(function($){
|
|||
});
|
||||
*/
|
||||
});
|
||||
|
||||
$('#sitemap_batch_design ._save').click(function(){
|
||||
var params = {
|
||||
menu_srl: $._xeAdminVar.sSelectedMenuSrl,
|
||||
layout_P: $('#layout_P').val(),
|
||||
layout_M: $('#layout_M').val()
|
||||
};
|
||||
$.exec_json('menu.procMenuAdminUpdateDesign', params, function(){
|
||||
loadSiteMap();
|
||||
});
|
||||
});
|
||||
$('#properties ._edit_copy').click(function(){
|
||||
//console.log(2, $._xeAdminVar.sSelectedMenuSrl);
|
||||
|
||||
|
|
@ -3983,8 +4025,8 @@ top.fullSetupWinLoaded = function(){
|
|||
var $body = $(oWin.document.body);
|
||||
|
||||
var $form = $body.find('form[enctype="multipart/form-data"]');
|
||||
//<iframe name="submitTarget" src="about:_blank" style="position:absolute; top:-10000px; left:-10000px; width:1025px;height:769px"></iframe>
|
||||
var $target = $("<iframe>").attr('name', 'submitTarget').attr('src', 'about:_blank').attr('style', 'position:absolute; top:-10000px; left:-10000px; width:1025px;height:769px');
|
||||
//<iframe name="submitTarget" src="" style="position:absolute; top:-10000px; left:-10000px; width:1025px;height:769px"></iframe>
|
||||
var $target = $("<iframe>").attr('name', 'submitTarget').attr('src', '').attr('style', 'position:absolute; top:-10000px; left:-10000px; width:1025px;height:769px');
|
||||
$form.append($target);
|
||||
|
||||
$form.append($("<INPUT>").attr("type", "hidden").attr("name", "xe_js_callback").attr("value", "top.opener.top.fullSetupDone"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue