* code for add data-app attr.

This commit is contained in:
wangyidong
2022-09-26 15:26:48 +08:00
parent 0ba479e9e5
commit 7a48c595b4
3 changed files with 16 additions and 4 deletions
+15
View File
@@ -111,6 +111,14 @@ class baseHTML
if(strlen(trim($title)) == 0) $title = $href;
$newline = $newline ? "\n" : '';
if(strpos($misc, 'data-app=') === false)
{
global $app, $lang;
$module = $app->rawModule;
$dataApp = (isset($lang->navGroup->$module) and $lang->navGroup->$module != $app->tab) ? "data-app='{$app->tab}'" : '';
$misc .= ' ' . $dataApp;
}
return "<a href='$href' $misc>$title</a>$newline";
}
@@ -501,6 +509,13 @@ class baseHTML
$gobackList = isset($_COOKIE['goback']) ? json_decode($_COOKIE['goback'], true) : array();
$gobackLink = isset($gobackList[$tab]) ? $gobackList[$tab] : '';
if(strpos($misc, 'data-app=') === false)
{
$module = $app->rawModule;
$dataApp = (isset($lang->navGroup->$module) and $lang->navGroup->$module != $app->tab) ? "data-app='{$app->tab}'" : '';
$misc .= ' ' . $dataApp;
}
/* If the link of the referer is not the link of the current page or the link of the index, the cookie and gobackLink will be updated. */
if(!preg_match("/(m=|\/)(index|search|$currentModule)(&f=|-)(index|buildquery|$currentMethod)(&|-|\.)?/", strtolower($refererLink)))
{
+1 -1
View File
@@ -671,7 +671,7 @@
defaultOpenUrl = !defaultOpenUrl ? codeApp : defaultOpenUrl + '#app=' + codeApp;
}
openTab(defaultOpenUrl ? defaultOpenUrl : defaultApp, $.cookie('tab'));
openTab(defaultOpenUrl ? defaultOpenUrl : defaultApp);
/* Refresh more menu on window resize */
$(window).on('resize', refreshMoreMenu);
-3
View File
@@ -2523,9 +2523,6 @@ class projectModel extends model
$this->session->set('project', $projectID, 'project');
$this->session->set('noSprint', true);
$this->app->tab = 'project';
$_COOKIE['tab'] = 'project';
$navGroup = zget($this->lang->navGroup, $moduleName);
$this->lang->$navGroup->menu = $this->lang->noSprint->{$modal}->menu;
$this->lang->$navGroup->menuOrder = $this->lang->noSprint->{$modal}->menuOrder;