* 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
+33 -34
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;
}