Merge branch 'zentaopms_289' into '289_language'
# Conflicts: # module/dev/model.php
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
* @version $Id: English.php 824 2010-05-02 15:32:06Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
$lang->api = new stdclass();
|
||||
$lang->api->common = 'API';
|
||||
$lang->api->getModel = 'Super Model API';
|
||||
$lang->api->sql = 'SQL Query API';
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
* @version $Id: English.php 824 2010-05-02 15:32:06Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
$lang->api = new stdclass();
|
||||
$lang->api->common = 'API';
|
||||
$lang->api->getModel = 'Super Model API';
|
||||
$lang->api->sql = 'SQL Query API';
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
* @version $Id: English.php 824 2010-05-02 15:32:06Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
$lang->api = new stdclass();
|
||||
$lang->api->common = 'API';
|
||||
$lang->api->getModel = 'Super Model API';
|
||||
$lang->api->sql = 'SQL Query API';
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
* @version $Id: English.php 824 2010-05-02 15:32:06Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
$lang->api = new stdclass();
|
||||
$lang->api->common = 'API';
|
||||
$lang->api->getModel = 'Super Model API';
|
||||
$lang->api->sql = 'SQL Query API';
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
* @version $Id: zh-cn.php 5129 2013-07-15 00:16:07Z zhujinyonging@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
$lang->api = new stdclass();
|
||||
$lang->api->common = 'API接口';
|
||||
$lang->api->getModel = '超级model调用接口';
|
||||
$lang->api->sql = 'SQL查询接口';
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
* @version $Id: zh-tw.php 5129 2013-07-15 00:16:07Z zhujinyonging@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
$lang->api = new stdclass();
|
||||
$lang->api->common = 'API介面';
|
||||
$lang->api->getModel = '超級model調用介面';
|
||||
$lang->api->sql = 'SQL查詢介面';
|
||||
|
||||
@@ -14,7 +14,6 @@ $lang->dev->post = 'POST Parameter';
|
||||
$lang->dev->modifyValue = 'modifyValue';
|
||||
$lang->dev->defaultValue = 'defaultValue';
|
||||
|
||||
|
||||
$lang->dev->paramRange = 'Parameter Range: %s';
|
||||
$lang->dev->paramDate = 'Date format: YY-mm-dd, e.g 2019-01-01';
|
||||
$lang->dev->paramColor = 'Color format: #RGB, e.g. #3da7f5';
|
||||
@@ -23,10 +22,13 @@ $lang->dev->noteEditor = "The editor is disabled for security reasons. To us
|
||||
$lang->dev->noteTranslate = "The translation is disabled for security reasons. To use this feature, please go to the official website to download and install the plugin of <a href='https://www.zentao.net/extension-viewExt-151.html' target='_blank'>translation</a>.";
|
||||
$lang->dev->confirmRestore = 'Do you want to reset?';
|
||||
|
||||
$lang->dev->default = 'Default';
|
||||
$lang->dev->change = 'Change';
|
||||
$lang->dev->UR = 'Epic';
|
||||
$lang->dev->SR = 'Story';
|
||||
$lang->dev->language = 'Language: %s';
|
||||
$lang->dev->default = 'Default';
|
||||
$lang->dev->currentLang = 'Current Language';
|
||||
$lang->dev->change = 'Change';
|
||||
$lang->dev->UR = 'Epic';
|
||||
$lang->dev->SR = 'Story';
|
||||
$lang->dev->branch = 'Branch';
|
||||
|
||||
$lang->dev->fields = array();
|
||||
$lang->dev->fields['id'] = 'ID';
|
||||
|
||||
@@ -14,7 +14,6 @@ $lang->dev->post = 'POST Parameter';
|
||||
$lang->dev->modifyValue = 'modifyValue';
|
||||
$lang->dev->defaultValue = 'defaultValue';
|
||||
|
||||
|
||||
$lang->dev->paramRange = 'Parameter Range: %s';
|
||||
$lang->dev->paramDate = 'Date format: YY-mm-dd, e.g 2019-01-01';
|
||||
$lang->dev->paramColor = 'Color format: #RGB, e.g. #3da7f5';
|
||||
@@ -23,10 +22,13 @@ $lang->dev->noteEditor = "The editor is disabled for security reasons. To us
|
||||
$lang->dev->noteTranslate = "The translation is disabled for security reasons. To use this feature, please go to the official website to download and install the plugin of <a href='https://www.zentao.net/extension-viewExt-151.html' target='_blank'>translation</a>.";
|
||||
$lang->dev->confirmRestore = 'Do you want to reset?';
|
||||
|
||||
$lang->dev->default = 'Default';
|
||||
$lang->dev->change = 'Change';
|
||||
$lang->dev->UR = 'Epic';
|
||||
$lang->dev->SR = 'Story';
|
||||
$lang->dev->language = 'Language: %s';
|
||||
$lang->dev->default = 'Default';
|
||||
$lang->dev->currentLang = 'Current Language';
|
||||
$lang->dev->change = 'Change';
|
||||
$lang->dev->UR = 'Epic';
|
||||
$lang->dev->SR = 'Story';
|
||||
$lang->dev->branch = 'Branch';
|
||||
|
||||
$lang->dev->fields = array();
|
||||
$lang->dev->fields['id'] = 'ID';
|
||||
|
||||
@@ -14,7 +14,6 @@ $lang->dev->post = 'POST Parameter';
|
||||
$lang->dev->modifyValue = 'modifyValue';
|
||||
$lang->dev->defaultValue = 'defaultValue';
|
||||
|
||||
|
||||
$lang->dev->paramRange = 'Parameter Range: %s';
|
||||
$lang->dev->paramDate = 'Date format: YY-mm-dd, e.g 2019-01-01';
|
||||
$lang->dev->paramColor = 'Color format: #RGB, e.g. #3da7f5';
|
||||
@@ -23,10 +22,13 @@ $lang->dev->noteEditor = "The editor is disabled for security reasons. To us
|
||||
$lang->dev->noteTranslate = "The translation is disabled for security reasons. To use this feature, please go to the official website to download and install the plugin of <a href='https://www.zentao.net/extension-viewExt-151.html' target='_blank'>translation</a>.";
|
||||
$lang->dev->confirmRestore = 'Do you want to reset?';
|
||||
|
||||
$lang->dev->default = 'Default';
|
||||
$lang->dev->change = 'Change';
|
||||
$lang->dev->UR = 'Epic';
|
||||
$lang->dev->SR = 'Story';
|
||||
$lang->dev->language = 'Language: %s';
|
||||
$lang->dev->default = 'Default';
|
||||
$lang->dev->currentLang = 'Current Language';
|
||||
$lang->dev->change = 'Change';
|
||||
$lang->dev->UR = 'Epic';
|
||||
$lang->dev->SR = 'Story';
|
||||
$lang->dev->branch = 'Branch';
|
||||
|
||||
$lang->dev->fields = array();
|
||||
$lang->dev->fields['id'] = 'ID';
|
||||
|
||||
@@ -28,6 +28,7 @@ $lang->dev->currentLang = '当前语言';
|
||||
$lang->dev->change = '修改值';
|
||||
$lang->dev->UR = '用户需求';
|
||||
$lang->dev->SR = '软件需求';
|
||||
$lang->dev->branch = '平台/分支';
|
||||
|
||||
$lang->dev->fields = array();
|
||||
$lang->dev->fields['id'] = '序号';
|
||||
|
||||
+119
-36
@@ -360,6 +360,7 @@ class devModel extends model
|
||||
if(empty($language)) $language = $this->app->getClientLang();
|
||||
$originalLangs = array();
|
||||
$defaultLang = $this->loadDefaultLang($language);
|
||||
if($type == 'feature' and in_array($module, $this->config->dev->projectMenus)) $module = 'project';
|
||||
if($type == 'feature')
|
||||
{
|
||||
$this->defaultLang = $defaultLang;
|
||||
@@ -380,8 +381,15 @@ class devModel extends model
|
||||
}
|
||||
elseif($type == 'feature')
|
||||
{
|
||||
$langKey = 'featureBar-' . $method . '_';
|
||||
foreach($defaultLang->$module->featureBar[$method] as $feature => $featureName)
|
||||
$langKey = 'featureBar-' . $method . '_';
|
||||
$featureBars = zget($defaultLang->$module->featureBar, $method, array());
|
||||
if(strpos($method, '_') !== false)
|
||||
{
|
||||
$langKey = 'featureBar-' . str_replace('_', '-', $method) . '_';
|
||||
list($subMethod, $thirdMethod) = explode('_', $method);
|
||||
$featureBars = $defaultLang->$module->featureBar[$subMethod][$thirdMethod];
|
||||
}
|
||||
foreach($featureBars as $feature => $featureName)
|
||||
{
|
||||
$selectKey = $feature . 'Selects';
|
||||
if(isset($defaultLang->$module->$selectKey))
|
||||
@@ -458,6 +466,7 @@ class devModel extends model
|
||||
$langKey = "{$method}_";
|
||||
break;
|
||||
case 'feature':
|
||||
$method = str_replace('_', '-', $method);
|
||||
$customeds = $this->loadModel('custom')->getItems("lang={$language}&module={$module}§ion=featureBar-$method&vision={$this->config->vision}");
|
||||
$langKey = "featureBar-{$method}_";
|
||||
break;
|
||||
@@ -512,13 +521,7 @@ class devModel extends model
|
||||
$lang->hourCommon = $this->lang->hourCommon;
|
||||
if(!isset($lang->common)) $lang->common = new stdclass();
|
||||
|
||||
$loadedLangs = array();
|
||||
foreach($langFilesToLoad as $langFile)
|
||||
{
|
||||
if(in_array($langFile, $loadedLangs)) continue;
|
||||
include $langFile;
|
||||
$loadedLangs[] = $langFile;
|
||||
}
|
||||
foreach($langFilesToLoad as $langFile) include $langFile;
|
||||
|
||||
return $lang;
|
||||
}
|
||||
@@ -596,33 +599,82 @@ class devModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getFeatureMenus($menu, $module = '', $method = '', $loadModules = array())
|
||||
public function getFeatureMenus($module, $moduleName = '', $methodName = '')
|
||||
{
|
||||
$menus = array();
|
||||
$this->app->loadLang($menu);
|
||||
if(!in_array($menu, $loadModules) and isset($this->lang->$menu->menu))
|
||||
foreach(array('homeMenu', 'menu') as $menu)
|
||||
{
|
||||
$loadModules[] = $menu;
|
||||
$menuLang = $this->getLinkTitle($this->lang->$menu->menu);
|
||||
foreach($menuLang as $menuKey => $menuName) $menus += $this->getFeatureMenus($menuKey, $module, $method, $loadModules);
|
||||
}
|
||||
|
||||
if(isset($this->lang->$menu->featureBar))
|
||||
{
|
||||
$featureBar = $this->lang->$menu->featureBar;
|
||||
foreach($featureBar as $methodName => $feature)
|
||||
if(!isset($this->lang->$module->$menu)) continue;
|
||||
foreach($this->lang->$module->$menu as $menuKey => $menuValue)
|
||||
{
|
||||
if($methodName == 'caselib') $methodName = 'caseLib';
|
||||
if($methodName == 'all') $methodName = 'browse';
|
||||
if(is_array($menuValue) and !isset($menuValue['link'])) continue;
|
||||
$link = is_array($menuValue) ? $menuValue['link'] : $menuValue;
|
||||
if(strpos($link, '|') === false) continue;
|
||||
list($label, $thisModule, $thisMethod) = explode('|', $link);
|
||||
|
||||
$subMenu = new stdClass();
|
||||
$subMenu->title = zget($this->lang->$menu, $methodName);
|
||||
$subMenu->key = '';
|
||||
$subMenu->module = $menu;
|
||||
$subMenu->method = $methodName;
|
||||
$subMenu->active = ($method == $methodName and $module == $menu) ? 1 : 0;
|
||||
$subMenu = new stdclass();
|
||||
$subMenu->title = $label;
|
||||
$subMenu->key = '';
|
||||
$subMenu->module = $thisModule;
|
||||
$subMenu->method = $thisMethod;
|
||||
$subMenu->active = ($methodName == $thisMethod and $moduleName == $thisModule) ? 1 : 0;
|
||||
$subMenu->children = array();
|
||||
|
||||
$menus[] = $subMenu;
|
||||
$this->app->loadLang($thisModule);
|
||||
$hasFeatureBar = false;
|
||||
if(isset($this->lang->$thisModule->featureBar[$thisMethod])) $hasFeatureBar = true;
|
||||
|
||||
if(is_array($menuValue))
|
||||
{
|
||||
foreach(array('subMenu', 'dropMenu') as $menu)
|
||||
{
|
||||
if(!isset($menuValue[$menu])) continue;
|
||||
foreach($menuValue[$menu] as $subMenuKey => $subMenuValue)
|
||||
{
|
||||
if(is_array($subMenuValue) and !isset($subMenuValue['link'])) continue;
|
||||
$link = is_array($subMenuValue) ? $subMenuValue['link'] : $subMenuValue;
|
||||
if(strpos($link, '|') === false) continue;
|
||||
list($label, $thisModule, $thisMethod) = explode('|', $link);
|
||||
if($label == '@branch@') $label = $this->lang->dev->branch;
|
||||
|
||||
$this->app->loadLang($thisModule);
|
||||
if(isset($this->lang->$thisModule->featureBar[$menuKey][$subMenuKey]))
|
||||
{
|
||||
$thirdMenu = new stdClass();
|
||||
$thirdMenu->title = $label;
|
||||
$thirdMenu->key = '';
|
||||
$thirdMenu->module = $thisModule;
|
||||
$thirdMenu->method = "{$thisMethod}_{$subMenuKey}";
|
||||
$thirdMenu->active = ($methodName == $thirdMenu->method and $moduleName == $thisModule) ? 1 : 0;
|
||||
|
||||
$subMenu->active = 0;
|
||||
$subMenu->children[] = $thirdMenu;
|
||||
$hasFeatureBar = true;
|
||||
}
|
||||
elseif(isset($this->lang->$thisModule->featureBar[$thisMethod]))
|
||||
{
|
||||
if(is_array($this->lang->$thisModule->featureBar[$thisMethod]))
|
||||
{
|
||||
$arrayKey = key($this->lang->$thisModule->featureBar[$thisMethod]);
|
||||
if(is_array($this->lang->$thisModule->featureBar[$thisMethod][$arrayKey])) continue;
|
||||
}
|
||||
|
||||
$subMenu = new stdClass();
|
||||
$subMenu->title = $label;
|
||||
$subMenu->key = '';
|
||||
$subMenu->module = $thisModule;
|
||||
$subMenu->method = $thisMethod;
|
||||
$subMenu->active = ($methodName == $thisMethod and $moduleName == $thisModule) ? 1 : 0;
|
||||
$subMenu->children = array();
|
||||
|
||||
$menus[$subMenuKey] = $subMenu;
|
||||
$hasFeatureBar = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($hasFeatureBar) $menus[$menuKey] = $subMenu;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -662,20 +714,51 @@ class devModel extends model
|
||||
foreach($mainNav as $menuKey => $menu)
|
||||
{
|
||||
$menuItem = new stdclass();
|
||||
$menuItem->title = $menu;
|
||||
$menuItem->module = $menuKey;
|
||||
$menuItem->method = '';
|
||||
$menuItem->active = ($module == $menuKey and $method == '') ? 1 : 0;
|
||||
$menuItem->key = zget($maimNavPinYin, $menu, '');
|
||||
$menuItem->title = $menu;
|
||||
$menuItem->module = $menuKey;
|
||||
$menuItem->method = '';
|
||||
$menuItem->active = ($module == $menuKey and $method == '') ? 1 : 0;
|
||||
$menuItem->key = zget($maimNavPinYin, $menu, '');
|
||||
$menuItem->children = array();
|
||||
|
||||
$childFunc = 'get' . ucfirst($type) . 'Menus';
|
||||
$menuItem->children = $this->$childFunc($menuKey, $module, $method);
|
||||
if($type == 'feature' and in_array($menuKey, $this->config->dev->projectMenus))
|
||||
{
|
||||
if($menuKey != 'project') continue;
|
||||
foreach($this->config->dev->projectMenus as $projectModule) $menuItem->children += $this->getFeatureMenus($projectModule, $module, $method);
|
||||
}
|
||||
else
|
||||
{
|
||||
$menuItem->children = $this->$childFunc($menuKey, $module, $method);
|
||||
}
|
||||
$menuItem->children = array_values($menuItem->children);
|
||||
|
||||
if($type != 'second' and empty($menuItem->children)) continue;
|
||||
if($type == 'second' and in_array($menuKey, $this->config->dev->hideMainMenu)) continue;
|
||||
|
||||
$menuTree[] = $menuItem;
|
||||
}
|
||||
|
||||
/* Unique menu tree by module and method. */
|
||||
if($type == 'feature')
|
||||
{
|
||||
$methods = array();
|
||||
foreach($menuTree as $index => $menuItem)
|
||||
{
|
||||
foreach($menuItem->children as $subIndex => $subMenuItem)
|
||||
{
|
||||
$key = "{$subMenuItem->module}|{$subMenuItem->method}";
|
||||
if(isset($methods[$key]))
|
||||
{
|
||||
unset($menuItem->children[$subIndex]);
|
||||
continue;
|
||||
}
|
||||
$methods[$key] = true;
|
||||
}
|
||||
$menuItem->children = array_values($menuItem->children);
|
||||
}
|
||||
}
|
||||
|
||||
return $menuTree;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user