mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
#476 메뉴 설명 기능 구현
메뉴 항목마다 설명 항목을 추가합니다. `{$val1['desc']}` 와 같이 레이아웃에서 불러올 수 있습니다.
fontawesome 등을 쉽게 추가할 수 있게 해줍니다.
This commit is contained in:
parent
dee87dcce8
commit
37cea6b1ce
8 changed files with 61 additions and 22 deletions
|
|
@ -1002,4 +1002,7 @@ Menu không phải là người quản lý, nhiệm vụ của nó chỉ là li
|
|||
<value xml:lang="ko"><![CDATA[스킨 없음]]></value>
|
||||
<value xml:lang="jp"><![CDATA[スキン無し]]></value>
|
||||
</item>
|
||||
<item name="menu_desc">
|
||||
<value xml:lang="ko"><![CDATA[메뉴 설명]]></value>
|
||||
</item>
|
||||
</lang>
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ class menuAdminController extends menu
|
|||
|
||||
// recreate menu cache file
|
||||
$this->makeXmlFile($request->menu_srl);
|
||||
|
||||
|
||||
if(!$isProc)
|
||||
{
|
||||
return $this->get('menu_item_srl');
|
||||
|
|
@ -504,6 +504,9 @@ class menuAdminController extends menu
|
|||
$args->is_shortcut = $request->is_shortcut;
|
||||
$args->url = '#';
|
||||
}
|
||||
|
||||
if($request->menu_desc) $args->desc = $request->menu_desc;
|
||||
else $args->desc = '';
|
||||
|
||||
$args->menu_item_srl = getNextSequence();
|
||||
$args->listorder = -1*$args->menu_item_srl;
|
||||
|
|
@ -536,6 +539,9 @@ class menuAdminController extends menu
|
|||
|
||||
if($request->menu_name_key) $args->name = $request->menu_name_key;
|
||||
else $args->name = $request->menu_name;
|
||||
|
||||
if($request->menu_desc) $args->desc = $request->menu_desc;
|
||||
else $args->desc = '';
|
||||
|
||||
if($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
|
||||
{
|
||||
|
|
@ -719,6 +725,8 @@ class menuAdminController extends menu
|
|||
{
|
||||
$args->name = $request->menu_name;
|
||||
}
|
||||
|
||||
$args->desc = $request->menu_desc;
|
||||
|
||||
if(count($args->group_srls) == 0)
|
||||
{
|
||||
|
|
@ -1880,6 +1888,7 @@ class menuAdminController extends menu
|
|||
$name_str = sprintf('$_names = array(%s); print $_names[$lang_type];', $name_arr_str);
|
||||
|
||||
$url = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->url);
|
||||
$desc = str_replace(array('&','"','<'),array('&','"','<'),$node->desc);
|
||||
if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
|
||||
{
|
||||
$href = "getSiteUrl('$domain', '','mid','$node->url')";
|
||||
|
|
@ -1915,7 +1924,7 @@ class menuAdminController extends menu
|
|||
if($group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))',$group_srls,$group_srls == -1?1:0);
|
||||
else $group_check_code = "true";
|
||||
$attribute = sprintf(
|
||||
'node_srl="%s" parent_srl="%s" menu_name_key=\'%s\' text="<?php if(%s) { %s }?>" url="<?php print(%s?"%s":"")?>" href="<?php print(%s?%s:"")?>" is_shortcut="%s" open_window="%s" expand="%s" normal_btn="%s" hover_btn="%s" active_btn="%s" link="<?php if(%s) {?>%s<?php }?>"',
|
||||
'node_srl="%s" parent_srl="%s" menu_name_key=\'%s\' text="<?php if(%s) { %s }?>" url="<?php print(%s?"%s":"")?>" href="<?php print(%s?%s:"")?>" is_shortcut="%s" desc="%s" open_window="%s" expand="%s" normal_btn="%s" hover_btn="%s" active_btn="%s" link="<?php if(%s) {?>%s<?php }?>"',
|
||||
$menu_item_srl,
|
||||
$node->parent_srl,
|
||||
addslashes($node->name),
|
||||
|
|
@ -1926,6 +1935,7 @@ class menuAdminController extends menu
|
|||
$group_check_code,
|
||||
$href,
|
||||
$is_shortcut,
|
||||
$desc,
|
||||
$open_window,
|
||||
$expand,
|
||||
$normal_btn,
|
||||
|
|
@ -1981,6 +1991,7 @@ class menuAdminController extends menu
|
|||
// List variables
|
||||
$href = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->href);
|
||||
$url = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->url);
|
||||
$desc = str_replace(array('&','"','<'),array('&','"','<'),$node->desc);
|
||||
if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
|
||||
{
|
||||
$href = "getSiteUrl('$domain', '','mid','$node->url')";
|
||||
|
|
@ -2030,7 +2041,7 @@ class menuAdminController extends menu
|
|||
}
|
||||
// Create properties (check if it belongs to the menu node by url_list. It looks a trick but fast and powerful)
|
||||
$attribute = sprintf(
|
||||
'"node_srl"=>"%s","parent_srl"=>"%s","menu_name_key"=>\'%s\',"isShow"=>(%s?true:false),"text"=>(%s?$_menu_names[%d][$lang_type]:""),"href"=>(%s?%s:""),"url"=>(%s?"%s":""),"is_shortcut"=>"%s","open_window"=>"%s","normal_btn"=>"%s","hover_btn"=>"%s","active_btn"=>"%s","selected"=>(array(%s)&&in_array(Context::get("mid"),array(%s))?1:0),"expand"=>"%s", "list"=>array(%s), "link"=>(%s? ( array(%s)&&in_array(Context::get("mid"),array(%s)) ?%s:%s):""),',
|
||||
'"node_srl"=>"%s","parent_srl"=>"%s","menu_name_key"=>\'%s\',"isShow"=>(%s?true:false),"text"=>(%s?$_menu_names[%d][$lang_type]:""),"href"=>(%s?%s:""),"url"=>(%s?"%s":""),"is_shortcut"=>"%s","desc"=>\'%s\',"open_window"=>"%s","normal_btn"=>"%s","hover_btn"=>"%s","active_btn"=>"%s","selected"=>(array(%s)&&in_array(Context::get("mid"),array(%s))?1:0),"expand"=>"%s", "list"=>array(%s), "link"=>(%s? ( array(%s)&&in_array(Context::get("mid"),array(%s)) ?%s:%s):""),',
|
||||
$node->menu_item_srl,
|
||||
$node->parent_srl,
|
||||
addslashes($node->name),
|
||||
|
|
@ -2042,6 +2053,7 @@ class menuAdminController extends menu
|
|||
$group_check_code,
|
||||
$url,
|
||||
$is_shortcut,
|
||||
$desc,
|
||||
$open_window,
|
||||
$normal_btn,
|
||||
$hover_btn,
|
||||
|
|
@ -2228,4 +2240,4 @@ class menuAdminController extends menu
|
|||
}
|
||||
}
|
||||
/* End of file menu.admin.controller.php */
|
||||
/* Location: ./modules/menu/menu.admin.controller.php */
|
||||
/* Location: ./modules/menu/menu.admin.controller.php */
|
||||
|
|
@ -79,6 +79,7 @@ class menuAdminView extends menu
|
|||
$menuItems = new stdClass();
|
||||
$menuItems->menuSrl = $value->menu_srl;
|
||||
$menuItems->title = $value->title;
|
||||
$menuItems->desc = $value->desc;
|
||||
$menuItems->menuItems = $menu;
|
||||
$menuList[] = $menuItems;
|
||||
}
|
||||
|
|
@ -194,4 +195,4 @@ class menuAdminView extends menu
|
|||
}
|
||||
}
|
||||
/* End of file menu.admin.view.php */
|
||||
/* Location: ./modules/menu/menu.admin.view.php */
|
||||
/* Location: ./modules/menu/menu.admin.view.php */
|
||||
|
|
@ -47,6 +47,11 @@ class menu extends ModuleObject
|
|||
$temp_menus = executeQueryArray('menu.getMenuByTitle', $args);
|
||||
if($temp_menus->toBool() && count($temp_menus->data)) return true;
|
||||
|
||||
// 2015. 06. 15 add column desc
|
||||
if(!$oDB->isColumnExists('menu_item', 'desc'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -68,6 +73,12 @@ class menu extends ModuleObject
|
|||
{
|
||||
$oDB->addIndex('menu', 'idx_title', array('title'));
|
||||
}
|
||||
|
||||
// 2015. 06. 15 add column desc
|
||||
if(!$oDB->isColumnExists('menu_item', 'desc'))
|
||||
{
|
||||
$oDB->addColumn('menu_item', 'desc','varchar',250,"",true);
|
||||
}
|
||||
|
||||
// 1.7(maserati) shortcut column add and mirgration
|
||||
if(!$oDB->isColumnExists('menu_item', 'is_shortcut'))
|
||||
|
|
@ -227,4 +238,4 @@ class menu extends ModuleObject
|
|||
}
|
||||
}
|
||||
/* End of file menu.class.php */
|
||||
/* Location: ./modules/menu/menu.class.php */
|
||||
/* Location: ./modules/menu/menu.class.php */
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
<column name="parent_srl" var="parent_srl" filter="number" default="0" />
|
||||
<column name="menu_srl" var="menu_srl" filter="number" notnull="notnull" />
|
||||
<column name="name" var="name" notnull="notnull" />
|
||||
<column name="desc" var="desc" />
|
||||
<column name="url" var="url" />
|
||||
<column name="is_shortcut" var="is_shortcut" notnull="notnull" default="N" />
|
||||
<column name="open_window" var="open_window" />
|
||||
|
|
@ -18,4 +19,4 @@
|
|||
<column name="listorder" var="listorder" notnull="notnull" />
|
||||
<column name="regdate" var="regdate" default="curdate()" />
|
||||
</columns>
|
||||
</query>
|
||||
</query>
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
<column name="menu_srl" var="menu_srl" />
|
||||
<column name="parent_srl" var="parent_srl" />
|
||||
<column name="name" var="name" notnull="notnull" />
|
||||
<column name="desc" var="desc" />
|
||||
<column name="url" var="url" />
|
||||
<column name="is_shortcut" var="is_shortcut" />
|
||||
<column name="open_window" var="open_window" />
|
||||
|
|
@ -18,4 +19,4 @@
|
|||
<conditions>
|
||||
<condition operation="equal" column="menu_item_srl" var="menu_item_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
</query>
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
<column name="parent_srl" type="number" size="12" notnull="notnull" default="0" />
|
||||
<column name="menu_srl" type="number" size="12" notnull="notnull" index="idx_menu_srl" />
|
||||
<column name="name" type="text" />
|
||||
<column name="desc" type="varchar" size="250" />
|
||||
<column name="url" type="varchar" size="250" />
|
||||
<column name="is_shortcut" type="char" size="1" default="N" />
|
||||
<column name="open_window" type="char" size="1" default="N" />
|
||||
|
|
@ -13,4 +14,4 @@
|
|||
<column name="group_srls" type="text" />
|
||||
<column name="listorder" type="number" size="11" default="0" index="idx_listorder" />
|
||||
<column name="regdate" type="date" index="idx_regdate" />
|
||||
</table>
|
||||
</table>
|
||||
|
|
@ -166,6 +166,12 @@
|
|||
<input id="menuName2" class="_menuName lang_code" type="text" required>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="multilingual x_input-append">
|
||||
<label for="lang_menuDesc">{$lang->menu_desc}</label>
|
||||
<input id="menuDesc" class="_menuDesc lang_code" type="text" required>
|
||||
</div>
|
||||
</li>
|
||||
<li class="typePage">
|
||||
<label for="mid1">{$lang->menu_id} <a href="#help_menuId" class="x_icon-question-sign" data-admin-toggle="#mid1_help">{$lang->help}</a></label>
|
||||
<div id="mid1_help" class="x_alert x_alert-info" style="display:none;width:169px">
|
||||
|
|
@ -223,6 +229,12 @@
|
|||
<input id="menuName" class="_menuName lang_code" type="text" required>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="multilingual x_input-append">
|
||||
<label for="lang_menuDesc">{$lang->menu_desc}</label>
|
||||
<input id="menuDesc" class="_menuDesc lang_code" type="text" required>
|
||||
</div>
|
||||
</li>
|
||||
<li style="padding:6px 0 0 0">
|
||||
<label><input type="checkbox" class="_newWindow" title="{$lang->menu_open_window}"> {$lang->menu_open_window}</label>
|
||||
</li>
|
||||
|
|
@ -1847,6 +1859,7 @@ jQuery(function($){
|
|||
});
|
||||
$('#add_menu ._save').bind("click", function(){
|
||||
var sMenuName = $('#add_menu ._menuName').val();
|
||||
var sMenuDesc = $('#add_menu ._menuDesc').val();
|
||||
var sUrl = $('#add_menu ._mid').val();
|
||||
var sTargetKey = "module_id";
|
||||
|
||||
|
|
@ -1895,21 +1908,14 @@ jQuery(function($){
|
|||
params['act'] = "procMenuAdminInsertItem";
|
||||
params['menu_name_key'] = "";
|
||||
params['menu_name'] = sMenuName;
|
||||
params['menu_desc'] = sMenuDesc;
|
||||
params['module_type'] = sSelectedModuleName;
|
||||
params['menu_open_window'] = "N";
|
||||
params['menu_expand'] = "N";
|
||||
params['is_shortcut'] = isShortCut;
|
||||
params['parent_srl'] = sSelectedMenuSrl;
|
||||
params[sTargetKey] = sUrl;
|
||||
|
||||
/*
|
||||
Array
|
||||
(
|
||||
[error] => "0"
|
||||
[message] => "등록했습니다."
|
||||
[menu_item_srl] => "2"
|
||||
)
|
||||
*/
|
||||
|
||||
$.exec_json("menu.procMenuAdminInsertItem", params, function(htData){
|
||||
// select the newly created menu
|
||||
//$._xeAdminVar.sSelectOnload = htData.menu_item_srl;
|
||||
|
|
@ -1937,6 +1943,7 @@ jQuery(function($){
|
|||
|
||||
//$(this).find('#menuName').val(htInfo.sText);
|
||||
$(this).find('#menuName').val(htInfo.sMenuNameKey);
|
||||
$(this).find('#menuDesc').val(htInfo.desc);
|
||||
//menu_name_key
|
||||
|
||||
$(this).find('#mid2').val(htInfo.url);
|
||||
|
|
@ -1952,9 +1959,9 @@ jQuery(function($){
|
|||
showMenuSelector($(this).find('._menuSelector_menuTreeContainer'), htInfo.url);
|
||||
}else{
|
||||
// URL shortcut
|
||||
var htInfo_url = htInfo.url;
|
||||
htInfo_url = htInfo_url.replace(/&/g, '&');
|
||||
htInfo.url = htInfo_url;
|
||||
var htInfo_url = htInfo.url;
|
||||
htInfo_url = htInfo_url.replace(/&/g, '&');
|
||||
htInfo.url = htInfo_url;
|
||||
$(this).find('a[href="#fix_linkUrl"]').click();
|
||||
$(this).find('._url_link').val($('<div />').text(htInfo.url).text());
|
||||
|
||||
|
|
@ -1990,6 +1997,7 @@ jQuery(function($){
|
|||
var htInfo = htNodeInfo[$._xeAdminVar.sSelectedMenuSrl];
|
||||
|
||||
var sMenuName = $('#default ._menuName').val();
|
||||
var sMenuDesc = $('#default ._menuDesc').val();
|
||||
var sMID;
|
||||
|
||||
var sNewWindow = $('#default ._newWindow').attr("checked")?"Y":"N";
|
||||
|
|
@ -2015,6 +2023,7 @@ jQuery(function($){
|
|||
}
|
||||
params['menu_item_srl'] = sSelectedMenuSrl;
|
||||
params['menu_name'] = sMenuName;
|
||||
params['menu_desc'] = sMenuDesc;
|
||||
params['menu_open_window'] = sNewWindow;
|
||||
params['menu_expand'] = sLeaveUnfolded;
|
||||
params['browser_title'] = sBrowserTitle;
|
||||
|
|
@ -4110,4 +4119,4 @@ jQuery.extend({
|
|||
}
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue