From f53d7d43b77474886e0b84fcf0e44effd62072af Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Wed, 3 Jan 2024 15:56:28 +0800 Subject: [PATCH] * Adjust repo control init. --- module/repo/control.php | 4 ++-- module/repo/ui/diffeditor.html.php | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/module/repo/control.php b/module/repo/control.php index fbb69519f1..46e481330d 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -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); } diff --git a/module/repo/ui/diffeditor.html.php b/module/repo/ui/diffeditor.html.php index f29bf6e030..1666142c94 100644 --- a/module/repo/ui/diffeditor.html.php +++ b/module/repo/ui/diffeditor.html.php @@ -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