* Fix repo links.

This commit is contained in:
zhujinyong
2021-03-26 09:35:30 +08:00
parent 4b46539205
commit 54be2a4b4e
6 changed files with 14 additions and 10 deletions
+7 -3
View File
@@ -293,6 +293,7 @@ class repo extends control
$this->view->showBug = $showBug;
$this->view->encoding = str_replace('-', '_', $encoding);
$this->view->repoID = $repoID;
$this->view->branchID = $this->cookie->repoBranch;
$this->view->objectID = $objectID;
$this->view->repo = $repo;
$this->view->revision = $revision;
@@ -582,6 +583,7 @@ class repo extends control
$this->view->type = $type;
$this->view->changes = $changes;
$this->view->repoID = $repoID;
$this->view->branchID = $this->cookie->repoBranch;
$this->view->objectID = $objectID;
$this->view->revision = $log[0]->revision;
$this->view->parentDir = $parent;
@@ -632,6 +634,7 @@ class repo extends control
$this->view->title = $this->lang->repo->common;
$this->view->repoID = $repoID;
$this->view->branchID = $this->cookie->repoBranch;
$this->view->objectID = $objectID;
$this->view->repo = $repo;
$this->view->revision = $revision;
@@ -662,9 +665,9 @@ class repo extends control
$this->commonAction($repoID, $objectID);
if($this->get->repoPath) $entry = $this->get->repoPath;
$file = $entry;
$repo = $this->repo->getRepoByID($repoID);
$entry = $this->repo->decodePath($entry);
$file = $entry;
$repo = $this->repo->getRepoByID($repoID);
$entry = $this->repo->decodePath($entry);
$pathInfo = pathinfo($entry);
$suffix = '';
@@ -736,6 +739,7 @@ class repo extends control
$this->view->suffix = $suffix;
$this->view->file = $file;
$this->view->repoID = $repoID;
$this->view->branchID = $this->cookie->repoBranch;
$this->view->objectID = $objectID;
$this->view->repo = $repo;
$this->view->encoding = str_replace('-', '_', $encoding);
+2 -2
View File
@@ -31,14 +31,14 @@ css::import($jsRoot . 'misc/highlight/styles/github.css');
<div class="page-title">
<strong>
<?php
echo html::a($this->repo->createLink('browse', "repoID=$repoID&objectID=$objectID"), $repo->name);
echo html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID"), $repo->name);
$paths= explode('/', $entry);
$fileName = array_pop($paths);
$postPath = '';
foreach($paths as $pathName)
{
$postPath .= $pathName . '/';
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
}
echo '/' . ' ' . $fileName;
echo " <span class='label label-info'>" . $revisionName . '</span>';
+1 -1
View File
@@ -35,7 +35,7 @@
foreach($paths as $pathName)
{
$postPath .= $pathName . '/';
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
}
echo '/' . ' ' . $fileName;
if($repo->SCM == 'Git')
+1 -1
View File
@@ -35,7 +35,7 @@
<tr>
<td class='text-center'><?php echo $repo->id; ?></td>
<td class='text'><?php echo zget($lang->repo->scmList, $repo->SCM); ?></td>
<td class='text' title='<?php echo $repo->name; ?>'><?php echo html::a($this->createLink('repo', 'browse', "repoID={$repo->id}&objectID=$objectID"), $repo->name);?></td>
<td class='text' title='<?php echo $repo->name; ?>'><?php echo html::a($this->createLink('repo', 'browse', "repoID={$repo->id}&branchID=&objectID=$objectID"), $repo->name);?></td>
<td class='text'>
<?php
$productList = explode(',', str_replace(' ', '', $repo->product));
+1 -1
View File
@@ -19,7 +19,7 @@ $typeInfo = $type == 'file' ? '&type=file' : '';
<?php include '../../common/view/header.html.php';?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<?php $browseLink = $app->session->revisionList != false ? $app->session->revisionList : $this->repo->createLink('browse', "repoID={$repoID}{$preDir}");?>
<?php $browseLink = $app->session->revisionList != false ? $app->session->revisionList : $this->repo->createLink('browse', "repoID={$repoID}&branchID=$branchID&objectID=$objectID{$preDir}");?>
<?php echo html::a($browseLink, "<i class='icon icon-back'></i>" . $lang->goback, '', "class='btn btn-link' data-app='{$app->openApp}'");?>
<div class="divider"></div>
<div class="page-title">
+2 -2
View File
@@ -25,14 +25,14 @@ $version = " <span class=\"label label-info\">$revisionName</span>";
<div class="page-title">
<strong>
<?php
echo html::a($this->repo->createLink('browse', "repoID=$repoID&objectID=$objectID"), $repo->name);
echo html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID"), $repo->name);
$paths= explode('/', $entry);
$fileName = array_pop($paths);
$postPath = '';
foreach($paths as $pathName)
{
$postPath .= $pathName . '/';
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
}
echo '/' . ' ' . $fileName;
echo $version;