* Modify lite menu.

This commit is contained in:
caoyanyi
2023-02-23 13:55:37 +08:00
parent 0d847aaccc
commit e38e141d03
8 changed files with 54 additions and 36 deletions

View File

@@ -248,3 +248,9 @@ if(!helper::hasFeature('waterfall')) $config->disableFeature = array('design', '
$config->dev->disableMainMenu = array('project', 'product', 'execution');
$config->dev->projectMenus = array('project', 'scrum', 'waterfall', 'kanbanProject');
$config->dev->hideMainMenu = array();
if($config->vision == 'lite')
{
$config->dev->projectMenus = array('project', 'kanbanProject');
$config->dev->hideMainMenu = array('execution', 'kanban');
}

View File

@@ -105,7 +105,16 @@ class dev extends control
if($type == 'third')
{
if(empty($method)) $method = 'work';
if($this->config->vision == 'lite')
{
$module = $module == '' ? 'kanbanProject' : $module;
$method = $method == '' ? 'settings' : $method;
}
elseif(empty($method))
{
$module = 'my';
$method = 'work';
}
$moduleName = $module . 'SubMenu';
}

View File

@@ -197,3 +197,4 @@ $lang->dev->projectMenu['project'] = "{$lang->projectCommon} Common";
$lang->dev->projectMenu['scrum'] = "Scrum {$lang->projectCommon}";
$lang->dev->projectMenu['waterfall'] = "Waterfall {$lang->projectCommon}";
$lang->dev->projectMenu['kanbanProject'] = "Kanban {$lang->projectCommon}";
if($config->vision == 'lite') $lang->dev->projectMenu['kanbanProject'] = $lang->projectCommon;

View File

@@ -197,3 +197,4 @@ $lang->dev->projectMenu['project'] = "{$lang->projectCommon} Common";
$lang->dev->projectMenu['scrum'] = "Scrum {$lang->projectCommon}";
$lang->dev->projectMenu['waterfall'] = "Waterfall {$lang->projectCommon}";
$lang->dev->projectMenu['kanbanProject'] = "Kanban {$lang->projectCommon}";
if($config->vision == 'lite') $lang->dev->projectMenu['kanbanProject'] = $lang->projectCommon;

View File

@@ -197,3 +197,4 @@ $lang->dev->projectMenu['project'] = "{$lang->projectCommon} Common";
$lang->dev->projectMenu['scrum'] = "Scrum {$lang->projectCommon}";
$lang->dev->projectMenu['waterfall'] = "Waterfall {$lang->projectCommon}";
$lang->dev->projectMenu['kanbanProject'] = "Kanban {$lang->projectCommon}";
if($config->vision == 'lite') $lang->dev->projectMenu['kanbanProject'] = $lang->projectCommon;

View File

@@ -198,3 +198,4 @@ $lang->dev->projectMenu['project'] = "{$lang->projectCommon}通用";
$lang->dev->projectMenu['scrum'] = "敏捷{$lang->projectCommon}";
$lang->dev->projectMenu['waterfall'] = "瀑布{$lang->projectCommon}";
$lang->dev->projectMenu['kanbanProject'] = "看板{$lang->projectCommon}";
if($config->vision == 'lite') $lang->dev->projectMenu['kanbanProject'] = $lang->projectCommon;

View File

@@ -411,44 +411,42 @@ class devModel extends model
$langKey = '';
$customeds = array();
if($type == 'common')
switch($type)
{
$customeds = $this->loadModel('custom')->getItems("lang={$language}&module=common&section=&vision={$this->config->vision}");
foreach($customeds as $customed) $customedLangs[$customed->key] = $customed->value;
case 'common':
$customeds = $this->loadModel('custom')->getItems("lang={$language}&module=common&section=&vision={$this->config->vision}");
foreach($customeds as $customed) $customedLangs[$customed->key] = $customed->value;
$customedLangs['URCommon'] = $this->lang->dev->UR == $this->lang->URCommon ? '' : $this->lang->URCommon;
$customedLangs['SRCommon'] = $this->lang->dev->SR == $this->lang->SRCommon ? '' : $this->lang->SRCommon;
if($this->config->custom->URSR)
{
$URSRList = $this->custom->getItems("lang={$language}&module=custom&section=URSRList&key={$this->config->custom->URSR}&vision={$this->config->vision}");
$URSRList = array_shift($URSRList);
if($URSRList)
$customedLangs['URCommon'] = $this->lang->dev->UR == $this->lang->URCommon ? '' : $this->lang->URCommon;
$customedLangs['SRCommon'] = $this->lang->dev->SR == $this->lang->SRCommon ? '' : $this->lang->SRCommon;
if($this->config->custom->URSR)
{
$URSRList = json_decode($URSRList->value);
$customedLangs['URCommon'] = $this->lang->dev->UR == $URSRList->URName ? '' : $URSRList->URName;
$customedLangs['SRCommon'] = $this->lang->dev->SR == $URSRList->SRName ? '' : $URSRList->SRName;
$URSRList = $this->custom->getItems("lang={$language}&module=custom&section=URSRList&key={$this->config->custom->URSR}&vision={$this->config->vision}");
$URSRList = array_shift($URSRList);
if($URSRList)
{
$URSRList = json_decode($URSRList->value);
$customedLangs['URCommon'] = $this->lang->dev->UR == $URSRList->URName ? '' : $URSRList->URName;
$customedLangs['SRCommon'] = $this->lang->dev->SR == $URSRList->SRName ? '' : $URSRList->SRName;
}
}
}
if(!$this->config->URAndSR) unset($customedLangs['SRCommon']);
}
elseif($type == 'first')
{
$customeds = $this->loadModel('custom')->getItems("lang={$language}&module=common&section=mainNav&vision={$this->config->vision}");
$langKey = 'mainNav_';
}
elseif($type == 'second')
{
$customeds = $this->loadModel('custom')->getItems("lang={$language}&module={$module}Menu&vision={$this->config->vision}");
}
elseif($type == 'third')
{
$customeds = $this->loadModel('custom')->getItems("lang={$language}&module={$module}SubMenu&section=$method&vision={$this->config->vision}");
$langKey = "{$method}_";
}
elseif($type == 'feature')
{
$customeds = $this->loadModel('custom')->getItems("lang={$language}&module={$module}&section=featureBar-$method&vision={$this->config->vision}");
$langKey = "featureBar-{$method}_";
if(!$this->config->URAndSR) unset($customedLangs['SRCommon']);
break;
case 'first':
$customeds = $this->loadModel('custom')->getItems("lang={$language}&module=common&section=mainNav&vision={$this->config->vision}");
$langKey = 'mainNav_';
break;
case 'second':
$customeds = $this->loadModel('custom')->getItems("lang={$language}&module={$module}Menu&vision={$this->config->vision}");
break;
case 'third':
$customeds = $this->loadModel('custom')->getItems("lang={$language}&module={$module}SubMenu&section=$method&vision={$this->config->vision}");
$langKey = "{$method}_";
break;
case 'feature':
$customeds = $this->loadModel('custom')->getItems("lang={$language}&module={$module}&section=featureBar-$method&vision={$this->config->vision}");
$langKey = "featureBar-{$method}_";
break;
}
foreach($customeds as $customed)
@@ -657,6 +655,7 @@ class devModel extends model
$childFunc = 'get' . ucfirst($type) . 'Menus';
$menuItem->children = $this->$childFunc($menuKey, $module, $method);
if($type != 'second' and empty($menuItem->children)) continue;
if($type == 'second' and in_array($menuKey, $this->config->dev->hideMainMenu)) continue;
$menuTree[] = $menuItem;
}

View File

@@ -31,7 +31,7 @@
<?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&module=$module&method=$method&language=$language"), $label, '', "class='btn btn-link $active'");?>
<?php echo html::a(inlink('langItem', "type=$key&module=&method=&language=$language"), $label, '', "class='btn btn-link $active'");?>
<?php endforeach;?>
</div>
</div>