* Adjust repo control init.

This commit is contained in:
caoyanyi
2024-01-03 15:56:28 +08:00
parent 8ebde2489d
commit f53d7d43b7
2 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -45,7 +45,7 @@ class repo extends control
*/
public function commonAction(int $repoID = 0, int $objectID = 0)
{
$tab = $this->app->tab;
$tab = isonlybody() ? '' : $this->app->tab;
$this->repos = $this->repo->getRepoPairs($tab, $objectID);
if($tab == 'project')
@@ -65,7 +65,7 @@ class repo extends control
$this->loadModel('execution')->setMenu($objectID);
$this->view->executionID = $objectID;
}
elseif($tab != 'admin')
elseif($tab != 'admin' && !isonlybody())
{
$this->repo->setMenu($this->repos, $repoID);
}
+6 -3
View File
@@ -30,10 +30,13 @@ jsVar('urlParams', "repoID=$repoID&objectID=$objectID&entry=%s&oldRevision=$oldR
\zin\featureBar();
$dropMenus = array();
if(common::hasPriv('repo', 'download')) $dropMenus[] = array('text' => $this->lang->repo->downloadDiff, 'icon' => 'download', 'data-link' => $this->repo->createLink('download', "repoID=$repoID&path={path}&fromRevision=$oldRevision&toRevision=$newRevision&type=path"), 'id' => 'repoDownloadCode');
if(!isonlybody())
{
if(common::hasPriv('repo', 'download')) $dropMenus[] = array('text' => $this->lang->repo->downloadDiff, 'icon' => 'download', 'data-link' => $this->repo->createLink('download', "repoID=$repoID&path={path}&fromRevision=$oldRevision&toRevision=$newRevision&type=path"), 'id' => 'repoDownloadCode');
$dropMenus[] = array('text' => $this->lang->repo->viewDiffList['inline'], 'icon' => 'snap-house', 'id' => 'inline', 'class' => 'inline-appose');
$dropMenus[] = array('text' => $this->lang->repo->viewDiffList['appose'], 'icon' => 'col-archive', 'id' => 'appose', 'class' => 'inline-appose');
$dropMenus[] = array('text' => $this->lang->repo->viewDiffList['inline'], 'icon' => 'snap-house', 'id' => 'inline', 'class' => 'inline-appose');
$dropMenus[] = array('text' => $this->lang->repo->viewDiffList['appose'], 'icon' => 'col-archive', 'id' => 'appose', 'class' => 'inline-appose');
}
div(
set::id('fileTabs'),
tabs