Merge branch 'zentaopms_289' of https://gitlab.zcorp.cc/easycorp/zentaopms into zentaopms_289
This commit is contained in:
@@ -92,14 +92,21 @@ class dev extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function langItem($type = 'common', $module = '', $method = '', $language = 'zh_cn')
|
||||
public function langItem($type = 'common', $module = 'my', $method = '', $language = 'zh_cn')
|
||||
{
|
||||
$language = str_replace('_', '-', $language);
|
||||
if($type == 'second' and empty($module)) $module = 'my';
|
||||
$moduleName = $module;
|
||||
if($type == 'common' or $type == 'first') $moduleName = 'common';
|
||||
if($type == 'second') $moduleName = $module . 'Menu';
|
||||
if($type == 'third') $moduleName = $module . 'SubMenu';
|
||||
|
||||
if($type == 'third')
|
||||
{
|
||||
if(empty($method)) $method = 'work';
|
||||
$moduleName = $module . 'SubMenu';
|
||||
}
|
||||
|
||||
if($type == 'feature' and empty($method)) $method = 'todo';
|
||||
|
||||
if($this->server->request_method == 'POST')
|
||||
{
|
||||
@@ -129,11 +136,8 @@ class dev extends control
|
||||
return $this->send(array('result' => 'success', 'locate' => 'reload', 'message' => $this->lang->saveSuccess));
|
||||
}
|
||||
|
||||
$this->dev->loadDefaultLang();
|
||||
|
||||
$this->view->title = $this->lang->langItem;
|
||||
$this->view->type = $type;
|
||||
$this->view->featureBar = $this->lang->dev->featureBar['langItem'];
|
||||
$this->view->originalLangs = $this->dev->getOriginalLang($type, $module, $method, $language);
|
||||
$this->view->customedLangs = $this->dev->getCustomedLang($type, $module, $method, $language);
|
||||
$this->view->menuTree = $this->dev->getMenuTree($type, $module, $method);
|
||||
|
||||
+61
-52
@@ -2,7 +2,7 @@ $(function()
|
||||
{
|
||||
$(".input-list").on("click", 'input', function(e)
|
||||
{
|
||||
handleClickItem(e.target.id);
|
||||
handleClickItem(e.target.id);
|
||||
});
|
||||
$(".input-list").on("blur", 'input', function(e)
|
||||
{
|
||||
@@ -11,11 +11,15 @@ $(function()
|
||||
|
||||
$('.label-list > .input-label').on('click', function(e)
|
||||
{
|
||||
handleClickItem($(this).attr('labelid'));
|
||||
handleClickItem($(this).attr('labelid'));
|
||||
});
|
||||
|
||||
initMenu();
|
||||
|
||||
$('li.has-list > ul').addClass("menu-active-primary menu-hover-primary")
|
||||
|
||||
handleInputSearch();
|
||||
|
||||
function addActive(id)
|
||||
{
|
||||
$('[labelid=' + id + ']').addClass('text-primary');
|
||||
@@ -42,61 +46,66 @@ $(function()
|
||||
};
|
||||
}
|
||||
|
||||
function handleInputSearch()
|
||||
{
|
||||
$('.menu-tree .search-input').on('input', function()
|
||||
{
|
||||
var val = $(this).val();
|
||||
if (!val)
|
||||
{
|
||||
var updateData = menuTree;
|
||||
}
|
||||
else
|
||||
{
|
||||
var updateData = [];
|
||||
for (var i = 0; i < menuTree.length; i++)
|
||||
{
|
||||
var item = {};
|
||||
$.extend(true, item, menuTree[i])
|
||||
if (item.children)
|
||||
{
|
||||
var children = [];
|
||||
for (var j = 0; j < item.children.length; j++)
|
||||
{
|
||||
if (item.children[j].title.includes(val) || (item.children[j].key && item.children[j].key.includes(val)))
|
||||
{
|
||||
children.push(item.children[j]);
|
||||
}
|
||||
}
|
||||
item.children = children;
|
||||
}
|
||||
if (item.children.length || item.title.includes(val) ||(item.key && item.key.includes(val)))
|
||||
{
|
||||
updateData.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#menuTree').data('zui.tree').reload(updateData);
|
||||
})
|
||||
}
|
||||
|
||||
function initMenu()
|
||||
{
|
||||
if (navTypes.includes(type))
|
||||
{
|
||||
$('#menuTree').tree(
|
||||
if (navTypes.includes(type))
|
||||
{
|
||||
data: menuTree,
|
||||
itemCreator: function($li, item)
|
||||
$('#menuTree').tree(
|
||||
{
|
||||
$li.append('<a data-module="' + item.module + '" data-method="' + item.method + '" data-has-children="' + (item.children ? !!item.children.length : false) + '"class="text-muted""' + '" href=# >' + item.title + '</a>');
|
||||
}
|
||||
});
|
||||
}
|
||||
data: menuTree,
|
||||
initialState: 'active',
|
||||
itemCreator: function($li, item)
|
||||
{
|
||||
$li.append('<a data-module="' + item.module + '" data-method="' + item.method + '" data-has-children="' + (item.children ? !!item.children.length : false) + '" href=# >' + item.title + '</a>');
|
||||
if (item.active) $li.addClass('active open in');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('.menu-tree .search-input').on('input', function()
|
||||
{
|
||||
var val = $(this).val();
|
||||
if (!val)
|
||||
{
|
||||
var updateData = menuTree;
|
||||
}
|
||||
else
|
||||
{
|
||||
var updateData = [];
|
||||
for (var i = 0; i < menuTree.length; i++)
|
||||
{
|
||||
var item = {};
|
||||
$.extend(true, item, menuTree[i])
|
||||
if (item.children)
|
||||
{
|
||||
var children = [];
|
||||
for (var j = 0; j < item.children.length; j++)
|
||||
{
|
||||
if (item.children[j].title.includes(val) || (item.children[j].key && item.children[j].key.includes(val)))
|
||||
{
|
||||
children.push(item.children[j]);
|
||||
}
|
||||
}
|
||||
item.children = children;
|
||||
}
|
||||
if (item.children.length || item.title.includes(val) ||(item.key && item.key.includes(val)))
|
||||
{
|
||||
updateData.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#menuTree').data('zui.tree').reload(updateData);
|
||||
})
|
||||
|
||||
$('#menuTree').on('click', 'a', function(e)
|
||||
{
|
||||
var target = $(e.target);
|
||||
if (target.attr('data-has-children') === 'true') return
|
||||
$('#menuTree').on('click', 'a', function(e)
|
||||
{
|
||||
var target = $(e.target);
|
||||
if (target.attr('data-has-children') === 'true') return
|
||||
|
||||
self.location.href = createLink('dev', 'langItem', 'type=' + type + '&module=' + target.attr('data-module') + '&method=' + target.attr('data-method'));
|
||||
})
|
||||
self.location.href = createLink('dev', 'langItem', 'type=' + type + '&module=' + target.attr('data-module') + '&method=' + target.attr('data-method'));
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
+17
-3
@@ -381,7 +381,7 @@ class devModel extends model
|
||||
elseif($type == 'third')
|
||||
{
|
||||
$langKey = "{$method}_";
|
||||
$lang = $defaultLang->$module->menu->$method['subMenu'];
|
||||
$lang = $defaultLang->$module->menu->{$method}['subMenu'];
|
||||
}
|
||||
|
||||
$menus = $this->getLinkTitle($lang);
|
||||
@@ -559,7 +559,7 @@ class devModel extends model
|
||||
$menusPinYin = common::convert2Pinyin($menuLang);
|
||||
foreach($menuLang as $menuKey => $menuName)
|
||||
{
|
||||
if(!isset($this->lang->$menu->menu->$menuKey['subMenu'])) continue;
|
||||
if(!isset($this->lang->$menu->menu->{$menuKey}['subMenu']) or !get_object_vars($this->lang->$menu->menu->{$menuKey}['subMenu'])) continue;
|
||||
|
||||
$subMenu = new stdClass();
|
||||
$subMenu->title = $menuName;
|
||||
@@ -622,7 +622,21 @@ class devModel extends model
|
||||
$menuTree = array();
|
||||
if(!in_array($type, $this->config->dev->navTypes)) return $menuTree;
|
||||
|
||||
$mainNav = $this->getLinkTitle($this->lang->mainNav);
|
||||
$mainNav = $type == 'second' ? $this->lang->mainNav : array();
|
||||
if($type != 'second')
|
||||
{
|
||||
foreach($this->lang->mainNav as $menuKey => $menu)
|
||||
{
|
||||
if($menuKey == 'project')
|
||||
{
|
||||
foreach($this->config->dev->projectMenus as $subMenuKey) $mainNav[$subMenuKey] = $this->lang->dev->projectMenu[$subMenuKey];
|
||||
}
|
||||
|
||||
$mainNav[$menuKey] = $menu;
|
||||
}
|
||||
}
|
||||
|
||||
$mainNav = $this->getLinkTitle($mainNav);
|
||||
$maimNavPinYin = common::convert2Pinyin($mainNav);
|
||||
|
||||
if(empty($module)) $module = 'my';
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<?php include 'header.html.php';?>
|
||||
<div id='mainMenu' class='clearfix menu-secondary'>
|
||||
<div class="btn-toolBar pull-left">
|
||||
<?php foreach($featureBar as $key => $label):?>
|
||||
<?php foreach($lang->dev->featureBar['langItem'] as $key => $label):?>
|
||||
<?php $active = $type == $key ? 'btn-active-text' : '';?>
|
||||
<?php $label = "<span class='text'>$label</span>";?>
|
||||
<?php echo html::a(inlink('langItem', "type=$key"), $label, '', "class='btn btn-link $active'");?>
|
||||
|
||||
@@ -225,7 +225,6 @@ $lang->product->featureBar['all']['all'] = '全部' . $lang->productCommon;
|
||||
$lang->product->featureBar['all']['noclosed'] = $lang->product->unclosed;
|
||||
$lang->product->featureBar['all']['closed'] = $lang->product->statusList['closed'];
|
||||
|
||||
|
||||
$lang->product->moreSelects['reviewedbyme'] = $lang->product->reviewedByMe;
|
||||
$lang->product->moreSelects['assignedbyme'] = $lang->product->assignedByMe;
|
||||
$lang->product->moreSelects['closedbyme'] = $lang->product->closedByMe;
|
||||
|
||||
@@ -151,6 +151,10 @@ $lang->program->featureBar['browse']['doing'] = '进行中';
|
||||
$lang->program->featureBar['browse']['suspended'] = '已挂起';
|
||||
$lang->program->featureBar['browse']['closed'] = '已关闭';
|
||||
|
||||
$lang->program->featureBar['product']['all'] = '全部' . $lang->productCommon;
|
||||
$lang->program->featureBar['product']['noclosed'] = '未关闭';
|
||||
$lang->program->featureBar['product']['closed'] = '结束';
|
||||
|
||||
$lang->program->kanban = new stdclass();
|
||||
$lang->program->kanban->common = '项目集看板';
|
||||
$lang->program->kanban->typeList['my'] = '我参与的项目集';
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<?php if(!isonlybody()):?>
|
||||
<div class="btn-toolBar pull-left">
|
||||
<?php foreach($lang->product->featureBar['all'] as $key => $label):?>
|
||||
<?php foreach($lang->program->featureBar['product'] as $key => $label):?>
|
||||
<?php $active = $key == $browseType ? 'btn-active-text' : '';?>
|
||||
<?php if($key == $browseType) $label .= " <span class='label label-light label-badge'>{$pager->recTotal}</span>";?>
|
||||
<?php echo html::a(inlink("product", "programID=$programID&browseType=$key&orderBy=$orderBy"), "<span class='text'>{$label}</span>", '', "class='btn btn-link $active'");?>
|
||||
|
||||
Reference in New Issue
Block a user